Skip to content

chore: remove restate-what comments across code and tests#578

Merged
DavidCozens merged 4 commits into
mainfrom
chore/comment-cleanup
Jul 5, 2026
Merged

chore: remove restate-what comments across code and tests#578
DavidCozens merged 4 commits into
mainfrom
chore/comment-cleanup

Conversation

@DavidCozens

@DavidCozens DavidCozens commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Comment hygiene pass: remove comments that merely restate what the code does, per the Clean Code "say why, not what" principle. Pure deletions — no code/behaviour change (25 files, ~300 lines removed).

What was removed

  • Core/Source — 8 function-divider banners (/* ---- BlockStore_Write ---- */) + 2 "Little-endian read/write" restatements.
  • Tests root — section-divider banners (BlockStoreTest, FileFake, FileFakeTest, OpenSslFakeTest) + inline restatements ("verify magic bytes", "Fill block 00 with two records", "handleA opens file …").
  • Tests/Support fake headers — 148 /* <symbol> configuration|accessors|spy */ banners that only repeat the Fake_Set*/*CallCount names beneath them. The .c fakes keep theirs (there the banners map abbreviated statics back to the faked symbol).
  • BDD — 6 section banners in BddTargetFreeRtosPipeline.c + 3 Python restatements.

What was deliberately kept

RFC/MISRA/standard refs, cppcheck-suppress/NOLINT/IWYU justifications, third-party API gotchas (lwIP/OpenSSL/Winsock quirks), ownership/contract/threshold docs, deliberately-empty-branch markers, Given/When/Then test specs, seam explanations (poisoned-vtable, injection-via-UT_PTR_SET), header banners carrying extra info (e.g. getsockopt's modelled options, MqFake one-shot semantics, mbedTLS conf_own_cert mTLS note, OpenSSL SNI path), the magic-sleep() purpose comments, and test-intent notes ("Covered by teardown", "Doesn't crash; nothing to assert").

Verification

  • clang-format reflow applied (one double-blank collapse in LwipTcpFake.h).
  • Local MISRA cppcheck was inconclusive only because the base dev container lacks the FreeRTOS/lwIP/mbedTLS third-party headers (cppcheck can't fully parse those Platform/*/Source/ trees) — an environment gap, not a regression. No comment-only change can introduce a MISRA finding, and none of the modified files touch Platform/. CI's analyze-cppcheck (full toolchain) is the authority.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Removed internal section comments and documentation headers throughout the codebase to streamline code organization and reduce visual clutter.
    • Consolidated test support interface declarations by removing redundant grouping comments.

Note: No functional changes, features, or bug fixes included in this release.

