Skip to content

[ruff] Detect redirected-noqa in file-level comments (RUF101)#14635

Merged
MichaReiser merged 11 commits intoastral-sh:mainfrom
ntBre:brent/fix-14531
Nov 27, 2024
Merged

[ruff] Detect redirected-noqa in file-level comments (RUF101)#14635
MichaReiser merged 11 commits intoastral-sh:mainfrom
ntBre:brent/fix-14531

Conversation

@ntBre
Copy link
Contributor

@ntBre ntBre commented Nov 27, 2024

Summary

Fixes #14531, where ruff was not reporting diagnostics on file-level # ruff: noqa comments with redirected rule codes.

The main change here is making ParsedFileExemption closer in structure to Directive, with a sequence of Codes with TextRanges instead of just &str for diagnostic reporting.

Test Plan

The changes were tested against the example code from #14531 to make sure the diagnostic is now emitted.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

redirected-noqa (RUF101) does not detect file-level # ruff: noqa comments

4 participants