refactor: S24.08 enforce top-down function ordering across all .c files#425
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (24)
📝 WalkthroughWalkthroughThis PR applies a codebase-wide function-ordering refactor (S24.08) that reorders static inline helpers and internal function definitions across Core, Platform, and Bdd/Targets modules to enforce the documented naming/layout convention: ChangesFunction-Ordering Refactor Sweep
🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
☀️ Quality Summary 🚦 build-linux-gcc: 100% successful (✔️ 1296 passed, 🙈 2 skipped) 🚧 Error MessagesCreated by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result. |
Pure move-only refactor. Re-applies the documented function-ordering convention (`_Create`/`_Destroy` first, public funcs next, static helpers defined immediately beneath their first caller) across every `.c` file under Core/Source, Platform/, and Bdd/Targets/. Tests/fakes audited clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
f864e26 to
1fc159b
Compare
☀️ Quality Summary 🚦 build-linux-gcc: 100% successful (✔️ 1296 passed, 🙈 2 skipped) Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result. |
Purpose
Closes #423. Re-applies the documented function-ordering convention (
_Create/_Destroyfirst, public funcs next, static helpers defined immediately beneath their first caller) across the project tree. The convention had drifted in pool-class*Static.cfiles and a handful of platform adapters — caught by CodeRabbit on PR #422 (SolidSyslogPosixAddressStatic.c::HandleFromIndexsat after_Destroydespite its first caller being_Create).Change Description
Move-only refactor. No behaviour change.
Files touched (24):
SolidSyslogStatic.c,SolidSyslogMetaSdStatic.c,SolidSyslogUdpSenderStatic.c,SolidSyslogBlockStoreStatic.c,BlockSequence.c.diskio.c(Semihosting helpers regrouped into call-graph order), FreeRTOS BDDmain.c(main+ fourvApplication*OS-callback hooks lifted to the top, OnSet cluster reorganised into call-graph order, three forward decls added forSetEthernetIrqPriority/InteractiveTask/ServiceTask).Convention clarifications applied:
_Cleanup. When_Cleanupdelegates to_Close(TlsStream / MbedTlsStream / WinsockTcpStream),_Closemoved up beneath_Cleanup. When_Cleanupinlines its own close logic (PosixTcpStream),_Closestays at the end in API order.mainis a special case (per direction during review): entry-point first, other rules apply normally.Helper-to-helper micro-ordering within a single caller's helper cluster (e.g. ordering of
BreakDownFileTime/MicrosecondsFromFileTime/PopulateTimestampunder_GetTimestamp) was left alone — the strict reading would touch many compliant files for stylistic gain only.Test Evidence
cmake --preset debug && cmake --build --preset debug --target junit— all tests green (host tests + MbedTls integration tests in thecpputest-freertoscontainer).clang-format --dry-run --Werroron changed files — clean.Pre-existing format violation in
TlsStreamStatic.candFatFsFileStatic.c(bool released = ...continuation indent) is out of scope — both files untouched by this PR.Areas Affected
🤖 Generated with Claude Code
Summary by CodeRabbit
Refactor
Chores