Skip to content

feat(ignore): path-scoped ignore.rules entries - #706

Merged
ajianaz merged 1 commit into
developfrom
feat/680-path-scoped-ignore-rules
Oct 27, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/680-path-scoped-ignore-rules

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

What

ignore.rules entries can now be objects, backwards compatible with plain strings:

ignore:
  rules:
    - "Hardcoded password or secret"          # whole project, unchanged
    - rule: bug-println
      files: ["crates/cli/**", "evals/**"]    # only these paths
      reason: "stdout is the cli interface"   # optional, documentation
  • rule is matched like a plain entry (rule id or title fragment); files uses the ignore.files glob syntax.
  • Applied in review, scan and the MCP tools, before the max_findings cap.
  • An empty files list (or an empty rule) is a config error instead of a rule that applies nowhere.
  • Docs (configuration.md, new section) and CHANGELOG updated.

Why

A rule can be noise in one crate and a real design guard in another (bug-println in a CLI vs an embedder-safe core); today the only options are silencing it everywhere or excluding directories from every check. Closes #680.

Testing

  • Unit tests: a scoped rule is silenced only under its globs, plain strings still silence everywhere, **/file.rs globs.
  • Config tests: YAML with strings and scoped objects (with reason) loads; empty files fails validation.
  • 2 end-to-end tests (tests/scoped_ignore.rs): silenced in crates/cli, still fires in crates/core; plain form unchanged.
  • fmt, clippy -D warnings and the full suite pass.

Signed-off-by: ajianaz <ajianaz@users.noreply.github.com>
@ajianaz
ajianaz merged commit 04f06c8 into develop Oct 27, 2026
13 checks passed
ajianaz added a commit that referenced this pull request Oct 27, 2026
## What

`ignore.rules` entries can now be objects, backwards compatible with
plain strings:

```yaml
ignore:
  rules:
    - "Hardcoded password or secret"          # whole project, unchanged
    - rule: bug-println
      files: ["crates/cli/**", "evals/**"]    # only these paths
      reason: "stdout is the cli interface"   # optional, documentation
```

- `rule` is matched like a plain entry (rule id or title fragment);
`files` uses the `ignore.files` glob syntax.
- Applied in `review`, `scan` and the MCP tools, before the
`max_findings` cap.
- An empty `files` list (or an empty `rule`) is a config error instead
of a rule that applies nowhere.
- Docs (`configuration.md`, new section) and CHANGELOG updated.

## Why

A rule can be noise in one crate and a real design guard in another
(`bug-println` in a CLI vs an embedder-safe core); today the only
options are silencing it everywhere or excluding directories from every
check. Closes #680.

## Testing

- Unit tests: a scoped rule is silenced only under its globs, plain
strings still silence everywhere, `**/file.rs` globs.
- Config tests: YAML with strings and scoped objects (with `reason`)
loads; empty `files` fails validation.
- 2 end-to-end tests (tests/scoped_ignore.rs): silenced in `crates/cli`,
still fires in `crates/core`; plain form unchanged.
- fmt, clippy -D warnings and the full suite pass.

Signed-off-by: ajianaz <ajianaz@users.noreply.github.com>
Co-authored-by: ajianaz <ajianaz@users.noreply.github.com>
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.

feat(ignore): path-scoped ignore.rules (silence a rule in some directories only)

1 participant