fix(ci): cargo fmt + split 4 .rs files under 1000 LOC#752
Conversation
Two pre-existing CI gates were red on main:
1. **Formatting** failed on `crates/fbuild-daemon/src/handlers/websockets.rs`.
Resolved by `cargo fmt --all`. The same fmt pass also reflowed the
newly-extracted test files.
2. **LOC Gate** flagged 4 files over 1000 lines:
crates/fbuild-daemon/src/device_manager.rs (1006, +6)
crates/fbuild-cli/src/daemon_client.rs (1049, +49)
crates/fbuild-serial/src/manager.rs (1480, +480)
crates/fbuild-build/src/source_scanner.rs (1478, +478)
For each, lift the `#[cfg(test)] mod tests { ... }` block out of the
parent file into a sibling `<stem>/tests.rs` submodule and replace
it with `#[cfg(test)] mod tests;`. Tests stay in the same module
path (`crate::<parent>::tests::...`) so test discovery is
unchanged; this is purely a textual move that keeps the parent
files under the gate.
After:
device_manager.rs 687
daemon_client.rs 952
manager.rs 972
source_scanner.rs 910
All four are well under 1000 and have room for routine growth before
needing further per-domain submodule splits (per the
`foo.rs → foo/<sub>.rs` convention in CLAUDE.md).
Each new `<stem>/` directory ships a README per the repo's
`readme_guard.py` hook.
Verified locally (with SOLDR_NO_ZCCACHE=1 as a workaround for a wedged
local zccache daemon — unrelated):
- `soldr cargo check --workspace --all-targets` → clean
- `soldr cargo fmt --all -- --check` → clean
- `soldr cargo clippy --workspace --all-targets -- -D warnings` → clean
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Minor bump. Picks up: - #747 native fbuild as raw wheel script (drops Python launcher; fixes Windows stdout-ordering bug on COM25 303A:1001 USB Serial Device (COM25) ser=80:F1:B2:D1:DF:B1 └─ Espressif Systems / ESP32-S3 USB-CDC COM1 [Unknown] └─ (no USB identifier — Unknown endpoint) COM3 [Unknown] └─ (no USB identifier — Unknown endpoint) COM22 303A:1001 USB Serial Device (COM22) ser=D8:3B:DA:41:64:C0 └─ Espressif Systems / ESP32-S3 USB-CDC COM4 [Unknown] └─ (no USB identifier — Unknown endpoint) COM9 303A:1001 USB Serial Device (COM9) ser=8C:BF:EA:CF:87:B4 └─ Espressif Systems / ESP32-S3 USB-CDC COM20 16C0:0483 USB Serial Device (COM20) ser=15821020 └─ Van Ooijen Technische Informatica / Teensyduino Serial COM10 1FC9:0132 USB Serial Device (COM10) ser=0B03400A └─ NXP Semiconductors / LPC-Link2 CMSIS-DAP 5 USB ports, 3 non-USB ports) - #748 src-layout package-dir (static analyzers resolve fbuild.api) - #750 daemon WS handler split into reader/writer/inbound - #751 gitignore .extern-repos/ - #752 cargo fmt + extract test modules so 4 files fall under the 1000-LOC gate No public-API changes beyond what's already documented in the merged PRs above. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 17 minutes and 6 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
✨ 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
Two pre-existing CI gates were red on main; both unrelated to product behavior, both mechanical to fix.
crates/fbuild-daemon/src/handlers/websockets.rs. Resolved bycargo fmt --all.#[cfg(test)] mod tests { ... }block was lifted into a sibling<stem>/tests.rssubmodule, with#[cfg(test)] mod tests;replacing it in the parent. Tests stay at the same module path — purely a textual move.crates/fbuild-daemon/src/device_manager.rscrates/fbuild-cli/src/daemon_client.rscrates/fbuild-serial/src/manager.rscrates/fbuild-build/src/source_scanner.rsEach new
<stem>/directory ships a README per the repo'sreadme_guard.pyhook.Test plan
soldr cargo check --workspace --all-targets— cleansoldr cargo fmt --all -- --check— cleansoldr cargo clippy --workspace --all-targets -- -D warnings— clean🤖 Generated with Claude Code