Suppressions
Silence a finding you have decided to keep, without hiding the decision.
Rust Doctor has no comment directive of its own. There is nothing like
rust-doctor-disable-next-line, deliberately: a suppression syntax that only
one tool understands is a decision no other reader can see.
Two mechanisms silence a finding, and both are already part of the language or the project.
#One site: #[allow]
For a Clippy rule, the ordinary attribute works, because Rust Doctor asks
Clippy for these lints with -W and an allow in the source wins over a
warning on the command line.
#[allow(clippy::unwrap_used)] // The key is inserted immediately above.
let value = map.get("key").unwrap();Scope it as narrowly as the exception: on the expression or the function, not
on the crate. Rust Doctor catalogues a crate-level allow as a finding of its
own, since it silences a rule everywhere to solve a problem in one place.
The native detectors do not read attributes. They parse source text, read manifests, or ask git what it tracks, so their findings are silenced by policy rather than by an attribute.
#Whole project: off
[rules]
"rust_doctor::structure::near_duplicate" = "off"Or for one run:
rust-doctor --rule rust_doctor::structure::near_duplicate=offA rule set to off leaves the scan entirely: it stops costing the score and
stops appearing in the report. See Configuration.
#Lowering rather than silencing
warn keeps a rule visible while removing it from what blocks CI, which is
usually what you want when the fix is real but not urgent:
rust-doctor --category maintainability=warn --blocking error