Skip to content

Commit e9de061

Browse files
committed
Check common case first in external rule check
1 parent 2fe49fb commit e9de061

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/ruff_linter/src/rules/ruff/rules/invalid_rule_code.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ pub(crate) fn invalid_noqa_code(
6363

6464
for code in directive.iter() {
6565
let code_str = code.as_str();
66-
if external.iter().any(|ext| code_str.starts_with(ext))
67-
|| Rule::from_code(code.as_str()).is_ok()
66+
if Rule::from_code(code.as_str()).is_ok()
67+
|| external.iter().any(|ext| code_str.starts_with(ext))
6868
{
6969
all_invalid = false;
7070
} else {

0 commit comments

Comments
 (0)