Skip to content

Commit 7a578ce

Browse files
authored
Ignore ruff:isort like ruff:noqa in new suppressions (#21922)
## Summary Ignores `#ruff:isort` when parsing suppressions similar to `#ruff:noqa`. Should clear up ecosystem issues in #21908 ## Test Plan cargo tests
1 parent 34f7a04 commit 7a578ce

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/ruff_linter/src/suppression.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,10 @@ impl<'src> SuppressionParser<'src> {
490490
} else if self.cursor.as_str().starts_with("enable") {
491491
self.cursor.skip_bytes("enable".len());
492492
Ok(SuppressionAction::Enable)
493-
} else if self.cursor.as_str().starts_with("noqa") {
494-
// file-level "noqa" variant, ignore for now
493+
} else if self.cursor.as_str().starts_with("noqa")
494+
|| self.cursor.as_str().starts_with("isort")
495+
{
496+
// alternate suppression variants, ignore for now
495497
self.error(ParseErrorKind::NotASuppression)
496498
} else {
497499
self.error(ParseErrorKind::UnknownAction)

0 commit comments

Comments
 (0)