Skip to content

refactor(baseline): split baseline.rs into a submodule directory (#68)#70

Open
Metbcy wants to merge 1 commit into
mainfrom
refactor/baseline-split
Open

refactor(baseline): split baseline.rs into a submodule directory (#68)#70
Metbcy wants to merge 1 commit into
mainfrom
refactor/baseline-split

Conversation

@Metbcy

@Metbcy Metbcy commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Summary

Splits the 1274-LOC src/baseline.rs into a src/baseline/ submodule directory, the next file over the 1000-LOC soft cap after the #57 series (PRs #62-#65). Closes #68.

This is a pure mechanical move: no logic, control flow, or string literal changed. The layout mirrors the reference shape from PR #62 (run/) and #64 (maintainer/).

Layout

File LOC Responsibility
mod.rs 302 Crate doc, Baseline / BaselineEntry / ExpiredEntry types and the parsing core (load, from_value, from_value_strict), plus the re-export wiring
apply.rs 49 The suppression pass (apply)
mutate.rs 140 Baseline-file writing (add_suppression, add_suppression_full, AddOutcome)
comment.rs 70 PR/MR comment directive parsing (parse_comment_directive)
tests.rs 741 The #[cfg(test)] mod tests block, moved verbatim

Why

baseline.rs was the largest non-test file over the soft cap. The split keeps each concern in its own file so review attention does not skip the middle of a 1200-line module, and it follows the budget rule in docs/src/architecture.md.

Compatibility

The public surface stays reachable at the same paths (crate::baseline::{Baseline, BaselineEntry, ExpiredEntry, apply, add_suppression, add_suppression_full, parse_comment_directive, AddOutcome} plus the Baseline methods). pub mod baseline; in src/lib.rs is unchanged. doc_kind was widened from private to pub(super) since it is now shared across mutate.rs and the tests. No other visibility changed.

Testing

  • cargo build --all-targets --all-features (RUSTFLAGS="-D warnings"): clean
  • cargo clippy --all-targets --all-features -- -D warnings: clean
  • cargo test --all-features: 441 lib + 36 cli + 9 integration + 7 real_world + 1 doc, all pass
  • cargo fmt --all --check: clean

Closes #68.

src/baseline.rs was 1274 LOC, over the 1000-LOC soft cap in the module
size budget. Split it into src/baseline/ mirroring the run/ and
enrich/maintainer/ splits from the #57 series: a thin mod.rs that owns
the Baseline/BaselineEntry types and parsing core, plus apply.rs
(suppression pass), mutate.rs (baseline-file writing), comment.rs
(directive parsing), and tests.rs.

Pure mechanical move, no behavior change. The public surface stays
reachable at crate::baseline::* and pub mod baseline; in lib.rs is
unchanged. doc_kind widened from private to pub(super) since it is now
shared across mutate.rs and the tests.

Closes #68.
@github-actions

Copy link
Copy Markdown

Coverage report

Line coverage: 82.9% (8677 / 10470 lines)

Full lcov report available as workflow artifact coverage-lcov: download from this run.

v0.9.8 introduces this report; --fail-under-lines will be added once coverage is visible across 2–3 releases.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(baseline): split src/baseline.rs into a submodule directory (#57 follow-up)

1 participant