Make noqa parsing consistent and more robust #16483
dylwil3
added this to the v0.10 milestone 358 days ago
dylwil3
marked this pull request as draft 358 days ago
dylwil3
marked this pull request as ready for review 357 days ago
dylwil3
force pushed
from
ae10927b
to
e0ea1701
355 days ago
dylwil3
marked this pull request as draft 355 days ago
dylwil3
marked this pull request as ready for review 355 days ago
tests and snapshots to capture current behavior
da0d858a
match function signatures for directive and file exemption
386017ee
test that code text matches slice at range
3c8e0230
core parsing reimplementation
8e06ad55
update snapshots for parsing behavior
a7ec02c1
update noqa.py fixture and snapshot for new behavior
fa96a03f
emit warnings for inline and file-level exemptions
b5949d5a
include warnings in snapshot tests
418d2a71
remove ParsedFileExemption
83d4c469
remove Directive::lex_code
2ea73c0e
replace ParsedNoqaDirective with Directive everywhere
d8b90520
clippy
b6f66cea
ascii whitespace only in regex
2ac597b4
revert "ascii whitespace only in regex" and try again
0c45ccfb
try explicit case-insensitive
f88cc8de
hand roll noqa prefix regex
6be00e0c
hand roll file exemption prefix regex
018fa036
rewrite noqa parser with Cursor
de4e5eb6
update snapshots
6dd06d30
use public lex_codes for blanket noqa rule
81714fbd
truncate source range end to comment range before lexing
de9284c2
use text_len
5f85a756
typo lexess->lexes
90f3be3a
allow non ascii whitespace in comment after All noqa
a3eb354c
fold prefix stripping into lexer
0bedda21
dylwil3
force pushed
from
48ddf252
to
0bedda21
354 days ago
MichaReiser
changed the base branch from
main
to
micha/ruff-0.10
351 days ago
smaller diff for tests
3de925d5
in_range instead of starts_at
729a0921
eat_whitespace method
03cca16b
test case with leading hashes and spaces
b580b93a
nit: simplify skip of tool prefix
f190d53c
allow spaces after noqa and before colon
8069e66d
nit: rename current to position
81709fca
remove need to store line in lexer
1b108b36
example comment for whitespace delimiters
70c22f67
space before colon no longer possible in blanket noqa PGH004
bde12aed
clippy
6b5d25b6
just allow arbitrary whitespace it's not a big deal
d48bb11d
remove unreachable branch in PGH004 implementation
ae39f619
dylwil3
merged
b8f12844
into micha/ruff-0.10 350 days ago
Assignees
No one assigned
Labels
breaking
suppression
Login to write a write a comment.
Login via GitHub