lint: weak asserts outside test files, and a waiver date token - #687
Merged
reardencode merged 2 commits intoSep 23, 2026
Merged
reardencode merged 2 commits into
reardencode merged 2 commits into
Conversation
Hero-Gamer
force-pushed
the
add/ast-grep-enforce-mutation-policy
branch
from
September 22, 2026 23:49
26e1b83 to
3620b68
Compare
Hero-Gamer
force-pushed
the
add/ast-grep-enforce-mutation-policy
branch
from
September 23, 2026 00:41
3620b68 to
a2a1dc8
Compare
Hero-Gamer
force-pushed
the
add/ast-grep-enforce-mutation-policy
branch
from
September 23, 2026 01:04
a2a1dc8 to
d714fe5
Compare
15 tasks
…expiry - weak-assert.yml: Flag assertions that check only is_err/is_ok rather than the specific error variant. Applies to src/ including #[cfg(test)] blocks. - waiver-expiry.yml: Require YYYY-MM-DD expiry date on all MUTANT-WAIVER comments - Explicit ignores: separate test dirs, benches, core vector fixture files - Exempt 2 pre-existing panic-detection assertions with expiry 2026-12-31 - Zero hits on master → CI-safe - Per code-shape.md: structural lint only, not a second clippy
weak-assert does not see *tests*.rs, tests/, or benches/, and the two excluded src files have no expiry check. A MUTANT-WAIVER date token is required only in scanned files, and the date is not compared to today.
rearden-grok
Bot
force-pushed
the
add/ast-grep-enforce-mutation-policy
branch
from
September 23, 2026 19:01
d714fe5 to
5e5cb2f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebased onto current master.
What this adds
Two ast-grep rules, run by the existing
ast-grepjob. They do not scan the unit-test files where mutant misses usually live.weak-assert.ymlflags bareis_ok/is_err/matches!(Ok(_))/matches!(Err(_))(and theassert_eq!(…, true)forms) in Rust that is not a test file.*tests*.rs,tests/,benches/..rsfiles, including a#[cfg(test)]module inside them. ast-grep has nocfg.tip_accept.rsandscript_pool.rsare excluded entirely. The rule does not enforce an expiry on those exclusions.waiver-expiry.ymlrequires aMUTANT-WAIVERcomment in a scanned file to contain anexpires YYYY-MM-DDtoken. The date is not compared to today. Comments in*tests*.rsandtests/are not scanned.Compliance