Skip to content

[ruff] Support file level noqa in RUF102#23535

Merged
amyreese merged 6 commits intomainfrom
amy/ruf102-file-level
Feb 25, 2026
Merged

[ruff] Support file level noqa in RUF102#23535
amyreese merged 6 commits intomainfrom
amy/ruf102-file-level

Conversation

@amyreese
Copy link
Member

  • Report invalid codes in file-level noqa
  • test case for file-level ruf102
  • drop old warning
  • drop old test

Fixes #23457

@amyreese amyreese added rule Implementing or modifying a lint rule suppression Related to supression of violations e.g. noqa labels Feb 24, 2026
@amyreese amyreese requested a review from ntBre February 24, 2026 03:19
@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 24, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me overall, just a few nits. This probably also needs to be a preview change right? I'd say it substantially increases the scope of the rule.

@amyreese amyreese force-pushed the amy/ruf102-file-level branch from 0e8d971 to 127c595 Compare February 24, 2026 21:28
@amyreese amyreese added the preview Related to preview mode features label Feb 24, 2026
Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I think this will also close #23267 now too.

@amyreese amyreese merged commit 57a1eb2 into main Feb 25, 2026
43 checks passed
@amyreese amyreese deleted the amy/ruf102-file-level branch February 25, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Related to preview mode features rule Implementing or modifying a lint rule suppression Related to supression of violations e.g. noqa

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make RUF102 also flag file-level noqa codes

2 participants