mirror of
https://github.com/astral-sh/ruff.git
synced 2025-12-23 09:19:39 +00:00
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
This commit is contained in:
parent
34f7a04ef7
commit
7a578ce833
1 changed files with 4 additions and 2 deletions
|
|
@ -490,8 +490,10 @@ impl<'src> SuppressionParser<'src> {
|
|||
} else if self.cursor.as_str().starts_with("enable") {
|
||||
self.cursor.skip_bytes("enable".len());
|
||||
Ok(SuppressionAction::Enable)
|
||||
} else if self.cursor.as_str().starts_with("noqa") {
|
||||
// file-level "noqa" variant, ignore for now
|
||||
} else if self.cursor.as_str().starts_with("noqa")
|
||||
|| self.cursor.as_str().starts_with("isort")
|
||||
{
|
||||
// alternate suppression variants, ignore for now
|
||||
self.error(ParseErrorKind::NotASuppression)
|
||||
} else {
|
||||
self.error(ParseErrorKind::UnknownAction)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue