Skip to content

refactor(symbol_analyzer): split into mod/markdown/tests submodule#475

Merged
zackees merged 1 commit into
mainfrom
fix/split-symbol-analyzer
Jun 7, 2026
Merged

refactor(symbol_analyzer): split into mod/markdown/tests submodule#475
zackees merged 1 commit into
mainfrom
fix/split-symbol-analyzer

Conversation

@zackees
Copy link
Copy Markdown
Member

@zackees zackees commented Jun 7, 2026

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:

File LOC Contents
`mod.rs` 608 ELF probe (`read_pt_load_regions`), `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`, `format_referenced_by`, `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 — `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

  • `soldr cargo check --workspace --all-targets`
  • `soldr cargo clippy --workspace --all-targets -- -D warnings`
  • `soldr cargo test -p fbuild-build --lib symbol_analyzer` — 17/17 pass
  • `soldr cargo fmt --all -- --check`
  • All files under 1000 LOC (608 / 430 / 597)

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

`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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 7, 2026

Warning

Review limit reached

@zackees, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2b56b867-a987-4ff0-a7e6-e5cb77b255f1

📥 Commits

Reviewing files that changed from the base of the PR and between 6dcb3ae and a9ffbe8.

📒 Files selected for processing (5)
  • crates/fbuild-build/src/symbol_analyzer.rs
  • crates/fbuild-build/src/symbol_analyzer/README.md
  • crates/fbuild-build/src/symbol_analyzer/markdown.rs
  • crates/fbuild-build/src/symbol_analyzer/mod.rs
  • crates/fbuild-build/src/symbol_analyzer/tests.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/split-symbol-analyzer

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant