C0013 waiver-unused¶
Rule: Every waiver comment allows a finding.
| Code | C0013 (stable, never reused) |
| Id | waiver-unused |
| Category | waivers |
| Source | spirit_level |
| Fix | by hand |
Level per tier¶
| Tier | Level | Reason |
|---|---|---|
| small | warn |
a waiver that allows nothing is left over from changed code |
| small-workspace | warn |
a waiver that allows nothing is left over from changed code |
| medium | warn |
a waiver that allows nothing is left over from changed code |
| big | deny |
every waiver allows something, or it goes |
| ai | off | |
| embedded | off | |
| ui | off | |
| egui | off | |
| units-strict | off | |
| units-paranoid | off |
Why¶
A waiver that allows nothing is left over from code that changed. It still reads as if the code needed an exception, and it would silently allow a new finding of the same lint that nobody looked at.
A waiver counts as unused only when every lint it names ran in this check, so --only or a lint that could not run never makes a waiver look unused.
How to fix¶
Remove the comment.
Configure¶
Allow one finding in the code with // spirit-level: allow(waiver-unused) <reason> (waivers); the code works there too, as in [lints.C0013].