source-lints: add node_fs.rs to dead-code escape inventory - #36073
Conversation
#36067 renamed _cp_symlink/_cp_open_dest_with_mkdir and moved the dead-code suppression from the underscore prefix to explicit #[cfg_attr(..., allow(dead_code))] attributes. Both functions are live on Linux/FreeBSD and dead on Windows (and macOS for cp_symlink), so the escapes are legitimate, but the inventory was not regenerated and the ratchet test has been failing on main since bfd1e92. Regenerated with: bun ./test/internal/source-lints/dead-code-escapes.test.ts
|
Warning Review limit reached
Next review available in: 20 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?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 reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. 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, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
Comment |
There was a problem hiding this comment.
LGTM — mechanical inventory regen to unbreak the source-lints workflow.
What was reviewed:
- Confirmed
node_fs.rshas exactly 2 item-levelallow(dead_code)escapes, both platform-gated#[cfg_attr]oncp_symlink/cp_open_dest_with_mkdir. - Verified both functions are live on non-gated targets (called at lines 8613/8680/8706/8852/8878), so the escapes are legitimate rather than masking actual dead code.
- Entry is alphabetically ordered between
fs_events.rsandNodeHTTPResponse.rs.
Extended reasoning...
Overview
Single-line addition to test/internal/source-lints/dead-code-escape-limits.json, a generated inventory file that caps how many item-level #[allow(dead_code)] attributes each source file may contain. #36067 renamed two underscore-prefixed helpers in node_fs.rs and replaced the underscore-based suppression with explicit #[cfg_attr(..., allow(dead_code))], which the lint now counts. The inventory wasn't regenerated in that PR, so the source-lints GitHub Actions workflow has been red on main.
Security risks
None. This touches only a test-infrastructure JSON snapshot; no runtime code, no build config.
Level of scrutiny
Minimal. The file is machine-generated (bun ./test/internal/source-lints/dead-code-escapes.test.ts) and the diff matches what regeneration would produce. I independently grepped node_fs.rs and found exactly the two allow(dead_code) occurrences described, both cfg-gated to platforms where the callers are compiled out — the canonical legitimate case for this escape hatch.
Other factors
- Alphabetical ordering is preserved.
- The count (2) matches the actual grep count, so this isn't over-budgeting.
- No prior reviewer comments to address; only a CodeRabbit rate-limit notice on the timeline.
|
CI build failure ( This diff touches only a generated test-inventory JSON and cannot affect the Rust build. |
## What Adds `src/runtime/node/node_fs.rs: 2` to the dead-code escape inventory so the `dead-code-escapes` source-lint passes again on main. ## Why #36067 (bfd1e92) renamed `_cp_symlink` → `cp_symlink` and `_cp_open_dest_with_mkdir` → `cp_open_dest_with_mkdir`, moving the dead-code suppression from the leading underscore (which the inventory regex does not match) to explicit `#[cfg_attr(..., allow(dead_code))]` attributes: ```rust #[cfg_attr(any(windows, target_os = "macos"), allow(dead_code))] fn cp_symlink(&mut self, ...) { ... } #[cfg_attr(windows, allow(dead_code))] fn cp_open_dest_with_mkdir(&mut self, ...) { ... } ``` Both functions are called from the Linux/FreeBSD arms of `copy_single_file_sync` (lines 8613, 8680, 8706, 8852, 8878) and are only dead on the platforms named in the predicate, so the escapes are legitimate per the test's own rules. The inventory file was simply not regenerated, and the GitHub Actions `source-lints` workflow has been failing on every main commit since: ``` (fail) #[allow(dead_code)] escapes > src/runtime/node/node_fs.rs (0) error: src/runtime/node/node_fs.rs has 2 item-level #[allow(dead_code)] escapes, up from 0. ``` Failed runs: 30249533282 (bfd1e92), 30249969141, 30250537591, 30250867335. ## How Regenerated with `bun ./test/internal/source-lints/dead-code-escapes.test.ts` per the test's instructions. ## Verification ``` $ bun test test/internal/source-lints/dead-code-escapes.test.ts ... (pass) #[allow(dead_code)] escapes > src/runtime/node/node_fs.rs (2) ... 26 pass 0 fail ``` <!-- robobun:evidence:begin --> --- **no test proof** · iteration 0 · docs-only change; test-proof not applicable <!-- robobun:evidence:end -->
What
Adds
src/runtime/node/node_fs.rs: 2to the dead-code escape inventory so thedead-code-escapessource-lint passes again on main.Why
#36067 (bfd1e92) renamed
_cp_symlink→cp_symlinkand_cp_open_dest_with_mkdir→cp_open_dest_with_mkdir, moving the dead-code suppression from the leading underscore (which the inventory regex does not match) to explicit#[cfg_attr(..., allow(dead_code))]attributes:Both functions are called from the Linux/FreeBSD arms of
copy_single_file_sync(lines 8613, 8680, 8706, 8852, 8878) and are only dead on the platforms named in the predicate, so the escapes are legitimate per the test's own rules. The inventory file was simply not regenerated, and the GitHub Actionssource-lintsworkflow has been failing on every main commit since:Failed runs: 30249533282 (bfd1e92), 30249969141, 30250537591, 30250867335.
How
Regenerated with
bun ./test/internal/source-lints/dead-code-escapes.test.tsper the test's instructions.Verification
no test proof · iteration 0 · docs-only change; test-proof not applicable