fix(lint): unbreak the 2000-line file-size gate on main - #7830
Conversation
Two files crossed the cap in the 2026-08-11 batch and `lint` has been red on `main` ever since: crates/perry-hir/src/lower/pre_scan.rs 1985 -> 2011 (#7828) crates/perry-runtime/src/gc/layout.rs 1982 -> 2023 (#7809, #7812) Both are pure code moves, no logic change: * `pre_scan_weakref_locals` and its doc comment move to `lower/pre_scan/weakref_locals.rs` (1653 lines left behind). It is the cohesive unit — one top-level pre-scan with its own five local sets — and it is where #7828 added the lines. * `LayoutSlotMask` (the enum and its whole `impl`) moves to `gc/layout/slot_mask.rs` (1807 lines left behind). Its visibility widens from `pub(super)` to `pub(in crate::gc)` because the type is now one module deeper and `layout_tables.rs` / `hot_tls.rs` still name it; the reachable set is unchanged. `scripts/check_file_size.sh` passes.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR moves the weak-reference pre-scan and GC slot-mask implementations into dedicated Rust modules. It preserves existing behavior and internal access through re-exports. It also adds a changelog entry for the file-size lint gate. ChangesWeak-reference local pre-scan
GC slot-mask extraction
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@changelog.d/7830-file-size-gate.md`:
- Around line 3-23: Replace the narrative in the changelog entry with one
concise release-note statement describing the shipped fix: resolve the file-size
lint gate by moving the GC layout slot-mask implementation and weak-reference
pre-scan implementation into dedicated modules. Remove CI history, PR
references, line counts, and development guidance.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 475c3418-d304-4d88-81c3-6dc0dcd78847
📒 Files selected for processing (5)
changelog.d/7830-file-size-gate.mdcrates/perry-hir/src/lower/pre_scan.rscrates/perry-hir/src/lower/pre_scan/weakref_locals.rscrates/perry-runtime/src/gc/layout.rscrates/perry-runtime/src/gc/layout/slot_mask.rs
What
linthas been red onmainsince the 2026-08-11 batch: two files crossed the 2000-line cap thatscripts/check_file_size.shenforces.crates/perry-hir/src/lower/pre_scan.rscrates/perry-runtime/src/gc/layout.rspre_scan.rsis my own regression from #7828 — CLAUDE.md warns about exactly this cap ("adding a long doc comment can trip it") and I did not run the script before pushing.The split
Both are pure code moves. No logic changes, no behaviour changes.
pre_scan_weakref_locals→lower/pre_scan/weakref_locals.rs(1653 lines left behind). It is the cohesive unit to carve out: one of the file's three top-level pre-scans, owning its own five local sets, and the one #7828 grew.LayoutSlotMask(enum + its wholeimpl) →gc/layout/slot_mask.rs(1807 lines left behind). One self-contained data type with its methods. Its visibility widens frompub(super)topub(in crate::gc)purely because the type now sits one module deeper andlayout_tables.rs/hot_tls.rsstill name it — the reachable set is identical.Validation
scripts/check_file_size.sh→OK: no Rust source files exceed 2000 lines.(was exit 1 on both files)cargo check -p perry-hir -p perry-runtimeclean; zero warnings introduced (the 19 thatcargo checkprints are pre-existing and all in files this PR does not touch)cargo fmt --all -- --checkcleantest_gap_proxy_local_name_collision_7775.ts(the fix(hir): a local named like a proxy local is not a proxy #7828 test whose code moved) still matches Node byte-for-byteSummary by CodeRabbit