Skip to content

MAINT: Consolidate Ruff per-file-ignores; drop dead pyrit/ui config#2098

Merged
romanlutz merged 1 commit into
microsoft:mainfrom
romanlutz:romanlutz-simplify-per-file-ignores
Jun 29, 2026
Merged

MAINT: Consolidate Ruff per-file-ignores; drop dead pyrit/ui config#2098
romanlutz merged 1 commit into
microsoft:mainfrom
romanlutz:romanlutz-simplify-per-file-ignores

Conversation

@romanlutz

Copy link
Copy Markdown
Contributor

Description

The [tool.ruff.lint.per-file-ignores] table had grown redundant and partly stale. This is a pure, behavior-preserving cleanup of that table; it does not change what gets linted anywhere.

Specifically:

  • Removed the redundant combined "pyrit/{auxiliary_attacks,ui}/**/*.py" entry. Ruff unions ignores across all matching patterns, so its granular D1xx/D4xx/DOCxxx codes were already covered by the dedicated auxiliary_attacks entry's D/DOC prefixes. Its only non-redundant codes, N and PERF, were folded into that entry, which is now ["A", "B905", "D", "DOC", "N", "PERF", "SIM101", "SIM108"].
  • Removed the dead "pyrit/ui/**/*.py" entry. pyrit/ui/ does not exist, so both it and the ui branch of the combined pattern matched zero files.

Net effect: three lines removed and one entry updated, while auxiliary_attacks (vendored GCG attack code) keeps the exact same effective ignore set.

Tests and Documentation

Config-only change; no code, tests, or docs are affected, and JupyText is not applicable.

Behavior was verified unchanged two independent ways:

  • Parsed Ruff's fully-resolved config (ruff check --show-settings) before and after. The effective ignore set for an auxiliary_attacks file is byte-identical (the same 86 fully-expanded rule codes), and every other matcher (doc, backend, tests, etc.) is unchanged.
  • ruff check pyrit/auxiliary_attacks pyrit/backend --statistics returns identical results before and after (the same 9 pre-existing D421 in pyrit/backend, which are out of scope for this PR).

… config

Merge the redundant `pyrit/{auxiliary_attacks,ui}` entry into the single `pyrit/auxiliary_attacks/**/*.py` entry by adding N and PERF (the only codes not already subsumed by its D/DOC/A prefixes). Remove the `pyrit/ui/**/*.py` entry and the ui branch of the combined pattern as dead config (pyrit/ui/ does not exist).

Behavior-preserving: Ruff's resolved per-file-ignores for an auxiliary_attacks file are byte-identical (86 expanded codes) before and after, and `ruff check pyrit/auxiliary_attacks pyrit/backend` reports the same results.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@romanlutz romanlutz added this pull request to the merge queue Jun 29, 2026
Merged via the queue into microsoft:main with commit 965093b Jun 29, 2026
47 checks passed
@romanlutz romanlutz deleted the romanlutz-simplify-per-file-ignores branch June 29, 2026 19:22
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.

3 participants