DavidCozens and others added 4 commits June 17, 2026 23:23
Drop the 8 function-divider banners in BlockStore.c / FileBlockDevice.c
(they only repeat the name of the function below) and the two "Little-endian
read/write" comments in CircularBuffer.c (the shift expression says it). No
behaviour change; the kept comments are rationale, contracts, and standards
refs only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop section-divider banners that only name the block/function below
(BlockStoreTest, FileFake, FileFakeTest) and inline comments that restate
the adjacent code ("verify magic bytes", "Fill block 00 with two records",
"handleA opens file ..."). Kept comments that explain test intent or a
non-obvious mechanism: the Given/When/Then specs, the cleartext-header
note, "Covered by teardown", "Doesn't crash; nothing to assert", the
poisoned-vtable seam, and the arg-capture/failure-mode rationale dividers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Remove the `/* <symbol> configuration|accessors|spy */` banners in the
Tests/Support fake headers — they only restate the well-named
Fake_Set*/CallCount declarations beneath them. The .c fakes keep their
banners (they map abbreviated statics back to the faked symbol). Kept any
header banner carrying extra info: getsockopt's modelled options, MqFake's
one-shot semantics, the lwIP spy-capture notes, mbedTLS conf_own_cert mTLS
note, OpenSSL SNI/ctrl-path notes, forward-decl and injection-seam notes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the 6 section-divider banners in BddTargetFreeRtosPipeline.c and three
Python restatements (syslog_steps.py "refresh the line count" / "Check that
IDs form a contiguous ascending sequence", environment.py "Clean up any
long-lived interactive process"). Kept the "Allow time for ..." sleep
comments — they explain the async operation a magic time.sleep() waits on,
which the code can't express — and the cross-scenario-contamination note.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4804c262-400e-49f2-8bbe-d0862737b95f

📥 Commits

Reviewing files that changed from the base of the PR and between e56c34f and b4ff4c8.

📒 Files selected for processing (25)
  • Bdd/Targets/Common/BddTargetFreeRtosPipeline.c
  • Bdd/features/environment.py
  • Bdd/features/steps/syslog_steps.py
  • Core/Source/SolidSyslogBlockStore.c
  • Core/Source/SolidSyslogCircularBuffer.c
  • Core/Source/SolidSyslogFileBlockDevice.c
  • Tests/FileFake.c
  • Tests/FileFakeTest.cpp
  • Tests/SolidSyslogBlockStorePosixTest.cpp
  • Tests/SolidSyslogBlockStoreTest.cpp
  • Tests/Support/FatFsFakes/Interface/FatFsFake.h
  • Tests/Support/FreeRtosFakes/Interface/FreeRtosArpFake.h
  • Tests/Support/FreeRtosFakes/Interface/FreeRtosDnsFake.h
  • Tests/Support/FreeRtosFakes/Interface/FreeRtosSemaphoreFake.h
  • Tests/Support/FreeRtosFakes/Interface/FreeRtosSocketsFake.h
  • Tests/Support/FreeRtosFakes/Interface/FreeRtosTaskFake.h
  • Tests/Support/LwipFakes/Interface/LwipPbufFake.h
  • Tests/Support/LwipFakes/Interface/LwipTcpFake.h
  • Tests/Support/LwipFakes/Interface/LwipUdpFake.h
  • Tests/Support/MbedTlsFake.h
  • Tests/Support/MqFake.h
  • Tests/Support/OpenSslFake.h
  • Tests/Support/PlusFatFakes/Interface/PlusFatFake.h
  • Tests/Support/SocketFake.h
  • Tests/Support/WinsockFake.h
💤 Files with no reviewable changes (25)
  • Tests/Support/FreeRtosFakes/Interface/FreeRtosArpFake.h
  • Tests/Support/LwipFakes/Interface/LwipPbufFake.h
  • Tests/Support/FreeRtosFakes/Interface/FreeRtosTaskFake.h
  • Tests/Support/PlusFatFakes/Interface/PlusFatFake.h
  • Tests/Support/FreeRtosFakes/Interface/FreeRtosDnsFake.h
  • Tests/Support/LwipFakes/Interface/LwipUdpFake.h
  • Core/Source/SolidSyslogCircularBuffer.c
  • Tests/SolidSyslogBlockStorePosixTest.cpp
  • Core/Source/SolidSyslogBlockStore.c
  • Bdd/features/environment.py
  • Tests/Support/FreeRtosFakes/Interface/FreeRtosSemaphoreFake.h
  • Core/Source/SolidSyslogFileBlockDevice.c
  • Tests/Support/FatFsFakes/Interface/FatFsFake.h
  • Bdd/features/steps/syslog_steps.py
  • Tests/Support/LwipFakes/Interface/LwipTcpFake.h
  • Tests/Support/WinsockFake.h
  • Tests/Support/FreeRtosFakes/Interface/FreeRtosSocketsFake.h
  • Tests/FileFakeTest.cpp
  • Tests/Support/MbedTlsFake.h
  • Tests/Support/MqFake.h
  • Tests/Support/SocketFake.h
  • Tests/FileFake.c
  • Tests/SolidSyslogBlockStoreTest.cpp
  • Bdd/Targets/Common/BddTargetFreeRtosPipeline.c
  • Tests/Support/OpenSslFake.h

📝 Walkthrough

Walkthrough

This PR removes section-divider and group-header comments across 26 files spanning production C sources (SolidSyslogBlockStore, SolidSyslogCircularBuffer, SolidSyslogFileBlockDevice, BddTargetFreeRtosPipeline), test support fake/mock headers (FatFs, FreeRTOS, LwIP, MbedTLS, OpenSSL, MQ, Socket, Winsock fakes), test implementations, and BDD step/environment files. No logic, function signatures, control flow, or exported APIs are modified.

Changes

Comment Section-Header Cleanup

Layer / File(s) Summary
Production source comment cleanup
Bdd/Targets/Common/BddTargetFreeRtosPipeline.c, Core/Source/SolidSyslogBlockStore.c, Core/Source/SolidSyslogCircularBuffer.c, Core/Source/SolidSyslogFileBlockDevice.c
Section-divider comment blocks removed from production C sources (console glue, config callbacks, set handler, store lifecycle, teardown, tasks, vtable groups, and little-endian header notes); all implementations unchanged.
Test support fake/mock header comment cleanup
Tests/Support/FatFsFakes/Interface/FatFsFake.h, Tests/Support/FreeRtosFakes/Interface/..., Tests/Support/LwipFakes/Interface/..., Tests/Support/MbedTlsFake.h, Tests/Support/OpenSslFake.h, Tests/Support/MqFake.h, Tests/Support/PlusFatFakes/Interface/PlusFatFake.h, Tests/Support/SocketFake.h, Tests/Support/WinsockFake.h
Per-function and group section comments (e.g., /* f_open */, "socket configuration", "connect accessors", "Failure-mode switches") removed from all fake/mock headers; all declared function signatures remain identical.
Test implementation comment cleanup
Tests/FileFake.c, Tests/FileFakeTest.cpp, Tests/SolidSyslogBlockStorePosixTest.cpp, Tests/SolidSyslogBlockStoreTest.cpp
Section-header comment blocks removed from FileFake implementation and all block-store/file test files; all test logic, assertions, and test groupings are functionally unchanged.
BDD environment and step comment cleanup
Bdd/features/environment.py, Bdd/features/steps/syslog_steps.py
Explanatory comments removed from after_scenario teardown, step_check_message_count, and step_check_contiguous_sequence_ids; all step behavior and assertions remain intact.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • DavidCozens/solid-syslog#300: Introduced the FreeRtosArpFake_SetCacheHit/IsIpInArpCacheCallCount/LastIsIpInArpCacheArg declarations in FreeRtosArpFake.h whose surrounding comment blocks are removed in this PR.
  • DavidCozens/solid-syslog#521: Introduced the pipeline sections in BddTargetFreeRtosPipeline.c (console glue, OnSet, store/security lifecycle, teardown, tasks) whose section-header comments are removed in this PR.

Poem

🐇 Hop, hop, snip away the clutter,
No banners left to make code stutter.
The functions stand proud, side by side,
No comment dividers left inside.
Clean and tidy — just the code, no fuss!
This bunny tidied up the codebase for us. ✂️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing comments that merely restate code logic across the codebase, following Clean Code principles.
Description check ✅ Passed The description provides comprehensive context on what was removed, what was deliberately kept, and verification steps, addressing the PR's purpose and scope effectively.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/comment-cleanup

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1521 passed)
   🚦   build-freertos-host-tdd-plustcp: 100% successful (✔️ 1872 passed)
   🚦   build-linux-clang: 100% successful (✔️ 1453 passed)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1453 passed)
   🚦   integration-linux-openssl: 100% successful (✔️ 16 passed)
   🚦   integration-linux-mbedtls: 100% successful (✔️ 14 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 16 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 49 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 88% successful (✔️ 46 passed, 🙈 6 skipped)
   🚦   bdd-freertos-qemu-plustcp: 87% successful (✔️ 45 passed, 🙈 7 skipped)
   🚦   bdd-freertos-qemu-lwip: 87% successful (✔️ 45 passed, 🙈 7 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 1298 passed)
   🚦   build-linux-tunable-override: 100% successful (✔️ 1453 passed)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

@DavidCozens DavidCozens merged commit f4c8ff1 into main Jul 5, 2026
28 checks passed
@DavidCozens DavidCozens deleted the chore/comment-cleanup branch July 5, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant