refactor(symbol_analyzer): split into mod/markdown/tests submodule#475
Conversation
`symbol_analyzer.rs` was 1609 LOC and tripped the "Reject .rs files
over 1000 LOC" CI gate. Restructure into a directory module with
three files, each well under the limit:
| File | LOC | Contents |
|------|-----|----------|
| `mod.rs` | 608 | ELF probe, `analyze_elf` + `AnalyzeConfig`, nm/c++filt drivers, `format_text_report`, project ELF discovery |
| `markdown.rs` | 430 | `format_markdown_report`, `format_markdown_report_with_graphs`, `MarkdownGraphOptions`, `SidecarOptions`, `write_sidecar_dot_files`, internal `emit_*` helpers |
| `tests.rs` | 597 | All 17 `#[cfg(test)]` cases |
The markdown public surface is re-exported from `mod.rs`
(`pub use markdown::{format_markdown_report, ...}`) so existing
consumers like `fbuild_cli::cli::symbols_cmd` and
`fbuild_cli::cli::graph_cmd` keep importing
`fbuild_build::symbol_analyzer::format_markdown_report` unchanged.
Content-preserving — no behavior change. The only non-mechanical edit
is two missing local imports in one test
(`markdown_report_emits_dual_ranked_callees_subtable`) that
previously resolved through the file's module-scope imports and now
need explicit `use super::*;` + `use super::markdown::*;` after the
split.
Verified clean: `check --workspace --all-targets`,
`clippy --workspace --all-targets -- -D warnings`,
`test -p fbuild-build --lib symbol_analyzer` (17/17),
`fmt --check`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 5 minutes and 7 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. 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 (5)
✨ 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 |
Companion to #474 — together these two PRs restore the
`Reject .rs files over 1000 LOC` gate that's been red on `main`
since #468 / #470.
What changed
`crates/fbuild-build/src/symbol_analyzer.rs` (1609 LOC) →
`crates/fbuild-build/src/symbol_analyzer/` directory:
The markdown public surface is re-exported from `mod.rs`
(`pub use markdown::{format_markdown_report, ...}`) so existing
consumers — `fbuild_cli::cli::symbols_cmd`,
`fbuild_cli::cli::graph_cmd` — keep importing
`fbuild_build::symbol_analyzer::format_markdown_report` unchanged.
No consumer file is touched.
Content-preserving refactor. Only non-mechanical edit: one test
(`markdown_report_emits_dual_ranked_callees_subtable`) gained two
explicit `use` lines that previously resolved through file-scope
imports.
Test plan
Merge order
#474 (graph.rs split + doc-link fix) lands first; this PR is independent (different crate, no shared file) so order doesn't strictly matter — but both need to land before #472 can go green via rebase.
🤖 Generated with Claude Code