ci(loc-gate): enforce 1000-LOC max per .rs file, refactor 15 oversize files#252
Conversation
Adds a fast shell-only workflow that scans every .rs file outside target/ and fails the job if any exceeds the 1000-line threshold. Surface gate status via a CI badge in the README. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…to satisfy LOC gate
…odules to satisfy LOC gate
… to satisfy LOC gate
…gate Splits the 2094-line crates/fbuild-python/src/lib.rs into eight topic-focused modules so every .rs file in this crate is under 900 LOC, satisfying the new 1000-LOC gate. No public API change: the #[pymodule] entry point, all #[pyclass] types, and all #[pyfunction] registrations are preserved exactly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…o satisfy LOC gate
…o satisfy LOC gate
…o satisfy LOC gate
|
Important Review skippedToo many files! This PR contains 161 files, which is 11 over the limit of 150. To get a review, narrow the scope: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (161)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
Summary
loc-gate.yml) that fails CI if any.rsfile outsidetarget/exceeds 1000 LOC.LOC gate
The workflow scans every
*.rsfile in the repo, prints::error file=...::annotations for any over 1000 LOC, and exits non-zero. No toolchain bootstrap — purefind+wc, runs in seconds.Refactored files
main.rscli/(16 files)handlers/emulator.rshandlers/emulator/(13 files)handlers/operations.rshandlers/operations/(8 files)lib.rsesp32.rsesp32/(6 files)esp32/orchestrator.rsesp32/orchestrator/(12 files)compile_database.rscompile_database/+ tests subdirini_parser.rsini_parser/(5 files)board.rsboard/(6 files)pipeline.rspipeline/(8 files)mcp.rsmcp/(9 files)library/esp32_framework.rslibrary/esp32_framework/(7 files)disk_cache/index.rsdisk_cache/index/(5 files)esp32_native.rsesp32_native/(7 files)stm32/orchestrator.rsstm32/orchestrator/(5 files)Approach
Each oversize file was refactored independently by a parallel worktree agent. Every refactor:
pub usefrom the newmod.rs(or via existing parent-module declarations).cargo check -p <crate>andcargo test -p <crate>(where applicable).A full workspace
cargo check --workspace --all-targetswas run on the merged branch — passes with no new warnings.Test plan
.rsfile > 1000 LOC).fbuild buildfor a small target still works end-to-end.🤖 Generated with Claude Code