Skip to content

refactor(render/sarif): split into submodule directory (#57 3/3)#65

Merged
Metbcy merged 2 commits into
mainfrom
refactor/split-sarif-rs-57
Jun 1, 2026
Merged

refactor(render/sarif): split into submodule directory (#57 3/3)#65
Metbcy merged 2 commits into
mainfrom
refactor/split-sarif-rs-57

Conversation

@Metbcy
Copy link
Copy Markdown
Owner

@Metbcy Metbcy commented Jun 1, 2026

Final part of #57 (module size budget round 2). Follows #62 (run.rs) and #64 (maintainer.rs).

What

src/render/sarif.rs (1205 LOC) split into src/render/sarif/:

  • mod.rs (73): docstring, consts, module decls, pub use document::render
  • document.rs (32): pub fn render orchestrator
  • rules.rs (128): fn rules + fn rule
  • results.rs (350): fn results (the twelve-loop finding emitter)
  • helpers.rs (58): fingerprint, plugin_sarif_level, synthetic_location, sarif_level
  • tests.rs (588): #[cfg(test)] mod tests

Biggest non-test file: results.rs at 350 LOC.

Behavior change

None. Pure mechanical cut-paste. Public path crate::render::sarif::render preserved (verified via src/run.rs:403). fingerprint had been pub(crate) but has zero out-of-module callers — narrowed to module-private (tests reach it via #[cfg(test)] re-export in mod.rs).

Verification

  • cargo test --lib: 429 passed, 0 failed
  • cargo clippy --all-targets -- -D warnings: clean
  • cargo test --lib render::sarif: 17 passed

Closes #57

After this merges, all three splits (run.rs, maintainer.rs, sarif.rs) are in. Crate's biggest non-test file drops from 1284 LOC to <600.

src/render/sarif.rs (1205 LOC) -> src/render/sarif/:
- mod.rs (73): docstring, consts, module decls, pub use render
- document.rs (32): pub fn render orchestrator
- rules.rs (128): fn rules + fn rule
- results.rs (350): fn results (twelve-loop finding emitter)
- helpers.rs (58): fingerprint, plugin_sarif_level, synthetic_location, sarif_level
- tests.rs (588): #[cfg(test)] mod tests

Biggest non-test file: results.rs at 350 LOC. Pure cut-paste, zero
behavior change. Public API path crate::render::sarif::render preserved.
429 lib tests pass, clippy clean.

Closes #57 (all three splits landed: run.rs #62, maintainer.rs #64, sarif.rs).
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

Coverage report

Line coverage: 83.6% (9129 / 10921 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.

@Metbcy Metbcy merged commit 142f291 into main Jun 1, 2026
10 checks passed
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.

Module size budget round 2: split run.rs, enrich/maintainer.rs, render/sarif.rs

1 participant