From 7a578ce8334d4a1e75f91b1c600fa035f0469bed Mon Sep 17 00:00:00 2001 From: Amethyst Reese Date: Thu, 11 Dec 2025 11:04:28 -0800 Subject: [PATCH] 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 --- crates/ruff_linter/src/suppression.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ruff_linter/src/suppression.rs b/crates/ruff_linter/src/suppression.rs index 9eb12d1026..18c6ad50ce 100644 --- a/crates/ruff_linter/src/suppression.rs +++ b/crates/ruff_linter/src/suppression.rs @@ -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)