Skip to content

Commit 52a54a9

Browse files
committed
noqa_code().rule() instead of name().parse()
1 parent 08a227e commit 52a54a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/ruff_linter/src/linter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ pub fn check_path(
439439
if !settings.fix_safety.is_empty() {
440440
for diagnostic in &mut diagnostics {
441441
if let Some(fix) = diagnostic.fix.take() {
442-
if let Ok(rule) = diagnostic.name().parse() {
442+
if let Some(rule) = diagnostic.noqa_code().and_then(|code| code.rule()) {
443443
let fixed_applicability = settings
444444
.fix_safety
445445
.resolve_applicability(rule, fix.applicability());

0 commit comments

Comments
 (0)