diff --git a/crates/ruff_linter/resources/test/fixtures/ruff/RUF100_0.py b/crates/ruff_linter/resources/test/fixtures/ruff/RUF100_0.py index 0d97a541cd535..451ba4d2666b1 100644 --- a/crates/ruff_linter/resources/test/fixtures/ruff/RUF100_0.py +++ b/crates/ruff_linter/resources/test/fixtures/ruff/RUF100_0.py @@ -105,3 +105,4 @@ def f(): def f(): # Invalid - nonexistant error code with multibyte character d = 1 #…noqa: F841, E50 + e = 1 #…noqa: E50 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_0.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_0.snap index 81690b9ba0696..e564ff931f9eb 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_0.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_0.snap @@ -290,6 +290,7 @@ RUF100_0.py:107:12: RUF100 [*] Unused `noqa` directive (unknown: `E50`) 106 | # Invalid - nonexistant error code with multibyte character 107 | d = 1 #…noqa: F841, E50 | ^^^^^^^^^^^^^^^^ RUF100 +108 | e = 1 #…noqa: E50 | = help: Remove unused `noqa` directive @@ -299,3 +300,35 @@ RUF100_0.py:107:12: RUF100 [*] Unused `noqa` directive (unknown: `E50`) 106 106 | # Invalid - nonexistant error code with multibyte character 107 |- d = 1 #…noqa: F841, E50 107 |+ d = 1 # noqa: F841 +108 108 | e = 1 #…noqa: E50 + +RUF100_0.py:108:5: F841 [*] Local variable `e` is assigned to but never used + | +106 | # Invalid - nonexistant error code with multibyte character +107 | d = 1 #…noqa: F841, E50 +108 | e = 1 #…noqa: E50 + | ^ F841 + | + = help: Remove assignment to unused variable `e` + +ℹ Unsafe fix +105 105 | def f(): +106 106 | # Invalid - nonexistant error code with multibyte character +107 107 | d = 1 #…noqa: F841, E50 +108 |- e = 1 #…noqa: E50 + +RUF100_0.py:108:12: RUF100 [*] Unused `noqa` directive (unknown: `E50`) + | +106 | # Invalid - nonexistant error code with multibyte character +107 | d = 1 #…noqa: F841, E50 +108 | e = 1 #…noqa: E50 + | ^^^^^^^^^^ RUF100 + | + = help: Remove unused `noqa` directive + +ℹ Safe fix +105 105 | def f(): +106 106 | # Invalid - nonexistant error code with multibyte character +107 107 | d = 1 #…noqa: F841, E50 +108 |- e = 1 #…noqa: E50 + 108 |+ e = 1 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_0_prefix.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_0_prefix.snap index 2f413749f48d2..c3314085aa7da 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_0_prefix.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_0_prefix.snap @@ -270,6 +270,7 @@ RUF100_0.py:107:12: RUF100 [*] Unused `noqa` directive (unknown: `E50`) 106 | # Invalid - nonexistant error code with multibyte character 107 | d = 1 #…noqa: F841, E50 | ^^^^^^^^^^^^^^^^ RUF100 +108 | e = 1 #…noqa: E50 | = help: Remove unused `noqa` directive @@ -279,3 +280,35 @@ RUF100_0.py:107:12: RUF100 [*] Unused `noqa` directive (unknown: `E50`) 106 106 | # Invalid - nonexistant error code with multibyte character 107 |- d = 1 #…noqa: F841, E50 107 |+ d = 1 # noqa: F841 +108 108 | e = 1 #…noqa: E50 + +RUF100_0.py:108:5: F841 [*] Local variable `e` is assigned to but never used + | +106 | # Invalid - nonexistant error code with multibyte character +107 | d = 1 #…noqa: F841, E50 +108 | e = 1 #…noqa: E50 + | ^ F841 + | + = help: Remove assignment to unused variable `e` + +ℹ Unsafe fix +105 105 | def f(): +106 106 | # Invalid - nonexistant error code with multibyte character +107 107 | d = 1 #…noqa: F841, E50 +108 |- e = 1 #…noqa: E50 + +RUF100_0.py:108:12: RUF100 [*] Unused `noqa` directive (unknown: `E50`) + | +106 | # Invalid - nonexistant error code with multibyte character +107 | d = 1 #…noqa: F841, E50 +108 | e = 1 #…noqa: E50 + | ^^^^^^^^^^ RUF100 + | + = help: Remove unused `noqa` directive + +ℹ Safe fix +105 105 | def f(): +106 106 | # Invalid - nonexistant error code with multibyte character +107 107 | d = 1 #…noqa: F841, E50 +108 |- e = 1 #…noqa: E50 + 108 |+ e = 1