Skip to content

fix(ignore): warn about cora-ignore markers that match nothing and add a reason separator - #692

Merged
ajianaz merged 1 commit into
developfrom
fix/679-unmatched-ignore-markers
Oct 16, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/679-unmatched-ignore-markers

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

What

  • A cora-ignore marker on a line that has findings but names none of them (typo, unknown rule, or explanation text that became part of the rule name) now prints a warning on stderr with the marker location, what it named and the rule ids on that line.
  • -- ends the rule list: cora-ignore: sec-hardcoded-secret -- env var name suppresses the finding and keeps the reason in the source.
  • Docs (Inline Suppression) and CHANGELOG updated.

Why

A suppression that silently does nothing makes people widen ignore.rules instead. Closes #679. Not done: warning about stale markers on clean lines (too noisy for diff reviews where only part of the file is visible); JSON/SARIF reporting of unmatched markers and a --strict-markers flag can follow.

Testing

  • Unit tests: separator, trailing text, unknown rule, matching markers and clean-line markers not reported.
  • 3 end-to-end tests in tests/inline_ignore.rs reproducing the issue (warning, finding kept; separator suppresses).
  • fmt, clippy -D warnings and the full suite pass.

…d a reason separator (#679)

Signed-off-by: ajianaz <ajianaz@users.noreply.github.com>
@ajianaz
ajianaz force-pushed the fix/679-unmatched-ignore-markers branch from b993f76 to 0d2ae22 Compare October 16, 2026 09:48
@ajianaz
ajianaz merged commit 09aab85 into develop Oct 16, 2026
14 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.

fix(ignore): a cora-ignore marker with trailing text, or naming an unknown rule, silently suppresses nothing

1 participant