Skip to content

Commit 2ff32de

Browse files
committed
Short circuit if no suppressions loaded
1 parent d3288fc commit 2ff32de

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/ruff_linter/src/suppression.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ impl Suppressions {
120120

121121
/// Check if a diagnostic is suppressed by any known range suppressions
122122
pub(crate) fn check_diagnostic(&self, diagnostic: &Diagnostic) -> bool {
123+
if self.valid.is_empty() {
124+
return false;
125+
}
126+
123127
let Some(code) = diagnostic.secondary_code() else {
124128
return false;
125129
};

0 commit comments

Comments
 (0)