refactor(symbol_analysis): split graph.rs + fix rustdoc broken link#474
Conversation
…dule `graph.rs` was 1744 LOC and tripped the "Reject .rs files over 1000 LOC" CI gate. Also fixes the `Documentation` gate which was failing on an unresolved rustdoc intra-doc link. Restructure: `symbol_analysis/graph.rs` → `symbol_analysis/graph/` with three files, each well under the 1000-LOC limit: - `mod.rs` (698) — public types (`GraphConfig`, `GraphNode`, `EdgeDirection`, `GraphEdge`, `BackrefGraph`), the `BackrefGraph::build*` entry points, `to_dot()` rendering, and the small dot-helpers (`node_color`, `node_width`, `format_*_label`, `sanitize_id`, `sanitize_filename`, `escape_dot_label`). - `walker.rs` (361) — internal walker (`CappedReferencer`, `rank_and_cap_referencers`, `push_edge_dedup`, `walk_forward`, `CalleeCandidate`, `format_callee_label`) plus the public `rank_callees_dual` / `CalleeRanked` API, re-exported from `mod.rs` so the existing path `fbuild_core::symbol_analysis::graph::rank_callees_dual` keeps resolving for `fbuild_build::symbol_analyzer`. - `tests.rs` (715) — the entire `#[cfg(test)] mod tests` body. Also fixes the rustdoc broken-link warning that failed the `Documentation` job: `[`build`]` → `[`Self::build`]` so the intra-doc resolver finds it (`-D rustdoc::broken_intra_doc_links` under `-D warnings`). No public API change. Content-preserving refactor; only visibility adjustments (`pub(super)` where the parent calls into the new walker module). Verified clean: `check`, `clippy --all-targets -- -D warnings`, `test -p fbuild-core --lib symbol_analysis` (66 passed including all 20 `graph::tests::*`), `fmt --check`, and `RUSTDOCFLAGS="-D warnings" cargo doc -p fbuild-core --no-deps`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 20 minutes and 22 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 |
Restores two failing CI gates that have been red on `main` since #468 / #470:
`crates/fbuild-core/src/symbol_analysis/graph.rs` at 1744 LOC.
intra-doc link (`unresolved link to `build``).
What changed
`symbol_analysis/graph.rs` → `symbol_analysis/graph/` directory with
three files, each well under the 1000-LOC limit:
Doc link fix: `[`build`]` → `[`Self::build`]` so rustdoc resolves it under `-D rustdoc::broken_intra_doc_links`.
Why
consumer (`fbuild_build::symbol_analyzer`) still imports
`fbuild_core::symbol_analysis::graph::{rank_callees_dual, Direction}`
unchanged thanks to a re-export in `mod.rs`.
tests.rs siblings under a `mod.rs`) — no new convention.
Test plan
Follow-up
`crates/fbuild-build/src/symbol_analyzer.rs` (1609 LOC) still trips the
LOC gate; same treatment in a separate PR.
🤖 Generated with Claude Code