Repository navigation
Closed
Description
Summary
The CodeRabbit public-API-expansion rule added in #4005 cites an API that has since changed twice. Its worked example is already stale, and #4008 will move every path it references. Review instructions that describe code which no longer exists are worse than none — they teach the reviewer a shape nobody can find.
Do this after #4008 lands, not before, or it will need doing twice.
What is stale
The rule (.coderabbit.yaml, path: "src/fl/**/*.h") uses a wrong-vs-right pair built on the LittleFS backend:
// WRONG — as written in the rule
class FileSystem {
static FileSystem littleFs(bool format_on_fail = false); // NEW
bool beginLittleFs(bool format_on_fail = false); // NEW
};
// RIGHT — as written in the rule
FsImplPtr make_littlefs_filesystem(bool format_on_fail = false) FL_NO_EXCEPT;Neither spelling survives:
make_littlefs_filesystemno longer exists. It becamefl::getEmbeddedFs()in refactor(fs): expose embedded storage generically as fl::getEmbeddedFs() #4006, because naming a technology in the public API forces every platform — including the host stub — to hold an opinion about LittleFS (design: expose on-chip flash storage generically, not as make_littlefs_filesystem #4007). The rule currently teaches the exact naming mistake that issue exists to prevent.- The paths move under refactor: consolidate the filesystem subsystem under src/fl/fs/ #4008.
fl/system/file_system.hbecomesfl/fs/fs.h; the globsrc/fl/**/*.hstill matches, but every path cited in the prose will be wrong. - The
FileSystemgod-class evidence changes. The rule's motivating example is thatFileSystemcarries a member per format (openVideo,loadJpeg,openMp3, ...). refactor: consolidate the filesystem subsystem under src/fl/fs/ #4008 moves those to free functions infl/fs/read.h, so the cautionary tale becomes a fixed problem rather than a live one — which is fine, but the rule should then cite it as history, not as the current state.
What to update
- Replace the worked example with the post-refactor: consolidate the filesystem subsystem under src/fl/fs/ #4008 shape: adding a medium costs one free factory (
getSdFs,getEmbeddedFs) and no change toFileSystem; adding a format costs one free function infl/fs/read.hand no change to either. - Reframe the
FileSystemevidence as "this is what it looked like before refactor: consolidate the filesystem subsystem under src/fl/fs/ #4008, and why" so the rule keeps its concrete grounding without describing code that is gone. - Re-check the
IWYU pragma: exportargument. It is the strongest point in the rule —file_system.hre-exportingvideo.handjpeg.hto every consumer — and refactor: consolidate the filesystem subsystem under src/fl/fs/ #4008 is specifically meant to fix it. Once fixed, cite it as the resolved example. - Verify the carve-out for the Public Settings Pattern still reads correctly against the moved paths. Two rules share the
src/fl/**/*.hglob and require opposite things; that interaction is easy to break silently.
Related
- docs(review): add a CodeRabbit rule on public API expansion #4005 — added the rule (merged)
- refactor: consolidate the filesystem subsystem under src/fl/fs/ #4008 — the restructure that invalidates it
- design: expose on-chip flash storage generically, not as make_littlefs_filesystem #4007 — why the technology name left the public API
- audit: fl/system/file_system.h has drifted from the API Object Pattern #4003 — the audit the rule encodes
- meta: remote assets — hosting, build-time resolution, and on-device filesystem deployment #3986 — meta
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
docs(review): refresh the API-expansion rule after the fl/fs move (#4014