From 8634ed01b720f8496c8a41f59f5f10de8c3d462b Mon Sep 17 00:00:00 2001 From: Zanie Date: Tue, 3 Oct 2023 12:16:01 -0500 Subject: [PATCH] Update snapshots to reflect changes in fix messages --- crates/ruff_cli/tests/lint.rs | 8 +- ...__message__grouped__tests__fix_status.snap | 4 +- ...ter__message__text__tests__fix_status.snap | 4 +- ...__flake8_annotations__tests__defaults.snap | 4 +- ..._annotations__tests__mypy_init_return.snap | 6 +- ...otations__tests__simple_magic_methods.snap | 28 ++--- ...__flake8_bugbear__tests__B007_B007.py.snap | 8 +- ...ke8_bugbear__tests__B009_B009_B010.py.snap | 34 +++--- ...ke8_bugbear__tests__B010_B009_B010.py.snap | 12 +-- ...__flake8_bugbear__tests__B011_B011.py.snap | 4 +- ...8_comprehensions__tests__C400_C400.py.snap | 4 +- ...8_comprehensions__tests__C401_C401.py.snap | 26 ++--- ...8_comprehensions__tests__C402_C402.py.snap | 26 ++--- ...8_comprehensions__tests__C403_C403.py.snap | 18 ++-- ...8_comprehensions__tests__C404_C404.py.snap | 20 ++-- ...8_comprehensions__tests__C405_C405.py.snap | 40 +++---- ...8_comprehensions__tests__C406_C406.py.snap | 8 +- ...8_comprehensions__tests__C408_C408.py.snap | 32 +++--- ...low_dict_calls_with_keyword_arguments.snap | 10 +- ...8_comprehensions__tests__C409_C409.py.snap | 10 +- ...8_comprehensions__tests__C410_C410.py.snap | 8 +- ...8_comprehensions__tests__C411_C411.py.snap | 2 +- ...8_comprehensions__tests__C413_C413.py.snap | 20 ++-- ...8_comprehensions__tests__C414_C414.py.snap | 48 ++++----- ...8_comprehensions__tests__C416_C416.py.snap | 14 +-- ...8_comprehensions__tests__C417_C417.py.snap | 36 +++---- ...8_comprehensions__tests__C418_C418.py.snap | 8 +- ...8_comprehensions__tests__C419_C419.py.snap | 14 +-- ...__rules__flake8_errmsg__tests__custom.snap | 14 +-- ...rules__flake8_errmsg__tests__defaults.snap | 18 ++-- ...8_import_conventions__tests__defaults.snap | 26 ++--- ...ke8_import_conventions__tests__tricky.snap | 2 +- ...ake8_logging__tests__LOG001_LOG001.py.snap | 4 +- ...ake8_logging__tests__LOG002_LOG002.py.snap | 8 +- ...ake8_logging__tests__LOG009_LOG009.py.snap | 4 +- ...__flake8_pie__tests__PIE794_PIE794.py.snap | 8 +- ...__flake8_pie__tests__PIE810_PIE810.py.snap | 10 +- ..._flake8_pyi__tests__PYI010_PYI010.pyi.snap | 6 +- ..._flake8_pyi__tests__PYI011_PYI011.pyi.snap | 36 +++---- ..._flake8_pyi__tests__PYI014_PYI014.pyi.snap | 26 ++--- ..._flake8_pyi__tests__PYI015_PYI015.pyi.snap | 22 ++-- ...__flake8_pyi__tests__PYI025_PYI025.py.snap | 4 +- ..._flake8_pyi__tests__PYI025_PYI025.pyi.snap | 10 +- ..._flake8_pyi__tests__PYI026_PYI026.pyi.snap | 10 +- ..._flake8_pyi__tests__PYI053_PYI053.pyi.snap | 10 +- ..._flake8_pyi__tests__PYI054_PYI054.pyi.snap | 16 +-- ...e8_pyi__tests__py38_PYI026_PYI026.pyi.snap | 10 +- ...es__flake8_pytest_style__tests__PT003.snap | 16 +-- ...flake8_pytest_style__tests__PT006_csv.snap | 4 +- ...e8_pytest_style__tests__PT006_default.snap | 20 ++-- ...lake8_pytest_style__tests__PT006_list.snap | 16 +-- ...es__flake8_pytest_style__tests__PT009.snap | 58 +++++----- ...es__flake8_pytest_style__tests__PT014.snap | 16 +-- ...es__flake8_pytest_style__tests__PT018.snap | 30 +++--- ...es__flake8_pytest_style__tests__PT026.snap | 4 +- ...__flake8_pytest_style__tests__PT027_0.snap | 16 +-- ...__flake8_pytest_style__tests__PT027_1.snap | 2 +- ...lake8_return__tests__RET503_RET503.py.snap | 40 +++---- ...lake8_return__tests__RET504_RET504.py.snap | 22 ++-- ...ke8_simplify__tests__SIM101_SIM101.py.snap | 14 +-- ...ke8_simplify__tests__SIM102_SIM102.py.snap | 24 ++--- ...ke8_simplify__tests__SIM103_SIM103.py.snap | 8 +- ...8_simplify__tests__SIM105_SIM105_0.py.snap | 18 ++-- ...8_simplify__tests__SIM105_SIM105_1.py.snap | 2 +- ...8_simplify__tests__SIM105_SIM105_2.py.snap | 2 +- ...8_simplify__tests__SIM105_SIM105_4.py.snap | 2 +- ...ke8_simplify__tests__SIM108_SIM108.py.snap | 6 +- ...ke8_simplify__tests__SIM109_SIM109.py.snap | 8 +- ...ke8_simplify__tests__SIM110_SIM110.py.snap | 22 ++-- ...ke8_simplify__tests__SIM110_SIM111.py.snap | 24 ++--- ...ke8_simplify__tests__SIM112_SIM112.py.snap | 6 +- ...ke8_simplify__tests__SIM117_SIM117.py.snap | 20 ++-- ...ke8_simplify__tests__SIM118_SIM118.py.snap | 38 +++---- ...ke8_simplify__tests__SIM202_SIM202.py.snap | 6 +- ...ke8_simplify__tests__SIM208_SIM208.py.snap | 10 +- ...ke8_simplify__tests__SIM210_SIM210.py.snap | 8 +- ...ke8_simplify__tests__SIM211_SIM211.py.snap | 6 +- ...ke8_simplify__tests__SIM212_SIM212.py.snap | 4 +- ...ke8_simplify__tests__SIM220_SIM220.py.snap | 6 +- ...ke8_simplify__tests__SIM221_SIM221.py.snap | 6 +- ...ke8_simplify__tests__SIM222_SIM222.py.snap | 102 +++++++++--------- ...ke8_simplify__tests__SIM223_SIM223.py.snap | 98 ++++++++--------- ...ke8_simplify__tests__SIM401_SIM401.py.snap | 12 +-- ...ts__tests__ban_parent_imports_package.snap | 12 +-- ..._type_checking__tests__exempt_modules.snap | 2 +- ...ke8_type_checking__tests__import_from.snap | 2 +- ...ests__import_from_type_checking_block.snap | 2 +- ...ype_checking__tests__multiple_members.snap | 4 +- ...sts__multiple_modules_different_types.snap | 4 +- ...ng__tests__multiple_modules_same_type.snap | 4 +- ...ype_checking__tests__no_typing_import.snap | 2 +- ...rt-in-type-checking-block_TCH004_1.py.snap | 2 +- ...t-in-type-checking-block_TCH004_11.py.snap | 2 +- ...t-in-type-checking-block_TCH004_12.py.snap | 2 +- ...rt-in-type-checking-block_TCH004_2.py.snap | 2 +- ...rt-in-type-checking-block_TCH004_4.py.snap | 2 +- ...rt-in-type-checking-block_TCH004_5.py.snap | 6 +- ...rt-in-type-checking-block_TCH004_9.py.snap | 4 +- ...k_runtime_evaluated_base_classes_1.py.snap | 6 +- ...ock_runtime_evaluated_decorators_1.py.snap | 6 +- ...__flake8_type_checking__tests__strict.snap | 16 +-- ...ests__type_checking_block_after_usage.snap | 2 +- ...g__tests__type_checking_block_comment.snap | 2 +- ...ng__tests__type_checking_block_inline.snap | 2 +- ...__tests__type_checking_block_own_line.snap | 2 +- ...ing-only-first-party-import_TCH001.py.snap | 2 +- ...nly-standard-library-import_TCH003.py.snap | 2 +- ...t_runtime_evaluated_base_classes_3.py.snap | 2 +- ...ort_runtime_evaluated_decorators_3.py.snap | 2 +- ...ing-only-third-party-import_TCH002.py.snap | 18 ++-- ...t_runtime_evaluated_base_classes_2.py.snap | 4 +- ...ort_runtime_evaluated_decorators_2.py.snap | 2 +- ...ing-only-third-party-import_strict.py.snap | 4 +- ...s__typing_import_after_package_import.snap | 2 +- ...__typing_import_before_package_import.snap | 2 +- ...rules__flynt__tests__FLY002_FLY002.py.snap | 14 +-- ...__numpy-deprecated-function_NPY003.py.snap | 20 ++-- ...numpy-deprecated-type-alias_NPY001.py.snap | 14 +-- ...es__pandas_vet__tests__PD002_PD002.py.snap | 14 +-- ..._rules__pandas_vet__tests__PD002_fail.snap | 2 +- ...__perflint__tests__PERF102_PERF102.py.snap | 24 ++--- ...les__pycodestyle__tests__E711_E711.py.snap | 20 ++-- ...les__pycodestyle__tests__E712_E712.py.snap | 26 ++--- ...les__pycodestyle__tests__E731_E731.py.snap | 26 ++--- ...pycodestyle__tests__constant_literals.snap | 8 +- ...__rules__pydocstyle__tests__D200_D.py.snap | 6 +- ...ules__pydocstyle__tests__D200_D200.py.snap | 2 +- ...__rules__pydocstyle__tests__D400_D.py.snap | 34 +++--- ...ules__pydocstyle__tests__D400_D400.py.snap | 24 ++--- ...__rules__pydocstyle__tests__D415_D.py.snap | 32 +++--- ...__rules__pydocstyle__tests__d209_d400.snap | 2 +- ..._rules__pyflakes__tests__F601_F601.py.snap | 16 +-- ..._rules__pyflakes__tests__F602_F602.py.snap | 12 +-- ...ules__pyflakes__tests__F841_F841_0.py.snap | 16 +-- ...ules__pyflakes__tests__F841_F841_1.py.snap | 4 +- ...ules__pyflakes__tests__F841_F841_3.py.snap | 58 +++++----- ...lakes__tests__f841_dummy_variable_rgx.snap | 20 ++-- ...nt__tests__PLC0414_import_aliasing.py.snap | 16 +-- ...t__tests__PLR1722_sys_exit_alias_0.py.snap | 8 +- ...t__tests__PLR1722_sys_exit_alias_1.py.snap | 8 +- ...__tests__PLR1722_sys_exit_alias_11.py.snap | 2 +- ...__tests__PLR1722_sys_exit_alias_12.py.snap | 2 +- ...t__tests__PLR1722_sys_exit_alias_2.py.snap | 8 +- ...t__tests__PLR1722_sys_exit_alias_3.py.snap | 4 +- ...t__tests__PLR1722_sys_exit_alias_4.py.snap | 8 +- ...t__tests__PLR1722_sys_exit_alias_5.py.snap | 8 +- ...t__tests__PLR1722_sys_exit_alias_6.py.snap | 4 +- ...t__tests__PLR1722_sys_exit_alias_7.py.snap | 2 +- ...t__tests__PLR1722_sys_exit_alias_8.py.snap | 2 +- ...t__tests__PLR1722_sys_exit_alias_9.py.snap | 2 +- ...int__tests__PLW3301_nested_min_max.py.snap | 28 ++--- ...er__rules__pyupgrade__tests__UP005.py.snap | 8 +- ...__rules__pyupgrade__tests__UP006_0.py.snap | 4 +- ...__rules__pyupgrade__tests__UP006_1.py.snap | 2 +- ...__rules__pyupgrade__tests__UP006_3.py.snap | 2 +- ...er__rules__pyupgrade__tests__UP007.py.snap | 34 +++--- ...er__rules__pyupgrade__tests__UP008.py.snap | 10 +- ...er__rules__pyupgrade__tests__UP010.py.snap | 20 ++-- ...er__rules__pyupgrade__tests__UP013.py.snap | 24 ++--- ...er__rules__pyupgrade__tests__UP014.py.snap | 10 +- ...er__rules__pyupgrade__tests__UP020.py.snap | 2 +- ...er__rules__pyupgrade__tests__UP021.py.snap | 6 +- ...er__rules__pyupgrade__tests__UP022.py.snap | 14 +-- ...er__rules__pyupgrade__tests__UP023.py.snap | 20 ++-- ...er__rules__pyupgrade__tests__UP026.py.snap | 52 ++++----- ...er__rules__pyupgrade__tests__UP027.py.snap | 10 +- ...__rules__pyupgrade__tests__UP028_0.py.snap | 26 ++--- ...er__rules__pyupgrade__tests__UP029.py.snap | 8 +- ...__rules__pyupgrade__tests__UP030_0.py.snap | 46 ++++---- ...__rules__pyupgrade__tests__UP031_0.py.snap | 82 +++++++------- ...__rules__pyupgrade__tests__UP032_0.py.snap | 86 +++++++-------- ...__rules__pyupgrade__tests__UP032_1.py.snap | 2 +- ...__rules__pyupgrade__tests__UP032_2.py.snap | 44 ++++---- ...er__rules__pyupgrade__tests__UP035.py.snap | 92 ++++++++-------- ...__rules__pyupgrade__tests__UP036_0.py.snap | 58 +++++----- ...__rules__pyupgrade__tests__UP036_1.py.snap | 26 ++--- ...__rules__pyupgrade__tests__UP036_2.py.snap | 24 ++--- ...__rules__pyupgrade__tests__UP036_3.py.snap | 6 +- ...__rules__pyupgrade__tests__UP036_4.py.snap | 16 +-- ...__rules__pyupgrade__tests__UP036_5.py.snap | 4 +- ...er__rules__pyupgrade__tests__UP038.py.snap | 4 +- ...rade__tests__datetime_utc_alias_py311.snap | 8 +- ...tests__future_annotations_pep_604_p37.snap | 2 +- ...sts__future_annotations_pep_604_py310.snap | 4 +- ...es__refurb__tests__FURB105_FURB105.py.snap | 34 +++--- ...es__refurb__tests__FURB113_FURB113.py.snap | 24 ++--- ...es__refurb__tests__FURB131_FURB131.py.snap | 12 +-- ...es__refurb__tests__FURB132_FURB132.py.snap | 8 +- ...es__refurb__tests__FURB140_FURB140.py.snap | 18 ++-- ...es__refurb__tests__FURB145_FURB145.py.snap | 12 +-- ...es__refurb__tests__FURB148_FURB148.py.snap | 40 +++---- ..._ruff__tests__PY39_RUF013_RUF013_0.py.snap | 44 ++++---- ..._ruff__tests__PY39_RUF013_RUF013_1.py.snap | 2 +- ..._rules__ruff__tests__RUF005_RUF005.py.snap | 30 +++--- ...ules__ruff__tests__RUF013_RUF013_0.py.snap | 44 ++++---- ...ules__ruff__tests__RUF013_RUF013_1.py.snap | 2 +- ..._rules__ruff__tests__RUF015_RUF015.py.snap | 24 ++--- ...ules__ruff__tests__RUF017_RUF017_0.py.snap | 14 +-- ...ules__ruff__tests__RUF017_RUF017_1.py.snap | 2 +- ...ruff_linter__rules__ruff__tests__noqa.snap | 2 +- ..._linter__rules__ruff__tests__ruf100_0.snap | 24 ++--- ..._linter__rules__ruff__tests__ruf100_1.snap | 10 +- ..._linter__rules__ruff__tests__ruf100_2.snap | 2 +- ..._linter__rules__ruff__tests__ruf100_3.snap | 38 +++---- ..._linter__rules__ruff__tests__ruf100_5.snap | 2 +- ...__rules__ruff__tests__ruff_noqa_codes.snap | 2 +- ...rules__ruff__tests__ruff_noqa_invalid.snap | 2 +- ...atops__tests__verbose-raise_TRY201.py.snap | 6 +- ...inter__linter__tests__unused_variable.snap | 8 +- 209 files changed, 1591 insertions(+), 1591 deletions(-) diff --git a/crates/ruff_cli/tests/lint.rs b/crates/ruff_cli/tests/lint.rs index 2cfae9668738cf..220b14ba028cc8 100644 --- a/crates/ruff_cli/tests/lint.rs +++ b/crates/ruff_cli/tests/lint.rs @@ -40,7 +40,7 @@ inline-quotes = "single" -:1:5: B005 Using `.strip()` with multi-character strings is misleading -:1:19: Q000 [*] Double quotes found but single quotes preferred Found 3 errors. - [*] 2 potentially fixable with the --fix option. + [*] 2 fixable with the --fix option. ----- stderr ----- "###); @@ -75,7 +75,7 @@ inline-quotes = "single" -:1:5: B005 Using `.strip()` with multi-character strings is misleading -:1:19: Q000 [*] Double quotes found but single quotes preferred Found 3 errors. - [*] 2 potentially fixable with the --fix option. + [*] 2 fixable with the --fix option. ----- stderr ----- "###); @@ -110,7 +110,7 @@ inline-quotes = "single" -:1:5: B005 Using `.strip()` with multi-character strings is misleading -:1:19: Q000 [*] Double quotes found but single quotes preferred Found 3 errors. - [*] 2 potentially fixable with the --fix option. + [*] 2 fixable with the --fix option. ----- stderr ----- "###); @@ -149,7 +149,7 @@ inline-quotes = "single" -:1:5: B005 Using `.strip()` with multi-character strings is misleading -:1:19: Q000 [*] Double quotes found but single quotes preferred Found 3 errors. - [*] 2 potentially fixable with the --fix option. + [*] 2 fixable with the --fix option. ----- stderr ----- "###); diff --git a/crates/ruff_linter/src/message/snapshots/ruff_linter__message__grouped__tests__fix_status.snap b/crates/ruff_linter/src/message/snapshots/ruff_linter__message__grouped__tests__fix_status.snap index 453cf1eda49e2b..575ca407106c88 100644 --- a/crates/ruff_linter/src/message/snapshots/ruff_linter__message__grouped__tests__fix_status.snap +++ b/crates/ruff_linter/src/message/snapshots/ruff_linter__message__grouped__tests__fix_status.snap @@ -3,14 +3,14 @@ source: crates/ruff_linter/src/message/grouped.rs expression: content --- fib.py: - 1:8 F401 [*] `os` imported but unused + 1:8 F401 [**] `os` imported but unused | 1 | import os | ^^ F401 | = help: Remove unused import: `os` - 6:5 F841 [*] Local variable `x` is assigned to but never used + 6:5 F841 [**] Local variable `x` is assigned to but never used | 4 | def fibonacci(n): 5 | """Compute the nth number in the Fibonacci sequence.""" diff --git a/crates/ruff_linter/src/message/snapshots/ruff_linter__message__text__tests__fix_status.snap b/crates/ruff_linter/src/message/snapshots/ruff_linter__message__text__tests__fix_status.snap index a53420329c119c..f79d5b82f84823 100644 --- a/crates/ruff_linter/src/message/snapshots/ruff_linter__message__text__tests__fix_status.snap +++ b/crates/ruff_linter/src/message/snapshots/ruff_linter__message__text__tests__fix_status.snap @@ -2,14 +2,14 @@ source: crates/ruff_linter/src/message/text.rs expression: content --- -fib.py:1:8: F401 [*] `os` imported but unused +fib.py:1:8: F401 [**] `os` imported but unused | 1 | import os | ^^ F401 | = help: Remove unused import: `os` -fib.py:6:5: F841 [*] Local variable `x` is assigned to but never used +fib.py:6:5: F841 [**] Local variable `x` is assigned to but never used | 4 | def fibonacci(n): 5 | """Compute the nth number in the Fibonacci sequence.""" diff --git a/crates/ruff_linter/src/rules/flake8_annotations/snapshots/ruff_linter__rules__flake8_annotations__tests__defaults.snap b/crates/ruff_linter/src/rules/flake8_annotations/snapshots/ruff_linter__rules__flake8_annotations__tests__defaults.snap index 46f4faabe2fd89..8c70b0002784f9 100644 --- a/crates/ruff_linter/src/rules/flake8_annotations/snapshots/ruff_linter__rules__flake8_annotations__tests__defaults.snap +++ b/crates/ruff_linter/src/rules/flake8_annotations/snapshots/ruff_linter__rules__flake8_annotations__tests__defaults.snap @@ -242,7 +242,7 @@ annotation_presence.py:154:10: ANN401 Dynamically typed expressions (typing.Any) | ^^^^^^^^^^^^^^^^^^^^^^^^ ANN401 | -annotation_presence.py:159:9: ANN204 [*] Missing return type annotation for special method `__init__` +annotation_presence.py:159:9: ANN204 [**] Missing return type annotation for special method `__init__` | 157 | class Foo: 158 | @decorator() @@ -262,7 +262,7 @@ annotation_presence.py:159:9: ANN204 [*] Missing return type annotation for spec 161 161 | 162 162 | -annotation_presence.py:165:9: ANN204 [*] Missing return type annotation for special method `__init__` +annotation_presence.py:165:9: ANN204 [**] Missing return type annotation for special method `__init__` | 163 | # Regression test for: https://github.com/astral-sh/ruff/issues/7711 164 | class Class: diff --git a/crates/ruff_linter/src/rules/flake8_annotations/snapshots/ruff_linter__rules__flake8_annotations__tests__mypy_init_return.snap b/crates/ruff_linter/src/rules/flake8_annotations/snapshots/ruff_linter__rules__flake8_annotations__tests__mypy_init_return.snap index 193ef4f8ba8aca..d4fe71714f3b9e 100644 --- a/crates/ruff_linter/src/rules/flake8_annotations/snapshots/ruff_linter__rules__flake8_annotations__tests__mypy_init_return.snap +++ b/crates/ruff_linter/src/rules/flake8_annotations/snapshots/ruff_linter__rules__flake8_annotations__tests__mypy_init_return.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs --- -mypy_init_return.py:5:9: ANN204 [*] Missing return type annotation for special method `__init__` +mypy_init_return.py:5:9: ANN204 [**] Missing return type annotation for special method `__init__` | 3 | # Error 4 | class Foo: @@ -21,7 +21,7 @@ mypy_init_return.py:5:9: ANN204 [*] Missing return type annotation for special m 7 7 | 8 8 | -mypy_init_return.py:11:9: ANN204 [*] Missing return type annotation for special method `__init__` +mypy_init_return.py:11:9: ANN204 [**] Missing return type annotation for special method `__init__` | 9 | # Error 10 | class Foo: @@ -49,7 +49,7 @@ mypy_init_return.py:40:5: ANN202 Missing return type annotation for private func 41 | ... | -mypy_init_return.py:47:9: ANN204 [*] Missing return type annotation for special method `__init__` +mypy_init_return.py:47:9: ANN204 [**] Missing return type annotation for special method `__init__` | 45 | # of a vararg falsely indicated that the function has a typed argument. 46 | class Foo: diff --git a/crates/ruff_linter/src/rules/flake8_annotations/snapshots/ruff_linter__rules__flake8_annotations__tests__simple_magic_methods.snap b/crates/ruff_linter/src/rules/flake8_annotations/snapshots/ruff_linter__rules__flake8_annotations__tests__simple_magic_methods.snap index 8dd48048c65601..a1e0107e631237 100644 --- a/crates/ruff_linter/src/rules/flake8_annotations/snapshots/ruff_linter__rules__flake8_annotations__tests__simple_magic_methods.snap +++ b/crates/ruff_linter/src/rules/flake8_annotations/snapshots/ruff_linter__rules__flake8_annotations__tests__simple_magic_methods.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs --- -simple_magic_methods.py:2:9: ANN204 [*] Missing return type annotation for special method `__str__` +simple_magic_methods.py:2:9: ANN204 [**] Missing return type annotation for special method `__str__` | 1 | class Foo: 2 | def __str__(self): @@ -18,7 +18,7 @@ simple_magic_methods.py:2:9: ANN204 [*] Missing return type annotation for speci 4 4 | 5 5 | def __repr__(self): -simple_magic_methods.py:5:9: ANN204 [*] Missing return type annotation for special method `__repr__` +simple_magic_methods.py:5:9: ANN204 [**] Missing return type annotation for special method `__repr__` | 3 | ... 4 | @@ -38,7 +38,7 @@ simple_magic_methods.py:5:9: ANN204 [*] Missing return type annotation for speci 7 7 | 8 8 | def __len__(self): -simple_magic_methods.py:8:9: ANN204 [*] Missing return type annotation for special method `__len__` +simple_magic_methods.py:8:9: ANN204 [**] Missing return type annotation for special method `__len__` | 6 | ... 7 | @@ -58,7 +58,7 @@ simple_magic_methods.py:8:9: ANN204 [*] Missing return type annotation for speci 10 10 | 11 11 | def __length_hint__(self): -simple_magic_methods.py:11:9: ANN204 [*] Missing return type annotation for special method `__length_hint__` +simple_magic_methods.py:11:9: ANN204 [**] Missing return type annotation for special method `__length_hint__` | 9 | ... 10 | @@ -78,7 +78,7 @@ simple_magic_methods.py:11:9: ANN204 [*] Missing return type annotation for spec 13 13 | 14 14 | def __init__(self): -simple_magic_methods.py:14:9: ANN204 [*] Missing return type annotation for special method `__init__` +simple_magic_methods.py:14:9: ANN204 [**] Missing return type annotation for special method `__init__` | 12 | ... 13 | @@ -98,7 +98,7 @@ simple_magic_methods.py:14:9: ANN204 [*] Missing return type annotation for spec 16 16 | 17 17 | def __del__(self): -simple_magic_methods.py:17:9: ANN204 [*] Missing return type annotation for special method `__del__` +simple_magic_methods.py:17:9: ANN204 [**] Missing return type annotation for special method `__del__` | 15 | ... 16 | @@ -118,7 +118,7 @@ simple_magic_methods.py:17:9: ANN204 [*] Missing return type annotation for spec 19 19 | 20 20 | def __bool__(self): -simple_magic_methods.py:20:9: ANN204 [*] Missing return type annotation for special method `__bool__` +simple_magic_methods.py:20:9: ANN204 [**] Missing return type annotation for special method `__bool__` | 18 | ... 19 | @@ -138,7 +138,7 @@ simple_magic_methods.py:20:9: ANN204 [*] Missing return type annotation for spec 22 22 | 23 23 | def __bytes__(self): -simple_magic_methods.py:23:9: ANN204 [*] Missing return type annotation for special method `__bytes__` +simple_magic_methods.py:23:9: ANN204 [**] Missing return type annotation for special method `__bytes__` | 21 | ... 22 | @@ -158,7 +158,7 @@ simple_magic_methods.py:23:9: ANN204 [*] Missing return type annotation for spec 25 25 | 26 26 | def __format__(self, format_spec): -simple_magic_methods.py:26:9: ANN204 [*] Missing return type annotation for special method `__format__` +simple_magic_methods.py:26:9: ANN204 [**] Missing return type annotation for special method `__format__` | 24 | ... 25 | @@ -178,7 +178,7 @@ simple_magic_methods.py:26:9: ANN204 [*] Missing return type annotation for spec 28 28 | 29 29 | def __contains__(self, item): -simple_magic_methods.py:29:9: ANN204 [*] Missing return type annotation for special method `__contains__` +simple_magic_methods.py:29:9: ANN204 [**] Missing return type annotation for special method `__contains__` | 27 | ... 28 | @@ -198,7 +198,7 @@ simple_magic_methods.py:29:9: ANN204 [*] Missing return type annotation for spec 31 31 | 32 32 | def __complex__(self): -simple_magic_methods.py:32:9: ANN204 [*] Missing return type annotation for special method `__complex__` +simple_magic_methods.py:32:9: ANN204 [**] Missing return type annotation for special method `__complex__` | 30 | ... 31 | @@ -218,7 +218,7 @@ simple_magic_methods.py:32:9: ANN204 [*] Missing return type annotation for spec 34 34 | 35 35 | def __int__(self): -simple_magic_methods.py:35:9: ANN204 [*] Missing return type annotation for special method `__int__` +simple_magic_methods.py:35:9: ANN204 [**] Missing return type annotation for special method `__int__` | 33 | ... 34 | @@ -238,7 +238,7 @@ simple_magic_methods.py:35:9: ANN204 [*] Missing return type annotation for spec 37 37 | 38 38 | def __float__(self): -simple_magic_methods.py:38:9: ANN204 [*] Missing return type annotation for special method `__float__` +simple_magic_methods.py:38:9: ANN204 [**] Missing return type annotation for special method `__float__` | 36 | ... 37 | @@ -258,7 +258,7 @@ simple_magic_methods.py:38:9: ANN204 [*] Missing return type annotation for spec 40 40 | 41 41 | def __index__(self): -simple_magic_methods.py:41:9: ANN204 [*] Missing return type annotation for special method `__index__` +simple_magic_methods.py:41:9: ANN204 [**] Missing return type annotation for special method `__index__` | 39 | ... 40 | diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B007_B007.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B007_B007.py.snap index 283f28ee82d05f..f2f81ce37df9f8 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B007_B007.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B007_B007.py.snap @@ -11,7 +11,7 @@ B007.py:6:5: B007 Loop control variable `i` not used within loop body | = help: Rename unused `i` to `_i` -B007.py:18:13: B007 [*] Loop control variable `k` not used within loop body +B007.py:18:13: B007 [**] Loop control variable `k` not used within loop body | 16 | for i in range(10): 17 | for j in range(10): @@ -39,7 +39,7 @@ B007.py:30:5: B007 Loop control variable `i` not used within loop body | = help: Rename unused `i` to `_i` -B007.py:30:13: B007 [*] Loop control variable `k` not used within loop body +B007.py:30:13: B007 [**] Loop control variable `k` not used within loop body | 30 | for i, (j, (k, l)) in strange_generator(): # i, k not used | ^ B007 @@ -99,7 +99,7 @@ B007.py:46:10: B007 Loop control variable `bar` may not be used within loop body | = help: Rename unused `bar` to `_bar` -B007.py:52:14: B007 [*] Loop control variable `bar` not used within loop body +B007.py:52:14: B007 [**] Loop control variable `bar` not used within loop body | 50 | def f(): 51 | # Fixable. @@ -131,7 +131,7 @@ B007.py:59:14: B007 Loop control variable `bar` not used within loop body | = help: Rename unused `bar` to `_bar` -B007.py:68:14: B007 [*] Loop control variable `bar` not used within loop body +B007.py:68:14: B007 [**] Loop control variable `bar` not used within loop body | 66 | def f(): 67 | # Fixable. diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B009_B009_B010.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B009_B009_B010.py.snap index 1a0d1da89b96b7..2b50b028ef54c0 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B009_B009_B010.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B009_B009_B010.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs --- -B009_B010.py:19:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:19:1: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 18 | # Invalid usage 19 | getattr(foo, "bar") @@ -21,7 +21,7 @@ B009_B010.py:19:1: B009 [*] Do not call `getattr` with a constant attribute valu 21 21 | getattr(foo, "__123abc__") 22 22 | getattr(foo, "abc123") -B009_B010.py:20:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:20:1: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 18 | # Invalid usage 19 | getattr(foo, "bar") @@ -42,7 +42,7 @@ B009_B010.py:20:1: B009 [*] Do not call `getattr` with a constant attribute valu 22 22 | getattr(foo, "abc123") 23 23 | getattr(foo, r"abc123") -B009_B010.py:21:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:21:1: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 19 | getattr(foo, "bar") 20 | getattr(foo, "_123abc") @@ -63,7 +63,7 @@ B009_B010.py:21:1: B009 [*] Do not call `getattr` with a constant attribute valu 23 23 | getattr(foo, r"abc123") 24 24 | _ = lambda x: getattr(x, "bar") -B009_B010.py:22:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:22:1: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 20 | getattr(foo, "_123abc") 21 | getattr(foo, "__123abc__") @@ -84,7 +84,7 @@ B009_B010.py:22:1: B009 [*] Do not call `getattr` with a constant attribute valu 24 24 | _ = lambda x: getattr(x, "bar") 25 25 | if getattr(x, "bar"): -B009_B010.py:23:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:23:1: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 21 | getattr(foo, "__123abc__") 22 | getattr(foo, "abc123") @@ -105,7 +105,7 @@ B009_B010.py:23:1: B009 [*] Do not call `getattr` with a constant attribute valu 25 25 | if getattr(x, "bar"): 26 26 | pass -B009_B010.py:24:15: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:24:15: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 22 | getattr(foo, "abc123") 23 | getattr(foo, r"abc123") @@ -126,7 +126,7 @@ B009_B010.py:24:15: B009 [*] Do not call `getattr` with a constant attribute val 26 26 | pass 27 27 | getattr(1, "real") -B009_B010.py:25:4: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:25:4: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 23 | getattr(foo, r"abc123") 24 | _ = lambda x: getattr(x, "bar") @@ -147,7 +147,7 @@ B009_B010.py:25:4: B009 [*] Do not call `getattr` with a constant attribute valu 27 27 | getattr(1, "real") 28 28 | getattr(1., "real") -B009_B010.py:27:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:27:1: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 25 | if getattr(x, "bar"): 26 | pass @@ -168,7 +168,7 @@ B009_B010.py:27:1: B009 [*] Do not call `getattr` with a constant attribute valu 29 29 | getattr(1.0, "real") 30 30 | getattr(1j, "real") -B009_B010.py:28:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:28:1: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 26 | pass 27 | getattr(1, "real") @@ -189,7 +189,7 @@ B009_B010.py:28:1: B009 [*] Do not call `getattr` with a constant attribute valu 30 30 | getattr(1j, "real") 31 31 | getattr(True, "real") -B009_B010.py:29:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:29:1: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 27 | getattr(1, "real") 28 | getattr(1., "real") @@ -210,7 +210,7 @@ B009_B010.py:29:1: B009 [*] Do not call `getattr` with a constant attribute valu 31 31 | getattr(True, "real") 32 32 | getattr(x := 1, "real") -B009_B010.py:30:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:30:1: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 28 | getattr(1., "real") 29 | getattr(1.0, "real") @@ -231,7 +231,7 @@ B009_B010.py:30:1: B009 [*] Do not call `getattr` with a constant attribute valu 32 32 | getattr(x := 1, "real") 33 33 | getattr(x + y, "real") -B009_B010.py:31:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:31:1: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 29 | getattr(1.0, "real") 30 | getattr(1j, "real") @@ -252,7 +252,7 @@ B009_B010.py:31:1: B009 [*] Do not call `getattr` with a constant attribute valu 33 33 | getattr(x + y, "real") 34 34 | getattr("foo" -B009_B010.py:32:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:32:1: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 30 | getattr(1j, "real") 31 | getattr(True, "real") @@ -273,7 +273,7 @@ B009_B010.py:32:1: B009 [*] Do not call `getattr` with a constant attribute valu 34 34 | getattr("foo" 35 35 | "bar", "real") -B009_B010.py:33:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:33:1: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 31 | getattr(True, "real") 32 | getattr(x := 1, "real") @@ -294,7 +294,7 @@ B009_B010.py:33:1: B009 [*] Do not call `getattr` with a constant attribute valu 35 35 | "bar", "real") 36 36 | -B009_B010.py:34:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:34:1: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 32 | getattr(x := 1, "real") 33 | getattr(x + y, "real") @@ -316,7 +316,7 @@ B009_B010.py:34:1: B009 [*] Do not call `getattr` with a constant attribute valu 37 37 | 38 38 | # Valid setattr usage -B009_B010.py:58:8: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:58:8: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 57 | # Regression test for: https://github.com/astral-sh/ruff/issues/7455#issuecomment-1722458885 58 | assert getattr(func, '_rpc')is True @@ -336,7 +336,7 @@ B009_B010.py:58:8: B009 [*] Do not call `getattr` with a constant attribute valu 60 60 | # Regression test for: https://github.com/astral-sh/ruff/issues/7455#issuecomment-1732387247 61 61 | getattr(*foo, "bar") -B009_B010.py:65:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:65:1: B009 [**] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 64 | # Regression test for: https://github.com/astral-sh/ruff/issues/7455#issuecomment-1739800901 65 | / getattr(self. diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B010_B009_B010.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B010_B009_B010.py.snap index 2945aafb436c95..39b8f2fc278396 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B010_B009_B010.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B010_B009_B010.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs --- -B009_B010.py:50:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:50:1: B010 [**] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. | 49 | # Invalid usage 50 | setattr(foo, "bar", None) @@ -21,7 +21,7 @@ B009_B010.py:50:1: B010 [*] Do not call `setattr` with a constant attribute valu 52 52 | setattr(foo, "__123abc__", None) 53 53 | setattr(foo, "abc123", None) -B009_B010.py:51:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:51:1: B010 [**] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. | 49 | # Invalid usage 50 | setattr(foo, "bar", None) @@ -42,7 +42,7 @@ B009_B010.py:51:1: B010 [*] Do not call `setattr` with a constant attribute valu 53 53 | setattr(foo, "abc123", None) 54 54 | setattr(foo, r"abc123", None) -B009_B010.py:52:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:52:1: B010 [**] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. | 50 | setattr(foo, "bar", None) 51 | setattr(foo, "_123abc", None) @@ -63,7 +63,7 @@ B009_B010.py:52:1: B010 [*] Do not call `setattr` with a constant attribute valu 54 54 | setattr(foo, r"abc123", None) 55 55 | setattr(foo.bar, r"baz", None) -B009_B010.py:53:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:53:1: B010 [**] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. | 51 | setattr(foo, "_123abc", None) 52 | setattr(foo, "__123abc__", None) @@ -84,7 +84,7 @@ B009_B010.py:53:1: B010 [*] Do not call `setattr` with a constant attribute valu 55 55 | setattr(foo.bar, r"baz", None) 56 56 | -B009_B010.py:54:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:54:1: B010 [**] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. | 52 | setattr(foo, "__123abc__", None) 53 | setattr(foo, "abc123", None) @@ -104,7 +104,7 @@ B009_B010.py:54:1: B010 [*] Do not call `setattr` with a constant attribute valu 56 56 | 57 57 | # Regression test for: https://github.com/astral-sh/ruff/issues/7455#issuecomment-1722458885 -B009_B010.py:55:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:55:1: B010 [**] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. | 53 | setattr(foo, "abc123", None) 54 | setattr(foo, r"abc123", None) diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B011_B011.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B011_B011.py.snap index 5415cf1eae26b8..0a6c1cb5b3236e 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B011_B011.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B011_B011.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs --- -B011.py:8:8: B011 [*] Do not `assert False` (`python -O` removes these calls), raise `AssertionError()` +B011.py:8:8: B011 [**] Do not `assert False` (`python -O` removes these calls), raise `AssertionError()` | 7 | assert 1 != 2 8 | assert False @@ -20,7 +20,7 @@ B011.py:8:8: B011 [*] Do not `assert False` (`python -O` removes these calls), r 9 9 | assert 1 != 2, "message" 10 10 | assert False, "message" -B011.py:10:8: B011 [*] Do not `assert False` (`python -O` removes these calls), raise `AssertionError()` +B011.py:10:8: B011 [**] Do not `assert False` (`python -O` removes these calls), raise `AssertionError()` | 8 | assert False 9 | assert 1 != 2, "message" diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C400_C400.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C400_C400.py.snap index 924f9aad1929c8..c4254696705e0f 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C400_C400.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C400_C400.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C400.py:1:5: C400 [*] Unnecessary generator (rewrite as a `list` comprehension) +C400.py:1:5: C400 [**] Unnecessary generator (rewrite as a `list` comprehension) | 1 | x = list(x for x in range(3)) | ^^^^^^^^^^^^^^^^^^^^^^^^^ C400 @@ -17,7 +17,7 @@ C400.py:1:5: C400 [*] Unnecessary generator (rewrite as a `list` comprehension) 3 3 | x for x in range(3) 4 4 | ) -C400.py:2:5: C400 [*] Unnecessary generator (rewrite as a `list` comprehension) +C400.py:2:5: C400 [**] Unnecessary generator (rewrite as a `list` comprehension) | 1 | x = list(x for x in range(3)) 2 | x = list( diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C401_C401.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C401_C401.py.snap index a46cb832d29203..08bcff29e8dfce 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C401_C401.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C401_C401.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C401.py:1:5: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:1:5: C401 [**] Unnecessary generator (rewrite as a `set` comprehension) | 1 | x = set(x for x in range(3)) | ^^^^^^^^^^^^^^^^^^^^^^^^ C401 @@ -17,7 +17,7 @@ C401.py:1:5: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) 3 3 | y = f"{set(a if a < 6 else 0 for a in range(3))}" 4 4 | _ = "{}".format(set(a if a < 6 else 0 for a in range(3))) -C401.py:2:5: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:2:5: C401 [**] Unnecessary generator (rewrite as a `set` comprehension) | 1 | x = set(x for x in range(3)) 2 | x = set(x for x in range(3)) @@ -35,7 +35,7 @@ C401.py:2:5: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) 4 4 | _ = "{}".format(set(a if a < 6 else 0 for a in range(3))) 5 5 | print(f"Hello {set(a for a in range(3))} World") -C401.py:3:8: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:3:8: C401 [**] Unnecessary generator (rewrite as a `set` comprehension) | 1 | x = set(x for x in range(3)) 2 | x = set(x for x in range(3)) @@ -55,7 +55,7 @@ C401.py:3:8: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) 5 5 | print(f"Hello {set(a for a in range(3))} World") 6 6 | -C401.py:4:17: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:4:17: C401 [**] Unnecessary generator (rewrite as a `set` comprehension) | 2 | x = set(x for x in range(3)) 3 | y = f"{set(a if a < 6 else 0 for a in range(3))}" @@ -75,7 +75,7 @@ C401.py:4:17: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) 6 6 | 7 7 | -C401.py:5:16: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:5:16: C401 [**] Unnecessary generator (rewrite as a `set` comprehension) | 3 | y = f"{set(a if a < 6 else 0 for a in range(3))}" 4 | _ = "{}".format(set(a if a < 6 else 0 for a in range(3))) @@ -94,7 +94,7 @@ C401.py:5:16: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) 7 7 | 8 8 | def f(x): -C401.py:12:16: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:12:16: C401 [**] Unnecessary generator (rewrite as a `set` comprehension) | 12 | print(f'Hello {set(a for a in "abc")} World') | ^^^^^^^^^^^^^^^^^^^^^ C401 @@ -113,7 +113,7 @@ C401.py:12:16: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) 14 14 | print(f"Hello {set(f(a) for a in 'abc')} World") 15 15 | print(f"{set(a for a in 'abc') - set(a for a in 'ab')}") -C401.py:13:16: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:13:16: C401 [**] Unnecessary generator (rewrite as a `set` comprehension) | 12 | print(f'Hello {set(a for a in "abc")} World') 13 | print(f"Hello {set(a for a in 'abc')} World") @@ -133,7 +133,7 @@ C401.py:13:16: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) 15 15 | print(f"{set(a for a in 'abc') - set(a for a in 'ab')}") 16 16 | print(f"{ set(a for a in 'abc') - set(a for a in 'ab') }") -C401.py:14:16: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:14:16: C401 [**] Unnecessary generator (rewrite as a `set` comprehension) | 12 | print(f'Hello {set(a for a in "abc")} World') 13 | print(f"Hello {set(a for a in 'abc')} World") @@ -154,7 +154,7 @@ C401.py:14:16: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) 16 16 | print(f"{ set(a for a in 'abc') - set(a for a in 'ab') }") 17 17 | -C401.py:15:10: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:15:10: C401 [**] Unnecessary generator (rewrite as a `set` comprehension) | 13 | print(f"Hello {set(a for a in 'abc')} World") 14 | print(f"Hello {set(f(a) for a in 'abc')} World") @@ -174,7 +174,7 @@ C401.py:15:10: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) 17 17 | 18 18 | # The fix generated for this diagnostic is incorrect, as we add additional space -C401.py:15:34: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:15:34: C401 [**] Unnecessary generator (rewrite as a `set` comprehension) | 13 | print(f"Hello {set(a for a in 'abc')} World") 14 | print(f"Hello {set(f(a) for a in 'abc')} World") @@ -194,7 +194,7 @@ C401.py:15:34: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) 17 17 | 18 18 | # The fix generated for this diagnostic is incorrect, as we add additional space -C401.py:16:11: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:16:11: C401 [**] Unnecessary generator (rewrite as a `set` comprehension) | 14 | print(f"Hello {set(f(a) for a in 'abc')} World") 15 | print(f"{set(a for a in 'abc') - set(a for a in 'ab')}") @@ -215,7 +215,7 @@ C401.py:16:11: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) 18 18 | # The fix generated for this diagnostic is incorrect, as we add additional space 19 19 | # around the set comprehension. -C401.py:16:35: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:16:35: C401 [**] Unnecessary generator (rewrite as a `set` comprehension) | 14 | print(f"Hello {set(f(a) for a in 'abc')} World") 15 | print(f"{set(a for a in 'abc') - set(a for a in 'ab')}") @@ -236,7 +236,7 @@ C401.py:16:35: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) 18 18 | # The fix generated for this diagnostic is incorrect, as we add additional space 19 19 | # around the set comprehension. -C401.py:20:12: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:20:12: C401 [**] Unnecessary generator (rewrite as a `set` comprehension) | 18 | # The fix generated for this diagnostic is incorrect, as we add additional space 19 | # around the set comprehension. diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C402_C402.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C402_C402.py.snap index 86d9bacc139336..5dcb97a323bb76 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C402_C402.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C402_C402.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C402.py:1:1: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:1:1: C402 [**] Unnecessary generator (rewrite as a `dict` comprehension) | 1 | dict((x, x) for x in range(3)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C402 @@ -17,7 +17,7 @@ C402.py:1:1: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) 3 3 | (x, x) for x in range(3) 4 4 | ) -C402.py:2:1: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:2:1: C402 [**] Unnecessary generator (rewrite as a `dict` comprehension) | 1 | dict((x, x) for x in range(3)) 2 | / dict( @@ -41,7 +41,7 @@ C402.py:2:1: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) 6 6 | y = f'{dict((x, x) for x in range(3))}' 7 7 | print(f'Hello {dict((x, x) for x in range(3))} World') -C402.py:6:8: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:6:8: C402 [**] Unnecessary generator (rewrite as a `dict` comprehension) | 4 | ) 5 | dict(((x, x) for x in range(3)), z=3) @@ -62,7 +62,7 @@ C402.py:6:8: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) 8 8 | print(f"Hello {dict((x, x) for x in 'abc')} World") 9 9 | print(f'Hello {dict((x, x) for x in "abc")} World') -C402.py:7:16: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:7:16: C402 [**] Unnecessary generator (rewrite as a `dict` comprehension) | 5 | dict(((x, x) for x in range(3)), z=3) 6 | y = f'{dict((x, x) for x in range(3))}' @@ -83,7 +83,7 @@ C402.py:7:16: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) 9 9 | print(f'Hello {dict((x, x) for x in "abc")} World') 10 10 | print(f'Hello {dict((x,x) for x in "abc")} World') -C402.py:8:16: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:8:16: C402 [**] Unnecessary generator (rewrite as a `dict` comprehension) | 6 | y = f'{dict((x, x) for x in range(3))}' 7 | print(f'Hello {dict((x, x) for x in range(3))} World') @@ -104,7 +104,7 @@ C402.py:8:16: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) 10 10 | print(f'Hello {dict((x,x) for x in "abc")} World') 11 11 | -C402.py:9:16: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:9:16: C402 [**] Unnecessary generator (rewrite as a `dict` comprehension) | 7 | print(f'Hello {dict((x, x) for x in range(3))} World') 8 | print(f"Hello {dict((x, x) for x in 'abc')} World") @@ -124,7 +124,7 @@ C402.py:9:16: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) 11 11 | 12 12 | f'{dict((x, x) for x in range(3)) | dict((x, x) for x in range(3))}' -C402.py:10:16: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:10:16: C402 [**] Unnecessary generator (rewrite as a `dict` comprehension) | 8 | print(f"Hello {dict((x, x) for x in 'abc')} World") 9 | print(f'Hello {dict((x, x) for x in "abc")} World') @@ -145,7 +145,7 @@ C402.py:10:16: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension 12 12 | f'{dict((x, x) for x in range(3)) | dict((x, x) for x in range(3))}' 13 13 | f'{ dict((x, x) for x in range(3)) | dict((x, x) for x in range(3)) }' -C402.py:12:4: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:12:4: C402 [**] Unnecessary generator (rewrite as a `dict` comprehension) | 10 | print(f'Hello {dict((x,x) for x in "abc")} World') 11 | @@ -165,7 +165,7 @@ C402.py:12:4: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) 14 14 | 15 15 | def f(x): -C402.py:12:37: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:12:37: C402 [**] Unnecessary generator (rewrite as a `dict` comprehension) | 10 | print(f'Hello {dict((x,x) for x in "abc")} World') 11 | @@ -185,7 +185,7 @@ C402.py:12:37: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension 14 14 | 15 15 | def f(x): -C402.py:13:5: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:13:5: C402 [**] Unnecessary generator (rewrite as a `dict` comprehension) | 12 | f'{dict((x, x) for x in range(3)) | dict((x, x) for x in range(3))}' 13 | f'{ dict((x, x) for x in range(3)) | dict((x, x) for x in range(3)) }' @@ -205,7 +205,7 @@ C402.py:13:5: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) 15 15 | def f(x): 16 16 | return x -C402.py:13:38: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:13:38: C402 [**] Unnecessary generator (rewrite as a `dict` comprehension) | 12 | f'{dict((x, x) for x in range(3)) | dict((x, x) for x in range(3))}' 13 | f'{ dict((x, x) for x in range(3)) | dict((x, x) for x in range(3)) }' @@ -225,7 +225,7 @@ C402.py:13:38: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension 15 15 | def f(x): 16 16 | return x -C402.py:18:16: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:18:16: C402 [**] Unnecessary generator (rewrite as a `dict` comprehension) | 16 | return x 17 | @@ -246,7 +246,7 @@ C402.py:18:16: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension 20 20 | # Regression test for: https://github.com/astral-sh/ruff/issues/7086 21 21 | dict((k,v)for k,v in d.iteritems() if k in only_args) -C402.py:21:1: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:21:1: C402 [**] Unnecessary generator (rewrite as a `dict` comprehension) | 20 | # Regression test for: https://github.com/astral-sh/ruff/issues/7086 21 | dict((k,v)for k,v in d.iteritems() if k in only_args) diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C403_C403.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C403_C403.py.snap index 9091d9352bbb33..dc91926640913a 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C403_C403.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C403_C403.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C403.py:1:5: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comprehension) +C403.py:1:5: C403 [**] Unnecessary `list` comprehension (rewrite as a `set` comprehension) | 1 | s = set([x for x in range(3)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ C403 @@ -17,7 +17,7 @@ C403.py:1:5: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` compr 3 3 | [x for x in range(3)] 4 4 | ) -C403.py:2:5: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comprehension) +C403.py:2:5: C403 [**] Unnecessary `list` comprehension (rewrite as a `set` comprehension) | 1 | s = set([x for x in range(3)]) 2 | s = set( @@ -42,7 +42,7 @@ C403.py:2:5: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` compr 6 6 | s = f"{set([x for x in 'ab'])}" 7 7 | s = f'{set([x for x in "ab"])}' -C403.py:6:8: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comprehension) +C403.py:6:8: C403 [**] Unnecessary `list` comprehension (rewrite as a `set` comprehension) | 4 | ) 5 | @@ -62,7 +62,7 @@ C403.py:6:8: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` compr 8 8 | 9 9 | def f(x): -C403.py:7:8: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comprehension) +C403.py:7:8: C403 [**] Unnecessary `list` comprehension (rewrite as a `set` comprehension) | 6 | s = f"{set([x for x in 'ab'])}" 7 | s = f'{set([x for x in "ab"])}' @@ -82,7 +82,7 @@ C403.py:7:8: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` compr 9 9 | def f(x): 10 10 | return x -C403.py:12:8: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comprehension) +C403.py:12:8: C403 [**] Unnecessary `list` comprehension (rewrite as a `set` comprehension) | 10 | return x 11 | @@ -103,7 +103,7 @@ C403.py:12:8: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comp 14 14 | s = f"{ set([x for x in 'ab']) | set([x for x in 'ab']) }" 15 15 | s = f"{set([x for x in 'ab']) | set([x for x in 'ab'])}" -C403.py:14:9: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comprehension) +C403.py:14:9: C403 [**] Unnecessary `list` comprehension (rewrite as a `set` comprehension) | 12 | s = f"{set([f(x) for x in 'ab'])}" 13 | @@ -121,7 +121,7 @@ C403.py:14:9: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comp 14 |+s = f"{ {x for x in 'ab'} | set([x for x in 'ab']) }" 15 15 | s = f"{set([x for x in 'ab']) | set([x for x in 'ab'])}" -C403.py:14:34: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comprehension) +C403.py:14:34: C403 [**] Unnecessary `list` comprehension (rewrite as a `set` comprehension) | 12 | s = f"{set([f(x) for x in 'ab'])}" 13 | @@ -139,7 +139,7 @@ C403.py:14:34: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` com 14 |+s = f"{ set([x for x in 'ab']) | {x for x in 'ab'} }" 15 15 | s = f"{set([x for x in 'ab']) | set([x for x in 'ab'])}" -C403.py:15:8: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comprehension) +C403.py:15:8: C403 [**] Unnecessary `list` comprehension (rewrite as a `set` comprehension) | 14 | s = f"{ set([x for x in 'ab']) | set([x for x in 'ab']) }" 15 | s = f"{set([x for x in 'ab']) | set([x for x in 'ab'])}" @@ -154,7 +154,7 @@ C403.py:15:8: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comp 15 |-s = f"{set([x for x in 'ab']) | set([x for x in 'ab'])}" 15 |+s = f"{ {x for x in 'ab'} | set([x for x in 'ab'])}" -C403.py:15:33: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comprehension) +C403.py:15:33: C403 [**] Unnecessary `list` comprehension (rewrite as a `set` comprehension) | 14 | s = f"{ set([x for x in 'ab']) | set([x for x in 'ab']) }" 15 | s = f"{set([x for x in 'ab']) | set([x for x in 'ab'])}" diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C404_C404.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C404_C404.py.snap index d5bfe8a3a9ab58..88626167096680 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C404_C404.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C404_C404.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C404.py:1:1: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) +C404.py:1:1: C404 [**] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) | 1 | dict([(i, i) for i in range(3)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C404 @@ -16,7 +16,7 @@ C404.py:1:1: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` comp 3 3 | 4 4 | def f(x): -C404.py:7:4: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) +C404.py:7:4: C404 [**] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) | 5 | return x 6 | @@ -37,7 +37,7 @@ C404.py:7:4: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` comp 9 9 | f"{dict([(s, s) for s in 'ab'])}" 10 10 | f"{dict([(s,f(s)) for s in 'ab'])}" -C404.py:8:4: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) +C404.py:8:4: C404 [**] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) | 7 | f'{dict([(s,s) for s in "ab"])}' 8 | f"{dict([(s,s) for s in 'ab'])}" @@ -57,7 +57,7 @@ C404.py:8:4: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` comp 10 10 | f"{dict([(s,f(s)) for s in 'ab'])}" 11 11 | -C404.py:9:4: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) +C404.py:9:4: C404 [**] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) | 7 | f'{dict([(s,s) for s in "ab"])}' 8 | f"{dict([(s,s) for s in 'ab'])}" @@ -77,7 +77,7 @@ C404.py:9:4: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` comp 11 11 | 12 12 | f'{dict([(s,s) for s in "ab"]) | dict([(s,s) for s in "ab"])}' -C404.py:10:4: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) +C404.py:10:4: C404 [**] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) | 8 | f"{dict([(s,s) for s in 'ab'])}" 9 | f"{dict([(s, s) for s in 'ab'])}" @@ -98,7 +98,7 @@ C404.py:10:4: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` com 12 12 | f'{dict([(s,s) for s in "ab"]) | dict([(s,s) for s in "ab"])}' 13 13 | f'{ dict([(s,s) for s in "ab"]) | dict([(s,s) for s in "ab"]) }' -C404.py:12:4: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) +C404.py:12:4: C404 [**] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) | 10 | f"{dict([(s,f(s)) for s in 'ab'])}" 11 | @@ -118,7 +118,7 @@ C404.py:12:4: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` com 14 14 | 15 15 | # Regression test for: https://github.com/astral-sh/ruff/issues/7087 -C404.py:12:34: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) +C404.py:12:34: C404 [**] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) | 10 | f"{dict([(s,f(s)) for s in 'ab'])}" 11 | @@ -138,7 +138,7 @@ C404.py:12:34: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` co 14 14 | 15 15 | # Regression test for: https://github.com/astral-sh/ruff/issues/7087 -C404.py:13:5: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) +C404.py:13:5: C404 [**] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) | 12 | f'{dict([(s,s) for s in "ab"]) | dict([(s,s) for s in "ab"])}' 13 | f'{ dict([(s,s) for s in "ab"]) | dict([(s,s) for s in "ab"]) }' @@ -158,7 +158,7 @@ C404.py:13:5: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` com 15 15 | # Regression test for: https://github.com/astral-sh/ruff/issues/7087 16 16 | saved.append(dict([(k, v)for k,v in list(unique_instance.__dict__.items()) if k in [f.name for f in unique_instance._meta.fields]])) -C404.py:13:35: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) +C404.py:13:35: C404 [**] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) | 12 | f'{dict([(s,s) for s in "ab"]) | dict([(s,s) for s in "ab"])}' 13 | f'{ dict([(s,s) for s in "ab"]) | dict([(s,s) for s in "ab"]) }' @@ -178,7 +178,7 @@ C404.py:13:35: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` co 15 15 | # Regression test for: https://github.com/astral-sh/ruff/issues/7087 16 16 | saved.append(dict([(k, v)for k,v in list(unique_instance.__dict__.items()) if k in [f.name for f in unique_instance._meta.fields]])) -C404.py:16:14: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) +C404.py:16:14: C404 [**] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) | 15 | # Regression test for: https://github.com/astral-sh/ruff/issues/7087 16 | saved.append(dict([(k, v)for k,v in list(unique_instance.__dict__.items()) if k in [f.name for f in unique_instance._meta.fields]])) diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C405_C405.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C405_C405.py.snap index 1ae0f55d0d505c..2ed3481b2f58a4 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C405_C405.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C405_C405.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C405.py:1:1: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:1:1: C405 [**] Unnecessary `list` literal (rewrite as a `set` literal) | 1 | set([1, 2]) | ^^^^^^^^^^^ C405 @@ -17,7 +17,7 @@ C405.py:1:1: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) 3 3 | set([]) 4 4 | set(()) -C405.py:2:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) +C405.py:2:1: C405 [**] Unnecessary `tuple` literal (rewrite as a `set` literal) | 1 | set([1, 2]) 2 | set((1, 2)) @@ -35,7 +35,7 @@ C405.py:2:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) 4 4 | set(()) 5 5 | set() -C405.py:3:1: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:3:1: C405 [**] Unnecessary `list` literal (rewrite as a `set` literal) | 1 | set([1, 2]) 2 | set((1, 2)) @@ -55,7 +55,7 @@ C405.py:3:1: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) 5 5 | set() 6 6 | set((1,)) -C405.py:4:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) +C405.py:4:1: C405 [**] Unnecessary `tuple` literal (rewrite as a `set` literal) | 2 | set((1, 2)) 3 | set([]) @@ -77,7 +77,7 @@ C405.py:4:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) 7 7 | set(( 8 8 | 1, -C405.py:6:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) +C405.py:6:1: C405 [**] Unnecessary `tuple` literal (rewrite as a `set` literal) | 4 | set(()) 5 | set() @@ -98,7 +98,7 @@ C405.py:6:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) 8 8 | 1, 9 9 | )) -C405.py:7:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) +C405.py:7:1: C405 [**] Unnecessary `tuple` literal (rewrite as a `set` literal) | 5 | set() 6 | set((1,)) @@ -124,7 +124,7 @@ C405.py:7:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) 11 11 | 1, 12 12 | ]) -C405.py:10:1: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:10:1: C405 [**] Unnecessary `list` literal (rewrite as a `set` literal) | 8 | 1, 9 | )) @@ -150,7 +150,7 @@ C405.py:10:1: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) 14 14 | (1,) 15 15 | ) -C405.py:13:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) +C405.py:13:1: C405 [**] Unnecessary `tuple` literal (rewrite as a `set` literal) | 11 | 1, 12 | ]) @@ -175,7 +175,7 @@ C405.py:13:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) 17 15 | [1,] 18 16 | ) -C405.py:16:1: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:16:1: C405 [**] Unnecessary `list` literal (rewrite as a `set` literal) | 14 | (1,) 15 | ) @@ -200,7 +200,7 @@ C405.py:16:1: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) 20 18 | f"{set(['a', 'b'])}" 21 19 | f'{set(["a", "b"])}' -C405.py:19:4: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:19:4: C405 [**] Unnecessary `list` literal (rewrite as a `set` literal) | 17 | [1,] 18 | ) @@ -221,7 +221,7 @@ C405.py:19:4: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) 21 21 | f'{set(["a", "b"])}' 22 22 | -C405.py:20:4: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:20:4: C405 [**] Unnecessary `list` literal (rewrite as a `set` literal) | 18 | ) 19 | f"{set([1,2,3])}" @@ -241,7 +241,7 @@ C405.py:20:4: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) 22 22 | 23 23 | f"{set(['a', 'b']) - set(['a'])}" -C405.py:21:4: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:21:4: C405 [**] Unnecessary `list` literal (rewrite as a `set` literal) | 19 | f"{set([1,2,3])}" 20 | f"{set(['a', 'b'])}" @@ -262,7 +262,7 @@ C405.py:21:4: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) 23 23 | f"{set(['a', 'b']) - set(['a'])}" 24 24 | f"{ set(['a', 'b']) - set(['a']) }" -C405.py:23:4: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:23:4: C405 [**] Unnecessary `list` literal (rewrite as a `set` literal) | 21 | f'{set(["a", "b"])}' 22 | @@ -283,7 +283,7 @@ C405.py:23:4: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) 25 25 | f"a {set(['a', 'b']) - set(['a'])} b" 26 26 | f"a { set(['a', 'b']) - set(['a']) } b" -C405.py:23:22: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:23:22: C405 [**] Unnecessary `list` literal (rewrite as a `set` literal) | 21 | f'{set(["a", "b"])}' 22 | @@ -304,7 +304,7 @@ C405.py:23:22: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) 25 25 | f"a {set(['a', 'b']) - set(['a'])} b" 26 26 | f"a { set(['a', 'b']) - set(['a']) } b" -C405.py:24:5: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:24:5: C405 [**] Unnecessary `list` literal (rewrite as a `set` literal) | 23 | f"{set(['a', 'b']) - set(['a'])}" 24 | f"{ set(['a', 'b']) - set(['a']) }" @@ -323,7 +323,7 @@ C405.py:24:5: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) 25 25 | f"a {set(['a', 'b']) - set(['a'])} b" 26 26 | f"a { set(['a', 'b']) - set(['a']) } b" -C405.py:24:23: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:24:23: C405 [**] Unnecessary `list` literal (rewrite as a `set` literal) | 23 | f"{set(['a', 'b']) - set(['a'])}" 24 | f"{ set(['a', 'b']) - set(['a']) }" @@ -342,7 +342,7 @@ C405.py:24:23: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) 25 25 | f"a {set(['a', 'b']) - set(['a'])} b" 26 26 | f"a { set(['a', 'b']) - set(['a']) } b" -C405.py:25:6: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:25:6: C405 [**] Unnecessary `list` literal (rewrite as a `set` literal) | 23 | f"{set(['a', 'b']) - set(['a'])}" 24 | f"{ set(['a', 'b']) - set(['a']) }" @@ -360,7 +360,7 @@ C405.py:25:6: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) 25 |+f"a { {'a', 'b'} - set(['a'])} b" 26 26 | f"a { set(['a', 'b']) - set(['a']) } b" -C405.py:25:24: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:25:24: C405 [**] Unnecessary `list` literal (rewrite as a `set` literal) | 23 | f"{set(['a', 'b']) - set(['a'])}" 24 | f"{ set(['a', 'b']) - set(['a']) }" @@ -378,7 +378,7 @@ C405.py:25:24: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) 25 |+f"a {set(['a', 'b']) - {'a'} } b" 26 26 | f"a { set(['a', 'b']) - set(['a']) } b" -C405.py:26:7: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:26:7: C405 [**] Unnecessary `list` literal (rewrite as a `set` literal) | 24 | f"{ set(['a', 'b']) - set(['a']) }" 25 | f"a {set(['a', 'b']) - set(['a'])} b" @@ -394,7 +394,7 @@ C405.py:26:7: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) 26 |-f"a { set(['a', 'b']) - set(['a']) } b" 26 |+f"a { {'a', 'b'} - set(['a']) } b" -C405.py:26:25: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:26:25: C405 [**] Unnecessary `list` literal (rewrite as a `set` literal) | 24 | f"{ set(['a', 'b']) - set(['a']) }" 25 | f"a {set(['a', 'b']) - set(['a'])} b" diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C406_C406.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C406_C406.py.snap index f8983c16830b55..3fc6d154f78299 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C406_C406.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C406_C406.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C406.py:1:6: C406 [*] Unnecessary `list` literal (rewrite as a `dict` literal) +C406.py:1:6: C406 [**] Unnecessary `list` literal (rewrite as a `dict` literal) | 1 | d1 = dict([(1, 2)]) | ^^^^^^^^^^^^^^ C406 @@ -17,7 +17,7 @@ C406.py:1:6: C406 [*] Unnecessary `list` literal (rewrite as a `dict` literal) 3 3 | d3 = dict([]) 4 4 | d4 = dict(()) -C406.py:2:6: C406 [*] Unnecessary `tuple` literal (rewrite as a `dict` literal) +C406.py:2:6: C406 [**] Unnecessary `tuple` literal (rewrite as a `dict` literal) | 1 | d1 = dict([(1, 2)]) 2 | d2 = dict(((1, 2),)) @@ -35,7 +35,7 @@ C406.py:2:6: C406 [*] Unnecessary `tuple` literal (rewrite as a `dict` literal) 4 4 | d4 = dict(()) 5 5 | d5 = dict() -C406.py:3:6: C406 [*] Unnecessary `list` literal (rewrite as a `dict` literal) +C406.py:3:6: C406 [**] Unnecessary `list` literal (rewrite as a `dict` literal) | 1 | d1 = dict([(1, 2)]) 2 | d2 = dict(((1, 2),)) @@ -54,7 +54,7 @@ C406.py:3:6: C406 [*] Unnecessary `list` literal (rewrite as a `dict` literal) 4 4 | d4 = dict(()) 5 5 | d5 = dict() -C406.py:4:6: C406 [*] Unnecessary `tuple` literal (rewrite as a `dict` literal) +C406.py:4:6: C406 [**] Unnecessary `tuple` literal (rewrite as a `dict` literal) | 2 | d2 = dict(((1, 2),)) 3 | d3 = dict([]) diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C408_C408.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C408_C408.py.snap index 09904c22e26504..1a1897481a4bb1 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C408_C408.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C408_C408.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C408.py:1:5: C408 [*] Unnecessary `tuple` call (rewrite as a literal) +C408.py:1:5: C408 [**] Unnecessary `tuple` call (rewrite as a literal) | 1 | t = tuple() | ^^^^^^^ C408 @@ -17,7 +17,7 @@ C408.py:1:5: C408 [*] Unnecessary `tuple` call (rewrite as a literal) 3 3 | d1 = dict() 4 4 | d2 = dict(a=1) -C408.py:2:5: C408 [*] Unnecessary `list` call (rewrite as a literal) +C408.py:2:5: C408 [**] Unnecessary `list` call (rewrite as a literal) | 1 | t = tuple() 2 | l = list() @@ -35,7 +35,7 @@ C408.py:2:5: C408 [*] Unnecessary `list` call (rewrite as a literal) 4 4 | d2 = dict(a=1) 5 5 | d3 = dict(**d2) -C408.py:3:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:3:6: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 1 | t = tuple() 2 | l = list() @@ -55,7 +55,7 @@ C408.py:3:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) 5 5 | d3 = dict(**d2) 6 6 | -C408.py:4:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:4:6: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 2 | l = list() 3 | d1 = dict() @@ -75,7 +75,7 @@ C408.py:4:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) 6 6 | 7 7 | -C408.py:14:4: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:14:4: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 12 | a = list() 13 | @@ -96,7 +96,7 @@ C408.py:14:4: C408 [*] Unnecessary `dict` call (rewrite as a literal) 16 16 | f"{dict()}" 17 17 | f"a {dict()} b" -C408.py:15:4: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:15:4: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 14 | f"{dict(x='y')}" 15 | f'{dict(x="y")}' @@ -116,7 +116,7 @@ C408.py:15:4: C408 [*] Unnecessary `dict` call (rewrite as a literal) 17 17 | f"a {dict()} b" 18 18 | -C408.py:16:4: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:16:4: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 14 | f"{dict(x='y')}" 15 | f'{dict(x="y")}' @@ -136,7 +136,7 @@ C408.py:16:4: C408 [*] Unnecessary `dict` call (rewrite as a literal) 18 18 | 19 19 | f"{dict(x='y') | dict(y='z')}" -C408.py:17:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:17:6: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 15 | f'{dict(x="y")}' 16 | f"{dict()}" @@ -157,7 +157,7 @@ C408.py:17:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) 19 19 | f"{dict(x='y') | dict(y='z')}" 20 20 | f"{ dict(x='y') | dict(y='z') }" -C408.py:19:4: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:19:4: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 17 | f"a {dict()} b" 18 | @@ -178,7 +178,7 @@ C408.py:19:4: C408 [*] Unnecessary `dict` call (rewrite as a literal) 21 21 | f"a {dict(x='y') | dict(y='z')} b" 22 22 | f"a { dict(x='y') | dict(y='z') } b" -C408.py:19:18: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:19:18: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 17 | f"a {dict()} b" 18 | @@ -199,7 +199,7 @@ C408.py:19:18: C408 [*] Unnecessary `dict` call (rewrite as a literal) 21 21 | f"a {dict(x='y') | dict(y='z')} b" 22 22 | f"a { dict(x='y') | dict(y='z') } b" -C408.py:20:5: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:20:5: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 19 | f"{dict(x='y') | dict(y='z')}" 20 | f"{ dict(x='y') | dict(y='z') }" @@ -218,7 +218,7 @@ C408.py:20:5: C408 [*] Unnecessary `dict` call (rewrite as a literal) 21 21 | f"a {dict(x='y') | dict(y='z')} b" 22 22 | f"a { dict(x='y') | dict(y='z') } b" -C408.py:20:19: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:20:19: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 19 | f"{dict(x='y') | dict(y='z')}" 20 | f"{ dict(x='y') | dict(y='z') }" @@ -237,7 +237,7 @@ C408.py:20:19: C408 [*] Unnecessary `dict` call (rewrite as a literal) 21 21 | f"a {dict(x='y') | dict(y='z')} b" 22 22 | f"a { dict(x='y') | dict(y='z') } b" -C408.py:21:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:21:6: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 19 | f"{dict(x='y') | dict(y='z')}" 20 | f"{ dict(x='y') | dict(y='z') }" @@ -255,7 +255,7 @@ C408.py:21:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) 21 |+f"a { {'x': 'y'} | dict(y='z')} b" 22 22 | f"a { dict(x='y') | dict(y='z') } b" -C408.py:21:20: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:21:20: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 19 | f"{dict(x='y') | dict(y='z')}" 20 | f"{ dict(x='y') | dict(y='z') }" @@ -273,7 +273,7 @@ C408.py:21:20: C408 [*] Unnecessary `dict` call (rewrite as a literal) 21 |+f"a {dict(x='y') | {'y': 'z'} } b" 22 22 | f"a { dict(x='y') | dict(y='z') } b" -C408.py:22:7: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:22:7: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 20 | f"{ dict(x='y') | dict(y='z') }" 21 | f"a {dict(x='y') | dict(y='z')} b" @@ -289,7 +289,7 @@ C408.py:22:7: C408 [*] Unnecessary `dict` call (rewrite as a literal) 22 |-f"a { dict(x='y') | dict(y='z') } b" 22 |+f"a { {'x': 'y'} | dict(y='z') } b" -C408.py:22:21: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:22:21: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 20 | f"{ dict(x='y') | dict(y='z') }" 21 | f"a {dict(x='y') | dict(y='z')} b" diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C408_C408.py_allow_dict_calls_with_keyword_arguments.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C408_C408.py_allow_dict_calls_with_keyword_arguments.snap index 7032a8c4511f4f..5f4c704cd4d3e3 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C408_C408.py_allow_dict_calls_with_keyword_arguments.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C408_C408.py_allow_dict_calls_with_keyword_arguments.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C408.py:1:5: C408 [*] Unnecessary `tuple` call (rewrite as a literal) +C408.py:1:5: C408 [**] Unnecessary `tuple` call (rewrite as a literal) | 1 | t = tuple() | ^^^^^^^ C408 @@ -17,7 +17,7 @@ C408.py:1:5: C408 [*] Unnecessary `tuple` call (rewrite as a literal) 3 3 | d1 = dict() 4 4 | d2 = dict(a=1) -C408.py:2:5: C408 [*] Unnecessary `list` call (rewrite as a literal) +C408.py:2:5: C408 [**] Unnecessary `list` call (rewrite as a literal) | 1 | t = tuple() 2 | l = list() @@ -35,7 +35,7 @@ C408.py:2:5: C408 [*] Unnecessary `list` call (rewrite as a literal) 4 4 | d2 = dict(a=1) 5 5 | d3 = dict(**d2) -C408.py:3:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:3:6: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 1 | t = tuple() 2 | l = list() @@ -55,7 +55,7 @@ C408.py:3:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) 5 5 | d3 = dict(**d2) 6 6 | -C408.py:16:4: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:16:4: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 14 | f"{dict(x='y')}" 15 | f'{dict(x="y")}' @@ -75,7 +75,7 @@ C408.py:16:4: C408 [*] Unnecessary `dict` call (rewrite as a literal) 18 18 | 19 19 | f"{dict(x='y') | dict(y='z')}" -C408.py:17:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:17:6: C408 [**] Unnecessary `dict` call (rewrite as a literal) | 15 | f'{dict(x="y")}' 16 | f"{dict()}" diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C409_C409.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C409_C409.py.snap index 962bd5c19a88c9..455b0d3ccff73f 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C409_C409.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C409_C409.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C409.py:1:6: C409 [*] Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal) +C409.py:1:6: C409 [**] Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal) | 1 | t1 = tuple([]) | ^^^^^^^^^ C409 @@ -17,7 +17,7 @@ C409.py:1:6: C409 [*] Unnecessary `list` literal passed to `tuple()` (rewrite as 3 3 | t3 = tuple((1, 2)) 4 4 | t4 = tuple([ -C409.py:2:6: C409 [*] Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal) +C409.py:2:6: C409 [**] Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal) | 1 | t1 = tuple([]) 2 | t2 = tuple([1, 2]) @@ -35,7 +35,7 @@ C409.py:2:6: C409 [*] Unnecessary `list` literal passed to `tuple()` (rewrite as 4 4 | t4 = tuple([ 5 5 | 1, -C409.py:3:6: C409 [*] Unnecessary `tuple` literal passed to `tuple()` (remove the outer call to `tuple()`) +C409.py:3:6: C409 [**] Unnecessary `tuple` literal passed to `tuple()` (remove the outer call to `tuple()`) | 1 | t1 = tuple([]) 2 | t2 = tuple([1, 2]) @@ -55,7 +55,7 @@ C409.py:3:6: C409 [*] Unnecessary `tuple` literal passed to `tuple()` (remove th 5 5 | 1, 6 6 | 2 -C409.py:4:6: C409 [*] Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal) +C409.py:4:6: C409 [**] Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal) | 2 | t2 = tuple([1, 2]) 3 | t3 = tuple((1, 2)) @@ -84,7 +84,7 @@ C409.py:4:6: C409 [*] Unnecessary `list` literal passed to `tuple()` (rewrite as 9 9 | (1, 2) 10 10 | ) -C409.py:8:6: C409 [*] Unnecessary `tuple` literal passed to `tuple()` (remove the outer call to `tuple()`) +C409.py:8:6: C409 [**] Unnecessary `tuple` literal passed to `tuple()` (remove the outer call to `tuple()`) | 6 | 2 7 | ]) diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C410_C410.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C410_C410.py.snap index 997e8547578aa4..a448f1e5f312c3 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C410_C410.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C410_C410.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C410.py:1:6: C410 [*] Unnecessary `list` literal passed to `list()` (remove the outer call to `list()`) +C410.py:1:6: C410 [**] Unnecessary `list` literal passed to `list()` (remove the outer call to `list()`) | 1 | l1 = list([1, 2]) | ^^^^^^^^^^^^ C410 @@ -17,7 +17,7 @@ C410.py:1:6: C410 [*] Unnecessary `list` literal passed to `list()` (remove the 3 3 | l3 = list([]) 4 4 | l4 = list(()) -C410.py:2:6: C410 [*] Unnecessary `tuple` literal passed to `list()` (rewrite as a `list` literal) +C410.py:2:6: C410 [**] Unnecessary `tuple` literal passed to `list()` (rewrite as a `list` literal) | 1 | l1 = list([1, 2]) 2 | l2 = list((1, 2)) @@ -34,7 +34,7 @@ C410.py:2:6: C410 [*] Unnecessary `tuple` literal passed to `list()` (rewrite as 3 3 | l3 = list([]) 4 4 | l4 = list(()) -C410.py:3:6: C410 [*] Unnecessary `list` literal passed to `list()` (remove the outer call to `list()`) +C410.py:3:6: C410 [**] Unnecessary `list` literal passed to `list()` (remove the outer call to `list()`) | 1 | l1 = list([1, 2]) 2 | l2 = list((1, 2)) @@ -51,7 +51,7 @@ C410.py:3:6: C410 [*] Unnecessary `list` literal passed to `list()` (remove the 3 |+l3 = [] 4 4 | l4 = list(()) -C410.py:4:6: C410 [*] Unnecessary `tuple` literal passed to `list()` (rewrite as a `list` literal) +C410.py:4:6: C410 [**] Unnecessary `tuple` literal passed to `list()` (rewrite as a `list` literal) | 2 | l2 = list((1, 2)) 3 | l3 = list([]) diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C411_C411.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C411_C411.py.snap index 1878f091a7ced0..15fff6b2d3b01c 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C411_C411.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C411_C411.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C411.py:2:1: C411 [*] Unnecessary `list` call (remove the outer call to `list()`) +C411.py:2:1: C411 [**] Unnecessary `list` call (remove the outer call to `list()`) | 1 | x = [1, 2, 3] 2 | list([i for i in x]) diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C413_C413.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C413_C413.py.snap index ae89b1802aa2ec..0c5bdbf331c586 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C413_C413.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C413_C413.py.snap @@ -21,7 +21,7 @@ C413.py:3:1: C413 [*] Unnecessary `list` call around `sorted()` 5 5 | reversed(sorted(x, key=lambda e: e)) 6 6 | reversed(sorted(x, reverse=True)) -C413.py:4:1: C413 [*] Unnecessary `reversed` call around `sorted()` +C413.py:4:1: C413 [**] Unnecessary `reversed` call around `sorted()` | 2 | list(x) 3 | list(sorted(x)) @@ -42,7 +42,7 @@ C413.py:4:1: C413 [*] Unnecessary `reversed` call around `sorted()` 6 6 | reversed(sorted(x, reverse=True)) 7 7 | reversed(sorted(x, key=lambda e: e, reverse=True)) -C413.py:5:1: C413 [*] Unnecessary `reversed` call around `sorted()` +C413.py:5:1: C413 [**] Unnecessary `reversed` call around `sorted()` | 3 | list(sorted(x)) 4 | reversed(sorted(x)) @@ -63,7 +63,7 @@ C413.py:5:1: C413 [*] Unnecessary `reversed` call around `sorted()` 7 7 | reversed(sorted(x, key=lambda e: e, reverse=True)) 8 8 | reversed(sorted(x, reverse=True, key=lambda e: e)) -C413.py:6:1: C413 [*] Unnecessary `reversed` call around `sorted()` +C413.py:6:1: C413 [**] Unnecessary `reversed` call around `sorted()` | 4 | reversed(sorted(x)) 5 | reversed(sorted(x, key=lambda e: e)) @@ -84,7 +84,7 @@ C413.py:6:1: C413 [*] Unnecessary `reversed` call around `sorted()` 8 8 | reversed(sorted(x, reverse=True, key=lambda e: e)) 9 9 | reversed(sorted(x, reverse=False)) -C413.py:7:1: C413 [*] Unnecessary `reversed` call around `sorted()` +C413.py:7:1: C413 [**] Unnecessary `reversed` call around `sorted()` | 5 | reversed(sorted(x, key=lambda e: e)) 6 | reversed(sorted(x, reverse=True)) @@ -105,7 +105,7 @@ C413.py:7:1: C413 [*] Unnecessary `reversed` call around `sorted()` 9 9 | reversed(sorted(x, reverse=False)) 10 10 | reversed(sorted(x, reverse=x)) -C413.py:8:1: C413 [*] Unnecessary `reversed` call around `sorted()` +C413.py:8:1: C413 [**] Unnecessary `reversed` call around `sorted()` | 6 | reversed(sorted(x, reverse=True)) 7 | reversed(sorted(x, key=lambda e: e, reverse=True)) @@ -126,7 +126,7 @@ C413.py:8:1: C413 [*] Unnecessary `reversed` call around `sorted()` 10 10 | reversed(sorted(x, reverse=x)) 11 11 | reversed(sorted(x, reverse=not x)) -C413.py:9:1: C413 [*] Unnecessary `reversed` call around `sorted()` +C413.py:9:1: C413 [**] Unnecessary `reversed` call around `sorted()` | 7 | reversed(sorted(x, key=lambda e: e, reverse=True)) 8 | reversed(sorted(x, reverse=True, key=lambda e: e)) @@ -147,7 +147,7 @@ C413.py:9:1: C413 [*] Unnecessary `reversed` call around `sorted()` 11 11 | reversed(sorted(x, reverse=not x)) 12 12 | -C413.py:10:1: C413 [*] Unnecessary `reversed` call around `sorted()` +C413.py:10:1: C413 [**] Unnecessary `reversed` call around `sorted()` | 8 | reversed(sorted(x, reverse=True, key=lambda e: e)) 9 | reversed(sorted(x, reverse=False)) @@ -167,7 +167,7 @@ C413.py:10:1: C413 [*] Unnecessary `reversed` call around `sorted()` 12 12 | 13 13 | # Regression test for: https://github.com/astral-sh/ruff/issues/7289 -C413.py:11:1: C413 [*] Unnecessary `reversed` call around `sorted()` +C413.py:11:1: C413 [**] Unnecessary `reversed` call around `sorted()` | 9 | reversed(sorted(x, reverse=False)) 10 | reversed(sorted(x, reverse=x)) @@ -188,7 +188,7 @@ C413.py:11:1: C413 [*] Unnecessary `reversed` call around `sorted()` 13 13 | # Regression test for: https://github.com/astral-sh/ruff/issues/7289 14 14 | reversed(sorted(i for i in range(42))) -C413.py:14:1: C413 [*] Unnecessary `reversed` call around `sorted()` +C413.py:14:1: C413 [**] Unnecessary `reversed` call around `sorted()` | 13 | # Regression test for: https://github.com/astral-sh/ruff/issues/7289 14 | reversed(sorted(i for i in range(42))) @@ -207,7 +207,7 @@ C413.py:14:1: C413 [*] Unnecessary `reversed` call around `sorted()` 16 16 | 17 17 | -C413.py:15:1: C413 [*] Unnecessary `reversed` call around `sorted()` +C413.py:15:1: C413 [**] Unnecessary `reversed` call around `sorted()` | 13 | # Regression test for: https://github.com/astral-sh/ruff/issues/7289 14 | reversed(sorted(i for i in range(42))) diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C414_C414.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C414_C414.py.snap index 396a8d26ab0eb5..a13cdbe849508f 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C414_C414.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C414_C414.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C414.py:2:1: C414 [*] Unnecessary `list` call within `list()` +C414.py:2:1: C414 [**] Unnecessary `list` call within `list()` | 1 | x = [1, 2, 3] 2 | list(list(x)) @@ -19,7 +19,7 @@ C414.py:2:1: C414 [*] Unnecessary `list` call within `list()` 4 4 | tuple(list(x)) 5 5 | tuple(tuple(x)) -C414.py:3:1: C414 [*] Unnecessary `tuple` call within `list()` +C414.py:3:1: C414 [**] Unnecessary `tuple` call within `list()` | 1 | x = [1, 2, 3] 2 | list(list(x)) @@ -39,7 +39,7 @@ C414.py:3:1: C414 [*] Unnecessary `tuple` call within `list()` 5 5 | tuple(tuple(x)) 6 6 | set(set(x)) -C414.py:4:1: C414 [*] Unnecessary `list` call within `tuple()` +C414.py:4:1: C414 [**] Unnecessary `list` call within `tuple()` | 2 | list(list(x)) 3 | list(tuple(x)) @@ -60,7 +60,7 @@ C414.py:4:1: C414 [*] Unnecessary `list` call within `tuple()` 6 6 | set(set(x)) 7 7 | set(list(x)) -C414.py:5:1: C414 [*] Unnecessary `tuple` call within `tuple()` +C414.py:5:1: C414 [**] Unnecessary `tuple` call within `tuple()` | 3 | list(tuple(x)) 4 | tuple(list(x)) @@ -81,7 +81,7 @@ C414.py:5:1: C414 [*] Unnecessary `tuple` call within `tuple()` 7 7 | set(list(x)) 8 8 | set(tuple(x)) -C414.py:6:1: C414 [*] Unnecessary `set` call within `set()` +C414.py:6:1: C414 [**] Unnecessary `set` call within `set()` | 4 | tuple(list(x)) 5 | tuple(tuple(x)) @@ -102,7 +102,7 @@ C414.py:6:1: C414 [*] Unnecessary `set` call within `set()` 8 8 | set(tuple(x)) 9 9 | set(sorted(x)) -C414.py:7:1: C414 [*] Unnecessary `list` call within `set()` +C414.py:7:1: C414 [**] Unnecessary `list` call within `set()` | 5 | tuple(tuple(x)) 6 | set(set(x)) @@ -123,7 +123,7 @@ C414.py:7:1: C414 [*] Unnecessary `list` call within `set()` 9 9 | set(sorted(x)) 10 10 | set(sorted(x, key=lambda y: y)) -C414.py:8:1: C414 [*] Unnecessary `tuple` call within `set()` +C414.py:8:1: C414 [**] Unnecessary `tuple` call within `set()` | 6 | set(set(x)) 7 | set(list(x)) @@ -144,7 +144,7 @@ C414.py:8:1: C414 [*] Unnecessary `tuple` call within `set()` 10 10 | set(sorted(x, key=lambda y: y)) 11 11 | set(reversed(x)) -C414.py:9:1: C414 [*] Unnecessary `sorted` call within `set()` +C414.py:9:1: C414 [**] Unnecessary `sorted` call within `set()` | 7 | set(list(x)) 8 | set(tuple(x)) @@ -165,7 +165,7 @@ C414.py:9:1: C414 [*] Unnecessary `sorted` call within `set()` 11 11 | set(reversed(x)) 12 12 | sorted(list(x)) -C414.py:10:1: C414 [*] Unnecessary `sorted` call within `set()` +C414.py:10:1: C414 [**] Unnecessary `sorted` call within `set()` | 8 | set(tuple(x)) 9 | set(sorted(x)) @@ -186,7 +186,7 @@ C414.py:10:1: C414 [*] Unnecessary `sorted` call within `set()` 12 12 | sorted(list(x)) 13 13 | sorted(tuple(x)) -C414.py:11:1: C414 [*] Unnecessary `reversed` call within `set()` +C414.py:11:1: C414 [**] Unnecessary `reversed` call within `set()` | 9 | set(sorted(x)) 10 | set(sorted(x, key=lambda y: y)) @@ -207,7 +207,7 @@ C414.py:11:1: C414 [*] Unnecessary `reversed` call within `set()` 13 13 | sorted(tuple(x)) 14 14 | sorted(sorted(x)) -C414.py:12:1: C414 [*] Unnecessary `list` call within `sorted()` +C414.py:12:1: C414 [**] Unnecessary `list` call within `sorted()` | 10 | set(sorted(x, key=lambda y: y)) 11 | set(reversed(x)) @@ -228,7 +228,7 @@ C414.py:12:1: C414 [*] Unnecessary `list` call within `sorted()` 14 14 | sorted(sorted(x)) 15 15 | sorted(sorted(x, key=foo, reverse=False), reverse=False, key=foo) -C414.py:13:1: C414 [*] Unnecessary `tuple` call within `sorted()` +C414.py:13:1: C414 [**] Unnecessary `tuple` call within `sorted()` | 11 | set(reversed(x)) 12 | sorted(list(x)) @@ -249,7 +249,7 @@ C414.py:13:1: C414 [*] Unnecessary `tuple` call within `sorted()` 15 15 | sorted(sorted(x, key=foo, reverse=False), reverse=False, key=foo) 16 16 | sorted(sorted(x, reverse=True), reverse=True) -C414.py:14:1: C414 [*] Unnecessary `sorted` call within `sorted()` +C414.py:14:1: C414 [**] Unnecessary `sorted` call within `sorted()` | 12 | sorted(list(x)) 13 | sorted(tuple(x)) @@ -270,7 +270,7 @@ C414.py:14:1: C414 [*] Unnecessary `sorted` call within `sorted()` 16 16 | sorted(sorted(x, reverse=True), reverse=True) 17 17 | sorted(reversed(x)) -C414.py:15:1: C414 [*] Unnecessary `sorted` call within `sorted()` +C414.py:15:1: C414 [**] Unnecessary `sorted` call within `sorted()` | 13 | sorted(tuple(x)) 14 | sorted(sorted(x)) @@ -291,7 +291,7 @@ C414.py:15:1: C414 [*] Unnecessary `sorted` call within `sorted()` 17 17 | sorted(reversed(x)) 18 18 | sorted(list(x), key=lambda y: y) -C414.py:16:1: C414 [*] Unnecessary `sorted` call within `sorted()` +C414.py:16:1: C414 [**] Unnecessary `sorted` call within `sorted()` | 14 | sorted(sorted(x)) 15 | sorted(sorted(x, key=foo, reverse=False), reverse=False, key=foo) @@ -312,7 +312,7 @@ C414.py:16:1: C414 [*] Unnecessary `sorted` call within `sorted()` 18 18 | sorted(list(x), key=lambda y: y) 19 19 | tuple( -C414.py:17:1: C414 [*] Unnecessary `reversed` call within `sorted()` +C414.py:17:1: C414 [**] Unnecessary `reversed` call within `sorted()` | 15 | sorted(sorted(x, key=foo, reverse=False), reverse=False, key=foo) 16 | sorted(sorted(x, reverse=True), reverse=True) @@ -333,7 +333,7 @@ C414.py:17:1: C414 [*] Unnecessary `reversed` call within `sorted()` 19 19 | tuple( 20 20 | list( -C414.py:18:1: C414 [*] Unnecessary `list` call within `sorted()` +C414.py:18:1: C414 [**] Unnecessary `list` call within `sorted()` | 16 | sorted(sorted(x, reverse=True), reverse=True) 17 | sorted(reversed(x)) @@ -354,7 +354,7 @@ C414.py:18:1: C414 [*] Unnecessary `list` call within `sorted()` 20 20 | list( 21 21 | [x, 3, "hell"\ -C414.py:19:1: C414 [*] Unnecessary `list` call within `tuple()` +C414.py:19:1: C414 [**] Unnecessary `list` call within `tuple()` | 17 | sorted(reversed(x)) 18 | sorted(list(x), key=lambda y: y) @@ -383,7 +383,7 @@ C414.py:19:1: C414 [*] Unnecessary `list` call within `tuple()` 25 23 | set(set()) 26 24 | set(list()) -C414.py:25:1: C414 [*] Unnecessary `set` call within `set()` +C414.py:25:1: C414 [**] Unnecessary `set` call within `set()` | 23 | ) 24 | ) @@ -404,7 +404,7 @@ C414.py:25:1: C414 [*] Unnecessary `set` call within `set()` 27 27 | set(tuple()) 28 28 | sorted(reversed()) -C414.py:26:1: C414 [*] Unnecessary `list` call within `set()` +C414.py:26:1: C414 [**] Unnecessary `list` call within `set()` | 24 | ) 25 | set(set()) @@ -425,7 +425,7 @@ C414.py:26:1: C414 [*] Unnecessary `list` call within `set()` 28 28 | sorted(reversed()) 29 29 | -C414.py:27:1: C414 [*] Unnecessary `tuple` call within `set()` +C414.py:27:1: C414 [**] Unnecessary `tuple` call within `set()` | 25 | set(set()) 26 | set(list()) @@ -445,7 +445,7 @@ C414.py:27:1: C414 [*] Unnecessary `tuple` call within `set()` 29 29 | 30 30 | # Nested sorts with differing keyword arguments. Not flagged. -C414.py:28:1: C414 [*] Unnecessary `reversed` call within `sorted()` +C414.py:28:1: C414 [**] Unnecessary `reversed` call within `sorted()` | 26 | set(list()) 27 | set(tuple()) @@ -466,7 +466,7 @@ C414.py:28:1: C414 [*] Unnecessary `reversed` call within `sorted()` 30 30 | # Nested sorts with differing keyword arguments. Not flagged. 31 31 | sorted(sorted(x, key=lambda y: y)) -C414.py:37:27: C414 [*] Unnecessary `list` call within `sorted()` +C414.py:37:27: C414 [**] Unnecessary `list` call within `sorted()` | 36 | # Preserve trailing comments. 37 | xxxxxxxxxxx_xxxxx_xxxxx = sorted( @@ -492,7 +492,7 @@ C414.py:37:27: C414 [*] Unnecessary `list` call within `sorted()` 40 40 | # xx xxxx xxxxxxx xxxx xxx xxxxxxxx Nxxx 41 41 | key=lambda xxxxx: xxxxx or "", -C414.py:44:27: C414 [*] Unnecessary `list` call within `sorted()` +C414.py:44:27: C414 [**] Unnecessary `list` call within `sorted()` | 42 | ) 43 | diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C416_C416.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C416_C416.py.snap index f7ea1bfbbc3dcb..d95dd77ae3e6c8 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C416_C416.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C416_C416.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C416.py:6:1: C416 [*] Unnecessary `list` comprehension (rewrite using `list()`) +C416.py:6:1: C416 [**] Unnecessary `list` comprehension (rewrite using `list()`) | 4 | d = {"a": 1, "b": 2, "c": 3} 5 | @@ -22,7 +22,7 @@ C416.py:6:1: C416 [*] Unnecessary `list` comprehension (rewrite using `list()`) 8 8 | {k: v for k, v in y} 9 9 | {k: v for k, v in d.items()} -C416.py:7:1: C416 [*] Unnecessary `set` comprehension (rewrite using `set()`) +C416.py:7:1: C416 [**] Unnecessary `set` comprehension (rewrite using `set()`) | 6 | [i for i in x] 7 | {i for i in x} @@ -42,7 +42,7 @@ C416.py:7:1: C416 [*] Unnecessary `set` comprehension (rewrite using `set()`) 9 9 | {k: v for k, v in d.items()} 10 10 | [(k, v) for k, v in d.items()] -C416.py:8:1: C416 [*] Unnecessary `dict` comprehension (rewrite using `dict()`) +C416.py:8:1: C416 [**] Unnecessary `dict` comprehension (rewrite using `dict()`) | 6 | [i for i in x] 7 | {i for i in x} @@ -63,7 +63,7 @@ C416.py:8:1: C416 [*] Unnecessary `dict` comprehension (rewrite using `dict()`) 10 10 | [(k, v) for k, v in d.items()] 11 11 | {k: (a, b) for k, (a, b) in d.items()} -C416.py:9:1: C416 [*] Unnecessary `dict` comprehension (rewrite using `dict()`) +C416.py:9:1: C416 [**] Unnecessary `dict` comprehension (rewrite using `dict()`) | 7 | {i for i in x} 8 | {k: v for k, v in y} @@ -84,7 +84,7 @@ C416.py:9:1: C416 [*] Unnecessary `dict` comprehension (rewrite using `dict()`) 11 11 | {k: (a, b) for k, (a, b) in d.items()} 12 12 | -C416.py:10:1: C416 [*] Unnecessary `list` comprehension (rewrite using `list()`) +C416.py:10:1: C416 [**] Unnecessary `list` comprehension (rewrite using `list()`) | 8 | {k: v for k, v in y} 9 | {k: v for k, v in d.items()} @@ -104,7 +104,7 @@ C416.py:10:1: C416 [*] Unnecessary `list` comprehension (rewrite using `list()`) 12 12 | 13 13 | [i for i, in z] -C416.py:11:1: C416 [*] Unnecessary `dict` comprehension (rewrite using `dict()`) +C416.py:11:1: C416 [**] Unnecessary `dict` comprehension (rewrite using `dict()`) | 9 | {k: v for k, v in d.items()} 10 | [(k, v) for k, v in d.items()] @@ -125,7 +125,7 @@ C416.py:11:1: C416 [*] Unnecessary `dict` comprehension (rewrite using `dict()`) 13 13 | [i for i, in z] 14 14 | [i for i, j in y] -C416.py:24:70: C416 [*] Unnecessary `list` comprehension (rewrite using `list()`) +C416.py:24:70: C416 [**] Unnecessary `list` comprehension (rewrite using `list()`) | 23 | # Regression test for: https://github.com/astral-sh/ruff/issues/7196 24 | any(len(symbol_table.get_by_type(symbol_type)) > 0 for symbol_type in[t for t in SymbolType]) diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C417_C417.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C417_C417.py.snap index 1418d486ed6185..f17e79e70c8819 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C417_C417.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C417_C417.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C417.py:3:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:3:1: C417 [**] Unnecessary `map` usage (rewrite using a generator expression) | 1 | # Errors. 2 | nums = [1, 2, 3] @@ -21,7 +21,7 @@ C417.py:3:1: C417 [*] Unnecessary `map` usage (rewrite using a generator express 5 5 | list(map(lambda x: x * 2, nums)) 6 6 | set(map(lambda x: x % 2 == 0, nums)) -C417.py:4:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:4:1: C417 [**] Unnecessary `map` usage (rewrite using a generator expression) | 2 | nums = [1, 2, 3] 3 | map(lambda x: x + 1, nums) @@ -42,7 +42,7 @@ C417.py:4:1: C417 [*] Unnecessary `map` usage (rewrite using a generator express 6 6 | set(map(lambda x: x % 2 == 0, nums)) 7 7 | dict(map(lambda v: (v, v**2), nums)) -C417.py:5:1: C417 [*] Unnecessary `map` usage (rewrite using a `list` comprehension) +C417.py:5:1: C417 [**] Unnecessary `map` usage (rewrite using a `list` comprehension) | 3 | map(lambda x: x + 1, nums) 4 | map(lambda x: str(x), nums) @@ -63,7 +63,7 @@ C417.py:5:1: C417 [*] Unnecessary `map` usage (rewrite using a `list` comprehens 7 7 | dict(map(lambda v: (v, v**2), nums)) 8 8 | dict(map(lambda v: [v, v**2], nums)) -C417.py:6:1: C417 [*] Unnecessary `map` usage (rewrite using a `set` comprehension) +C417.py:6:1: C417 [**] Unnecessary `map` usage (rewrite using a `set` comprehension) | 4 | map(lambda x: str(x), nums) 5 | list(map(lambda x: x * 2, nums)) @@ -84,7 +84,7 @@ C417.py:6:1: C417 [*] Unnecessary `map` usage (rewrite using a `set` comprehensi 8 8 | dict(map(lambda v: [v, v**2], nums)) 9 9 | map(lambda: "const", nums) -C417.py:7:1: C417 [*] Unnecessary `map` usage (rewrite using a `dict` comprehension) +C417.py:7:1: C417 [**] Unnecessary `map` usage (rewrite using a `dict` comprehension) | 5 | list(map(lambda x: x * 2, nums)) 6 | set(map(lambda x: x % 2 == 0, nums)) @@ -105,7 +105,7 @@ C417.py:7:1: C417 [*] Unnecessary `map` usage (rewrite using a `dict` comprehens 9 9 | map(lambda: "const", nums) 10 10 | map(lambda _: 3.0, nums) -C417.py:8:1: C417 [*] Unnecessary `map` usage (rewrite using a `dict` comprehension) +C417.py:8:1: C417 [**] Unnecessary `map` usage (rewrite using a `dict` comprehension) | 6 | set(map(lambda x: x % 2 == 0, nums)) 7 | dict(map(lambda v: (v, v**2), nums)) @@ -126,7 +126,7 @@ C417.py:8:1: C417 [*] Unnecessary `map` usage (rewrite using a `dict` comprehens 10 10 | map(lambda _: 3.0, nums) 11 11 | _ = "".join(map(lambda x: x in nums and "1" or "0", range(123))) -C417.py:9:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:9:1: C417 [**] Unnecessary `map` usage (rewrite using a generator expression) | 7 | dict(map(lambda v: (v, v**2), nums)) 8 | dict(map(lambda v: [v, v**2], nums)) @@ -147,7 +147,7 @@ C417.py:9:1: C417 [*] Unnecessary `map` usage (rewrite using a generator express 11 11 | _ = "".join(map(lambda x: x in nums and "1" or "0", range(123))) 12 12 | all(map(lambda v: isinstance(v, dict), nums)) -C417.py:10:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:10:1: C417 [**] Unnecessary `map` usage (rewrite using a generator expression) | 8 | dict(map(lambda v: [v, v**2], nums)) 9 | map(lambda: "const", nums) @@ -168,7 +168,7 @@ C417.py:10:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expres 12 12 | all(map(lambda v: isinstance(v, dict), nums)) 13 13 | filter(func, map(lambda v: v, nums)) -C417.py:11:13: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:11:13: C417 [**] Unnecessary `map` usage (rewrite using a generator expression) | 9 | map(lambda: "const", nums) 10 | map(lambda _: 3.0, nums) @@ -189,7 +189,7 @@ C417.py:11:13: C417 [*] Unnecessary `map` usage (rewrite using a generator expre 13 13 | filter(func, map(lambda v: v, nums)) 14 14 | list(map(lambda x, y: x * y, nums)) -C417.py:12:5: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:12:5: C417 [**] Unnecessary `map` usage (rewrite using a generator expression) | 10 | map(lambda _: 3.0, nums) 11 | _ = "".join(map(lambda x: x in nums and "1" or "0", range(123))) @@ -210,7 +210,7 @@ C417.py:12:5: C417 [*] Unnecessary `map` usage (rewrite using a generator expres 14 14 | list(map(lambda x, y: x * y, nums)) 15 15 | -C417.py:13:14: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:13:14: C417 [**] Unnecessary `map` usage (rewrite using a generator expression) | 11 | _ = "".join(map(lambda x: x in nums and "1" or "0", range(123))) 12 | all(map(lambda v: isinstance(v, dict), nums)) @@ -230,7 +230,7 @@ C417.py:13:14: C417 [*] Unnecessary `map` usage (rewrite using a generator expre 15 15 | 16 16 | # When inside f-string, then the fix should be surrounded by whitespace -C417.py:14:1: C417 [*] Unnecessary `map` usage (rewrite using a `list` comprehension) +C417.py:14:1: C417 [**] Unnecessary `map` usage (rewrite using a `list` comprehension) | 12 | all(map(lambda v: isinstance(v, dict), nums)) 13 | filter(func, map(lambda v: v, nums)) @@ -251,7 +251,7 @@ C417.py:14:1: C417 [*] Unnecessary `map` usage (rewrite using a `list` comprehen 16 16 | # When inside f-string, then the fix should be surrounded by whitespace 17 17 | _ = f"{set(map(lambda x: x % 2 == 0, nums))}" -C417.py:17:8: C417 [*] Unnecessary `map` usage (rewrite using a `set` comprehension) +C417.py:17:8: C417 [**] Unnecessary `map` usage (rewrite using a `set` comprehension) | 16 | # When inside f-string, then the fix should be surrounded by whitespace 17 | _ = f"{set(map(lambda x: x % 2 == 0, nums))}" @@ -270,7 +270,7 @@ C417.py:17:8: C417 [*] Unnecessary `map` usage (rewrite using a `set` comprehens 19 19 | 20 20 | # False negatives. -C417.py:18:8: C417 [*] Unnecessary `map` usage (rewrite using a `dict` comprehension) +C417.py:18:8: C417 [**] Unnecessary `map` usage (rewrite using a `dict` comprehension) | 16 | # When inside f-string, then the fix should be surrounded by whitespace 17 | _ = f"{set(map(lambda x: x % 2 == 0, nums))}" @@ -291,7 +291,7 @@ C417.py:18:8: C417 [*] Unnecessary `map` usage (rewrite using a `dict` comprehen 20 20 | # False negatives. 21 21 | map(lambda x=2, y=1: x + y, nums, nums) -C417.py:36:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:36:1: C417 [**] Unnecessary `map` usage (rewrite using a generator expression) | 35 | # Error: the `x` is overridden by the inner lambda. 36 | map(lambda x: lambda x: x, range(4)) @@ -311,7 +311,7 @@ C417.py:36:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expres 38 38 | # Ok because of the default parameters, and variadic arguments. 39 39 | map(lambda x=1: x, nums) -C417.py:47:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:47:1: C417 [**] Unnecessary `map` usage (rewrite using a generator expression) | 46 | # Regression test for: https://github.com/astral-sh/ruff/issues/7121 47 | map(lambda x: x, y if y else z) @@ -330,7 +330,7 @@ C417.py:47:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expres 48 48 | map(lambda x: x, (y if y else z)) 49 49 | map(lambda x: x, (x, y, z)) -C417.py:48:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:48:1: C417 [**] Unnecessary `map` usage (rewrite using a generator expression) | 46 | # Regression test for: https://github.com/astral-sh/ruff/issues/7121 47 | map(lambda x: x, y if y else z) @@ -348,7 +348,7 @@ C417.py:48:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expres 48 |+(x for x in (y if y else z)) 49 49 | map(lambda x: x, (x, y, z)) -C417.py:49:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:49:1: C417 [**] Unnecessary `map` usage (rewrite using a generator expression) | 47 | map(lambda x: x, y if y else z) 48 | map(lambda x: x, (y if y else z)) diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C418_C418.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C418_C418.py.snap index 301da13fcdfd54..905cc34bbfdf1a 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C418_C418.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C418_C418.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C418.py:1:1: C418 [*] Unnecessary `dict` literal passed to `dict()` (remove the outer call to `dict()`) +C418.py:1:1: C418 [**] Unnecessary `dict` literal passed to `dict()` (remove the outer call to `dict()`) | 1 | dict({}) | ^^^^^^^^ C418 @@ -17,7 +17,7 @@ C418.py:1:1: C418 [*] Unnecessary `dict` literal passed to `dict()` (remove the 3 3 | dict({'x': 1 for x in range(10)}) 4 4 | dict( -C418.py:2:1: C418 [*] Unnecessary `dict` literal passed to `dict()` (remove the outer call to `dict()`) +C418.py:2:1: C418 [**] Unnecessary `dict` literal passed to `dict()` (remove the outer call to `dict()`) | 1 | dict({}) 2 | dict({'a': 1}) @@ -35,7 +35,7 @@ C418.py:2:1: C418 [*] Unnecessary `dict` literal passed to `dict()` (remove the 4 4 | dict( 5 5 | {'x': 1 for x in range(10)} -C418.py:3:1: C418 [*] Unnecessary `dict` comprehension passed to `dict()` (remove the outer call to `dict()`) +C418.py:3:1: C418 [**] Unnecessary `dict` comprehension passed to `dict()` (remove the outer call to `dict()`) | 1 | dict({}) 2 | dict({'a': 1}) @@ -55,7 +55,7 @@ C418.py:3:1: C418 [*] Unnecessary `dict` comprehension passed to `dict()` (remov 5 5 | {'x': 1 for x in range(10)} 6 6 | ) -C418.py:4:1: C418 [*] Unnecessary `dict` comprehension passed to `dict()` (remove the outer call to `dict()`) +C418.py:4:1: C418 [**] Unnecessary `dict` comprehension passed to `dict()` (remove the outer call to `dict()`) | 2 | dict({'a': 1}) 3 | dict({'x': 1 for x in range(10)}) diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C419_C419.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C419_C419.py.snap index 611f4aac47e8f0..391c4c17b5546b 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C419_C419.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C419_C419.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs --- -C419.py:1:5: C419 [*] Unnecessary list comprehension. +C419.py:1:5: C419 [**] Unnecessary list comprehension. | 1 | any([x.id for x in bar]) | ^^^^^^^^^^^^^^^^^^^ C419 @@ -17,7 +17,7 @@ C419.py:1:5: C419 [*] Unnecessary list comprehension. 3 3 | any( # first comment 4 4 | [x.id for x in bar], # second comment -C419.py:2:5: C419 [*] Unnecessary list comprehension. +C419.py:2:5: C419 [**] Unnecessary list comprehension. | 1 | any([x.id for x in bar]) 2 | all([x.id for x in bar]) @@ -35,7 +35,7 @@ C419.py:2:5: C419 [*] Unnecessary list comprehension. 4 4 | [x.id for x in bar], # second comment 5 5 | ) # third comment -C419.py:4:5: C419 [*] Unnecessary list comprehension. +C419.py:4:5: C419 [**] Unnecessary list comprehension. | 2 | all([x.id for x in bar]) 3 | any( # first comment @@ -56,7 +56,7 @@ C419.py:4:5: C419 [*] Unnecessary list comprehension. 6 6 | all( # first comment 7 7 | [x.id for x in bar], # second comment -C419.py:7:5: C419 [*] Unnecessary list comprehension. +C419.py:7:5: C419 [**] Unnecessary list comprehension. | 5 | ) # third comment 6 | all( # first comment @@ -77,7 +77,7 @@ C419.py:7:5: C419 [*] Unnecessary list comprehension. 9 9 | any({x.id for x in bar}) 10 10 | -C419.py:9:5: C419 [*] Unnecessary list comprehension. +C419.py:9:5: C419 [**] Unnecessary list comprehension. | 7 | [x.id for x in bar], # second comment 8 | ) # third comment @@ -98,7 +98,7 @@ C419.py:9:5: C419 [*] Unnecessary list comprehension. 11 11 | # OK 12 12 | all(x.id for x in bar) -C419.py:24:5: C419 [*] Unnecessary list comprehension. +C419.py:24:5: C419 [**] Unnecessary list comprehension. | 22 | # Special comment handling 23 | any( @@ -133,7 +133,7 @@ C419.py:24:5: C419 [*] Unnecessary list comprehension. 31 30 | ) 32 31 | -C419.py:35:5: C419 [*] Unnecessary list comprehension. +C419.py:35:5: C419 [**] Unnecessary list comprehension. | 33 | # Weird case where the function call, opening bracket, and comment are all 34 | # on the same line. diff --git a/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__custom.snap b/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__custom.snap index d9722404823c55..ce7eedda001d3b 100644 --- a/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__custom.snap +++ b/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__custom.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_errmsg/mod.rs --- -EM.py:5:24: EM101 [*] Exception must not use a string literal, assign to variable first +EM.py:5:24: EM101 [**] Exception must not use a string literal, assign to variable first | 4 | def f_a(): 5 | raise RuntimeError("This is an example exception") @@ -20,7 +20,7 @@ EM.py:5:24: EM101 [*] Exception must not use a string literal, assign to variabl 7 8 | 8 9 | def f_a_short(): -EM.py:18:24: EM102 [*] Exception must not use an f-string literal, assign to variable first +EM.py:18:24: EM102 [**] Exception must not use an f-string literal, assign to variable first | 16 | def f_b(): 17 | example = "example" @@ -40,7 +40,7 @@ EM.py:18:24: EM102 [*] Exception must not use an f-string literal, assign to var 20 21 | 21 22 | def f_c(): -EM.py:22:24: EM103 [*] Exception must not use a `.format()` string directly, assign to variable first +EM.py:22:24: EM103 [**] Exception must not use a `.format()` string directly, assign to variable first | 21 | def f_c(): 22 | raise RuntimeError("This is an {example} exception".format(example="example")) @@ -68,7 +68,7 @@ EM.py:32:24: EM101 Exception must not use a string literal, assign to variable f | = help: Assign to variable; remove string literal -EM.py:39:24: EM101 [*] Exception must not use a string literal, assign to variable first +EM.py:39:24: EM101 [**] Exception must not use a string literal, assign to variable first | 37 | msg = "hello" 38 | @@ -96,7 +96,7 @@ EM.py:46:28: EM101 Exception must not use a string literal, assign to variable f | = help: Assign to variable; remove string literal -EM.py:51:28: EM101 [*] Exception must not use a string literal, assign to variable first +EM.py:51:28: EM101 [**] Exception must not use a string literal, assign to variable first | 49 | def f_fix_indentation_check(foo): 50 | if foo: @@ -118,7 +118,7 @@ EM.py:51:28: EM101 [*] Exception must not use a string literal, assign to variab 53 54 | if foo == "foo": 54 55 | raise RuntimeError(f"This is an exception: {foo}") -EM.py:54:32: EM102 [*] Exception must not use an f-string literal, assign to variable first +EM.py:54:32: EM102 [**] Exception must not use an f-string literal, assign to variable first | 52 | else: 53 | if foo == "foo": @@ -139,7 +139,7 @@ EM.py:54:32: EM102 [*] Exception must not use an f-string literal, assign to var 56 57 | 57 58 | -EM.py:55:24: EM103 [*] Exception must not use a `.format()` string directly, assign to variable first +EM.py:55:24: EM103 [**] Exception must not use a `.format()` string directly, assign to variable first | 53 | if foo == "foo": 54 | raise RuntimeError(f"This is an exception: {foo}") diff --git a/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__defaults.snap b/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__defaults.snap index 03784c23fcc1ff..a76e5193b7408d 100644 --- a/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__defaults.snap +++ b/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__defaults.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_errmsg/mod.rs --- -EM.py:5:24: EM101 [*] Exception must not use a string literal, assign to variable first +EM.py:5:24: EM101 [**] Exception must not use a string literal, assign to variable first | 4 | def f_a(): 5 | raise RuntimeError("This is an example exception") @@ -20,7 +20,7 @@ EM.py:5:24: EM101 [*] Exception must not use a string literal, assign to variabl 7 8 | 8 9 | def f_a_short(): -EM.py:9:24: EM101 [*] Exception must not use a string literal, assign to variable first +EM.py:9:24: EM101 [**] Exception must not use a string literal, assign to variable first | 8 | def f_a_short(): 9 | raise RuntimeError("Error") @@ -39,7 +39,7 @@ EM.py:9:24: EM101 [*] Exception must not use a string literal, assign to variabl 11 12 | 12 13 | def f_a_empty(): -EM.py:13:24: EM101 [*] Exception must not use a string literal, assign to variable first +EM.py:13:24: EM101 [**] Exception must not use a string literal, assign to variable first | 12 | def f_a_empty(): 13 | raise RuntimeError("") @@ -58,7 +58,7 @@ EM.py:13:24: EM101 [*] Exception must not use a string literal, assign to variab 15 16 | 16 17 | def f_b(): -EM.py:18:24: EM102 [*] Exception must not use an f-string literal, assign to variable first +EM.py:18:24: EM102 [**] Exception must not use an f-string literal, assign to variable first | 16 | def f_b(): 17 | example = "example" @@ -78,7 +78,7 @@ EM.py:18:24: EM102 [*] Exception must not use an f-string literal, assign to var 20 21 | 21 22 | def f_c(): -EM.py:22:24: EM103 [*] Exception must not use a `.format()` string directly, assign to variable first +EM.py:22:24: EM103 [**] Exception must not use a `.format()` string directly, assign to variable first | 21 | def f_c(): 22 | raise RuntimeError("This is an {example} exception".format(example="example")) @@ -106,7 +106,7 @@ EM.py:32:24: EM101 Exception must not use a string literal, assign to variable f | = help: Assign to variable; remove string literal -EM.py:39:24: EM101 [*] Exception must not use a string literal, assign to variable first +EM.py:39:24: EM101 [**] Exception must not use a string literal, assign to variable first | 37 | msg = "hello" 38 | @@ -134,7 +134,7 @@ EM.py:46:28: EM101 Exception must not use a string literal, assign to variable f | = help: Assign to variable; remove string literal -EM.py:51:28: EM101 [*] Exception must not use a string literal, assign to variable first +EM.py:51:28: EM101 [**] Exception must not use a string literal, assign to variable first | 49 | def f_fix_indentation_check(foo): 50 | if foo: @@ -156,7 +156,7 @@ EM.py:51:28: EM101 [*] Exception must not use a string literal, assign to variab 53 54 | if foo == "foo": 54 55 | raise RuntimeError(f"This is an exception: {foo}") -EM.py:54:32: EM102 [*] Exception must not use an f-string literal, assign to variable first +EM.py:54:32: EM102 [**] Exception must not use an f-string literal, assign to variable first | 52 | else: 53 | if foo == "foo": @@ -177,7 +177,7 @@ EM.py:54:32: EM102 [*] Exception must not use an f-string literal, assign to var 56 57 | 57 58 | -EM.py:55:24: EM103 [*] Exception must not use a `.format()` string directly, assign to variable first +EM.py:55:24: EM103 [**] Exception must not use a `.format()` string directly, assign to variable first | 53 | if foo == "foo": 54 | raise RuntimeError(f"This is an exception: {foo}") diff --git a/crates/ruff_linter/src/rules/flake8_import_conventions/snapshots/ruff_linter__rules__flake8_import_conventions__tests__defaults.snap b/crates/ruff_linter/src/rules/flake8_import_conventions/snapshots/ruff_linter__rules__flake8_import_conventions__tests__defaults.snap index 848b339416991e..08e073cad421aa 100644 --- a/crates/ruff_linter/src/rules/flake8_import_conventions/snapshots/ruff_linter__rules__flake8_import_conventions__tests__defaults.snap +++ b/crates/ruff_linter/src/rules/flake8_import_conventions/snapshots/ruff_linter__rules__flake8_import_conventions__tests__defaults.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_import_conventions/mod.rs --- -defaults.py:6:12: ICN001 [*] `altair` should be imported as `alt` +defaults.py:6:12: ICN001 [**] `altair` should be imported as `alt` | 5 | def unconventional(): 6 | import altair @@ -32,7 +32,7 @@ defaults.py:7:12: ICN001 `matplotlib.pyplot` should be imported as `plt` | = help: Alias `matplotlib.pyplot` to `plt` -defaults.py:8:12: ICN001 [*] `numpy` should be imported as `np` +defaults.py:8:12: ICN001 [**] `numpy` should be imported as `np` | 6 | import altair 7 | import matplotlib.pyplot @@ -53,7 +53,7 @@ defaults.py:8:12: ICN001 [*] `numpy` should be imported as `np` 10 10 | import seaborn 11 11 | import tkinter -defaults.py:9:12: ICN001 [*] `pandas` should be imported as `pd` +defaults.py:9:12: ICN001 [**] `pandas` should be imported as `pd` | 7 | import matplotlib.pyplot 8 | import numpy @@ -74,7 +74,7 @@ defaults.py:9:12: ICN001 [*] `pandas` should be imported as `pd` 11 11 | import tkinter 12 12 | import networkx -defaults.py:10:12: ICN001 [*] `seaborn` should be imported as `sns` +defaults.py:10:12: ICN001 [**] `seaborn` should be imported as `sns` | 8 | import numpy 9 | import pandas @@ -95,7 +95,7 @@ defaults.py:10:12: ICN001 [*] `seaborn` should be imported as `sns` 12 12 | import networkx 13 13 | -defaults.py:11:12: ICN001 [*] `tkinter` should be imported as `tk` +defaults.py:11:12: ICN001 [**] `tkinter` should be imported as `tk` | 9 | import pandas 10 | import seaborn @@ -115,7 +115,7 @@ defaults.py:11:12: ICN001 [*] `tkinter` should be imported as `tk` 13 13 | 14 14 | -defaults.py:12:12: ICN001 [*] `networkx` should be imported as `nx` +defaults.py:12:12: ICN001 [**] `networkx` should be imported as `nx` | 10 | import seaborn 11 | import tkinter @@ -134,7 +134,7 @@ defaults.py:12:12: ICN001 [*] `networkx` should be imported as `nx` 14 14 | 15 15 | def unconventional_aliases(): -defaults.py:16:22: ICN001 [*] `altair` should be imported as `alt` +defaults.py:16:22: ICN001 [**] `altair` should be imported as `alt` | 15 | def unconventional_aliases(): 16 | import altair as altr @@ -154,7 +154,7 @@ defaults.py:16:22: ICN001 [*] `altair` should be imported as `alt` 18 18 | import numpy as nmp 19 19 | import pandas as pdas -defaults.py:17:33: ICN001 [*] `matplotlib.pyplot` should be imported as `plt` +defaults.py:17:33: ICN001 [**] `matplotlib.pyplot` should be imported as `plt` | 15 | def unconventional_aliases(): 16 | import altair as altr @@ -175,7 +175,7 @@ defaults.py:17:33: ICN001 [*] `matplotlib.pyplot` should be imported as `plt` 19 19 | import pandas as pdas 20 20 | import seaborn as sbrn -defaults.py:18:21: ICN001 [*] `numpy` should be imported as `np` +defaults.py:18:21: ICN001 [**] `numpy` should be imported as `np` | 16 | import altair as altr 17 | import matplotlib.pyplot as plot @@ -196,7 +196,7 @@ defaults.py:18:21: ICN001 [*] `numpy` should be imported as `np` 20 20 | import seaborn as sbrn 21 21 | import tkinter as tkr -defaults.py:19:22: ICN001 [*] `pandas` should be imported as `pd` +defaults.py:19:22: ICN001 [**] `pandas` should be imported as `pd` | 17 | import matplotlib.pyplot as plot 18 | import numpy as nmp @@ -217,7 +217,7 @@ defaults.py:19:22: ICN001 [*] `pandas` should be imported as `pd` 21 21 | import tkinter as tkr 22 22 | import networkx as nxy -defaults.py:20:23: ICN001 [*] `seaborn` should be imported as `sns` +defaults.py:20:23: ICN001 [**] `seaborn` should be imported as `sns` | 18 | import numpy as nmp 19 | import pandas as pdas @@ -238,7 +238,7 @@ defaults.py:20:23: ICN001 [*] `seaborn` should be imported as `sns` 22 22 | import networkx as nxy 23 23 | -defaults.py:21:23: ICN001 [*] `tkinter` should be imported as `tk` +defaults.py:21:23: ICN001 [**] `tkinter` should be imported as `tk` | 19 | import pandas as pdas 20 | import seaborn as sbrn @@ -258,7 +258,7 @@ defaults.py:21:23: ICN001 [*] `tkinter` should be imported as `tk` 23 23 | 24 24 | def conventional_aliases(): -defaults.py:22:24: ICN001 [*] `networkx` should be imported as `nx` +defaults.py:22:24: ICN001 [**] `networkx` should be imported as `nx` | 20 | import seaborn as sbrn 21 | import tkinter as tkr diff --git a/crates/ruff_linter/src/rules/flake8_import_conventions/snapshots/ruff_linter__rules__flake8_import_conventions__tests__tricky.snap b/crates/ruff_linter/src/rules/flake8_import_conventions/snapshots/ruff_linter__rules__flake8_import_conventions__tests__tricky.snap index 2078183e505c37..252120ec89f60f 100644 --- a/crates/ruff_linter/src/rules/flake8_import_conventions/snapshots/ruff_linter__rules__flake8_import_conventions__tests__tricky.snap +++ b/crates/ruff_linter/src/rules/flake8_import_conventions/snapshots/ruff_linter__rules__flake8_import_conventions__tests__tricky.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_import_conventions/mod.rs --- -tricky.py:7:16: ICN001 [*] `pandas` should be imported as `pd` +tricky.py:7:16: ICN001 [**] `pandas` should be imported as `pd` | 5 | try: 6 | global pandas diff --git a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG001_LOG001.py.snap b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG001_LOG001.py.snap index c7ee37c94cd0d0..89848002abf6e8 100644 --- a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG001_LOG001.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG001_LOG001.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_logging/mod.rs --- -LOG001.py:3:1: LOG001 [*] Use `logging.getLogger()` to instantiate loggers +LOG001.py:3:1: LOG001 [**] Use `logging.getLogger()` to instantiate loggers | 1 | import logging 2 | @@ -20,7 +20,7 @@ LOG001.py:3:1: LOG001 [*] Use `logging.getLogger()` to instantiate loggers 4 4 | logging.Logger() 5 5 | logging.getLogger(__name__) -LOG001.py:4:1: LOG001 [*] Use `logging.getLogger()` to instantiate loggers +LOG001.py:4:1: LOG001 [**] Use `logging.getLogger()` to instantiate loggers | 3 | logging.Logger(__name__) 4 | logging.Logger() diff --git a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG002_LOG002.py.snap b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG002_LOG002.py.snap index e208e94121730c..97d557a0e4ede4 100644 --- a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG002_LOG002.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG002_LOG002.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_logging/mod.rs --- -LOG002.py:11:11: LOG002 [*] Use `__name__` with `logging.getLogger()` +LOG002.py:11:11: LOG002 [**] Use `__name__` with `logging.getLogger()` | 10 | # LOG002 11 | getLogger(__file__) @@ -20,7 +20,7 @@ LOG002.py:11:11: LOG002 [*] Use `__name__` with `logging.getLogger()` 13 13 | 14 14 | logging.getLogger(__cached__) -LOG002.py:12:24: LOG002 [*] Use `__name__` with `logging.getLogger()` +LOG002.py:12:24: LOG002 [**] Use `__name__` with `logging.getLogger()` | 10 | # LOG002 11 | getLogger(__file__) @@ -41,7 +41,7 @@ LOG002.py:12:24: LOG002 [*] Use `__name__` with `logging.getLogger()` 14 14 | logging.getLogger(__cached__) 15 15 | getLogger(name=__cached__) -LOG002.py:14:19: LOG002 [*] Use `__name__` with `logging.getLogger()` +LOG002.py:14:19: LOG002 [**] Use `__name__` with `logging.getLogger()` | 12 | logging.getLogger(name=__file__) 13 | @@ -61,7 +61,7 @@ LOG002.py:14:19: LOG002 [*] Use `__name__` with `logging.getLogger()` 16 16 | 17 17 | -LOG002.py:15:16: LOG002 [*] Use `__name__` with `logging.getLogger()` +LOG002.py:15:16: LOG002 [**] Use `__name__` with `logging.getLogger()` | 14 | logging.getLogger(__cached__) 15 | getLogger(name=__cached__) diff --git a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG009_LOG009.py.snap b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG009_LOG009.py.snap index a31c6a2b1c3026..cdb3eea8da60b0 100644 --- a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG009_LOG009.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG009_LOG009.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_logging/mod.rs --- -LOG009.py:3:1: LOG009 [*] Use of undocumented `logging.WARN` constant +LOG009.py:3:1: LOG009 [**] Use of undocumented `logging.WARN` constant | 1 | import logging 2 | @@ -20,7 +20,7 @@ LOG009.py:3:1: LOG009 [*] Use of undocumented `logging.WARN` constant 5 5 | 6 6 | from logging import WARN, WARNING -LOG009.py:8:1: LOG009 [*] Use of undocumented `logging.WARN` constant +LOG009.py:8:1: LOG009 [**] Use of undocumented `logging.WARN` constant | 6 | from logging import WARN, WARNING 7 | diff --git a/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE794_PIE794.py.snap b/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE794_PIE794.py.snap index d67d3cfe87648a..f4d83912bcb455 100644 --- a/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE794_PIE794.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE794_PIE794.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pie/mod.rs --- -PIE794.py:4:5: PIE794 [*] Class field `name` is defined multiple times +PIE794.py:4:5: PIE794 [**] Class field `name` is defined multiple times | 2 | name = StringField() 3 | # .... @@ -21,7 +21,7 @@ PIE794.py:4:5: PIE794 [*] Class field `name` is defined multiple times 6 5 | def remove(self) -> None: 7 6 | ... -PIE794.py:13:5: PIE794 [*] Class field `name` is defined multiple times +PIE794.py:13:5: PIE794 [**] Class field `name` is defined multiple times | 11 | name: str = StringField() 12 | # .... @@ -41,7 +41,7 @@ PIE794.py:13:5: PIE794 [*] Class field `name` is defined multiple times 15 14 | def foo(self) -> None: 16 15 | ... -PIE794.py:23:5: PIE794 [*] Class field `bar` is defined multiple times +PIE794.py:23:5: PIE794 [**] Class field `bar` is defined multiple times | 21 | foo: bool = BooleanField() 22 | # ... @@ -59,7 +59,7 @@ PIE794.py:23:5: PIE794 [*] Class field `bar` is defined multiple times 25 24 | 26 25 | class User(BaseModel): -PIE794.py:40:5: PIE794 [*] Class field `bar` is defined multiple times +PIE794.py:40:5: PIE794 [**] Class field `bar` is defined multiple times | 38 | foo: bool = BooleanField() 39 | # ... diff --git a/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE810_PIE810.py.snap b/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE810_PIE810.py.snap index a889297249da7f..7c92f7fc64a966 100644 --- a/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE810_PIE810.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE810_PIE810.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pie/mod.rs --- -PIE810.py:2:1: PIE810 [*] Call `startswith` once with a `tuple` +PIE810.py:2:1: PIE810 [**] Call `startswith` once with a `tuple` | 1 | # error 2 | obj.startswith("foo") or obj.startswith("bar") @@ -19,7 +19,7 @@ PIE810.py:2:1: PIE810 [*] Call `startswith` once with a `tuple` 4 4 | obj.endswith("foo") or obj.endswith("bar") 5 5 | # error -PIE810.py:4:1: PIE810 [*] Call `endswith` once with a `tuple` +PIE810.py:4:1: PIE810 [**] Call `endswith` once with a `tuple` | 2 | obj.startswith("foo") or obj.startswith("bar") 3 | # error @@ -40,7 +40,7 @@ PIE810.py:4:1: PIE810 [*] Call `endswith` once with a `tuple` 6 6 | obj.startswith(foo) or obj.startswith(bar) 7 7 | # error -PIE810.py:6:1: PIE810 [*] Call `startswith` once with a `tuple` +PIE810.py:6:1: PIE810 [**] Call `startswith` once with a `tuple` | 4 | obj.endswith("foo") or obj.endswith("bar") 5 | # error @@ -61,7 +61,7 @@ PIE810.py:6:1: PIE810 [*] Call `startswith` once with a `tuple` 8 8 | obj.startswith(foo) or obj.startswith("foo") 9 9 | # error -PIE810.py:8:1: PIE810 [*] Call `startswith` once with a `tuple` +PIE810.py:8:1: PIE810 [**] Call `startswith` once with a `tuple` | 6 | obj.startswith(foo) or obj.startswith(bar) 7 | # error @@ -82,7 +82,7 @@ PIE810.py:8:1: PIE810 [*] Call `startswith` once with a `tuple` 10 10 | obj.endswith(foo) or obj.startswith(foo) or obj.startswith("foo") 11 11 | -PIE810.py:10:1: PIE810 [*] Call `startswith` once with a `tuple` +PIE810.py:10:1: PIE810 [**] Call `startswith` once with a `tuple` | 8 | obj.startswith(foo) or obj.startswith("foo") 9 | # error diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI010_PYI010.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI010_PYI010.pyi.snap index b68bdf828cfc92..9d9b9f1b047ba3 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI010_PYI010.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI010_PYI010.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs --- -PYI010.pyi:6:5: PYI010 [*] Function body must contain only `...` +PYI010.pyi:6:5: PYI010 [**] Function body must contain only `...` | 5 | def buzz(): 6 | print("buzz") # ERROR PYI010 @@ -21,7 +21,7 @@ PYI010.pyi:6:5: PYI010 [*] Function body must contain only `...` 8 8 | def foo2(): 9 9 | 123 # ERROR PYI010 -PYI010.pyi:9:5: PYI010 [*] Function body must contain only `...` +PYI010.pyi:9:5: PYI010 [**] Function body must contain only `...` | 8 | def foo2(): 9 | 123 # ERROR PYI010 @@ -41,7 +41,7 @@ PYI010.pyi:9:5: PYI010 [*] Function body must contain only `...` 11 11 | def bizz(): 12 12 | x = 123 # ERROR PYI010 -PYI010.pyi:12:5: PYI010 [*] Function body must contain only `...` +PYI010.pyi:12:5: PYI010 [**] Function body must contain only `...` | 11 | def bizz(): 12 | x = 123 # ERROR PYI010 diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI011_PYI011.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI011_PYI011.pyi.snap index b883a369b29150..7ad588162d68d4 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI011_PYI011.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI011_PYI011.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs --- -PYI011.pyi:10:14: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:10:14: PYI011 [**] Only simple default values allowed for typed arguments | 8 | def f12( 9 | x, @@ -22,7 +22,7 @@ PYI011.pyi:10:14: PYI011 [*] Only simple default values allowed for typed argume 12 12 | def f11(*, x: str = "x") -> None: ... # OK 13 13 | def f13( -PYI011.pyi:38:9: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:38:9: PYI011 [**] Only simple default values allowed for typed arguments | 36 | x: dict[ 37 | int, int @@ -50,7 +50,7 @@ PYI011.pyi:38:9: PYI011 [*] Only simple default values allowed for typed argumen 43 40 | def f153( 44 41 | x: list[ -PYI011.pyi:46:9: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:46:9: PYI011 [**] Only simple default values allowed for typed arguments | 44 | x: list[ 45 | int @@ -96,7 +96,7 @@ PYI011.pyi:46:9: PYI011 [*] Only simple default values allowed for typed argumen 60 48 | def f154( 61 49 | x: tuple[ -PYI011.pyi:63:9: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:63:9: PYI011 [**] Only simple default values allowed for typed arguments | 61 | x: tuple[ 62 | str, tuple[str, ...] @@ -124,7 +124,7 @@ PYI011.pyi:63:9: PYI011 [*] Only simple default values allowed for typed argumen 68 65 | def f141( 69 66 | x: list[ -PYI011.pyi:71:9: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:71:9: PYI011 [**] Only simple default values allowed for typed arguments | 69 | x: list[ 70 | int @@ -150,7 +150,7 @@ PYI011.pyi:71:9: PYI011 [*] Only simple default values allowed for typed argumen 75 73 | def f142( 76 74 | x: list[ -PYI011.pyi:78:9: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:78:9: PYI011 [**] Only simple default values allowed for typed arguments | 76 | x: list[ 77 | int @@ -176,7 +176,7 @@ PYI011.pyi:78:9: PYI011 [*] Only simple default values allowed for typed argumen 82 80 | def f16( 83 81 | x: frozenset[ -PYI011.pyi:85:9: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:85:9: PYI011 [**] Only simple default values allowed for typed arguments | 83 | x: frozenset[ 84 | bytes @@ -202,7 +202,7 @@ PYI011.pyi:85:9: PYI011 [*] Only simple default values allowed for typed argumen 89 87 | def f17( 90 88 | x: str = "foo" # Error PYI011 Only simple default values allowed for typed arguments -PYI011.pyi:90:14: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:90:14: PYI011 [**] Only simple default values allowed for typed arguments | 88 | ) -> None: ... 89 | def f17( @@ -226,7 +226,7 @@ PYI011.pyi:90:14: PYI011 [*] Only simple default values allowed for typed argume 93 92 | def f18( 94 93 | x: str = b"foo" # Error PYI011 Only simple default values allowed for typed arguments -PYI011.pyi:94:14: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:94:14: PYI011 [**] Only simple default values allowed for typed arguments | 92 | ) -> None: ... 93 | def f18( @@ -250,7 +250,7 @@ PYI011.pyi:94:14: PYI011 [*] Only simple default values allowed for typed argume 97 96 | def f19( 98 97 | x: object = "foo" # Error PYI011 Only simple default values allowed for typed arguments -PYI011.pyi:98:17: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:98:17: PYI011 [**] Only simple default values allowed for typed arguments | 96 | ) -> None: ... 97 | def f19( @@ -274,7 +274,7 @@ PYI011.pyi:98:17: PYI011 [*] Only simple default values allowed for typed argume 101 100 | def f20( 102 101 | x: int = 5 -PYI011.pyi:102:14: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:102:14: PYI011 [**] Only simple default values allowed for typed arguments | 100 | ) -> None: ... 101 | def f20( @@ -298,7 +298,7 @@ PYI011.pyi:102:14: PYI011 [*] Only simple default values allowed for typed argum 105 104 | def f21( 106 105 | x: complex = 3j -PYI011.pyi:106:18: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:106:18: PYI011 [**] Only simple default values allowed for typed arguments | 104 | ) -> None: ... 105 | def f21( @@ -322,7 +322,7 @@ PYI011.pyi:106:18: PYI011 [*] Only simple default values allowed for typed argum 109 108 | def f22( 110 109 | x: complex = -42.5j # Error PYI011 Only simple default values allowed for typed arguments -PYI011.pyi:110:18: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:110:18: PYI011 [**] Only simple default values allowed for typed arguments | 108 | ) -> None: ... 109 | def f22( @@ -346,7 +346,7 @@ PYI011.pyi:110:18: PYI011 [*] Only simple default values allowed for typed argum 113 112 | def f23( 114 113 | x: bool = True, # OK -PYI011.pyi:138:16: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:138:16: PYI011 [**] Only simple default values allowed for typed arguments | 136 | ) -> None: ... 137 | def f31( @@ -367,7 +367,7 @@ PYI011.pyi:138:16: PYI011 [*] Only simple default values allowed for typed argum 140 140 | def f32( 141 141 | x: float = np.inf, # Error PYI011 Only simple default values allowed for typed arguments -PYI011.pyi:141:16: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:141:16: PYI011 [**] Only simple default values allowed for typed arguments | 139 | ) -> None: ... 140 | def f32( @@ -388,7 +388,7 @@ PYI011.pyi:141:16: PYI011 [*] Only simple default values allowed for typed argum 143 143 | def f33( 144 144 | x: float = math.nan, # OK -PYI011.pyi:147:16: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:147:16: PYI011 [**] Only simple default values allowed for typed arguments | 145 | ) -> None: ... 146 | def f34( @@ -409,7 +409,7 @@ PYI011.pyi:147:16: PYI011 [*] Only simple default values allowed for typed argum 149 149 | def f35( 150 150 | x: complex = math.inf # Error PYI011 Only simple default values allowed for typed arguments -PYI011.pyi:150:18: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:150:18: PYI011 [**] Only simple default values allowed for typed arguments | 148 | ) -> None: ... 149 | def f35( @@ -433,7 +433,7 @@ PYI011.pyi:150:18: PYI011 [*] Only simple default values allowed for typed argum 153 152 | def f36( 154 153 | *, -PYI011.pyi:159:14: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:159:14: PYI011 [**] Only simple default values allowed for typed arguments | 157 | def f37( 158 | *, diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI014_PYI014.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI014_PYI014.pyi.snap index f16400fffca02c..ff1de2843e87ea 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI014_PYI014.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI014_PYI014.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs --- -PYI014.pyi:3:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:3:7: PYI014 [**] Only simple default values allowed for arguments | 1 | def f12( 2 | x, @@ -21,7 +21,7 @@ PYI014.pyi:3:7: PYI014 [*] Only simple default values allowed for arguments 5 5 | def f11(*, x="x") -> None: ... # OK 6 6 | def f13( -PYI014.pyi:29:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:29:7: PYI014 [**] Only simple default values allowed for arguments | 27 | def f151(x={1: 2}) -> None: ... 28 | def f152( @@ -49,7 +49,7 @@ PYI014.pyi:29:7: PYI014 [*] Only simple default values allowed for arguments 34 31 | def f153( 35 32 | x=[ # Error PYI014 -PYI014.pyi:35:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:35:7: PYI014 [**] Only simple default values allowed for arguments | 33 | ) -> None: ... 34 | def f153( @@ -95,7 +95,7 @@ PYI014.pyi:35:7: PYI014 [*] Only simple default values allowed for arguments 49 37 | def f154( 50 38 | x=( # Error PYI014 -PYI014.pyi:50:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:50:7: PYI014 [**] Only simple default values allowed for arguments | 48 | ) -> None: ... 49 | def f154( @@ -123,7 +123,7 @@ PYI014.pyi:50:7: PYI014 [*] Only simple default values allowed for arguments 55 52 | def f141( 56 53 | x=[*range(10)], # Error PYI014 -PYI014.pyi:56:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:56:7: PYI014 [**] Only simple default values allowed for arguments | 54 | ) -> None: ... 55 | def f141( @@ -144,7 +144,7 @@ PYI014.pyi:56:7: PYI014 [*] Only simple default values allowed for arguments 58 58 | def f142( 59 59 | x=list(range(10)), # Error PYI014 -PYI014.pyi:59:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:59:7: PYI014 [**] Only simple default values allowed for arguments | 57 | ) -> None: ... 58 | def f142( @@ -165,7 +165,7 @@ PYI014.pyi:59:7: PYI014 [*] Only simple default values allowed for arguments 61 61 | def f16(x=frozenset({b"foo", b"bar", b"baz"})) -> None: ... # Error PYI014 62 62 | def f17( -PYI014.pyi:61:11: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:61:11: PYI014 [**] Only simple default values allowed for arguments | 59 | x=list(range(10)), # Error PYI014 60 | ) -> None: ... @@ -186,7 +186,7 @@ PYI014.pyi:61:11: PYI014 [*] Only simple default values allowed for arguments 63 63 | x="foo" + "bar", # Error PYI014 64 64 | ) -> None: ... -PYI014.pyi:63:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:63:7: PYI014 [**] Only simple default values allowed for arguments | 61 | def f16(x=frozenset({b"foo", b"bar", b"baz"})) -> None: ... # Error PYI014 62 | def f17( @@ -207,7 +207,7 @@ PYI014.pyi:63:7: PYI014 [*] Only simple default values allowed for arguments 65 65 | def f18( 66 66 | x=b"foo" + b"bar", # Error PYI014 -PYI014.pyi:66:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:66:7: PYI014 [**] Only simple default values allowed for arguments | 64 | ) -> None: ... 65 | def f18( @@ -228,7 +228,7 @@ PYI014.pyi:66:7: PYI014 [*] Only simple default values allowed for arguments 68 68 | def f19( 69 69 | x="foo" + 4, # Error PYI014 -PYI014.pyi:69:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:69:7: PYI014 [**] Only simple default values allowed for arguments | 67 | ) -> None: ... 68 | def f19( @@ -249,7 +249,7 @@ PYI014.pyi:69:7: PYI014 [*] Only simple default values allowed for arguments 71 71 | def f20( 72 72 | x=5 + 5, # Error PYI014 -PYI014.pyi:72:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:72:7: PYI014 [**] Only simple default values allowed for arguments | 70 | ) -> None: ... 71 | def f20( @@ -270,7 +270,7 @@ PYI014.pyi:72:7: PYI014 [*] Only simple default values allowed for arguments 74 74 | def f21( 75 75 | x=3j - 3j, # Error PYI014 -PYI014.pyi:75:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:75:7: PYI014 [**] Only simple default values allowed for arguments | 73 | ) -> None: ... 74 | def f21( @@ -291,7 +291,7 @@ PYI014.pyi:75:7: PYI014 [*] Only simple default values allowed for arguments 77 77 | def f22( 78 78 | x=-42.5j + 4.3j, # Error PYI014 -PYI014.pyi:78:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:78:7: PYI014 [**] Only simple default values allowed for arguments | 76 | ) -> None: ... 77 | def f22( diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI015_PYI015.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI015_PYI015.pyi.snap index a083c72f1b07e9..0f39d6cdc1781a 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI015_PYI015.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI015_PYI015.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs --- -PYI015.pyi:44:23: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:44:23: PYI015 [**] Only simple default values allowed for assignments | 43 | # We *should* emit Y015 for more complex default values 44 | field221: list[int] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] # Y015 Only simple default values are allowed for assignments @@ -21,7 +21,7 @@ PYI015.pyi:44:23: PYI015 [*] Only simple default values allowed for assignments 46 46 | field224: list[int] = list(range(10)) # Y015 Only simple default values are allowed for assignments 47 47 | field225: list[object] = [{}, 1, 2] # Y015 Only simple default values are allowed for assignments -PYI015.pyi:45:23: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:45:23: PYI015 [**] Only simple default values allowed for assignments | 43 | # We *should* emit Y015 for more complex default values 44 | field221: list[int] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] # Y015 Only simple default values are allowed for assignments @@ -42,7 +42,7 @@ PYI015.pyi:45:23: PYI015 [*] Only simple default values allowed for assignments 47 47 | field225: list[object] = [{}, 1, 2] # Y015 Only simple default values are allowed for assignments 48 48 | field226: tuple[str | tuple[str, ...], ...] = ("foo", ("foo", "bar")) # Y015 Only simple default values are allowed for assignments -PYI015.pyi:46:23: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:46:23: PYI015 [**] Only simple default values allowed for assignments | 44 | field221: list[int] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] # Y015 Only simple default values are allowed for assignments 45 | field223: list[int] = [*range(10)] # Y015 Only simple default values are allowed for assignments @@ -63,7 +63,7 @@ PYI015.pyi:46:23: PYI015 [*] Only simple default values allowed for assignments 48 48 | field226: tuple[str | tuple[str, ...], ...] = ("foo", ("foo", "bar")) # Y015 Only simple default values are allowed for assignments 49 49 | field227: dict[str, object] = {"foo": {"foo": "bar"}} # Y015 Only simple default values are allowed for assignments -PYI015.pyi:47:26: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:47:26: PYI015 [**] Only simple default values allowed for assignments | 45 | field223: list[int] = [*range(10)] # Y015 Only simple default values are allowed for assignments 46 | field224: list[int] = list(range(10)) # Y015 Only simple default values are allowed for assignments @@ -84,7 +84,7 @@ PYI015.pyi:47:26: PYI015 [*] Only simple default values allowed for assignments 49 49 | field227: dict[str, object] = {"foo": {"foo": "bar"}} # Y015 Only simple default values are allowed for assignments 50 50 | field228: dict[str, list[object]] = {"foo": []} # Y015 Only simple default values are allowed for assignments -PYI015.pyi:48:47: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:48:47: PYI015 [**] Only simple default values allowed for assignments | 46 | field224: list[int] = list(range(10)) # Y015 Only simple default values are allowed for assignments 47 | field225: list[object] = [{}, 1, 2] # Y015 Only simple default values are allowed for assignments @@ -105,7 +105,7 @@ PYI015.pyi:48:47: PYI015 [*] Only simple default values allowed for assignments 50 50 | field228: dict[str, list[object]] = {"foo": []} # Y015 Only simple default values are allowed for assignments 51 51 | # When parsed, this case results in `None` being placed in the `.keys` list for the `ast.Dict` node -PYI015.pyi:49:31: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:49:31: PYI015 [**] Only simple default values allowed for assignments | 47 | field225: list[object] = [{}, 1, 2] # Y015 Only simple default values are allowed for assignments 48 | field226: tuple[str | tuple[str, ...], ...] = ("foo", ("foo", "bar")) # Y015 Only simple default values are allowed for assignments @@ -126,7 +126,7 @@ PYI015.pyi:49:31: PYI015 [*] Only simple default values allowed for assignments 51 51 | # When parsed, this case results in `None` being placed in the `.keys` list for the `ast.Dict` node 52 52 | field229: dict[int, int] = {1: 2, **{3: 4}} # Y015 Only simple default values are allowed for assignments -PYI015.pyi:50:37: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:50:37: PYI015 [**] Only simple default values allowed for assignments | 48 | field226: tuple[str | tuple[str, ...], ...] = ("foo", ("foo", "bar")) # Y015 Only simple default values are allowed for assignments 49 | field227: dict[str, object] = {"foo": {"foo": "bar"}} # Y015 Only simple default values are allowed for assignments @@ -147,7 +147,7 @@ PYI015.pyi:50:37: PYI015 [*] Only simple default values allowed for assignments 52 52 | field229: dict[int, int] = {1: 2, **{3: 4}} # Y015 Only simple default values are allowed for assignments 53 53 | field23 = "foo" + "bar" # Y015 Only simple default values are allowed for assignments -PYI015.pyi:52:28: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:52:28: PYI015 [**] Only simple default values allowed for assignments | 50 | field228: dict[str, list[object]] = {"foo": []} # Y015 Only simple default values are allowed for assignments 51 | # When parsed, this case results in `None` being placed in the `.keys` list for the `ast.Dict` node @@ -168,7 +168,7 @@ PYI015.pyi:52:28: PYI015 [*] Only simple default values allowed for assignments 54 54 | field24 = b"foo" + b"bar" # Y015 Only simple default values are allowed for assignments 55 55 | field25 = 5 * 5 # Y015 Only simple default values are allowed for assignments -PYI015.pyi:53:11: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:53:11: PYI015 [**] Only simple default values allowed for assignments | 51 | # When parsed, this case results in `None` being placed in the `.keys` list for the `ast.Dict` node 52 | field229: dict[int, int] = {1: 2, **{3: 4}} # Y015 Only simple default values are allowed for assignments @@ -189,7 +189,7 @@ PYI015.pyi:53:11: PYI015 [*] Only simple default values allowed for assignments 55 55 | field25 = 5 * 5 # Y015 Only simple default values are allowed for assignments 56 56 | -PYI015.pyi:54:11: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:54:11: PYI015 [**] Only simple default values allowed for assignments | 52 | field229: dict[int, int] = {1: 2, **{3: 4}} # Y015 Only simple default values are allowed for assignments 53 | field23 = "foo" + "bar" # Y015 Only simple default values are allowed for assignments @@ -209,7 +209,7 @@ PYI015.pyi:54:11: PYI015 [*] Only simple default values allowed for assignments 56 56 | 57 57 | # We shouldn't emit Y015 within functions -PYI015.pyi:55:11: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:55:11: PYI015 [**] Only simple default values allowed for assignments | 53 | field23 = "foo" + "bar" # Y015 Only simple default values are allowed for assignments 54 | field24 = b"foo" + b"bar" # Y015 Only simple default values are allowed for assignments diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025.py.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025.py.snap index 2bebd50a8dc7f1..6dfbae238029c8 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs --- -PYI025.py:10:33: PYI025 [*] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin +PYI025.py:10:33: PYI025 [**] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin | 9 | def f(): 10 | from collections.abc import Set # PYI025 @@ -19,7 +19,7 @@ PYI025.py:10:33: PYI025 [*] Use `from collections.abc import Set as AbstractSet` 12 12 | 13 13 | def f(): -PYI025.py:14:51: PYI025 [*] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin +PYI025.py:14:51: PYI025 [**] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin | 13 | def f(): 14 | from collections.abc import Container, Sized, Set, ValuesView # PYI025 diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025.pyi.snap index 51afedd7f8bf5b..eddc77c2f84d03 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs --- -PYI025.pyi:8:33: PYI025 [*] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin +PYI025.pyi:8:33: PYI025 [**] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin | 7 | def f(): 8 | from collections.abc import Set # PYI025 @@ -21,7 +21,7 @@ PYI025.pyi:8:33: PYI025 [*] Use `from collections.abc import Set as AbstractSet` 10 10 | def f(): 11 11 | from collections.abc import Container, Sized, Set, ValuesView # PYI025 -PYI025.pyi:11:51: PYI025 [*] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin +PYI025.pyi:11:51: PYI025 [**] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin | 10 | def f(): 11 | from collections.abc import Container, Sized, Set, ValuesView # PYI025 @@ -41,7 +41,7 @@ PYI025.pyi:11:51: PYI025 [*] Use `from collections.abc import Set as AbstractSet 13 13 | def f(): 14 14 | """Test: local symbol renaming.""" -PYI025.pyi:16:37: PYI025 [*] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin +PYI025.pyi:16:37: PYI025 [**] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin | 14 | """Test: local symbol renaming.""" 15 | if True: @@ -76,7 +76,7 @@ PYI025.pyi:16:37: PYI025 [*] Use `from collections.abc import Set as AbstractSet 29 29 | def Set(): 30 30 | pass -PYI025.pyi:33:29: PYI025 [*] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin +PYI025.pyi:33:29: PYI025 [**] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin | 31 | print(Set) 32 | @@ -119,7 +119,7 @@ PYI025.pyi:33:29: PYI025 [*] Use `from collections.abc import Set as AbstractSet 42 42 | def f(): 43 43 | """Test: nonlocal symbol renaming.""" -PYI025.pyi:44:33: PYI025 [*] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin +PYI025.pyi:44:33: PYI025 [**] Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin | 42 | def f(): 43 | """Test: nonlocal symbol renaming.""" diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI026_PYI026.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI026_PYI026.pyi.snap index b4c117f2ecf495..9b4336a552813b 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI026_PYI026.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI026_PYI026.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs --- -PYI026.pyi:3:1: PYI026 [*] Use `typing.TypeAlias` for type alias, e.g., `NewAny: TypeAlias = Any` +PYI026.pyi:3:1: PYI026 [**] Use `typing.TypeAlias` for type alias, e.g., `NewAny: TypeAlias = Any` | 1 | from typing import Literal, Any 2 | @@ -22,7 +22,7 @@ PYI026.pyi:3:1: PYI026 [*] Use `typing.TypeAlias` for type alias, e.g., `NewAny: 5 5 | Foo = Literal["foo"] 6 6 | IntOrStr = int | str -PYI026.pyi:4:1: PYI026 [*] Use `typing.TypeAlias` for type alias, e.g., `OptionalStr: TypeAlias = typing.Optional[str]` +PYI026.pyi:4:1: PYI026 [**] Use `typing.TypeAlias` for type alias, e.g., `OptionalStr: TypeAlias = typing.Optional[str]` | 3 | NewAny = Any 4 | OptionalStr = typing.Optional[str] @@ -43,7 +43,7 @@ PYI026.pyi:4:1: PYI026 [*] Use `typing.TypeAlias` for type alias, e.g., `Optiona 6 6 | IntOrStr = int | str 7 7 | AliasNone = None -PYI026.pyi:5:1: PYI026 [*] Use `typing.TypeAlias` for type alias, e.g., `Foo: TypeAlias = Literal["foo"]` +PYI026.pyi:5:1: PYI026 [**] Use `typing.TypeAlias` for type alias, e.g., `Foo: TypeAlias = Literal["foo"]` | 3 | NewAny = Any 4 | OptionalStr = typing.Optional[str] @@ -66,7 +66,7 @@ PYI026.pyi:5:1: PYI026 [*] Use `typing.TypeAlias` for type alias, e.g., `Foo: Ty 7 7 | AliasNone = None 8 8 | -PYI026.pyi:6:1: PYI026 [*] Use `typing.TypeAlias` for type alias, e.g., `IntOrStr: TypeAlias = int | str` +PYI026.pyi:6:1: PYI026 [**] Use `typing.TypeAlias` for type alias, e.g., `IntOrStr: TypeAlias = int | str` | 4 | OptionalStr = typing.Optional[str] 5 | Foo = Literal["foo"] @@ -89,7 +89,7 @@ PYI026.pyi:6:1: PYI026 [*] Use `typing.TypeAlias` for type alias, e.g., `IntOrSt 8 8 | 9 9 | NewAny: typing.TypeAlias = Any -PYI026.pyi:7:1: PYI026 [*] Use `typing.TypeAlias` for type alias, e.g., `AliasNone: TypeAlias = None` +PYI026.pyi:7:1: PYI026 [**] Use `typing.TypeAlias` for type alias, e.g., `AliasNone: TypeAlias = None` | 5 | Foo = Literal["foo"] 6 | IntOrStr = int | str diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI053_PYI053.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI053_PYI053.pyi.snap index 5b9f3aa1a13323..7488435b6245e7 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI053_PYI053.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI053_PYI053.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs --- -PYI053.pyi:3:14: PYI053 [*] String and bytes literals longer than 50 characters are not permitted +PYI053.pyi:3:14: PYI053 [**] String and bytes literals longer than 50 characters are not permitted | 1 | def f1(x: str = "50 character stringggggggggggggggggggggggggggggggg") -> None: ... # OK 2 | def f2( @@ -21,7 +21,7 @@ PYI053.pyi:3:14: PYI053 [*] String and bytes literals longer than 50 characters 5 5 | def f3( 6 6 | x: str = "50 character stringgggggggggggggggggggggggggggggg\U0001f600", # OK -PYI053.pyi:9:14: PYI053 [*] String and bytes literals longer than 50 characters are not permitted +PYI053.pyi:9:14: PYI053 [**] String and bytes literals longer than 50 characters are not permitted | 7 | ) -> None: ... 8 | def f4( @@ -42,7 +42,7 @@ PYI053.pyi:9:14: PYI053 [*] String and bytes literals longer than 50 characters 11 11 | def f5( 12 12 | x: bytes = b"50 character byte stringgggggggggggggggggggggggggg", # OK -PYI053.pyi:21:16: PYI053 [*] String and bytes literals longer than 50 characters are not permitted +PYI053.pyi:21:16: PYI053 [**] String and bytes literals longer than 50 characters are not permitted | 19 | ) -> None: ... 20 | def f8( @@ -62,7 +62,7 @@ PYI053.pyi:21:16: PYI053 [*] String and bytes literals longer than 50 characters 23 23 | 24 24 | foo: str = "50 character stringggggggggggggggggggggggggggggggg" # OK -PYI053.pyi:26:12: PYI053 [*] String and bytes literals longer than 50 characters are not permitted +PYI053.pyi:26:12: PYI053 [**] String and bytes literals longer than 50 characters are not permitted | 24 | foo: str = "50 character stringggggggggggggggggggggggggggggggg" # OK 25 | @@ -83,7 +83,7 @@ PYI053.pyi:26:12: PYI053 [*] String and bytes literals longer than 50 characters 28 28 | baz: bytes = b"50 character byte stringgggggggggggggggggggggggggg" # OK 29 29 | -PYI053.pyi:30:14: PYI053 [*] String and bytes literals longer than 50 characters are not permitted +PYI053.pyi:30:14: PYI053 [**] String and bytes literals longer than 50 characters are not permitted | 28 | baz: bytes = b"50 character byte stringgggggggggggggggggggggggggg" # OK 29 | diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI054_PYI054.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI054_PYI054.pyi.snap index 7db8611cad8e8f..7739a08fa8e974 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI054_PYI054.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI054_PYI054.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs --- -PYI054.pyi:2:16: PYI054 [*] Numeric literals with a string representation longer than ten characters are not permitted +PYI054.pyi:2:16: PYI054 [**] Numeric literals with a string representation longer than ten characters are not permitted | 1 | field01: int = 0xFFFFFFFF 2 | field02: int = 0xFFFFFFFFF # Error: PYI054 @@ -19,7 +19,7 @@ PYI054.pyi:2:16: PYI054 [*] Numeric literals with a string representation longer 4 4 | field04: int = -0xFFFFFFFFF # Error: PYI054 5 5 | -PYI054.pyi:4:17: PYI054 [*] Numeric literals with a string representation longer than ten characters are not permitted +PYI054.pyi:4:17: PYI054 [**] Numeric literals with a string representation longer than ten characters are not permitted | 2 | field02: int = 0xFFFFFFFFF # Error: PYI054 3 | field03: int = -0xFFFFFFFF @@ -40,7 +40,7 @@ PYI054.pyi:4:17: PYI054 [*] Numeric literals with a string representation longer 6 6 | field05: int = 1234567890 7 7 | field06: int = 12_456_890 -PYI054.pyi:8:16: PYI054 [*] Numeric literals with a string representation longer than ten characters are not permitted +PYI054.pyi:8:16: PYI054 [**] Numeric literals with a string representation longer than ten characters are not permitted | 6 | field05: int = 1234567890 7 | field06: int = 12_456_890 @@ -61,7 +61,7 @@ PYI054.pyi:8:16: PYI054 [*] Numeric literals with a string representation longer 10 10 | field09: int = -234_567_890 # Error: PYI054 11 11 | -PYI054.pyi:10:17: PYI054 [*] Numeric literals with a string representation longer than ten characters are not permitted +PYI054.pyi:10:17: PYI054 [**] Numeric literals with a string representation longer than ten characters are not permitted | 8 | field07: int = 12345678901 # Error: PYI054 9 | field08: int = -1234567801 @@ -82,7 +82,7 @@ PYI054.pyi:10:17: PYI054 [*] Numeric literals with a string representation longe 12 12 | field10: float = 123.456789 13 13 | field11: float = 123.4567890 # Error: PYI054 -PYI054.pyi:13:18: PYI054 [*] Numeric literals with a string representation longer than ten characters are not permitted +PYI054.pyi:13:18: PYI054 [**] Numeric literals with a string representation longer than ten characters are not permitted | 12 | field10: float = 123.456789 13 | field11: float = 123.4567890 # Error: PYI054 @@ -102,7 +102,7 @@ PYI054.pyi:13:18: PYI054 [*] Numeric literals with a string representation longe 15 15 | field13: float = -123.567_890 # Error: PYI054 16 16 | -PYI054.pyi:15:19: PYI054 [*] Numeric literals with a string representation longer than ten characters are not permitted +PYI054.pyi:15:19: PYI054 [**] Numeric literals with a string representation longer than ten characters are not permitted | 13 | field11: float = 123.4567890 # Error: PYI054 14 | field12: float = -123.456789 @@ -123,7 +123,7 @@ PYI054.pyi:15:19: PYI054 [*] Numeric literals with a string representation longe 17 17 | field14: complex = 1e1234567j 18 18 | field15: complex = 1e12345678j # Error: PYI054 -PYI054.pyi:18:20: PYI054 [*] Numeric literals with a string representation longer than ten characters are not permitted +PYI054.pyi:18:20: PYI054 [**] Numeric literals with a string representation longer than ten characters are not permitted | 17 | field14: complex = 1e1234567j 18 | field15: complex = 1e12345678j # Error: PYI054 @@ -142,7 +142,7 @@ PYI054.pyi:18:20: PYI054 [*] Numeric literals with a string representation longe 19 19 | field16: complex = -1e1234567j 20 20 | field17: complex = 1e123456789j # Error: PYI054 -PYI054.pyi:20:20: PYI054 [*] Numeric literals with a string representation longer than ten characters are not permitted +PYI054.pyi:20:20: PYI054 [**] Numeric literals with a string representation longer than ten characters are not permitted | 18 | field15: complex = 1e12345678j # Error: PYI054 19 | field16: complex = -1e1234567j diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__py38_PYI026_PYI026.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__py38_PYI026_PYI026.pyi.snap index f8db4ff1b26124..c961b4bc0c325e 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__py38_PYI026_PYI026.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__py38_PYI026_PYI026.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs --- -PYI026.pyi:3:1: PYI026 [*] Use `typing_extensions.TypeAlias` for type alias, e.g., `NewAny: TypeAlias = Any` +PYI026.pyi:3:1: PYI026 [**] Use `typing_extensions.TypeAlias` for type alias, e.g., `NewAny: TypeAlias = Any` | 1 | from typing import Literal, Any 2 | @@ -22,7 +22,7 @@ PYI026.pyi:3:1: PYI026 [*] Use `typing_extensions.TypeAlias` for type alias, e.g 5 6 | Foo = Literal["foo"] 6 7 | IntOrStr = int | str -PYI026.pyi:4:1: PYI026 [*] Use `typing_extensions.TypeAlias` for type alias, e.g., `OptionalStr: TypeAlias = typing.Optional[str]` +PYI026.pyi:4:1: PYI026 [**] Use `typing_extensions.TypeAlias` for type alias, e.g., `OptionalStr: TypeAlias = typing.Optional[str]` | 3 | NewAny = Any 4 | OptionalStr = typing.Optional[str] @@ -43,7 +43,7 @@ PYI026.pyi:4:1: PYI026 [*] Use `typing_extensions.TypeAlias` for type alias, e.g 6 7 | IntOrStr = int | str 7 8 | AliasNone = None -PYI026.pyi:5:1: PYI026 [*] Use `typing_extensions.TypeAlias` for type alias, e.g., `Foo: TypeAlias = Literal["foo"]` +PYI026.pyi:5:1: PYI026 [**] Use `typing_extensions.TypeAlias` for type alias, e.g., `Foo: TypeAlias = Literal["foo"]` | 3 | NewAny = Any 4 | OptionalStr = typing.Optional[str] @@ -66,7 +66,7 @@ PYI026.pyi:5:1: PYI026 [*] Use `typing_extensions.TypeAlias` for type alias, e.g 7 8 | AliasNone = None 8 9 | -PYI026.pyi:6:1: PYI026 [*] Use `typing_extensions.TypeAlias` for type alias, e.g., `IntOrStr: TypeAlias = int | str` +PYI026.pyi:6:1: PYI026 [**] Use `typing_extensions.TypeAlias` for type alias, e.g., `IntOrStr: TypeAlias = int | str` | 4 | OptionalStr = typing.Optional[str] 5 | Foo = Literal["foo"] @@ -89,7 +89,7 @@ PYI026.pyi:6:1: PYI026 [*] Use `typing_extensions.TypeAlias` for type alias, e.g 8 9 | 9 10 | NewAny: typing.TypeAlias = Any -PYI026.pyi:7:1: PYI026 [*] Use `typing_extensions.TypeAlias` for type alias, e.g., `AliasNone: TypeAlias = None` +PYI026.pyi:7:1: PYI026 [**] Use `typing_extensions.TypeAlias` for type alias, e.g., `AliasNone: TypeAlias = None` | 5 | Foo = Literal["foo"] 6 | IntOrStr = int | str diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT003.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT003.snap index ceb7e0f5b16328..1ce38d70571ab4 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT003.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT003.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs --- -PT003.py:14:17: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` +PT003.py:14:17: PT003 [**] `scope='function'` is implied in `@pytest.fixture()` | 14 | @pytest.fixture(scope="function") | ^^^^^^^^^^^^^^^^ PT003 @@ -20,7 +20,7 @@ PT003.py:14:17: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` 16 16 | ... 17 17 | -PT003.py:19:17: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` +PT003.py:19:17: PT003 [**] `scope='function'` is implied in `@pytest.fixture()` | 19 | @pytest.fixture(scope="function", name="my_fixture") | ^^^^^^^^^^^^^^^^ PT003 @@ -39,7 +39,7 @@ PT003.py:19:17: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` 21 21 | ... 22 22 | -PT003.py:24:36: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` +PT003.py:24:36: PT003 [**] `scope='function'` is implied in `@pytest.fixture()` | 24 | @pytest.fixture(name="my_fixture", scope="function") | ^^^^^^^^^^^^^^^^ PT003 @@ -58,7 +58,7 @@ PT003.py:24:36: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` 26 26 | ... 27 27 | -PT003.py:29:36: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` +PT003.py:29:36: PT003 [**] `scope='function'` is implied in `@pytest.fixture()` | 29 | @pytest.fixture(name="my_fixture", scope="function", **kwargs) | ^^^^^^^^^^^^^^^^ PT003 @@ -77,7 +77,7 @@ PT003.py:29:36: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` 31 31 | ... 32 32 | -PT003.py:37:31: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` +PT003.py:37:31: PT003 [**] `scope='function'` is implied in `@pytest.fixture()` | 35 | # tests the general case as we use a helper function that should 36 | # work for all cases. @@ -98,7 +98,7 @@ PT003.py:37:31: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` 39 39 | ... 40 40 | -PT003.py:43:5: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` +PT003.py:43:5: PT003 [**] `scope='function'` is implied in `@pytest.fixture()` | 42 | @pytest.fixture( 43 | scope="function", @@ -117,7 +117,7 @@ PT003.py:43:5: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` 45 44 | ) 46 45 | def error_multiple_args(): -PT003.py:52:5: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` +PT003.py:52:5: PT003 [**] `scope='function'` is implied in `@pytest.fixture()` | 50 | @pytest.fixture( 51 | name="my_fixture", @@ -137,7 +137,7 @@ PT003.py:52:5: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` 54 53 | def error_multiple_args(): 55 54 | ... -PT003.py:66:5: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` +PT003.py:66:5: PT003 [**] `scope='function'` is implied in `@pytest.fixture()` | 64 | # another comment ,) 65 | diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT006_csv.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT006_csv.snap index 1399986a40c656..fe881db1ddda1f 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT006_csv.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT006_csv.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs --- -PT006.py:24:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` +PT006.py:24:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` | 24 | @pytest.mark.parametrize(("param1", "param2"), [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^^^^^^ PT006 @@ -39,7 +39,7 @@ PT006.py:29:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expe 31 31 | ... 32 32 | -PT006.py:34:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` +PT006.py:34:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` | 34 | @pytest.mark.parametrize(["param1", "param2"], [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^^^^^^ PT006 diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT006_default.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT006_default.snap index c9e8b5e0c50016..3beec6ca92d639 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT006_default.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT006_default.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs --- -PT006.py:9:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` +PT006.py:9:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 9 | @pytest.mark.parametrize("param1,param2", [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^ PT006 @@ -20,7 +20,7 @@ PT006.py:9:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expec 11 11 | ... 12 12 | -PT006.py:14:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` +PT006.py:14:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 14 | @pytest.mark.parametrize(" param1, , param2 , ", [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PT006 @@ -39,7 +39,7 @@ PT006.py:14:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expe 16 16 | ... 17 17 | -PT006.py:19:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` +PT006.py:19:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 19 | @pytest.mark.parametrize("param1,param2", [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^ PT006 @@ -77,7 +77,7 @@ PT006.py:29:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expe 31 31 | ... 32 32 | -PT006.py:34:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` +PT006.py:34:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 34 | @pytest.mark.parametrize(["param1", "param2"], [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^^^^^^ PT006 @@ -115,7 +115,7 @@ PT006.py:39:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expe 41 41 | ... 42 42 | -PT006.py:44:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` +PT006.py:44:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 44 | @pytest.mark.parametrize([some_expr, another_expr], [1, 2, 3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^ PT006 @@ -134,7 +134,7 @@ PT006.py:44:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expe 46 46 | ... 47 47 | -PT006.py:49:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` +PT006.py:49:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 49 | @pytest.mark.parametrize([some_expr, "param2"], [1, 2, 3]) | ^^^^^^^^^^^^^^^^^^^^^ PT006 @@ -153,7 +153,7 @@ PT006.py:49:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expe 51 51 | ... 52 52 | -PT006.py:54:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` +PT006.py:54:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 54 | @pytest.mark.parametrize(("param1, " "param2, " "param3"), [(1, 2, 3), (4, 5, 6)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PT006 @@ -172,7 +172,7 @@ PT006.py:54:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expe 56 56 | ... 57 57 | -PT006.py:59:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` +PT006.py:59:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 59 | @pytest.mark.parametrize("param1, " "param2, " "param3", [(1, 2, 3), (4, 5, 6)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PT006 @@ -191,7 +191,7 @@ PT006.py:59:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expe 61 61 | ... 62 62 | -PT006.py:64:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` +PT006.py:64:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 64 | @pytest.mark.parametrize((("param1, " "param2, " "param3")), [(1, 2, 3), (4, 5, 6)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PT006 @@ -210,7 +210,7 @@ PT006.py:64:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expe 66 66 | ... 67 67 | -PT006.py:69:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` +PT006.py:69:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 69 | @pytest.mark.parametrize(("param1,param2"), [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^^^ PT006 diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT006_list.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT006_list.snap index bdce72095b1a4c..5d65f77d6536bf 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT006_list.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT006_list.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs --- -PT006.py:9:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` +PT006.py:9:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` | 9 | @pytest.mark.parametrize("param1,param2", [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^ PT006 @@ -20,7 +20,7 @@ PT006.py:9:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expec 11 11 | ... 12 12 | -PT006.py:14:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` +PT006.py:14:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` | 14 | @pytest.mark.parametrize(" param1, , param2 , ", [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PT006 @@ -39,7 +39,7 @@ PT006.py:14:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expe 16 16 | ... 17 17 | -PT006.py:19:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` +PT006.py:19:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` | 19 | @pytest.mark.parametrize("param1,param2", [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^ PT006 @@ -58,7 +58,7 @@ PT006.py:19:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expe 21 21 | ... 22 22 | -PT006.py:24:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` +PT006.py:24:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` | 24 | @pytest.mark.parametrize(("param1", "param2"), [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^^^^^^ PT006 @@ -115,7 +115,7 @@ PT006.py:39:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expe 41 41 | ... 42 42 | -PT006.py:54:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` +PT006.py:54:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` | 54 | @pytest.mark.parametrize(("param1, " "param2, " "param3"), [(1, 2, 3), (4, 5, 6)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PT006 @@ -134,7 +134,7 @@ PT006.py:54:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expe 56 56 | ... 57 57 | -PT006.py:59:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` +PT006.py:59:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` | 59 | @pytest.mark.parametrize("param1, " "param2, " "param3", [(1, 2, 3), (4, 5, 6)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PT006 @@ -153,7 +153,7 @@ PT006.py:59:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expe 61 61 | ... 62 62 | -PT006.py:64:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` +PT006.py:64:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` | 64 | @pytest.mark.parametrize((("param1, " "param2, " "param3")), [(1, 2, 3), (4, 5, 6)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PT006 @@ -172,7 +172,7 @@ PT006.py:64:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expe 66 66 | ... 67 67 | -PT006.py:69:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` +PT006.py:69:26: PT006 [**] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` | 69 | @pytest.mark.parametrize(("param1,param2"), [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^^^ PT006 diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT009.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT009.snap index 9b4b7fc1e426a8..6e1cbcde1b2682 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT009.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT009.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs --- -PT009.py:11:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` +PT009.py:11:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertTrue` | 9 | expr = 1 10 | msg = "Must be True" @@ -22,7 +22,7 @@ PT009.py:11:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 13 13 | self.assertTrue(expr, msg) # Error 14 14 | self.assertTrue(expr=expr, msg=msg) # Error -PT009.py:12:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` +PT009.py:12:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertTrue` | 10 | msg = "Must be True" 11 | self.assertTrue(expr) # Error @@ -43,7 +43,7 @@ PT009.py:12:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 14 14 | self.assertTrue(expr=expr, msg=msg) # Error 15 15 | self.assertTrue(msg=msg, expr=expr) # Error -PT009.py:13:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` +PT009.py:13:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertTrue` | 11 | self.assertTrue(expr) # Error 12 | self.assertTrue(expr=expr) # Error @@ -64,7 +64,7 @@ PT009.py:13:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 15 15 | self.assertTrue(msg=msg, expr=expr) # Error 16 16 | self.assertTrue(*(expr, msg)) # Error, unfixable -PT009.py:14:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` +PT009.py:14:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertTrue` | 12 | self.assertTrue(expr=expr) # Error 13 | self.assertTrue(expr, msg) # Error @@ -85,7 +85,7 @@ PT009.py:14:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 16 16 | self.assertTrue(*(expr, msg)) # Error, unfixable 17 17 | self.assertTrue(**{"expr": expr, "msg": msg}) # Error, unfixable -PT009.py:15:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` +PT009.py:15:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertTrue` | 13 | self.assertTrue(expr, msg) # Error 14 | self.assertTrue(expr=expr, msg=msg) # Error @@ -183,7 +183,7 @@ PT009.py:25:16: PT009 Use a regular `assert` instead of unittest-style `assertEq | = help: Replace `assertEqual(...)` with `assert ...` -PT009.py:28:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertFalse` +PT009.py:28:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertFalse` | 27 | def test_assert_false(self): 28 | self.assertFalse(True) # Error @@ -203,7 +203,7 @@ PT009.py:28:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 30 30 | def test_assert_equal(self): 31 31 | self.assertEqual(1, 2) # Error -PT009.py:31:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertEqual` +PT009.py:31:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertEqual` | 30 | def test_assert_equal(self): 31 | self.assertEqual(1, 2) # Error @@ -223,7 +223,7 @@ PT009.py:31:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 33 33 | def test_assert_not_equal(self): 34 34 | self.assertNotEqual(1, 1) # Error -PT009.py:34:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertNotEqual` +PT009.py:34:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertNotEqual` | 33 | def test_assert_not_equal(self): 34 | self.assertNotEqual(1, 1) # Error @@ -243,7 +243,7 @@ PT009.py:34:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 36 36 | def test_assert_greater(self): 37 37 | self.assertGreater(1, 2) # Error -PT009.py:37:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertGreater` +PT009.py:37:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertGreater` | 36 | def test_assert_greater(self): 37 | self.assertGreater(1, 2) # Error @@ -263,7 +263,7 @@ PT009.py:37:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 39 39 | def test_assert_greater_equal(self): 40 40 | self.assertGreaterEqual(1, 2) # Error -PT009.py:40:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertGreaterEqual` +PT009.py:40:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertGreaterEqual` | 39 | def test_assert_greater_equal(self): 40 | self.assertGreaterEqual(1, 2) # Error @@ -283,7 +283,7 @@ PT009.py:40:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 42 42 | def test_assert_less(self): 43 43 | self.assertLess(2, 1) # Error -PT009.py:43:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertLess` +PT009.py:43:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertLess` | 42 | def test_assert_less(self): 43 | self.assertLess(2, 1) # Error @@ -303,7 +303,7 @@ PT009.py:43:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 45 45 | def test_assert_less_equal(self): 46 46 | self.assertLessEqual(1, 2) # Error -PT009.py:46:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertLessEqual` +PT009.py:46:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertLessEqual` | 45 | def test_assert_less_equal(self): 46 | self.assertLessEqual(1, 2) # Error @@ -323,7 +323,7 @@ PT009.py:46:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 48 48 | def test_assert_in(self): 49 49 | self.assertIn(1, [2, 3]) # Error -PT009.py:49:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIn` +PT009.py:49:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertIn` | 48 | def test_assert_in(self): 49 | self.assertIn(1, [2, 3]) # Error @@ -343,7 +343,7 @@ PT009.py:49:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 51 51 | def test_assert_not_in(self): 52 52 | self.assertNotIn(2, [2, 3]) # Error -PT009.py:52:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertNotIn` +PT009.py:52:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertNotIn` | 51 | def test_assert_not_in(self): 52 | self.assertNotIn(2, [2, 3]) # Error @@ -363,7 +363,7 @@ PT009.py:52:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 54 54 | def test_assert_is_none(self): 55 55 | self.assertIsNone(0) # Error -PT009.py:55:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIsNone` +PT009.py:55:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertIsNone` | 54 | def test_assert_is_none(self): 55 | self.assertIsNone(0) # Error @@ -383,7 +383,7 @@ PT009.py:55:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 57 57 | def test_assert_is_not_none(self): 58 58 | self.assertIsNotNone(0) # Error -PT009.py:58:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIsNotNone` +PT009.py:58:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertIsNotNone` | 57 | def test_assert_is_not_none(self): 58 | self.assertIsNotNone(0) # Error @@ -403,7 +403,7 @@ PT009.py:58:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 60 60 | def test_assert_is(self): 61 61 | self.assertIs([], []) # Error -PT009.py:61:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIs` +PT009.py:61:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertIs` | 60 | def test_assert_is(self): 61 | self.assertIs([], []) # Error @@ -423,7 +423,7 @@ PT009.py:61:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 63 63 | def test_assert_is_not(self): 64 64 | self.assertIsNot(1, 1) # Error -PT009.py:64:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIsNot` +PT009.py:64:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertIsNot` | 63 | def test_assert_is_not(self): 64 | self.assertIsNot(1, 1) # Error @@ -443,7 +443,7 @@ PT009.py:64:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 66 66 | def test_assert_is_instance(self): 67 67 | self.assertIsInstance(1, str) # Error -PT009.py:67:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIsInstance` +PT009.py:67:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertIsInstance` | 66 | def test_assert_is_instance(self): 67 | self.assertIsInstance(1, str) # Error @@ -463,7 +463,7 @@ PT009.py:67:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 69 69 | def test_assert_is_not_instance(self): 70 70 | self.assertNotIsInstance(1, int) # Error -PT009.py:70:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertNotIsInstance` +PT009.py:70:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertNotIsInstance` | 69 | def test_assert_is_not_instance(self): 70 | self.assertNotIsInstance(1, int) # Error @@ -483,7 +483,7 @@ PT009.py:70:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 72 72 | def test_assert_regex(self): 73 73 | self.assertRegex("abc", r"def") # Error -PT009.py:73:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertRegex` +PT009.py:73:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertRegex` | 72 | def test_assert_regex(self): 73 | self.assertRegex("abc", r"def") # Error @@ -503,7 +503,7 @@ PT009.py:73:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 75 75 | def test_assert_not_regex(self): 76 76 | self.assertNotRegex("abc", r"abc") # Error -PT009.py:76:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertNotRegex` +PT009.py:76:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertNotRegex` | 75 | def test_assert_not_regex(self): 76 | self.assertNotRegex("abc", r"abc") # Error @@ -523,7 +523,7 @@ PT009.py:76:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 78 78 | def test_assert_regexp_matches(self): 79 79 | self.assertRegexpMatches("abc", r"def") # Error -PT009.py:79:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertRegexpMatches` +PT009.py:79:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertRegexpMatches` | 78 | def test_assert_regexp_matches(self): 79 | self.assertRegexpMatches("abc", r"def") # Error @@ -543,7 +543,7 @@ PT009.py:79:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 81 81 | def test_assert_not_regexp_matches(self): 82 82 | self.assertNotRegex("abc", r"abc") # Error -PT009.py:82:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertNotRegex` +PT009.py:82:9: PT009 [**] Use a regular `assert` instead of unittest-style `assertNotRegex` | 81 | def test_assert_not_regexp_matches(self): 82 | self.assertNotRegex("abc", r"abc") # Error @@ -563,7 +563,7 @@ PT009.py:82:9: PT009 [*] Use a regular `assert` instead of unittest-style `asser 84 84 | def test_fail_if(self): 85 85 | self.failIf("abc") # Error -PT009.py:85:9: PT009 [*] Use a regular `assert` instead of unittest-style `failIf` +PT009.py:85:9: PT009 [**] Use a regular `assert` instead of unittest-style `failIf` | 84 | def test_fail_if(self): 85 | self.failIf("abc") # Error @@ -583,7 +583,7 @@ PT009.py:85:9: PT009 [*] Use a regular `assert` instead of unittest-style `failI 87 87 | def test_fail_unless(self): 88 88 | self.failUnless("abc") # Error -PT009.py:88:9: PT009 [*] Use a regular `assert` instead of unittest-style `failUnless` +PT009.py:88:9: PT009 [**] Use a regular `assert` instead of unittest-style `failUnless` | 87 | def test_fail_unless(self): 88 | self.failUnless("abc") # Error @@ -603,7 +603,7 @@ PT009.py:88:9: PT009 [*] Use a regular `assert` instead of unittest-style `failU 90 90 | def test_fail_unless_equal(self): 91 91 | self.failUnlessEqual(1, 2) # Error -PT009.py:91:9: PT009 [*] Use a regular `assert` instead of unittest-style `failUnlessEqual` +PT009.py:91:9: PT009 [**] Use a regular `assert` instead of unittest-style `failUnlessEqual` | 90 | def test_fail_unless_equal(self): 91 | self.failUnlessEqual(1, 2) # Error @@ -623,7 +623,7 @@ PT009.py:91:9: PT009 [*] Use a regular `assert` instead of unittest-style `failU 93 93 | def test_fail_if_equal(self): 94 94 | self.failIfEqual(1, 2) # Error -PT009.py:94:9: PT009 [*] Use a regular `assert` instead of unittest-style `failIfEqual` +PT009.py:94:9: PT009 [**] Use a regular `assert` instead of unittest-style `failIfEqual` | 93 | def test_fail_if_equal(self): 94 | self.failIfEqual(1, 2) # Error @@ -641,7 +641,7 @@ PT009.py:94:9: PT009 [*] Use a regular `assert` instead of unittest-style `failI 96 96 | 97 97 | # Regression test for: https://github.com/astral-sh/ruff/issues/7455#issuecomment-1722459517 -PT009.py:98:2: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` +PT009.py:98:2: PT009 [**] Use a regular `assert` instead of unittest-style `assertTrue` | 97 | # Regression test for: https://github.com/astral-sh/ruff/issues/7455#issuecomment-1722459517 98 | (self.assertTrue( diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT014.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT014.snap index 2e05167b05b057..eb0a428b93070f 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT014.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT014.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs --- -PT014.py:4:35: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.parametrize` +PT014.py:4:35: PT014 [**] Duplicate of test case at index 0 in `@pytest_mark.parametrize` | 4 | @pytest.mark.parametrize("x", [1, 1, 2]) | ^ PT014 @@ -20,7 +20,7 @@ PT014.py:4:35: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.para 6 6 | ... 7 7 | -PT014.py:14:35: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.parametrize` +PT014.py:14:35: PT014 [**] Duplicate of test case at index 0 in `@pytest_mark.parametrize` | 14 | @pytest.mark.parametrize("x", [a, a, b, b, b, c]) | ^ PT014 @@ -39,7 +39,7 @@ PT014.py:14:35: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.par 16 16 | ... 17 17 | -PT014.py:14:41: PT014 [*] Duplicate of test case at index 2 in `@pytest_mark.parametrize` +PT014.py:14:41: PT014 [**] Duplicate of test case at index 2 in `@pytest_mark.parametrize` | 14 | @pytest.mark.parametrize("x", [a, a, b, b, b, c]) | ^ PT014 @@ -58,7 +58,7 @@ PT014.py:14:41: PT014 [*] Duplicate of test case at index 2 in `@pytest_mark.par 16 16 | ... 17 17 | -PT014.py:14:44: PT014 [*] Duplicate of test case at index 2 in `@pytest_mark.parametrize` +PT014.py:14:44: PT014 [**] Duplicate of test case at index 2 in `@pytest_mark.parametrize` | 14 | @pytest.mark.parametrize("x", [a, a, b, b, b, c]) | ^ PT014 @@ -88,7 +88,7 @@ PT014.py:24:9: PT014 Duplicate of test case at index 0 in `@pytest_mark.parametr | = help: Remove duplicate test case -PT014.py:32:39: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.parametrize` +PT014.py:32:39: PT014 [**] Duplicate of test case at index 0 in `@pytest_mark.parametrize` | 32 | @pytest.mark.parametrize("x", [a, b, (a), c, ((a))]) | ^ PT014 @@ -107,7 +107,7 @@ PT014.py:32:39: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.par 34 34 | ... 35 35 | -PT014.py:32:48: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.parametrize` +PT014.py:32:48: PT014 [**] Duplicate of test case at index 0 in `@pytest_mark.parametrize` | 32 | @pytest.mark.parametrize("x", [a, b, (a), c, ((a))]) | ^ PT014 @@ -126,7 +126,7 @@ PT014.py:32:48: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.par 34 34 | ... 35 35 | -PT014.py:42:10: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.parametrize` +PT014.py:42:10: PT014 [**] Duplicate of test case at index 0 in `@pytest_mark.parametrize` | 40 | a, 41 | b, @@ -146,7 +146,7 @@ PT014.py:42:10: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.par 44 43 | ((a)), 45 44 | ], -PT014.py:44:11: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.parametrize` +PT014.py:44:11: PT014 [**] Duplicate of test case at index 0 in `@pytest_mark.parametrize` | 42 | (a), 43 | c, diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT018.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT018.snap index a656a5c666f59e..9b30576ed2281b 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT018.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT018.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs --- -PT018.py:14:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:14:5: PT018 [**] Assertion should be broken down into multiple parts | 13 | def test_error(): 14 | assert something and something_else @@ -22,7 +22,7 @@ PT018.py:14:5: PT018 [*] Assertion should be broken down into multiple parts 16 17 | assert something and not something_else 17 18 | assert something and (something_else or something_third) -PT018.py:15:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:15:5: PT018 [**] Assertion should be broken down into multiple parts | 13 | def test_error(): 14 | assert something and something_else @@ -44,7 +44,7 @@ PT018.py:15:5: PT018 [*] Assertion should be broken down into multiple parts 17 18 | assert something and (something_else or something_third) 18 19 | assert not something and something_else -PT018.py:16:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:16:5: PT018 [**] Assertion should be broken down into multiple parts | 14 | assert something and something_else 15 | assert something and something_else and something_third @@ -66,7 +66,7 @@ PT018.py:16:5: PT018 [*] Assertion should be broken down into multiple parts 18 19 | assert not something and something_else 19 20 | assert not (something or something_else) -PT018.py:17:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:17:5: PT018 [**] Assertion should be broken down into multiple parts | 15 | assert something and something_else and something_third 16 | assert something and not something_else @@ -88,7 +88,7 @@ PT018.py:17:5: PT018 [*] Assertion should be broken down into multiple parts 19 20 | assert not (something or something_else) 20 21 | assert not (something or something_else or something_third) -PT018.py:18:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:18:5: PT018 [**] Assertion should be broken down into multiple parts | 16 | assert something and not something_else 17 | assert something and (something_else or something_third) @@ -110,7 +110,7 @@ PT018.py:18:5: PT018 [*] Assertion should be broken down into multiple parts 20 21 | assert not (something or something_else or something_third) 21 22 | assert something and something_else == """error -PT018.py:19:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:19:5: PT018 [**] Assertion should be broken down into multiple parts | 17 | assert something and (something_else or something_third) 18 | assert not something and something_else @@ -132,7 +132,7 @@ PT018.py:19:5: PT018 [*] Assertion should be broken down into multiple parts 21 22 | assert something and something_else == """error 22 23 | message -PT018.py:20:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:20:5: PT018 [**] Assertion should be broken down into multiple parts | 18 | assert not something and something_else 19 | assert not (something or something_else) @@ -154,7 +154,7 @@ PT018.py:20:5: PT018 [*] Assertion should be broken down into multiple parts 22 23 | message 23 24 | """ -PT018.py:21:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:21:5: PT018 [**] Assertion should be broken down into multiple parts | 19 | assert not (something or something_else) 20 | assert not (something or something_else or something_third) @@ -179,7 +179,7 @@ PT018.py:21:5: PT018 [*] Assertion should be broken down into multiple parts 23 24 | """ 24 25 | assert ( -PT018.py:24:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:24:5: PT018 [**] Assertion should be broken down into multiple parts | 22 | message 23 | """ @@ -210,7 +210,7 @@ PT018.py:24:5: PT018 [*] Assertion should be broken down into multiple parts 28 28 | message 29 29 | """ -PT018.py:33:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:33:5: PT018 [**] Assertion should be broken down into multiple parts | 32 | # recursive case 33 | assert not (a or not (b or c)) @@ -230,7 +230,7 @@ PT018.py:33:5: PT018 [*] Assertion should be broken down into multiple parts 35 36 | 36 37 | # detected, but no fix for messages -PT018.py:34:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:34:5: PT018 [**] Assertion should be broken down into multiple parts | 32 | # recursive case 33 | assert not (a or not (b or c)) @@ -282,7 +282,7 @@ PT018.py:40:5: PT018 Assertion should be broken down into multiple parts | = help: Break down assertion into multiple parts -PT018.py:44:1: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:44:1: PT018 [**] Assertion should be broken down into multiple parts | 43 | assert something # OK 44 | assert something and something_else # Error @@ -302,7 +302,7 @@ PT018.py:44:1: PT018 [*] Assertion should be broken down into multiple parts 46 47 | 47 48 | -PT018.py:45:1: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:45:1: PT018 [**] Assertion should be broken down into multiple parts | 43 | assert something # OK 44 | assert something and something_else # Error @@ -351,7 +351,7 @@ PT018.py:54:9: PT018 Assertion should be broken down into multiple parts | = help: Break down assertion into multiple parts -PT018.py:59:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:59:5: PT018 [**] Assertion should be broken down into multiple parts | 57 | # Regression test for: https://github.com/astral-sh/ruff/issues/7143 58 | def test_parenthesized_not(): @@ -380,7 +380,7 @@ PT018.py:59:5: PT018 [*] Assertion should be broken down into multiple parts 65 67 | assert (not ( 66 68 | self.find_graph_output(node.output[0]) -PT018.py:65:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:65:5: PT018 [**] Assertion should be broken down into multiple parts | 63 | ) 64 | diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT026.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT026.snap index 4bf726cece5838..7c3be1d128baef 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT026.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT026.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs --- -PT026.py:19:1: PT026 [*] Useless `pytest.mark.usefixtures` without parameters +PT026.py:19:1: PT026 [**] Useless `pytest.mark.usefixtures` without parameters | 19 | @pytest.mark.usefixtures() | ^^^^^^^^^^^^^^^^^^^^^^^^^^ PT026 @@ -20,7 +20,7 @@ PT026.py:19:1: PT026 [*] Useless `pytest.mark.usefixtures` without parameters 21 21 | pass 22 22 | -PT026.py:24:1: PT026 [*] Useless `pytest.mark.usefixtures` without parameters +PT026.py:24:1: PT026 [**] Useless `pytest.mark.usefixtures` without parameters | 24 | @pytest.mark.usefixtures | ^^^^^^^^^^^^^^^^^^^^^^^^ PT026 diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT027_0.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT027_0.snap index dd48d601634ba9..b92f47ea146775 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT027_0.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT027_0.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs --- -PT027_0.py:6:14: PT027 [*] Use `pytest.raises` instead of unittest-style `assertRaises` +PT027_0.py:6:14: PT027 [**] Use `pytest.raises` instead of unittest-style `assertRaises` | 4 | class Test(unittest.TestCase): 5 | def test_errors(self): @@ -25,7 +25,7 @@ PT027_0.py:6:14: PT027 [*] Use `pytest.raises` instead of unittest-style `assert 8 9 | with self.assertRaises(expected_exception=ValueError): 9 10 | raise ValueError -PT027_0.py:8:14: PT027 [*] Use `pytest.raises` instead of unittest-style `assertRaises` +PT027_0.py:8:14: PT027 [**] Use `pytest.raises` instead of unittest-style `assertRaises` | 6 | with self.assertRaises(ValueError): 7 | raise ValueError @@ -50,7 +50,7 @@ PT027_0.py:8:14: PT027 [*] Use `pytest.raises` instead of unittest-style `assert 10 11 | 11 12 | with self.failUnlessRaises(ValueError): -PT027_0.py:11:14: PT027 [*] Use `pytest.raises` instead of unittest-style `failUnlessRaises` +PT027_0.py:11:14: PT027 [**] Use `pytest.raises` instead of unittest-style `failUnlessRaises` | 9 | raise ValueError 10 | @@ -76,7 +76,7 @@ PT027_0.py:11:14: PT027 [*] Use `pytest.raises` instead of unittest-style `failU 13 14 | 14 15 | with self.assertRaisesRegex(ValueError, "test"): -PT027_0.py:14:14: PT027 [*] Use `pytest.raises` instead of unittest-style `assertRaisesRegex` +PT027_0.py:14:14: PT027 [**] Use `pytest.raises` instead of unittest-style `assertRaisesRegex` | 12 | raise ValueError 13 | @@ -102,7 +102,7 @@ PT027_0.py:14:14: PT027 [*] Use `pytest.raises` instead of unittest-style `asser 16 17 | 17 18 | with self.assertRaisesRegex(ValueError, expected_regex="test"): -PT027_0.py:17:14: PT027 [*] Use `pytest.raises` instead of unittest-style `assertRaisesRegex` +PT027_0.py:17:14: PT027 [**] Use `pytest.raises` instead of unittest-style `assertRaisesRegex` | 15 | raise ValueError("test") 16 | @@ -128,7 +128,7 @@ PT027_0.py:17:14: PT027 [*] Use `pytest.raises` instead of unittest-style `asser 19 20 | 20 21 | with self.assertRaisesRegex( -PT027_0.py:20:14: PT027 [*] Use `pytest.raises` instead of unittest-style `assertRaisesRegex` +PT027_0.py:20:14: PT027 [**] Use `pytest.raises` instead of unittest-style `assertRaisesRegex` | 18 | raise ValueError("test") 19 | @@ -157,7 +157,7 @@ PT027_0.py:20:14: PT027 [*] Use `pytest.raises` instead of unittest-style `asser 24 23 | 25 24 | with self.assertRaisesRegex( -PT027_0.py:25:14: PT027 [*] Use `pytest.raises` instead of unittest-style `assertRaisesRegex` +PT027_0.py:25:14: PT027 [**] Use `pytest.raises` instead of unittest-style `assertRaisesRegex` | 23 | raise ValueError("test") 24 | @@ -186,7 +186,7 @@ PT027_0.py:25:14: PT027 [*] Use `pytest.raises` instead of unittest-style `asser 29 28 | 30 29 | with self.assertRaisesRegexp(ValueError, "test"): -PT027_0.py:30:14: PT027 [*] Use `pytest.raises` instead of unittest-style `assertRaisesRegexp` +PT027_0.py:30:14: PT027 [**] Use `pytest.raises` instead of unittest-style `assertRaisesRegexp` | 28 | raise ValueError("test") 29 | diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT027_1.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT027_1.snap index 3886db7a54d0cf..abe0aca3025fe8 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT027_1.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT027_1.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs --- -PT027_1.py:11:14: PT027 [*] Use `pytest.raises` instead of unittest-style `assertRaises` +PT027_1.py:11:14: PT027 [**] Use `pytest.raises` instead of unittest-style `assertRaises` | 10 | def test_errors(self): 11 | with self.assertRaises(ValueError): diff --git a/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET503_RET503.py.snap b/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET503_RET503.py.snap index c3a4baa5697fe6..425ce133a45e63 100644 --- a/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET503_RET503.py.snap +++ b/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET503_RET503.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_return/mod.rs --- -RET503.py:20:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:20:5: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 18 | # if/elif/else 19 | def x(y): @@ -22,7 +22,7 @@ RET503.py:20:5: RET503 [*] Missing explicit `return` at the end of function able 23 24 | 24 25 | -RET503.py:27:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:27:9: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 25 | def x(y): 26 | if not y: @@ -42,7 +42,7 @@ RET503.py:27:9: RET503 [*] Missing explicit `return` at the end of function able 29 30 | return 2 30 31 | -RET503.py:36:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:36:5: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 34 | return 1 35 | @@ -60,7 +60,7 @@ RET503.py:36:5: RET503 [*] Missing explicit `return` at the end of function able 38 39 | 39 40 | # for -RET503.py:41:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:41:5: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 39 | # for 40 | def x(y): @@ -82,7 +82,7 @@ RET503.py:41:5: RET503 [*] Missing explicit `return` at the end of function able 45 46 | 46 47 | -RET503.py:52:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:52:9: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 50 | return i 51 | else: @@ -100,7 +100,7 @@ RET503.py:52:9: RET503 [*] Missing explicit `return` at the end of function able 54 55 | 55 56 | # A nonexistent function -RET503.py:59:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:59:5: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 57 | if x > 0: 58 | return False @@ -118,7 +118,7 @@ RET503.py:59:5: RET503 [*] Missing explicit `return` at the end of function able 61 62 | 62 63 | # A function that does return the control -RET503.py:66:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:66:5: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 64 | if x > 0: 65 | return False @@ -136,7 +136,7 @@ RET503.py:66:5: RET503 [*] Missing explicit `return` at the end of function able 68 69 | 69 70 | ### -RET503.py:82:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:82:5: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 80 | # last line in while loop 81 | def x(y): @@ -158,7 +158,7 @@ RET503.py:82:5: RET503 [*] Missing explicit `return` at the end of function able 87 88 | 88 89 | # exclude empty functions -RET503.py:113:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:113:5: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 111 | # return value within loop 112 | def bar1(x, y, z): @@ -180,7 +180,7 @@ RET503.py:113:5: RET503 [*] Missing explicit `return` at the end of function abl 118 119 | 119 120 | def bar3(x, y, z): -RET503.py:120:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:120:5: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 119 | def bar3(x, y, z): 120 | for i in x: @@ -204,7 +204,7 @@ RET503.py:120:5: RET503 [*] Missing explicit `return` at the end of function abl 128 129 | 129 130 | def bar1(x, y, z): -RET503.py:130:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:130:5: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 129 | def bar1(x, y, z): 130 | for i in x: @@ -225,7 +225,7 @@ RET503.py:130:5: RET503 [*] Missing explicit `return` at the end of function abl 135 136 | 136 137 | def bar3(x, y, z): -RET503.py:137:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:137:5: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 136 | def bar3(x, y, z): 137 | for i in x: @@ -249,7 +249,7 @@ RET503.py:137:5: RET503 [*] Missing explicit `return` at the end of function abl 145 146 | 146 147 | def prompts(self, foo): -RET503.py:274:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:274:5: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 272 | return False 273 | @@ -269,7 +269,7 @@ RET503.py:274:5: RET503 [*] Missing explicit `return` at the end of function abl 277 278 | 278 279 | def while_true(): -RET503.py:291:13: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:291:13: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 289 | return 1 290 | case 1: @@ -287,7 +287,7 @@ RET503.py:291:13: RET503 [*] Missing explicit `return` at the end of function ab 293 294 | 294 295 | def foo(baz: str) -> str: -RET503.py:300:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:300:9: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 298 | def end_of_statement(): 299 | def example(): @@ -307,7 +307,7 @@ RET503.py:300:9: RET503 [*] Missing explicit `return` at the end of function abl 303 304 | 304 305 | def example(): -RET503.py:305:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:305:9: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 304 | def example(): 305 | if True: @@ -326,7 +326,7 @@ RET503.py:305:9: RET503 [*] Missing explicit `return` at the end of function abl 308 309 | 309 310 | def example(): -RET503.py:310:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:310:9: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 309 | def example(): 310 | if True: @@ -345,7 +345,7 @@ RET503.py:310:9: RET503 [*] Missing explicit `return` at the end of function abl 313 314 | 314 315 | def example(): -RET503.py:315:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:315:9: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 314 | def example(): 315 | if True: @@ -364,7 +364,7 @@ RET503.py:315:9: RET503 [*] Missing explicit `return` at the end of function abl 318 319 | 319 320 | def example(): -RET503.py:320:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:320:9: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 319 | def example(): 320 | if True: @@ -384,7 +384,7 @@ RET503.py:320:9: RET503 [*] Missing explicit `return` at the end of function abl 324 325 | 325 326 | def end_of_file(): -RET503.py:328:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:328:5: RET503 [**] Missing explicit `return` at the end of function able to return non-`None` value | 326 | if False: 327 | return 1 diff --git a/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET504_RET504.py.snap b/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET504_RET504.py.snap index c9bcc8798437da..1910570dfd4970 100644 --- a/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET504_RET504.py.snap +++ b/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET504_RET504.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_return/mod.rs --- -RET504.py:6:12: RET504 [*] Unnecessary assignment to `a` before `return` statement +RET504.py:6:12: RET504 [**] Unnecessary assignment to `a` before `return` statement | 4 | def x(): 5 | a = 1 @@ -21,7 +21,7 @@ RET504.py:6:12: RET504 [*] Unnecessary assignment to `a` before `return` stateme 8 7 | 9 8 | # Can be refactored false positives -RET504.py:23:12: RET504 [*] Unnecessary assignment to `formatted` before `return` statement +RET504.py:23:12: RET504 [**] Unnecessary assignment to `formatted` before `return` statement | 21 | # clean up after any blank components 22 | formatted = formatted.replace("()", "").replace(" ", " ").strip() @@ -41,7 +41,7 @@ RET504.py:23:12: RET504 [*] Unnecessary assignment to `formatted` before `return 25 24 | 26 25 | # https://github.com/afonasev/flake8-return/issues/47#issue-641117366 -RET504.py:246:12: RET504 [*] Unnecessary assignment to `queryset` before `return` statement +RET504.py:246:12: RET504 [**] Unnecessary assignment to `queryset` before `return` statement | 244 | queryset = Model.filter(a=1) 245 | queryset = queryset.filter(c=3) @@ -61,7 +61,7 @@ RET504.py:246:12: RET504 [*] Unnecessary assignment to `queryset` before `return 248 247 | 249 248 | def get_queryset(): -RET504.py:251:12: RET504 [*] Unnecessary assignment to `queryset` before `return` statement +RET504.py:251:12: RET504 [**] Unnecessary assignment to `queryset` before `return` statement | 249 | def get_queryset(): 250 | queryset = Model.filter(a=1) @@ -81,7 +81,7 @@ RET504.py:251:12: RET504 [*] Unnecessary assignment to `queryset` before `return 253 252 | 254 253 | # Function arguments -RET504.py:269:12: RET504 [*] Unnecessary assignment to `val` before `return` statement +RET504.py:269:12: RET504 [**] Unnecessary assignment to `val` before `return` statement | 267 | return val 268 | val = 1 @@ -101,7 +101,7 @@ RET504.py:269:12: RET504 [*] Unnecessary assignment to `val` before `return` sta 271 270 | 272 271 | def str_to_bool(val): -RET504.py:321:12: RET504 [*] Unnecessary assignment to `x` before `return` statement +RET504.py:321:12: RET504 [**] Unnecessary assignment to `x` before `return` statement | 319 | with open("foo.txt", "r") as f: 320 | x = f.read() @@ -121,7 +121,7 @@ RET504.py:321:12: RET504 [*] Unnecessary assignment to `x` before `return` state 323 322 | 324 323 | def foo(): -RET504.py:342:12: RET504 [*] Unnecessary assignment to `b` before `return` statement +RET504.py:342:12: RET504 [**] Unnecessary assignment to `b` before `return` statement | 340 | a = 1 341 | b=a @@ -141,7 +141,7 @@ RET504.py:342:12: RET504 [*] Unnecessary assignment to `b` before `return` state 344 343 | 345 344 | def foo(): -RET504.py:348:12: RET504 [*] Unnecessary assignment to `b` before `return` statement +RET504.py:348:12: RET504 [**] Unnecessary assignment to `b` before `return` statement | 346 | a = 1 347 | b =a @@ -161,7 +161,7 @@ RET504.py:348:12: RET504 [*] Unnecessary assignment to `b` before `return` state 350 349 | 351 350 | def foo(): -RET504.py:354:12: RET504 [*] Unnecessary assignment to `b` before `return` statement +RET504.py:354:12: RET504 [**] Unnecessary assignment to `b` before `return` statement | 352 | a = 1 353 | b= a @@ -181,7 +181,7 @@ RET504.py:354:12: RET504 [*] Unnecessary assignment to `b` before `return` state 356 355 | 357 356 | def foo(): -RET504.py:359:12: RET504 [*] Unnecessary assignment to `a` before `return` statement +RET504.py:359:12: RET504 [**] Unnecessary assignment to `a` before `return` statement | 357 | def foo(): 358 | a = 1 # Comment @@ -201,7 +201,7 @@ RET504.py:359:12: RET504 [*] Unnecessary assignment to `a` before `return` state 361 360 | 362 361 | # Regression test for: https://github.com/astral-sh/ruff/issues/7098 -RET504.py:365:12: RET504 [*] Unnecessary assignment to `D` before `return` statement +RET504.py:365:12: RET504 [**] Unnecessary assignment to `D` before `return` statement | 363 | def mavko_debari(P_kbar): 364 | D=0.4853881 + 3.6006116*P - 0.0117368*(P-1.3822)**2 diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM101_SIM101.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM101_SIM101.py.snap index 1368303ffa0b85..a58e3afc10dfc7 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM101_SIM101.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM101_SIM101.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM101.py:1:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call +SIM101.py:1:4: SIM101 [**] Multiple `isinstance` calls for `a`, merge into a single call | 1 | if isinstance(a, int) or isinstance(a, float): # SIM101 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SIM101 @@ -16,7 +16,7 @@ SIM101.py:1:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a sing 3 3 | 4 4 | if isinstance(a, (int, float)) or isinstance(a, bool): # SIM101 -SIM101.py:4:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call +SIM101.py:4:4: SIM101 [**] Multiple `isinstance` calls for `a`, merge into a single call | 2 | pass 3 | @@ -36,7 +36,7 @@ SIM101.py:4:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a sing 6 6 | 7 7 | if isinstance(a, int) or isinstance(a, float) or isinstance(b, bool): # SIM101 -SIM101.py:7:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call +SIM101.py:7:4: SIM101 [**] Multiple `isinstance` calls for `a`, merge into a single call | 5 | pass 6 | @@ -56,7 +56,7 @@ SIM101.py:7:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a sing 9 9 | 10 10 | if isinstance(b, bool) or isinstance(a, int) or isinstance(a, float): # SIM101 -SIM101.py:10:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call +SIM101.py:10:4: SIM101 [**] Multiple `isinstance` calls for `a`, merge into a single call | 8 | pass 9 | @@ -76,7 +76,7 @@ SIM101.py:10:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a sin 12 12 | 13 13 | if isinstance(a, int) or isinstance(b, bool) or isinstance(a, float): # SIM101 -SIM101.py:13:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call +SIM101.py:13:4: SIM101 [**] Multiple `isinstance` calls for `a`, merge into a single call | 11 | pass 12 | @@ -96,7 +96,7 @@ SIM101.py:13:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a sin 15 15 | 16 16 | if (isinstance(a, int) or isinstance(a, float)) and isinstance(b, bool): # SIM101 -SIM101.py:16:5: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call +SIM101.py:16:5: SIM101 [**] Multiple `isinstance` calls for `a`, merge into a single call | 14 | pass 15 | @@ -116,7 +116,7 @@ SIM101.py:16:5: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a sin 18 18 | 19 19 | if isinstance(a.b, int) or isinstance(a.b, float): # SIM101 -SIM101.py:19:4: SIM101 [*] Multiple `isinstance` calls for expression, merge into a single call +SIM101.py:19:4: SIM101 [**] Multiple `isinstance` calls for expression, merge into a single call | 17 | pass 18 | diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM102_SIM102.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM102_SIM102.py.snap index 8f373fc0be83eb..9816b463c6bdd9 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM102_SIM102.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM102_SIM102.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM102.py:2:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:2:1: SIM102 [**] Use a single `if` statement instead of nested `if` statements | 1 | # SIM102 2 | / if a: @@ -22,7 +22,7 @@ SIM102.py:2:1: SIM102 [*] Use a single `if` statement instead of nested `if` sta 6 5 | # SIM102 7 6 | if a: -SIM102.py:7:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:7:1: SIM102 [**] Use a single `if` statement instead of nested `if` statements | 6 | # SIM102 7 | / if a: @@ -48,7 +48,7 @@ SIM102.py:7:1: SIM102 [*] Use a single `if` statement instead of nested `if` sta 12 11 | # SIM102 13 12 | if a: -SIM102.py:8:5: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:8:5: SIM102 [**] Use a single `if` statement instead of nested `if` statements | 6 | # SIM102 7 | if a: @@ -73,7 +73,7 @@ SIM102.py:8:5: SIM102 [*] Use a single `if` statement instead of nested `if` sta 12 11 | # SIM102 13 12 | if a: -SIM102.py:15:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:15:1: SIM102 [**] Use a single `if` statement instead of nested `if` statements | 13 | if a: 14 | pass @@ -108,7 +108,7 @@ SIM102.py:20:1: SIM102 Use a single `if` statement instead of nested `if` statem | = help: Combine `if` statements using `and` -SIM102.py:26:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:26:1: SIM102 [**] Use a single `if` statement instead of nested `if` statements | 25 | # SIM102 26 | / if a: @@ -134,7 +134,7 @@ SIM102.py:26:1: SIM102 [*] Use a single `if` statement instead of nested `if` st 31 30 | # OK 32 31 | if a: -SIM102.py:51:5: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:51:5: SIM102 [**] Use a single `if` statement instead of nested `if` statements | 49 | while x > 0: 50 | # SIM102 @@ -172,7 +172,7 @@ SIM102.py:51:5: SIM102 [*] Use a single `if` statement instead of nested `if` st 64 63 | 65 64 | -SIM102.py:67:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:67:1: SIM102 [**] Use a single `if` statement instead of nested `if` statements | 66 | # SIM102 67 | / if x > 0: @@ -208,7 +208,7 @@ SIM102.py:67:1: SIM102 [*] Use a single `if` statement instead of nested `if` st 80 79 | 81 80 | while x > 0: -SIM102.py:83:5: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:83:5: SIM102 [**] Use a single `if` statement instead of nested `if` statements | 81 | while x > 0: 82 | # SIM102 @@ -239,7 +239,7 @@ SIM102.py:83:5: SIM102 [*] Use a single `if` statement instead of nested `if` st 89 88 | # SIM102 (auto-fixable) 90 89 | if node.module012345678: -SIM102.py:90:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:90:1: SIM102 [**] Use a single `if` statement instead of nested `if` statements | 89 | # SIM102 (auto-fixable) 90 | / if node.module012345678: @@ -280,7 +280,7 @@ SIM102.py:97:1: SIM102 Use a single `if` statement instead of nested `if` statem | = help: Combine `if` statements using `and` -SIM102.py:106:5: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:106:5: SIM102 [**] Use a single `if` statement instead of nested `if` statements | 104 | # Regression test for https://github.com/apache/airflow/blob/145b16caaa43f0c42bffd97344df916c602cddde/airflow/configuration.py#L1161 105 | if a: @@ -306,7 +306,7 @@ SIM102.py:106:5: SIM102 [*] Use a single `if` statement instead of nested `if` s 110 109 | print("elif") 111 110 | -SIM102.py:132:5: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:132:5: SIM102 [**] Use a single `if` statement instead of nested `if` statements | 130 | if a: 131 | # SIM 102 @@ -332,7 +332,7 @@ SIM102.py:132:5: SIM102 [*] Use a single `if` statement instead of nested `if` s 136 135 | print("bar") 137 136 | -SIM102.py:165:5: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:165:5: SIM102 [**] Use a single `if` statement instead of nested `if` statements | 163 | if a: 164 | pass diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM103_SIM103.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM103_SIM103.py.snap index b6eb3af562a5b2..7cb2d25a7c644e 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM103_SIM103.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM103_SIM103.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM103.py:3:5: SIM103 [*] Return the condition `a` directly +SIM103.py:3:5: SIM103 [**] Return the condition `a` directly | 1 | def f(): 2 | # SIM103 @@ -26,7 +26,7 @@ SIM103.py:3:5: SIM103 [*] Return the condition `a` directly 8 5 | 9 6 | def f(): -SIM103.py:11:5: SIM103 [*] Return the condition `a == b` directly +SIM103.py:11:5: SIM103 [**] Return the condition `a == b` directly | 9 | def f(): 10 | # SIM103 @@ -52,7 +52,7 @@ SIM103.py:11:5: SIM103 [*] Return the condition `a == b` directly 16 13 | 17 14 | def f(): -SIM103.py:21:5: SIM103 [*] Return the condition `b` directly +SIM103.py:21:5: SIM103 [**] Return the condition `b` directly | 19 | if a: 20 | return 1 @@ -78,7 +78,7 @@ SIM103.py:21:5: SIM103 [*] Return the condition `b` directly 26 23 | 27 24 | def f(): -SIM103.py:32:9: SIM103 [*] Return the condition `b` directly +SIM103.py:32:9: SIM103 [**] Return the condition `b` directly | 30 | return 1 31 | else: diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_0.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_0.py.snap index 747d835818013f..6e4c1bbb4117ab 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_0.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM105_0.py:6:1: SIM105 [*] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass` +SIM105_0.py:6:1: SIM105 [**] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass` | 5 | # SIM105 6 | / try: @@ -28,7 +28,7 @@ SIM105_0.py:6:1: SIM105 [*] Use `contextlib.suppress(ValueError)` instead of `tr 11 10 | 12 11 | # SIM105 -SIM105_0.py:13:1: SIM105 [*] Use `contextlib.suppress(ValueError, OSError)` instead of `try`-`except`-`pass` +SIM105_0.py:13:1: SIM105 [**] Use `contextlib.suppress(ValueError, OSError)` instead of `try`-`except`-`pass` | 12 | # SIM105 13 | / try: @@ -59,7 +59,7 @@ SIM105_0.py:13:1: SIM105 [*] Use `contextlib.suppress(ValueError, OSError)` inst 18 17 | # SIM105 19 18 | try: -SIM105_0.py:19:1: SIM105 [*] Use `contextlib.suppress(ValueError, OSError)` instead of `try`-`except`-`pass` +SIM105_0.py:19:1: SIM105 [**] Use `contextlib.suppress(ValueError, OSError)` instead of `try`-`except`-`pass` | 18 | # SIM105 19 | / try: @@ -90,7 +90,7 @@ SIM105_0.py:19:1: SIM105 [*] Use `contextlib.suppress(ValueError, OSError)` inst 24 23 | # SIM105 25 24 | try: -SIM105_0.py:25:1: SIM105 [*] Use `contextlib.suppress(Exception)` instead of `try`-`except`-`pass` +SIM105_0.py:25:1: SIM105 [**] Use `contextlib.suppress(Exception)` instead of `try`-`except`-`pass` | 24 | # SIM105 25 | / try: @@ -121,7 +121,7 @@ SIM105_0.py:25:1: SIM105 [*] Use `contextlib.suppress(Exception)` instead of `tr 30 29 | # SIM105 31 30 | try: -SIM105_0.py:31:1: SIM105 [*] Use `contextlib.suppress(a.Error, b.Error)` instead of `try`-`except`-`pass` +SIM105_0.py:31:1: SIM105 [**] Use `contextlib.suppress(a.Error, b.Error)` instead of `try`-`except`-`pass` | 30 | # SIM105 31 | / try: @@ -152,7 +152,7 @@ SIM105_0.py:31:1: SIM105 [*] Use `contextlib.suppress(a.Error, b.Error)` instead 36 35 | # OK 37 36 | try: -SIM105_0.py:85:5: SIM105 [*] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass` +SIM105_0.py:85:5: SIM105 [**] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass` | 83 | def with_ellipsis(): 84 | # OK @@ -197,7 +197,7 @@ SIM105_0.py:100:5: SIM105 Use `contextlib.suppress(ValueError, OSError)` instead | = help: Replace with `contextlib.suppress(ValueError, OSError)` -SIM105_0.py:117:5: SIM105 [*] Use `contextlib.suppress(OSError)` instead of `try`-`except`-`pass` +SIM105_0.py:117:5: SIM105 [**] Use `contextlib.suppress(OSError)` instead of `try`-`except`-`pass` | 115 | # Regression test for: https://github.com/astral-sh/ruff/issues/7123 116 | def write_models(directory, Models): @@ -230,7 +230,7 @@ SIM105_0.py:117:5: SIM105 [*] Use `contextlib.suppress(OSError)` instead of `try 122 121 | try: os.makedirs(model_dir); 123 122 | except OSError: -SIM105_0.py:122:5: SIM105 [*] Use `contextlib.suppress(OSError)` instead of `try`-`except`-`pass` +SIM105_0.py:122:5: SIM105 [**] Use `contextlib.suppress(OSError)` instead of `try`-`except`-`pass` | 120 | pass; 121 | @@ -261,7 +261,7 @@ SIM105_0.py:122:5: SIM105 [*] Use `contextlib.suppress(OSError)` instead of `try 126 125 | try: os.makedirs(model_dir); 127 126 | except OSError: -SIM105_0.py:126:5: SIM105 [*] Use `contextlib.suppress(OSError)` instead of `try`-`except`-`pass` +SIM105_0.py:126:5: SIM105 [**] Use `contextlib.suppress(OSError)` instead of `try`-`except`-`pass` | 124 | pass; 125 | diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_1.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_1.py.snap index e7eba1d76e002d..67e13ee2fd6a23 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM105_1.py:5:1: SIM105 [*] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass` +SIM105_1.py:5:1: SIM105 [**] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass` | 4 | # SIM105 5 | / try: diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_2.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_2.py.snap index adf563480a1c48..33d9b3270ff19b 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM105_2.py:10:1: SIM105 [*] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass` +SIM105_2.py:10:1: SIM105 [**] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass` | 9 | # SIM105 10 | / try: diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_4.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_4.py.snap index 8f221aa111e300..1558a8c3f26488 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_4.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_4.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM105_4.py:2:1: SIM105 [*] Use `contextlib.suppress(ImportError)` instead of `try`-`except`-`pass` +SIM105_4.py:2:1: SIM105 [**] Use `contextlib.suppress(ImportError)` instead of `try`-`except`-`pass` | 1 | #!/usr/bin/env python 2 | / try: diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM108_SIM108.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM108_SIM108.py.snap index c4aad0339a2597..e6e680041aa087 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM108_SIM108.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM108_SIM108.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM108.py:2:1: SIM108 [*] Use ternary operator `b = c if a else d` instead of `if`-`else`-block +SIM108.py:2:1: SIM108 [**] Use ternary operator `b = c if a else d` instead of `if`-`else`-block | 1 | # SIM108 2 | / if a: @@ -25,7 +25,7 @@ SIM108.py:2:1: SIM108 [*] Use ternary operator `b = c if a else d` instead of `i 7 4 | # OK 8 5 | b = c if a else d -SIM108.py:30:5: SIM108 [*] Use ternary operator `b = 1 if a else 2` instead of `if`-`else`-block +SIM108.py:30:5: SIM108 [**] Use ternary operator `b = 1 if a else 2` instead of `if`-`else`-block | 28 | pass 29 | else: @@ -64,7 +64,7 @@ SIM108.py:58:1: SIM108 Use ternary operator `abc = x if x > 0 else -x` instead o | = help: Replace `if`-`else`-block with `abc = x if x > 0 else -x` -SIM108.py:82:1: SIM108 [*] Use ternary operator `b = "cccccccccccccccccccccccccccccccccß" if a else "ddddddddddddddddddddddddddddddddd💣"` instead of `if`-`else`-block +SIM108.py:82:1: SIM108 [**] Use ternary operator `b = "cccccccccccccccccccccccccccccccccß" if a else "ddddddddddddddddddddddddddddddddd💣"` instead of `if`-`else`-block | 81 | # SIM108 82 | / if a: diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM109_SIM109.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM109_SIM109.py.snap index fd8700afbae49a..ff368751e50ddb 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM109_SIM109.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM109_SIM109.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM109.py:2:4: SIM109 [*] Use `a in (b, c)` instead of multiple equality comparisons +SIM109.py:2:4: SIM109 [**] Use `a in (b, c)` instead of multiple equality comparisons | 1 | # SIM109 2 | if a == b or a == c: @@ -18,7 +18,7 @@ SIM109.py:2:4: SIM109 [*] Use `a in (b, c)` instead of multiple equality compari 4 4 | 5 5 | # SIM109 -SIM109.py:6:5: SIM109 [*] Use `a in (b, c)` instead of multiple equality comparisons +SIM109.py:6:5: SIM109 [**] Use `a in (b, c)` instead of multiple equality comparisons | 5 | # SIM109 6 | if (a == b or a == c) and None: @@ -37,7 +37,7 @@ SIM109.py:6:5: SIM109 [*] Use `a in (b, c)` instead of multiple equality compari 8 8 | 9 9 | # SIM109 -SIM109.py:10:4: SIM109 [*] Use `a in (b, c)` instead of multiple equality comparisons +SIM109.py:10:4: SIM109 [**] Use `a in (b, c)` instead of multiple equality comparisons | 9 | # SIM109 10 | if a == b or a == c or None: @@ -56,7 +56,7 @@ SIM109.py:10:4: SIM109 [*] Use `a in (b, c)` instead of multiple equality compar 12 12 | 13 13 | # SIM109 -SIM109.py:14:4: SIM109 [*] Use `a in (b, c)` instead of multiple equality comparisons +SIM109.py:14:4: SIM109 [**] Use `a in (b, c)` instead of multiple equality comparisons | 13 | # SIM109 14 | if a == b or None or a == c: diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM110_SIM110.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM110_SIM110.py.snap index 1473e4bfdaab31..04c611b6211c90 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM110_SIM110.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM110_SIM110.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM110.py:3:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM110.py:3:5: SIM110 [**] Use `return any(check(x) for x in iterable)` instead of `for` loop | 1 | def f(): 2 | # SIM110 @@ -26,7 +26,7 @@ SIM110.py:3:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead o 8 5 | 9 6 | def f(): -SIM110.py:25:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM110.py:25:5: SIM110 [**] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 23 | def f(): 24 | # SIM111 @@ -52,7 +52,7 @@ SIM110.py:25:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` inst 30 27 | 31 28 | def f(): -SIM110.py:33:5: SIM110 [*] Use `return all(x.is_empty() for x in iterable)` instead of `for` loop +SIM110.py:33:5: SIM110 [**] Use `return all(x.is_empty() for x in iterable)` instead of `for` loop | 31 | def f(): 32 | # SIM111 @@ -78,7 +78,7 @@ SIM110.py:33:5: SIM110 [*] Use `return all(x.is_empty() for x in iterable)` inst 38 35 | 39 36 | def f(): -SIM110.py:55:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM110.py:55:5: SIM110 [**] Use `return any(check(x) for x in iterable)` instead of `for` loop | 53 | def f(): 54 | # SIM110 @@ -106,7 +106,7 @@ SIM110.py:55:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead 61 57 | 62 58 | def f(): -SIM110.py:64:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM110.py:64:5: SIM110 [**] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 62 | def f(): 63 | # SIM111 @@ -134,7 +134,7 @@ SIM110.py:64:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` inst 70 66 | 71 67 | def f(): -SIM110.py:73:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM110.py:73:5: SIM110 [**] Use `return any(check(x) for x in iterable)` instead of `for` loop | 71 | def f(): 72 | # SIM110 @@ -163,7 +163,7 @@ SIM110.py:73:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead 79 75 | 80 76 | -SIM110.py:83:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM110.py:83:5: SIM110 [**] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 81 | def f(): 82 | # SIM111 @@ -218,7 +218,7 @@ SIM110.py:134:5: SIM110 Use `return all(not check(x) for x in iterable)` instead | = help: Replace with `return all(not check(x) for x in iterable)` -SIM110.py:144:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM110.py:144:5: SIM110 [**] Use `return any(check(x) for x in iterable)` instead of `for` loop | 143 | # SIM110 144 | for x in iterable: @@ -243,7 +243,7 @@ SIM110.py:144:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead 149 146 | 150 147 | def f(): -SIM110.py:154:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM110.py:154:5: SIM110 [**] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 153 | # SIM111 154 | for x in iterable: @@ -268,7 +268,7 @@ SIM110.py:154:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` ins 159 156 | 160 157 | def f(): -SIM110.py:162:5: SIM110 [*] Use `return any(x.isdigit() for x in "012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ")` instead of `for` loop +SIM110.py:162:5: SIM110 [**] Use `return any(x.isdigit() for x in "012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ")` instead of `for` loop | 160 | def f(): 161 | # SIM110 @@ -294,7 +294,7 @@ SIM110.py:162:5: SIM110 [*] Use `return any(x.isdigit() for x in "012ß9💣2ℝ 167 164 | 168 165 | def f(): -SIM110.py:184:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM110.py:184:5: SIM110 [**] Use `return any(check(x) for x in iterable)` instead of `for` loop | 182 | async def f(): 183 | # SIM110 diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM110_SIM111.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM110_SIM111.py.snap index 85c7002246f5de..72708ef64db805 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM110_SIM111.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM110_SIM111.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM111.py:3:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM111.py:3:5: SIM110 [**] Use `return any(check(x) for x in iterable)` instead of `for` loop | 1 | def f(): 2 | # SIM110 @@ -26,7 +26,7 @@ SIM111.py:3:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead o 8 5 | 9 6 | def f(): -SIM111.py:25:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM111.py:25:5: SIM110 [**] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 23 | def f(): 24 | # SIM111 @@ -52,7 +52,7 @@ SIM111.py:25:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` inst 30 27 | 31 28 | def f(): -SIM111.py:33:5: SIM110 [*] Use `return all(x.is_empty() for x in iterable)` instead of `for` loop +SIM111.py:33:5: SIM110 [**] Use `return all(x.is_empty() for x in iterable)` instead of `for` loop | 31 | def f(): 32 | # SIM111 @@ -78,7 +78,7 @@ SIM111.py:33:5: SIM110 [*] Use `return all(x.is_empty() for x in iterable)` inst 38 35 | 39 36 | def f(): -SIM111.py:55:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM111.py:55:5: SIM110 [**] Use `return any(check(x) for x in iterable)` instead of `for` loop | 53 | def f(): 54 | # SIM110 @@ -106,7 +106,7 @@ SIM111.py:55:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead 61 57 | 62 58 | def f(): -SIM111.py:64:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM111.py:64:5: SIM110 [**] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 62 | def f(): 63 | # SIM111 @@ -134,7 +134,7 @@ SIM111.py:64:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` inst 70 66 | 71 67 | def f(): -SIM111.py:73:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM111.py:73:5: SIM110 [**] Use `return any(check(x) for x in iterable)` instead of `for` loop | 71 | def f(): 72 | # SIM110 @@ -163,7 +163,7 @@ SIM111.py:73:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead 79 75 | 80 76 | -SIM111.py:83:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM111.py:83:5: SIM110 [**] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 81 | def f(): 82 | # SIM111 @@ -218,7 +218,7 @@ SIM111.py:134:5: SIM110 Use `return all(not check(x) for x in iterable)` instead | = help: Replace with `return all(not check(x) for x in iterable)` -SIM111.py:144:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM111.py:144:5: SIM110 [**] Use `return any(check(x) for x in iterable)` instead of `for` loop | 143 | # SIM110 144 | for x in iterable: @@ -243,7 +243,7 @@ SIM111.py:144:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead 149 146 | 150 147 | def f(): -SIM111.py:154:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM111.py:154:5: SIM110 [**] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 153 | # SIM111 154 | for x in iterable: @@ -268,7 +268,7 @@ SIM111.py:154:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` ins 159 156 | 160 157 | def f(): -SIM111.py:162:5: SIM110 [*] Use `return all(x in y for x in iterable)` instead of `for` loop +SIM111.py:162:5: SIM110 [**] Use `return all(x in y for x in iterable)` instead of `for` loop | 160 | def f(): 161 | # SIM111 @@ -294,7 +294,7 @@ SIM111.py:162:5: SIM110 [*] Use `return all(x in y for x in iterable)` instead o 167 164 | 168 165 | def f(): -SIM111.py:170:5: SIM110 [*] Use `return all(x <= y for x in iterable)` instead of `for` loop +SIM111.py:170:5: SIM110 [**] Use `return all(x <= y for x in iterable)` instead of `for` loop | 168 | def f(): 169 | # SIM111 @@ -320,7 +320,7 @@ SIM111.py:170:5: SIM110 [*] Use `return all(x <= y for x in iterable)` instead o 175 172 | 176 173 | def f(): -SIM111.py:178:5: SIM110 [*] Use `return all(not x.isdigit() for x in "012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9")` instead of `for` loop +SIM111.py:178:5: SIM110 [**] Use `return all(not x.isdigit() for x in "012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9")` instead of `for` loop | 176 | def f(): 177 | # SIM111 diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM112_SIM112.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM112_SIM112.py.snap index f19564b2160d0f..088585b0898f4a 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM112_SIM112.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM112_SIM112.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM112.py:4:12: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` +SIM112.py:4:12: SIM112 [**] Use capitalized environment variable `FOO` instead of `foo` | 3 | # Bad 4 | os.environ['foo'] @@ -65,7 +65,7 @@ SIM112.py:12:22: SIM112 Use capitalized environment variable `FOO` instead of `f | = help: Replace `foo` with `FOO` -SIM112.py:14:18: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` +SIM112.py:14:18: SIM112 [**] Use capitalized environment variable `FOO` instead of `foo` | 12 | env = os.environ.get('foo') 13 | @@ -96,7 +96,7 @@ SIM112.py:16:26: SIM112 Use capitalized environment variable `FOO` instead of `f | = help: Replace `foo` with `FOO` -SIM112.py:19:22: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` +SIM112.py:19:22: SIM112 [**] Use capitalized environment variable `FOO` instead of `foo` | 17 | pass 18 | diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM117_SIM117.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM117_SIM117.py.snap index bbc83f3ed4cd62..3fa77b36d4947a 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM117_SIM117.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM117_SIM117.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM117.py:2:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:2:1: SIM117 [**] Use a single `with` statement with multiple contexts instead of nested `with` statements | 1 | # SIM117 2 | / with A() as a: @@ -22,7 +22,7 @@ SIM117.py:2:1: SIM117 [*] Use a single `with` statement with multiple contexts i 6 5 | # SIM117 7 6 | with A(): -SIM117.py:7:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:7:1: SIM117 [**] Use a single `with` statement with multiple contexts instead of nested `with` statements | 6 | # SIM117 7 | / with A(): @@ -59,7 +59,7 @@ SIM117.py:13:1: SIM117 Use a single `with` statement with multiple contexts inst | = help: Combine `with` statements -SIM117.py:19:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:19:1: SIM117 [**] Use a single `with` statement with multiple contexts instead of nested `with` statements | 18 | # SIM117 19 | / with A() as a: @@ -85,7 +85,7 @@ SIM117.py:19:1: SIM117 [*] Use a single `with` statement with multiple contexts 24 23 | # OK 25 24 | with A() as a: -SIM117.py:47:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:47:1: SIM117 [**] Use a single `with` statement with multiple contexts instead of nested `with` statements | 46 | # SIM117 47 | / async with A() as a: @@ -108,7 +108,7 @@ SIM117.py:47:1: SIM117 [*] Use a single `with` statement with multiple contexts 51 50 | while True: 52 51 | # SIM117 -SIM117.py:53:5: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:53:5: SIM117 [**] Use a single `with` statement with multiple contexts instead of nested `with` statements | 51 | while True: 52 | # SIM117 @@ -146,7 +146,7 @@ SIM117.py:53:5: SIM117 [*] Use a single `with` statement with multiple contexts 66 65 | 67 66 | # SIM117 -SIM117.py:68:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:68:1: SIM117 [**] Use a single `with` statement with multiple contexts instead of nested `with` statements | 67 | # SIM117 68 | / with ( @@ -173,7 +173,7 @@ SIM117.py:68:1: SIM117 [*] Use a single `with` statement with multiple contexts 75 74 | # SIM117 76 75 | with A() as a: -SIM117.py:76:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:76:1: SIM117 [**] Use a single `with` statement with multiple contexts instead of nested `with` statements | 75 | # SIM117 76 | / with A() as a: @@ -205,7 +205,7 @@ SIM117.py:76:1: SIM117 [*] Use a single `with` statement with multiple contexts 83 82 | # SIM117 84 83 | with ( -SIM117.py:84:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:84:1: SIM117 [**] Use a single `with` statement with multiple contexts instead of nested `with` statements | 83 | # SIM117 84 | / with ( @@ -239,7 +239,7 @@ SIM117.py:84:1: SIM117 [*] Use a single `with` statement with multiple contexts 94 91 | # SIM117 (auto-fixable) 95 92 | with A("01ß9💣2ℝ8901ß9💣2ℝ8901ß9💣2ℝ89") as a: -SIM117.py:95:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:95:1: SIM117 [**] Use a single `with` statement with multiple contexts instead of nested `with` statements | 94 | # SIM117 (auto-fixable) 95 | / with A("01ß9💣2ℝ8901ß9💣2ℝ8901ß9💣2ℝ89") as a: @@ -284,7 +284,7 @@ SIM117.py:106:5: SIM117 Use a single `with` statement with multiple contexts ins | = help: Combine `with` statements -SIM117.py:126:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:126:1: SIM117 [**] Use a single `with` statement with multiple contexts instead of nested `with` statements | 125 | # SIM117 126 | / with A() as a: diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM118_SIM118.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM118_SIM118.py.snap index a95f8029662891..22018f1b504ac9 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM118_SIM118.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM118_SIM118.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM118.py:1:1: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` +SIM118.py:1:1: SIM118 [**] Use `key in dict` instead of `key in dict.keys()` | 1 | key in obj.keys() # SIM118 | ^^^^^^^^^^^^^^^^^ SIM118 @@ -17,7 +17,7 @@ SIM118.py:1:1: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` 3 3 | key not in obj.keys() # SIM118 4 4 | -SIM118.py:3:1: SIM118 [*] Use `key not in dict` instead of `key not in dict.keys()` +SIM118.py:3:1: SIM118 [**] Use `key not in dict` instead of `key not in dict.keys()` | 1 | key in obj.keys() # SIM118 2 | @@ -37,7 +37,7 @@ SIM118.py:3:1: SIM118 [*] Use `key not in dict` instead of `key not in dict.keys 5 5 | foo["bar"] in obj.keys() # SIM118 6 6 | -SIM118.py:5:1: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` +SIM118.py:5:1: SIM118 [**] Use `key in dict` instead of `key in dict.keys()` | 3 | key not in obj.keys() # SIM118 4 | @@ -58,7 +58,7 @@ SIM118.py:5:1: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` 7 7 | foo["bar"] not in obj.keys() # SIM118 8 8 | -SIM118.py:7:1: SIM118 [*] Use `key not in dict` instead of `key not in dict.keys()` +SIM118.py:7:1: SIM118 [**] Use `key not in dict` instead of `key not in dict.keys()` | 5 | foo["bar"] in obj.keys() # SIM118 6 | @@ -79,7 +79,7 @@ SIM118.py:7:1: SIM118 [*] Use `key not in dict` instead of `key not in dict.keys 9 9 | foo['bar'] in obj.keys() # SIM118 10 10 | -SIM118.py:9:1: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` +SIM118.py:9:1: SIM118 [**] Use `key in dict` instead of `key in dict.keys()` | 7 | foo["bar"] not in obj.keys() # SIM118 8 | @@ -100,7 +100,7 @@ SIM118.py:9:1: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` 11 11 | foo['bar'] not in obj.keys() # SIM118 12 12 | -SIM118.py:11:1: SIM118 [*] Use `key not in dict` instead of `key not in dict.keys()` +SIM118.py:11:1: SIM118 [**] Use `key not in dict` instead of `key not in dict.keys()` | 9 | foo['bar'] in obj.keys() # SIM118 10 | @@ -121,7 +121,7 @@ SIM118.py:11:1: SIM118 [*] Use `key not in dict` instead of `key not in dict.key 13 13 | foo() in obj.keys() # SIM118 14 14 | -SIM118.py:13:1: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` +SIM118.py:13:1: SIM118 [**] Use `key in dict` instead of `key in dict.keys()` | 11 | foo['bar'] not in obj.keys() # SIM118 12 | @@ -142,7 +142,7 @@ SIM118.py:13:1: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` 15 15 | foo() not in obj.keys() # SIM118 16 16 | -SIM118.py:15:1: SIM118 [*] Use `key not in dict` instead of `key not in dict.keys()` +SIM118.py:15:1: SIM118 [**] Use `key not in dict` instead of `key not in dict.keys()` | 13 | foo() in obj.keys() # SIM118 14 | @@ -163,7 +163,7 @@ SIM118.py:15:1: SIM118 [*] Use `key not in dict` instead of `key not in dict.key 17 17 | for key in obj.keys(): # SIM118 18 18 | pass -SIM118.py:17:5: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` +SIM118.py:17:5: SIM118 [**] Use `key in dict` instead of `key in dict.keys()` | 15 | foo() not in obj.keys() # SIM118 16 | @@ -183,7 +183,7 @@ SIM118.py:17:5: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` 19 19 | 20 20 | for key in list(obj.keys()): -SIM118.py:24:8: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` +SIM118.py:24:8: SIM118 [**] Use `key in dict` instead of `key in dict.keys()` | 22 | del obj[key] 23 | @@ -204,7 +204,7 @@ SIM118.py:24:8: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` 26 26 | {k for k in obj.keys()} # SIM118 27 27 | -SIM118.py:26:8: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` +SIM118.py:26:8: SIM118 [**] Use `key in dict` instead of `key in dict.keys()` | 24 | [k for k in obj.keys()] # SIM118 25 | @@ -225,7 +225,7 @@ SIM118.py:26:8: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` 28 28 | {k: k for k in obj.keys()} # SIM118 29 29 | -SIM118.py:28:11: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` +SIM118.py:28:11: SIM118 [**] Use `key in dict` instead of `key in dict.keys()` | 26 | {k for k in obj.keys()} # SIM118 27 | @@ -246,7 +246,7 @@ SIM118.py:28:11: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` 30 30 | (k for k in obj.keys()) # SIM118 31 31 | -SIM118.py:30:8: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` +SIM118.py:30:8: SIM118 [**] Use `key in dict` instead of `key in dict.keys()` | 28 | {k: k for k in obj.keys()} # SIM118 29 | @@ -267,7 +267,7 @@ SIM118.py:30:8: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` 32 32 | key in (obj or {}).keys() # SIM118 33 33 | -SIM118.py:32:1: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` +SIM118.py:32:1: SIM118 [**] Use `key in dict` instead of `key in dict.keys()` | 30 | (k for k in obj.keys()) # SIM118 31 | @@ -288,7 +288,7 @@ SIM118.py:32:1: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` 34 34 | (key) in (obj or {}).keys() # SIM118 35 35 | -SIM118.py:34:1: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` +SIM118.py:34:1: SIM118 [**] Use `key in dict` instead of `key in dict.keys()` | 32 | key in (obj or {}).keys() # SIM118 33 | @@ -309,7 +309,7 @@ SIM118.py:34:1: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` 36 36 | from typing import KeysView 37 37 | -SIM118.py:48:1: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` +SIM118.py:48:1: SIM118 [**] Use `key in dict` instead of `key in dict.keys()` | 47 | # Regression test for: https://github.com/astral-sh/ruff/issues/7124 48 | key in obj.keys()and foo @@ -329,7 +329,7 @@ SIM118.py:48:1: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` 50 50 | key in (obj.keys())and foo 51 51 | -SIM118.py:49:2: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` +SIM118.py:49:2: SIM118 [**] Use `key in dict` instead of `key in dict.keys()` | 47 | # Regression test for: https://github.com/astral-sh/ruff/issues/7124 48 | key in obj.keys()and foo @@ -349,7 +349,7 @@ SIM118.py:49:2: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` 51 51 | 52 52 | # Regression test for: https://github.com/astral-sh/ruff/issues/7200 -SIM118.py:50:1: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` +SIM118.py:50:1: SIM118 [**] Use `key in dict` instead of `key in dict.keys()` | 48 | key in obj.keys()and foo 49 | (key in obj.keys())and foo @@ -370,7 +370,7 @@ SIM118.py:50:1: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` 52 52 | # Regression test for: https://github.com/astral-sh/ruff/issues/7200 53 53 | for key in ( -SIM118.py:53:5: SIM118 [*] Use `key in dict` instead of `key in dict.keys()` +SIM118.py:53:5: SIM118 [**] Use `key in dict` instead of `key in dict.keys()` | 52 | # Regression test for: https://github.com/astral-sh/ruff/issues/7200 53 | for key in ( diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM202_SIM202.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM202_SIM202.py.snap index 739679e4deb3c3..ee135fa5e61ca7 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM202_SIM202.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM202_SIM202.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM202.py:2:4: SIM202 [*] Use `a == b` instead of `not a != b` +SIM202.py:2:4: SIM202 [**] Use `a == b` instead of `not a != b` | 1 | # SIM202 2 | if not a != b: @@ -18,7 +18,7 @@ SIM202.py:2:4: SIM202 [*] Use `a == b` instead of `not a != b` 4 4 | 5 5 | # SIM202 -SIM202.py:6:4: SIM202 [*] Use `a == b + c` instead of `not a != b + c` +SIM202.py:6:4: SIM202 [**] Use `a == b + c` instead of `not a != b + c` | 5 | # SIM202 6 | if not a != (b + c): @@ -37,7 +37,7 @@ SIM202.py:6:4: SIM202 [*] Use `a == b + c` instead of `not a != b + c` 8 8 | 9 9 | # SIM202 -SIM202.py:10:4: SIM202 [*] Use `a + b == c` instead of `not a + b != c` +SIM202.py:10:4: SIM202 [**] Use `a + b == c` instead of `not a + b != c` | 9 | # SIM202 10 | if not (a + b) != c: diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM208_SIM208.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM208_SIM208.py.snap index f1b5030c024dd2..2642af806aa749 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM208_SIM208.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM208_SIM208.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM208.py:1:4: SIM208 [*] Use `a` instead of `not (not a)` +SIM208.py:1:4: SIM208 [**] Use `a` instead of `not (not a)` | 1 | if not (not a): # SIM208 | ^^^^^^^^^^^ SIM208 @@ -16,7 +16,7 @@ SIM208.py:1:4: SIM208 [*] Use `a` instead of `not (not a)` 3 3 | 4 4 | if not (not (a == b)): # SIM208 -SIM208.py:4:4: SIM208 [*] Use `a == b` instead of `not (not a == b)` +SIM208.py:4:4: SIM208 [**] Use `a == b` instead of `not (not a == b)` | 2 | pass 3 | @@ -36,7 +36,7 @@ SIM208.py:4:4: SIM208 [*] Use `a == b` instead of `not (not a == b)` 6 6 | 7 7 | if not a: # OK -SIM208.py:16:5: SIM208 [*] Use `b` instead of `not (not b)` +SIM208.py:16:5: SIM208 [**] Use `b` instead of `not (not b)` | 14 | pass 15 | @@ -57,7 +57,7 @@ SIM208.py:16:5: SIM208 [*] Use `b` instead of `not (not b)` 18 18 | f(not not a) # SIM208 19 19 | -SIM208.py:18:3: SIM208 [*] Use `a` instead of `not (not a)` +SIM208.py:18:3: SIM208 [**] Use `a` instead of `not (not a)` | 16 | a = not not b # SIM208 17 | @@ -78,7 +78,7 @@ SIM208.py:18:3: SIM208 [*] Use `a` instead of `not (not a)` 20 20 | if 1 + (not (not a)): # SIM208 21 21 | pass -SIM208.py:20:9: SIM208 [*] Use `a` instead of `not (not a)` +SIM208.py:20:9: SIM208 [**] Use `a` instead of `not (not a)` | 18 | f(not not a) # SIM208 19 | diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM210_SIM210.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM210_SIM210.py.snap index 7f7cfde237e166..5cf1126fcb3d6c 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM210_SIM210.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM210_SIM210.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM210.py:1:5: SIM210 [*] Use `bool(...)` instead of `True if ... else False` +SIM210.py:1:5: SIM210 [**] Use `bool(...)` instead of `True if ... else False` | 1 | a = True if b else False # SIM210 | ^^^^^^^^^^^^^^^^^^^^ SIM210 @@ -17,7 +17,7 @@ SIM210.py:1:5: SIM210 [*] Use `bool(...)` instead of `True if ... else False` 3 3 | a = True if b != c else False # SIM210 4 4 | -SIM210.py:3:5: SIM210 [*] Remove unnecessary `True if ... else False` +SIM210.py:3:5: SIM210 [**] Remove unnecessary `True if ... else False` | 1 | a = True if b else False # SIM210 2 | @@ -37,7 +37,7 @@ SIM210.py:3:5: SIM210 [*] Remove unnecessary `True if ... else False` 5 5 | a = True if b + c else False # SIM210 6 6 | -SIM210.py:5:5: SIM210 [*] Use `bool(...)` instead of `True if ... else False` +SIM210.py:5:5: SIM210 [**] Use `bool(...)` instead of `True if ... else False` | 3 | a = True if b != c else False # SIM210 4 | @@ -67,7 +67,7 @@ SIM210.py:15:9: SIM210 Use `bool(...)` instead of `True if ... else False` | = help: Replace with `bool(...) -SIM210.py:19:11: SIM210 [*] Remove unnecessary `True if ... else False` +SIM210.py:19:11: SIM210 [**] Remove unnecessary `True if ... else False` | 18 | # Regression test for: https://github.com/astral-sh/ruff/issues/7076 19 | samesld = True if (psl.privatesuffix(urlparse(response.url).netloc) == diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM211_SIM211.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM211_SIM211.py.snap index 359b5384bc06a3..f4e1fb522d568c 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM211_SIM211.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM211_SIM211.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM211.py:1:5: SIM211 [*] Use `not ...` instead of `False if ... else True` +SIM211.py:1:5: SIM211 [**] Use `not ...` instead of `False if ... else True` | 1 | a = False if b else True # SIM211 | ^^^^^^^^^^^^^^^^^^^^ SIM211 @@ -17,7 +17,7 @@ SIM211.py:1:5: SIM211 [*] Use `not ...` instead of `False if ... else True` 3 3 | a = False if b != c else True # SIM211 4 4 | -SIM211.py:3:5: SIM211 [*] Use `not ...` instead of `False if ... else True` +SIM211.py:3:5: SIM211 [**] Use `not ...` instead of `False if ... else True` | 1 | a = False if b else True # SIM211 2 | @@ -37,7 +37,7 @@ SIM211.py:3:5: SIM211 [*] Use `not ...` instead of `False if ... else True` 5 5 | a = False if b + c else True # SIM211 6 6 | -SIM211.py:5:5: SIM211 [*] Use `not ...` instead of `False if ... else True` +SIM211.py:5:5: SIM211 [**] Use `not ...` instead of `False if ... else True` | 3 | a = False if b != c else True # SIM211 4 | diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM212_SIM212.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM212_SIM212.py.snap index 956cc50036d1eb..348bbad9bfe420 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM212_SIM212.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM212_SIM212.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM212.py:1:5: SIM212 [*] Use `a if a else b` instead of `b if not a else a` +SIM212.py:1:5: SIM212 [**] Use `a if a else b` instead of `b if not a else a` | 1 | c = b if not a else a # SIM212 | ^^^^^^^^^^^^^^^^^ SIM212 @@ -17,7 +17,7 @@ SIM212.py:1:5: SIM212 [*] Use `a if a else b` instead of `b if not a else a` 3 3 | c = b + c if not a else a # SIM212 4 4 | -SIM212.py:3:5: SIM212 [*] Use `a if a else b + c` instead of `b + c if not a else a` +SIM212.py:3:5: SIM212 [**] Use `a if a else b + c` instead of `b + c if not a else a` | 1 | c = b if not a else a # SIM212 2 | diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM220_SIM220.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM220_SIM220.py.snap index bf50be10507e3c..03c2374031d428 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM220_SIM220.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM220_SIM220.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM220.py:1:4: SIM220 [*] Use `False` instead of `a and not a` +SIM220.py:1:4: SIM220 [**] Use `False` instead of `a and not a` | 1 | if a and not a: | ^^^^^^^^^^^ SIM220 @@ -16,7 +16,7 @@ SIM220.py:1:4: SIM220 [*] Use `False` instead of `a and not a` 3 3 | 4 4 | if (a and not a) and b: -SIM220.py:4:5: SIM220 [*] Use `False` instead of `a and not a` +SIM220.py:4:5: SIM220 [**] Use `False` instead of `a and not a` | 2 | pass 3 | @@ -36,7 +36,7 @@ SIM220.py:4:5: SIM220 [*] Use `False` instead of `a and not a` 6 6 | 7 7 | if (a and not a) or b: -SIM220.py:7:5: SIM220 [*] Use `False` instead of `a and not a` +SIM220.py:7:5: SIM220 [**] Use `False` instead of `a and not a` | 5 | pass 6 | diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM221_SIM221.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM221_SIM221.py.snap index cb3d53dfe77227..3472e669bf8a17 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM221_SIM221.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM221_SIM221.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM221.py:1:4: SIM221 [*] Use `True` instead of `a or not a` +SIM221.py:1:4: SIM221 [**] Use `True` instead of `a or not a` | 1 | if a or not a: | ^^^^^^^^^^ SIM221 @@ -16,7 +16,7 @@ SIM221.py:1:4: SIM221 [*] Use `True` instead of `a or not a` 3 3 | 4 4 | if (a or not a) or b: -SIM221.py:4:5: SIM221 [*] Use `True` instead of `a or not a` +SIM221.py:4:5: SIM221 [**] Use `True` instead of `a or not a` | 2 | pass 3 | @@ -36,7 +36,7 @@ SIM221.py:4:5: SIM221 [*] Use `True` instead of `a or not a` 6 6 | 7 7 | if (a or not a) and b: -SIM221.py:7:5: SIM221 [*] Use `True` instead of `a or not a` +SIM221.py:7:5: SIM221 [**] Use `True` instead of `a or not a` | 5 | pass 6 | diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM222_SIM222.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM222_SIM222.py.snap index 02d93e42fc0398..d07375d8d3298e 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM222_SIM222.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM222_SIM222.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM222.py:1:4: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:1:4: SIM222 [**] Use `True` instead of `... or True` | 1 | if a or True: # SIM222 | ^^^^^^^^^ SIM222 @@ -16,7 +16,7 @@ SIM222.py:1:4: SIM222 [*] Use `True` instead of `... or True` 3 3 | 4 4 | if (a or b) or True: # SIM222 -SIM222.py:4:4: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:4:4: SIM222 [**] Use `True` instead of `... or True` | 2 | pass 3 | @@ -36,7 +36,7 @@ SIM222.py:4:4: SIM222 [*] Use `True` instead of `... or True` 6 6 | 7 7 | if a or (b or True): # SIM222 -SIM222.py:7:10: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:7:10: SIM222 [**] Use `True` instead of `... or True` | 5 | pass 6 | @@ -56,7 +56,7 @@ SIM222.py:7:10: SIM222 [*] Use `True` instead of `... or True` 9 9 | 10 10 | if a and True: # OK -SIM222.py:24:16: SIM222 [*] Use `True` instead of `True or ...` +SIM222.py:24:16: SIM222 [**] Use `True` instead of `True or ...` | 22 | pass 23 | @@ -76,7 +76,7 @@ SIM222.py:24:16: SIM222 [*] Use `True` instead of `True or ...` 26 26 | 27 27 | if True or f() or a or g() or b: # SIM222 -SIM222.py:27:4: SIM222 [*] Use `True` instead of `True or ...` +SIM222.py:27:4: SIM222 [**] Use `True` instead of `True or ...` | 25 | pass 26 | @@ -96,7 +96,7 @@ SIM222.py:27:4: SIM222 [*] Use `True` instead of `True or ...` 29 29 | 30 30 | if a or True or f() or b or g(): # SIM222 -SIM222.py:30:4: SIM222 [*] Use `True` instead of `... or True or ...` +SIM222.py:30:4: SIM222 [**] Use `True` instead of `... or True or ...` | 28 | pass 29 | @@ -116,7 +116,7 @@ SIM222.py:30:4: SIM222 [*] Use `True` instead of `... or True or ...` 32 32 | 33 33 | -SIM222.py:47:6: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:47:6: SIM222 [**] Use `True` instead of `... or True` | 47 | a or "" or True # SIM222 | ^^^^^^^^^^ SIM222 @@ -135,7 +135,7 @@ SIM222.py:47:6: SIM222 [*] Use `True` instead of `... or True` 49 49 | a or "foo" or True or "bar" # SIM222 50 50 | -SIM222.py:49:6: SIM222 [*] Use `"foo"` instead of `"foo" or ...` +SIM222.py:49:6: SIM222 [**] Use `"foo"` instead of `"foo" or ...` | 47 | a or "" or True # SIM222 48 | @@ -156,7 +156,7 @@ SIM222.py:49:6: SIM222 [*] Use `"foo"` instead of `"foo" or ...` 51 51 | a or 0 or True # SIM222 52 52 | -SIM222.py:51:6: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:51:6: SIM222 [**] Use `True` instead of `... or True` | 49 | a or "foo" or True or "bar" # SIM222 50 | @@ -177,7 +177,7 @@ SIM222.py:51:6: SIM222 [*] Use `True` instead of `... or True` 53 53 | a or 1 or True or 2 # SIM222 54 54 | -SIM222.py:53:6: SIM222 [*] Use `1` instead of `1 or ...` +SIM222.py:53:6: SIM222 [**] Use `1` instead of `1 or ...` | 51 | a or 0 or True # SIM222 52 | @@ -198,7 +198,7 @@ SIM222.py:53:6: SIM222 [*] Use `1` instead of `1 or ...` 55 55 | a or 0.0 or True # SIM222 56 56 | -SIM222.py:55:6: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:55:6: SIM222 [**] Use `True` instead of `... or True` | 53 | a or 1 or True or 2 # SIM222 54 | @@ -219,7 +219,7 @@ SIM222.py:55:6: SIM222 [*] Use `True` instead of `... or True` 57 57 | a or 0.1 or True or 0.2 # SIM222 58 58 | -SIM222.py:57:6: SIM222 [*] Use `0.1` instead of `0.1 or ...` +SIM222.py:57:6: SIM222 [**] Use `0.1` instead of `0.1 or ...` | 55 | a or 0.0 or True # SIM222 56 | @@ -240,7 +240,7 @@ SIM222.py:57:6: SIM222 [*] Use `0.1` instead of `0.1 or ...` 59 59 | a or [] or True # SIM222 60 60 | -SIM222.py:59:6: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:59:6: SIM222 [**] Use `True` instead of `... or True` | 57 | a or 0.1 or True or 0.2 # SIM222 58 | @@ -261,7 +261,7 @@ SIM222.py:59:6: SIM222 [*] Use `True` instead of `... or True` 61 61 | a or list([]) or True # SIM222 62 62 | -SIM222.py:61:6: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:61:6: SIM222 [**] Use `True` instead of `... or True` | 59 | a or [] or True # SIM222 60 | @@ -282,7 +282,7 @@ SIM222.py:61:6: SIM222 [*] Use `True` instead of `... or True` 63 63 | a or [1] or True or [2] # SIM222 64 64 | -SIM222.py:63:6: SIM222 [*] Use `[1]` instead of `[1] or ...` +SIM222.py:63:6: SIM222 [**] Use `[1]` instead of `[1] or ...` | 61 | a or list([]) or True # SIM222 62 | @@ -303,7 +303,7 @@ SIM222.py:63:6: SIM222 [*] Use `[1]` instead of `[1] or ...` 65 65 | a or list([1]) or True or list([2]) # SIM222 66 66 | -SIM222.py:65:6: SIM222 [*] Use `list([1])` instead of `list([1]) or ...` +SIM222.py:65:6: SIM222 [**] Use `list([1])` instead of `list([1]) or ...` | 63 | a or [1] or True or [2] # SIM222 64 | @@ -324,7 +324,7 @@ SIM222.py:65:6: SIM222 [*] Use `list([1])` instead of `list([1]) or ...` 67 67 | a or {} or True # SIM222 68 68 | -SIM222.py:67:6: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:67:6: SIM222 [**] Use `True` instead of `... or True` | 65 | a or list([1]) or True or list([2]) # SIM222 66 | @@ -345,7 +345,7 @@ SIM222.py:67:6: SIM222 [*] Use `True` instead of `... or True` 69 69 | a or dict() or True # SIM222 70 70 | -SIM222.py:69:6: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:69:6: SIM222 [**] Use `True` instead of `... or True` | 67 | a or {} or True # SIM222 68 | @@ -366,7 +366,7 @@ SIM222.py:69:6: SIM222 [*] Use `True` instead of `... or True` 71 71 | a or {1: 1} or True or {2: 2} # SIM222 72 72 | -SIM222.py:71:6: SIM222 [*] Use `{1: 1}` instead of `{1: 1} or ...` +SIM222.py:71:6: SIM222 [**] Use `{1: 1}` instead of `{1: 1} or ...` | 69 | a or dict() or True # SIM222 70 | @@ -387,7 +387,7 @@ SIM222.py:71:6: SIM222 [*] Use `{1: 1}` instead of `{1: 1} or ...` 73 73 | a or dict({1: 1}) or True or dict({2: 2}) # SIM222 74 74 | -SIM222.py:73:6: SIM222 [*] Use `dict({1: 1})` instead of `dict({1: 1}) or ...` +SIM222.py:73:6: SIM222 [**] Use `dict({1: 1})` instead of `dict({1: 1}) or ...` | 71 | a or {1: 1} or True or {2: 2} # SIM222 72 | @@ -408,7 +408,7 @@ SIM222.py:73:6: SIM222 [*] Use `dict({1: 1})` instead of `dict({1: 1}) or ...` 75 75 | a or set() or True # SIM222 76 76 | -SIM222.py:75:6: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:75:6: SIM222 [**] Use `True` instead of `... or True` | 73 | a or dict({1: 1}) or True or dict({2: 2}) # SIM222 74 | @@ -429,7 +429,7 @@ SIM222.py:75:6: SIM222 [*] Use `True` instead of `... or True` 77 77 | a or set(set()) or True # SIM222 78 78 | -SIM222.py:77:6: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:77:6: SIM222 [**] Use `True` instead of `... or True` | 75 | a or set() or True # SIM222 76 | @@ -450,7 +450,7 @@ SIM222.py:77:6: SIM222 [*] Use `True` instead of `... or True` 79 79 | a or {1} or True or {2} # SIM222 80 80 | -SIM222.py:79:6: SIM222 [*] Use `{1}` instead of `{1} or ...` +SIM222.py:79:6: SIM222 [**] Use `{1}` instead of `{1} or ...` | 77 | a or set(set()) or True # SIM222 78 | @@ -471,7 +471,7 @@ SIM222.py:79:6: SIM222 [*] Use `{1}` instead of `{1} or ...` 81 81 | a or set({1}) or True or set({2}) # SIM222 82 82 | -SIM222.py:81:6: SIM222 [*] Use `set({1})` instead of `set({1}) or ...` +SIM222.py:81:6: SIM222 [**] Use `set({1})` instead of `set({1}) or ...` | 79 | a or {1} or True or {2} # SIM222 80 | @@ -492,7 +492,7 @@ SIM222.py:81:6: SIM222 [*] Use `set({1})` instead of `set({1}) or ...` 83 83 | a or () or True # SIM222 84 84 | -SIM222.py:83:6: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:83:6: SIM222 [**] Use `True` instead of `... or True` | 81 | a or set({1}) or True or set({2}) # SIM222 82 | @@ -513,7 +513,7 @@ SIM222.py:83:6: SIM222 [*] Use `True` instead of `... or True` 85 85 | a or tuple(()) or True # SIM222 86 86 | -SIM222.py:85:6: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:85:6: SIM222 [**] Use `True` instead of `... or True` | 83 | a or () or True # SIM222 84 | @@ -534,7 +534,7 @@ SIM222.py:85:6: SIM222 [*] Use `True` instead of `... or True` 87 87 | a or (1,) or True or (2,) # SIM222 88 88 | -SIM222.py:87:6: SIM222 [*] Use `(1,)` instead of `(1,) or ...` +SIM222.py:87:6: SIM222 [**] Use `(1,)` instead of `(1,) or ...` | 85 | a or tuple(()) or True # SIM222 86 | @@ -555,7 +555,7 @@ SIM222.py:87:6: SIM222 [*] Use `(1,)` instead of `(1,) or ...` 89 89 | a or tuple((1,)) or True or tuple((2,)) # SIM222 90 90 | -SIM222.py:89:6: SIM222 [*] Use `tuple((1,))` instead of `tuple((1,)) or ...` +SIM222.py:89:6: SIM222 [**] Use `tuple((1,))` instead of `tuple((1,)) or ...` | 87 | a or (1,) or True or (2,) # SIM222 88 | @@ -576,7 +576,7 @@ SIM222.py:89:6: SIM222 [*] Use `tuple((1,))` instead of `tuple((1,)) or ...` 91 91 | a or frozenset() or True # SIM222 92 92 | -SIM222.py:91:6: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:91:6: SIM222 [**] Use `True` instead of `... or True` | 89 | a or tuple((1,)) or True or tuple((2,)) # SIM222 90 | @@ -597,7 +597,7 @@ SIM222.py:91:6: SIM222 [*] Use `True` instead of `... or True` 93 93 | a or frozenset(frozenset()) or True # SIM222 94 94 | -SIM222.py:93:6: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:93:6: SIM222 [**] Use `True` instead of `... or True` | 91 | a or frozenset() or True # SIM222 92 | @@ -618,7 +618,7 @@ SIM222.py:93:6: SIM222 [*] Use `True` instead of `... or True` 95 95 | a or frozenset({1}) or True or frozenset({2}) # SIM222 96 96 | -SIM222.py:95:6: SIM222 [*] Use `frozenset({1})` instead of `frozenset({1}) or ...` +SIM222.py:95:6: SIM222 [**] Use `frozenset({1})` instead of `frozenset({1}) or ...` | 93 | a or frozenset(frozenset()) or True # SIM222 94 | @@ -639,7 +639,7 @@ SIM222.py:95:6: SIM222 [*] Use `frozenset({1})` instead of `frozenset({1}) or .. 97 97 | a or frozenset(frozenset({1})) or True or frozenset(frozenset({2})) # SIM222 98 98 | -SIM222.py:97:6: SIM222 [*] Use `frozenset(frozenset({1}))` instead of `frozenset(frozenset({1})) or ...` +SIM222.py:97:6: SIM222 [**] Use `frozenset(frozenset({1}))` instead of `frozenset(frozenset({1})) or ...` | 95 | a or frozenset({1}) or True or frozenset({2}) # SIM222 96 | @@ -658,7 +658,7 @@ SIM222.py:97:6: SIM222 [*] Use `frozenset(frozenset({1}))` instead of `frozenset 99 99 | 100 100 | # Inside test `a` is simplified. -SIM222.py:102:6: SIM222 [*] Use `True` instead of `... or True or ...` +SIM222.py:102:6: SIM222 [**] Use `True` instead of `... or True or ...` | 100 | # Inside test `a` is simplified. 101 | @@ -679,7 +679,7 @@ SIM222.py:102:6: SIM222 [*] Use `True` instead of `... or True or ...` 104 104 | assert a or [1] or True or [2] # SIM222 105 105 | -SIM222.py:104:8: SIM222 [*] Use `True` instead of `... or True or ...` +SIM222.py:104:8: SIM222 [**] Use `True` instead of `... or True or ...` | 102 | bool(a or [1] or True or [2]) # SIM222 103 | @@ -700,7 +700,7 @@ SIM222.py:104:8: SIM222 [*] Use `True` instead of `... or True or ...` 106 106 | if (a or [1] or True or [2]) and (a or [1] or True or [2]): # SIM222 107 107 | pass -SIM222.py:106:5: SIM222 [*] Use `True` instead of `... or True or ...` +SIM222.py:106:5: SIM222 [**] Use `True` instead of `... or True or ...` | 104 | assert a or [1] or True or [2] # SIM222 105 | @@ -720,7 +720,7 @@ SIM222.py:106:5: SIM222 [*] Use `True` instead of `... or True or ...` 108 108 | 109 109 | 0 if a or [1] or True or [2] else 1 # SIM222 -SIM222.py:106:35: SIM222 [*] Use `True` instead of `... or True or ...` +SIM222.py:106:35: SIM222 [**] Use `True` instead of `... or True or ...` | 104 | assert a or [1] or True or [2] # SIM222 105 | @@ -740,7 +740,7 @@ SIM222.py:106:35: SIM222 [*] Use `True` instead of `... or True or ...` 108 108 | 109 109 | 0 if a or [1] or True or [2] else 1 # SIM222 -SIM222.py:109:6: SIM222 [*] Use `True` instead of `... or True or ...` +SIM222.py:109:6: SIM222 [**] Use `True` instead of `... or True or ...` | 107 | pass 108 | @@ -761,7 +761,7 @@ SIM222.py:109:6: SIM222 [*] Use `True` instead of `... or True or ...` 111 111 | while a or [1] or True or [2]: # SIM222 112 112 | pass -SIM222.py:111:7: SIM222 [*] Use `True` instead of `... or True or ...` +SIM222.py:111:7: SIM222 [**] Use `True` instead of `... or True or ...` | 109 | 0 if a or [1] or True or [2] else 1 # SIM222 110 | @@ -781,7 +781,7 @@ SIM222.py:111:7: SIM222 [*] Use `True` instead of `... or True or ...` 113 113 | 114 114 | [ -SIM222.py:118:8: SIM222 [*] Use `True` instead of `... or True or ...` +SIM222.py:118:8: SIM222 [**] Use `True` instead of `... or True or ...` | 116 | for a in range(10) 117 | for b in range(10) @@ -802,7 +802,7 @@ SIM222.py:118:8: SIM222 [*] Use `True` instead of `... or True or ...` 120 120 | ] 121 121 | -SIM222.py:119:8: SIM222 [*] Use `True` instead of `... or True or ...` +SIM222.py:119:8: SIM222 [**] Use `True` instead of `... or True or ...` | 117 | for b in range(10) 118 | if a or [1] or True or [2] # SIM222 @@ -822,7 +822,7 @@ SIM222.py:119:8: SIM222 [*] Use `True` instead of `... or True or ...` 121 121 | 122 122 | { -SIM222.py:126:8: SIM222 [*] Use `True` instead of `... or True or ...` +SIM222.py:126:8: SIM222 [**] Use `True` instead of `... or True or ...` | 124 | for a in range(10) 125 | for b in range(10) @@ -843,7 +843,7 @@ SIM222.py:126:8: SIM222 [*] Use `True` instead of `... or True or ...` 128 128 | } 129 129 | -SIM222.py:127:8: SIM222 [*] Use `True` instead of `... or True or ...` +SIM222.py:127:8: SIM222 [**] Use `True` instead of `... or True or ...` | 125 | for b in range(10) 126 | if a or [1] or True or [2] # SIM222 @@ -863,7 +863,7 @@ SIM222.py:127:8: SIM222 [*] Use `True` instead of `... or True or ...` 129 129 | 130 130 | { -SIM222.py:134:8: SIM222 [*] Use `True` instead of `... or True or ...` +SIM222.py:134:8: SIM222 [**] Use `True` instead of `... or True or ...` | 132 | for a in range(10) 133 | for b in range(10) @@ -884,7 +884,7 @@ SIM222.py:134:8: SIM222 [*] Use `True` instead of `... or True or ...` 136 136 | } 137 137 | -SIM222.py:135:8: SIM222 [*] Use `True` instead of `... or True or ...` +SIM222.py:135:8: SIM222 [**] Use `True` instead of `... or True or ...` | 133 | for b in range(10) 134 | if a or [1] or True or [2] # SIM222 @@ -904,7 +904,7 @@ SIM222.py:135:8: SIM222 [*] Use `True` instead of `... or True or ...` 137 137 | 138 138 | ( -SIM222.py:142:8: SIM222 [*] Use `True` instead of `... or True or ...` +SIM222.py:142:8: SIM222 [**] Use `True` instead of `... or True or ...` | 140 | for a in range(10) 141 | for b in range(10) @@ -925,7 +925,7 @@ SIM222.py:142:8: SIM222 [*] Use `True` instead of `... or True or ...` 144 144 | ) 145 145 | -SIM222.py:143:8: SIM222 [*] Use `True` instead of `... or True or ...` +SIM222.py:143:8: SIM222 [**] Use `True` instead of `... or True or ...` | 141 | for b in range(10) 142 | if a or [1] or True or [2] # SIM222 @@ -945,7 +945,7 @@ SIM222.py:143:8: SIM222 [*] Use `True` instead of `... or True or ...` 145 145 | 146 146 | # Outside test `a` is not simplified. -SIM222.py:148:6: SIM222 [*] Use `[1]` instead of `[1] or ...` +SIM222.py:148:6: SIM222 [**] Use `[1]` instead of `[1] or ...` | 146 | # Outside test `a` is not simplified. 147 | @@ -966,7 +966,7 @@ SIM222.py:148:6: SIM222 [*] Use `[1]` instead of `[1] or ...` 150 150 | if (a or [1] or True or [2]) == (a or [1]): # SIM222 151 151 | pass -SIM222.py:150:10: SIM222 [*] Use `[1]` instead of `[1] or ...` +SIM222.py:150:10: SIM222 [**] Use `[1]` instead of `[1] or ...` | 148 | a or [1] or True or [2] # SIM222 149 | @@ -986,7 +986,7 @@ SIM222.py:150:10: SIM222 [*] Use `[1]` instead of `[1] or ...` 152 152 | 153 153 | if f(a or [1] or True or [2]): # SIM222 -SIM222.py:153:11: SIM222 [*] Use `[1]` instead of `[1] or ...` +SIM222.py:153:11: SIM222 [**] Use `[1]` instead of `[1] or ...` | 151 | pass 152 | @@ -1006,7 +1006,7 @@ SIM222.py:153:11: SIM222 [*] Use `[1]` instead of `[1] or ...` 155 155 | 156 156 | # Regression test for: https://github.com/astral-sh/ruff/issues/7099 -SIM222.py:157:30: SIM222 [*] Use `(int, int, int)` instead of `(int, int, int) or ...` +SIM222.py:157:30: SIM222 [**] Use `(int, int, int)` instead of `(int, int, int) or ...` | 156 | # Regression test for: https://github.com/astral-sh/ruff/issues/7099 157 | def secondToTime(s0: int) -> (int, int, int) or str: @@ -1025,7 +1025,7 @@ SIM222.py:157:30: SIM222 [*] Use `(int, int, int)` instead of `(int, int, int) o 159 159 | 160 160 | -SIM222.py:161:31: SIM222 [*] Use `(int, int, int)` instead of `(int, int, int) or ...` +SIM222.py:161:31: SIM222 [**] Use `(int, int, int)` instead of `(int, int, int) or ...` | 161 | def secondToTime(s0: int) -> ((int, int, int) or str): | ^^^^^^^^^^^^^^^^^^^^^^ SIM222 diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM223_SIM223.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM223_SIM223.py.snap index 4454bf48517976..aecc64139fdbaa 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM223_SIM223.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM223_SIM223.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM223.py:1:4: SIM223 [*] Use `False` instead of `... and False` +SIM223.py:1:4: SIM223 [**] Use `False` instead of `... and False` | 1 | if a and False: # SIM223 | ^^^^^^^^^^^ SIM223 @@ -16,7 +16,7 @@ SIM223.py:1:4: SIM223 [*] Use `False` instead of `... and False` 3 3 | 4 4 | if (a or b) and False: # SIM223 -SIM223.py:4:4: SIM223 [*] Use `False` instead of `... and False` +SIM223.py:4:4: SIM223 [**] Use `False` instead of `... and False` | 2 | pass 3 | @@ -36,7 +36,7 @@ SIM223.py:4:4: SIM223 [*] Use `False` instead of `... and False` 6 6 | 7 7 | if a or (b and False): # SIM223 -SIM223.py:7:10: SIM223 [*] Use `False` instead of `... and False` +SIM223.py:7:10: SIM223 [**] Use `False` instead of `... and False` | 5 | pass 6 | @@ -56,7 +56,7 @@ SIM223.py:7:10: SIM223 [*] Use `False` instead of `... and False` 9 9 | 10 10 | if a or False: -SIM223.py:19:18: SIM223 [*] Use `False` instead of `False and ...` +SIM223.py:19:18: SIM223 [**] Use `False` instead of `False and ...` | 17 | pass 18 | @@ -76,7 +76,7 @@ SIM223.py:19:18: SIM223 [*] Use `False` instead of `False and ...` 21 21 | 22 22 | if False and f() and a and g() and b: # SIM223 -SIM223.py:22:4: SIM223 [*] Use `False` instead of `False and ...` +SIM223.py:22:4: SIM223 [**] Use `False` instead of `False and ...` | 20 | pass 21 | @@ -96,7 +96,7 @@ SIM223.py:22:4: SIM223 [*] Use `False` instead of `False and ...` 24 24 | 25 25 | if a and False and f() and b and g(): # SIM223 -SIM223.py:25:4: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:25:4: SIM223 [**] Use `False` instead of `... and False and ...` | 23 | pass 24 | @@ -116,7 +116,7 @@ SIM223.py:25:4: SIM223 [*] Use `False` instead of `... and False and ...` 27 27 | 28 28 | -SIM223.py:42:7: SIM223 [*] Use `""` instead of `"" and ...` +SIM223.py:42:7: SIM223 [**] Use `""` instead of `"" and ...` | 42 | a and "" and False # SIM223 | ^^^^^^^^^^^^ SIM223 @@ -135,7 +135,7 @@ SIM223.py:42:7: SIM223 [*] Use `""` instead of `"" and ...` 44 44 | a and "foo" and False and "bar" # SIM223 45 45 | -SIM223.py:44:7: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:44:7: SIM223 [**] Use `False` instead of `... and False and ...` | 42 | a and "" and False # SIM223 43 | @@ -156,7 +156,7 @@ SIM223.py:44:7: SIM223 [*] Use `False` instead of `... and False and ...` 46 46 | a and 0 and False # SIM223 47 47 | -SIM223.py:46:7: SIM223 [*] Use `0` instead of `0 and ...` +SIM223.py:46:7: SIM223 [**] Use `0` instead of `0 and ...` | 44 | a and "foo" and False and "bar" # SIM223 45 | @@ -177,7 +177,7 @@ SIM223.py:46:7: SIM223 [*] Use `0` instead of `0 and ...` 48 48 | a and 1 and False and 2 # SIM223 49 49 | -SIM223.py:48:7: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:48:7: SIM223 [**] Use `False` instead of `... and False and ...` | 46 | a and 0 and False # SIM223 47 | @@ -198,7 +198,7 @@ SIM223.py:48:7: SIM223 [*] Use `False` instead of `... and False and ...` 50 50 | a and 0.0 and False # SIM223 51 51 | -SIM223.py:50:7: SIM223 [*] Use `0.0` instead of `0.0 and ...` +SIM223.py:50:7: SIM223 [**] Use `0.0` instead of `0.0 and ...` | 48 | a and 1 and False and 2 # SIM223 49 | @@ -219,7 +219,7 @@ SIM223.py:50:7: SIM223 [*] Use `0.0` instead of `0.0 and ...` 52 52 | a and 0.1 and False and 0.2 # SIM223 53 53 | -SIM223.py:52:7: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:52:7: SIM223 [**] Use `False` instead of `... and False and ...` | 50 | a and 0.0 and False # SIM223 51 | @@ -240,7 +240,7 @@ SIM223.py:52:7: SIM223 [*] Use `False` instead of `... and False and ...` 54 54 | a and [] and False # SIM223 55 55 | -SIM223.py:54:7: SIM223 [*] Use `[]` instead of `[] and ...` +SIM223.py:54:7: SIM223 [**] Use `[]` instead of `[] and ...` | 52 | a and 0.1 and False and 0.2 # SIM223 53 | @@ -261,7 +261,7 @@ SIM223.py:54:7: SIM223 [*] Use `[]` instead of `[] and ...` 56 56 | a and list([]) and False # SIM223 57 57 | -SIM223.py:56:7: SIM223 [*] Use `list([])` instead of `list([]) and ...` +SIM223.py:56:7: SIM223 [**] Use `list([])` instead of `list([]) and ...` | 54 | a and [] and False # SIM223 55 | @@ -282,7 +282,7 @@ SIM223.py:56:7: SIM223 [*] Use `list([])` instead of `list([]) and ...` 58 58 | a and [1] and False and [2] # SIM223 59 59 | -SIM223.py:58:7: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:58:7: SIM223 [**] Use `False` instead of `... and False and ...` | 56 | a and list([]) and False # SIM223 57 | @@ -303,7 +303,7 @@ SIM223.py:58:7: SIM223 [*] Use `False` instead of `... and False and ...` 60 60 | a and list([1]) and False and list([2]) # SIM223 61 61 | -SIM223.py:60:7: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:60:7: SIM223 [**] Use `False` instead of `... and False and ...` | 58 | a and [1] and False and [2] # SIM223 59 | @@ -324,7 +324,7 @@ SIM223.py:60:7: SIM223 [*] Use `False` instead of `... and False and ...` 62 62 | a and {} and False # SIM223 63 63 | -SIM223.py:62:7: SIM223 [*] Use `{}` instead of `{} and ...` +SIM223.py:62:7: SIM223 [**] Use `{}` instead of `{} and ...` | 60 | a and list([1]) and False and list([2]) # SIM223 61 | @@ -345,7 +345,7 @@ SIM223.py:62:7: SIM223 [*] Use `{}` instead of `{} and ...` 64 64 | a and dict() and False # SIM223 65 65 | -SIM223.py:64:7: SIM223 [*] Use `dict()` instead of `dict() and ...` +SIM223.py:64:7: SIM223 [**] Use `dict()` instead of `dict() and ...` | 62 | a and {} and False # SIM223 63 | @@ -366,7 +366,7 @@ SIM223.py:64:7: SIM223 [*] Use `dict()` instead of `dict() and ...` 66 66 | a and {1: 1} and False and {2: 2} # SIM223 67 67 | -SIM223.py:66:7: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:66:7: SIM223 [**] Use `False` instead of `... and False and ...` | 64 | a and dict() and False # SIM223 65 | @@ -387,7 +387,7 @@ SIM223.py:66:7: SIM223 [*] Use `False` instead of `... and False and ...` 68 68 | a and dict({1: 1}) and False and dict({2: 2}) # SIM223 69 69 | -SIM223.py:68:7: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:68:7: SIM223 [**] Use `False` instead of `... and False and ...` | 66 | a and {1: 1} and False and {2: 2} # SIM223 67 | @@ -408,7 +408,7 @@ SIM223.py:68:7: SIM223 [*] Use `False` instead of `... and False and ...` 70 70 | a and set() and False # SIM223 71 71 | -SIM223.py:70:7: SIM223 [*] Use `set()` instead of `set() and ...` +SIM223.py:70:7: SIM223 [**] Use `set()` instead of `set() and ...` | 68 | a and dict({1: 1}) and False and dict({2: 2}) # SIM223 69 | @@ -429,7 +429,7 @@ SIM223.py:70:7: SIM223 [*] Use `set()` instead of `set() and ...` 72 72 | a and set(set()) and False # SIM223 73 73 | -SIM223.py:72:7: SIM223 [*] Use `set(set())` instead of `set(set()) and ...` +SIM223.py:72:7: SIM223 [**] Use `set(set())` instead of `set(set()) and ...` | 70 | a and set() and False # SIM223 71 | @@ -450,7 +450,7 @@ SIM223.py:72:7: SIM223 [*] Use `set(set())` instead of `set(set()) and ...` 74 74 | a and {1} and False and {2} # SIM223 75 75 | -SIM223.py:74:7: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:74:7: SIM223 [**] Use `False` instead of `... and False and ...` | 72 | a and set(set()) and False # SIM223 73 | @@ -471,7 +471,7 @@ SIM223.py:74:7: SIM223 [*] Use `False` instead of `... and False and ...` 76 76 | a and set({1}) and False and set({2}) # SIM223 77 77 | -SIM223.py:76:7: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:76:7: SIM223 [**] Use `False` instead of `... and False and ...` | 74 | a and {1} and False and {2} # SIM223 75 | @@ -492,7 +492,7 @@ SIM223.py:76:7: SIM223 [*] Use `False` instead of `... and False and ...` 78 78 | a and () and False # SIM222 79 79 | -SIM223.py:78:7: SIM223 [*] Use `()` instead of `() and ...` +SIM223.py:78:7: SIM223 [**] Use `()` instead of `() and ...` | 76 | a and set({1}) and False and set({2}) # SIM223 77 | @@ -513,7 +513,7 @@ SIM223.py:78:7: SIM223 [*] Use `()` instead of `() and ...` 80 80 | a and tuple(()) and False # SIM222 81 81 | -SIM223.py:80:7: SIM223 [*] Use `tuple(())` instead of `tuple(()) and ...` +SIM223.py:80:7: SIM223 [**] Use `tuple(())` instead of `tuple(()) and ...` | 78 | a and () and False # SIM222 79 | @@ -534,7 +534,7 @@ SIM223.py:80:7: SIM223 [*] Use `tuple(())` instead of `tuple(()) and ...` 82 82 | a and (1,) and False and (2,) # SIM222 83 83 | -SIM223.py:82:7: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:82:7: SIM223 [**] Use `False` instead of `... and False and ...` | 80 | a and tuple(()) and False # SIM222 81 | @@ -555,7 +555,7 @@ SIM223.py:82:7: SIM223 [*] Use `False` instead of `... and False and ...` 84 84 | a and tuple((1,)) and False and tuple((2,)) # SIM222 85 85 | -SIM223.py:84:7: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:84:7: SIM223 [**] Use `False` instead of `... and False and ...` | 82 | a and (1,) and False and (2,) # SIM222 83 | @@ -576,7 +576,7 @@ SIM223.py:84:7: SIM223 [*] Use `False` instead of `... and False and ...` 86 86 | a and frozenset() and False # SIM222 87 87 | -SIM223.py:86:7: SIM223 [*] Use `frozenset()` instead of `frozenset() and ...` +SIM223.py:86:7: SIM223 [**] Use `frozenset()` instead of `frozenset() and ...` | 84 | a and tuple((1,)) and False and tuple((2,)) # SIM222 85 | @@ -597,7 +597,7 @@ SIM223.py:86:7: SIM223 [*] Use `frozenset()` instead of `frozenset() and ...` 88 88 | a and frozenset(frozenset()) and False # SIM222 89 89 | -SIM223.py:88:7: SIM223 [*] Use `frozenset(frozenset())` instead of `frozenset(frozenset()) and ...` +SIM223.py:88:7: SIM223 [**] Use `frozenset(frozenset())` instead of `frozenset(frozenset()) and ...` | 86 | a and frozenset() and False # SIM222 87 | @@ -618,7 +618,7 @@ SIM223.py:88:7: SIM223 [*] Use `frozenset(frozenset())` instead of `frozenset(fr 90 90 | a and frozenset({1}) and False and frozenset({2}) # SIM222 91 91 | -SIM223.py:90:7: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:90:7: SIM223 [**] Use `False` instead of `... and False and ...` | 88 | a and frozenset(frozenset()) and False # SIM222 89 | @@ -639,7 +639,7 @@ SIM223.py:90:7: SIM223 [*] Use `False` instead of `... and False and ...` 92 92 | a and frozenset(frozenset({1})) and False and frozenset(frozenset({2})) # SIM222 93 93 | -SIM223.py:92:7: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:92:7: SIM223 [**] Use `False` instead of `... and False and ...` | 90 | a and frozenset({1}) and False and frozenset({2}) # SIM222 91 | @@ -658,7 +658,7 @@ SIM223.py:92:7: SIM223 [*] Use `False` instead of `... and False and ...` 94 94 | 95 95 | # Inside test `a` is simplified. -SIM223.py:97:6: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:97:6: SIM223 [**] Use `False` instead of `... and False and ...` | 95 | # Inside test `a` is simplified. 96 | @@ -679,7 +679,7 @@ SIM223.py:97:6: SIM223 [*] Use `False` instead of `... and False and ...` 99 99 | assert a and [] and False and [] # SIM223 100 100 | -SIM223.py:99:8: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:99:8: SIM223 [**] Use `False` instead of `... and False and ...` | 97 | bool(a and [] and False and []) # SIM223 98 | @@ -700,7 +700,7 @@ SIM223.py:99:8: SIM223 [*] Use `False` instead of `... and False and ...` 101 101 | if (a and [] and False and []) or (a and [] and False and []): # SIM223 102 102 | pass -SIM223.py:101:5: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:101:5: SIM223 [**] Use `False` instead of `... and False and ...` | 99 | assert a and [] and False and [] # SIM223 100 | @@ -720,7 +720,7 @@ SIM223.py:101:5: SIM223 [*] Use `False` instead of `... and False and ...` 103 103 | 104 104 | 0 if a and [] and False and [] else 1 # SIM222 -SIM223.py:101:36: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:101:36: SIM223 [**] Use `False` instead of `... and False and ...` | 99 | assert a and [] and False and [] # SIM223 100 | @@ -740,7 +740,7 @@ SIM223.py:101:36: SIM223 [*] Use `False` instead of `... and False and ...` 103 103 | 104 104 | 0 if a and [] and False and [] else 1 # SIM222 -SIM223.py:104:6: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:104:6: SIM223 [**] Use `False` instead of `... and False and ...` | 102 | pass 103 | @@ -761,7 +761,7 @@ SIM223.py:104:6: SIM223 [*] Use `False` instead of `... and False and ...` 106 106 | while a and [] and False and []: # SIM223 107 107 | pass -SIM223.py:106:7: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:106:7: SIM223 [**] Use `False` instead of `... and False and ...` | 104 | 0 if a and [] and False and [] else 1 # SIM222 105 | @@ -781,7 +781,7 @@ SIM223.py:106:7: SIM223 [*] Use `False` instead of `... and False and ...` 108 108 | 109 109 | [ -SIM223.py:113:8: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:113:8: SIM223 [**] Use `False` instead of `... and False and ...` | 111 | for a in range(10) 112 | for b in range(10) @@ -802,7 +802,7 @@ SIM223.py:113:8: SIM223 [*] Use `False` instead of `... and False and ...` 115 115 | ] 116 116 | -SIM223.py:114:8: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:114:8: SIM223 [**] Use `False` instead of `... and False and ...` | 112 | for b in range(10) 113 | if a and [] and False and [] # SIM223 @@ -822,7 +822,7 @@ SIM223.py:114:8: SIM223 [*] Use `False` instead of `... and False and ...` 116 116 | 117 117 | { -SIM223.py:121:8: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:121:8: SIM223 [**] Use `False` instead of `... and False and ...` | 119 | for a in range(10) 120 | for b in range(10) @@ -843,7 +843,7 @@ SIM223.py:121:8: SIM223 [*] Use `False` instead of `... and False and ...` 123 123 | } 124 124 | -SIM223.py:122:8: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:122:8: SIM223 [**] Use `False` instead of `... and False and ...` | 120 | for b in range(10) 121 | if a and [] and False and [] # SIM223 @@ -863,7 +863,7 @@ SIM223.py:122:8: SIM223 [*] Use `False` instead of `... and False and ...` 124 124 | 125 125 | { -SIM223.py:129:8: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:129:8: SIM223 [**] Use `False` instead of `... and False and ...` | 127 | for a in range(10) 128 | for b in range(10) @@ -884,7 +884,7 @@ SIM223.py:129:8: SIM223 [*] Use `False` instead of `... and False and ...` 131 131 | } 132 132 | -SIM223.py:130:8: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:130:8: SIM223 [**] Use `False` instead of `... and False and ...` | 128 | for b in range(10) 129 | if a and [] and False and [] # SIM223 @@ -904,7 +904,7 @@ SIM223.py:130:8: SIM223 [*] Use `False` instead of `... and False and ...` 132 132 | 133 133 | ( -SIM223.py:137:8: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:137:8: SIM223 [**] Use `False` instead of `... and False and ...` | 135 | for a in range(10) 136 | for b in range(10) @@ -925,7 +925,7 @@ SIM223.py:137:8: SIM223 [*] Use `False` instead of `... and False and ...` 139 139 | ) 140 140 | -SIM223.py:138:8: SIM223 [*] Use `False` instead of `... and False and ...` +SIM223.py:138:8: SIM223 [**] Use `False` instead of `... and False and ...` | 136 | for b in range(10) 137 | if a and [] and False and [] # SIM223 @@ -945,7 +945,7 @@ SIM223.py:138:8: SIM223 [*] Use `False` instead of `... and False and ...` 140 140 | 141 141 | # Outside test `a` is not simplified. -SIM223.py:143:7: SIM223 [*] Use `[]` instead of `[] and ...` +SIM223.py:143:7: SIM223 [**] Use `[]` instead of `[] and ...` | 141 | # Outside test `a` is not simplified. 142 | @@ -966,7 +966,7 @@ SIM223.py:143:7: SIM223 [*] Use `[]` instead of `[] and ...` 145 145 | if (a and [] and False and []) == (a and []): # SIM223 146 146 | pass -SIM223.py:145:11: SIM223 [*] Use `[]` instead of `[] and ...` +SIM223.py:145:11: SIM223 [**] Use `[]` instead of `[] and ...` | 143 | a and [] and False and [] # SIM223 144 | @@ -986,7 +986,7 @@ SIM223.py:145:11: SIM223 [*] Use `[]` instead of `[] and ...` 147 147 | 148 148 | if f(a and [] and False and []): # SIM223 -SIM223.py:148:12: SIM223 [*] Use `[]` instead of `[] and ...` +SIM223.py:148:12: SIM223 [**] Use `[]` instead of `[] and ...` | 146 | pass 147 | diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM401_SIM401.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM401_SIM401.py.snap index 8c5f552fbc65d6..7e621dbfc1815c 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM401_SIM401.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM401_SIM401.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs --- -SIM401.py:6:1: SIM401 [*] Use `var = a_dict.get(key, "default1")` instead of an `if` block +SIM401.py:6:1: SIM401 [**] Use `var = a_dict.get(key, "default1")` instead of an `if` block | 5 | # SIM401 (pattern-1) 6 | / if key in a_dict: @@ -27,7 +27,7 @@ SIM401.py:6:1: SIM401 [*] Use `var = a_dict.get(key, "default1")` instead of an 11 8 | # SIM401 (pattern-2) 12 9 | if key not in a_dict: -SIM401.py:12:1: SIM401 [*] Use `var = a_dict.get(key, "default2")` instead of an `if` block +SIM401.py:12:1: SIM401 [**] Use `var = a_dict.get(key, "default2")` instead of an `if` block | 11 | # SIM401 (pattern-2) 12 | / if key not in a_dict: @@ -53,7 +53,7 @@ SIM401.py:12:1: SIM401 [*] Use `var = a_dict.get(key, "default2")` instead of an 17 14 | # OK (default contains effect) 18 15 | if key in a_dict: -SIM401.py:24:1: SIM401 [*] Use `var = a_dict.get(keys[idx], "default")` instead of an `if` block +SIM401.py:24:1: SIM401 [**] Use `var = a_dict.get(keys[idx], "default")` instead of an `if` block | 23 | # SIM401 (complex expression in key) 24 | / if keys[idx] in a_dict: @@ -79,7 +79,7 @@ SIM401.py:24:1: SIM401 [*] Use `var = a_dict.get(keys[idx], "default")` instead 29 26 | # SIM401 (complex expression in dict) 30 27 | if key in dicts[idx]: -SIM401.py:30:1: SIM401 [*] Use `var = dicts[idx].get(key, "default")` instead of an `if` block +SIM401.py:30:1: SIM401 [**] Use `var = dicts[idx].get(key, "default")` instead of an `if` block | 29 | # SIM401 (complex expression in dict) 30 | / if key in dicts[idx]: @@ -105,7 +105,7 @@ SIM401.py:30:1: SIM401 [*] Use `var = dicts[idx].get(key, "default")` instead of 35 32 | # SIM401 (complex expression in var) 36 33 | if key in a_dict: -SIM401.py:36:1: SIM401 [*] Use `vars[idx] = a_dict.get(key, "defaultß9💣2ℝ6789ß9💣2ℝ6789ß9💣2ℝ6789ß9💣2ℝ6789ß9💣2ℝ6789")` instead of an `if` block +SIM401.py:36:1: SIM401 [**] Use `vars[idx] = a_dict.get(key, "defaultß9💣2ℝ6789ß9💣2ℝ6789ß9💣2ℝ6789ß9💣2ℝ6789ß9💣2ℝ6789")` instead of an `if` block | 35 | # SIM401 (complex expression in var) 36 | / if key in a_dict: @@ -131,7 +131,7 @@ SIM401.py:36:1: SIM401 [*] Use `vars[idx] = a_dict.get(key, "defaultß9💣2ℝ6 41 38 | # SIM401 42 39 | if foo(): -SIM401.py:45:5: SIM401 [*] Use `vars[idx] = a_dict.get(key, "default")` instead of an `if` block +SIM401.py:45:5: SIM401 [**] Use `vars[idx] = a_dict.get(key, "default")` instead of an `if` block | 43 | pass 44 | else: diff --git a/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__ban_parent_imports_package.snap b/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__ban_parent_imports_package.snap index db5e80f0a7bc45..62d9b1f21a2704 100644 --- a/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__ban_parent_imports_package.snap +++ b/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__ban_parent_imports_package.snap @@ -12,7 +12,7 @@ application.py:5:1: TID252 Relative imports from parent modules are banned | = help: Replace relative imports from parent modules with absolute imports -application.py:6:1: TID252 [*] Relative imports from parent modules are banned +application.py:6:1: TID252 [**] Relative imports from parent modules are banned | 5 | from ....import unknown 6 | from ..protocol import commands, definitions, responses @@ -32,7 +32,7 @@ application.py:6:1: TID252 [*] Relative imports from parent modules are banned 8 8 | from .. import server 9 9 | from . import logger, models -application.py:6:1: TID252 [*] Relative imports from parent modules are banned +application.py:6:1: TID252 [**] Relative imports from parent modules are banned | 5 | from ....import unknown 6 | from ..protocol import commands, definitions, responses @@ -52,7 +52,7 @@ application.py:6:1: TID252 [*] Relative imports from parent modules are banned 8 8 | from .. import server 9 9 | from . import logger, models -application.py:6:1: TID252 [*] Relative imports from parent modules are banned +application.py:6:1: TID252 [**] Relative imports from parent modules are banned | 5 | from ....import unknown 6 | from ..protocol import commands, definitions, responses @@ -72,7 +72,7 @@ application.py:6:1: TID252 [*] Relative imports from parent modules are banned 8 8 | from .. import server 9 9 | from . import logger, models -application.py:7:1: TID252 [*] Relative imports from parent modules are banned +application.py:7:1: TID252 [**] Relative imports from parent modules are banned | 5 | from ....import unknown 6 | from ..protocol import commands, definitions, responses @@ -93,7 +93,7 @@ application.py:7:1: TID252 [*] Relative imports from parent modules are banned 9 9 | from . import logger, models 10 10 | from ..protocol.UpperCaseModule import some_function -application.py:8:1: TID252 [*] Relative imports from parent modules are banned +application.py:8:1: TID252 [**] Relative imports from parent modules are banned | 6 | from ..protocol import commands, definitions, responses 7 | from ..server import example @@ -113,7 +113,7 @@ application.py:8:1: TID252 [*] Relative imports from parent modules are banned 9 9 | from . import logger, models 10 10 | from ..protocol.UpperCaseModule import some_function -application.py:10:1: TID252 [*] Relative imports from parent modules are banned +application.py:10:1: TID252 [**] Relative imports from parent modules are banned | 8 | from .. import server 9 | from . import logger, models diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__exempt_modules.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__exempt_modules.snap index e80bedfc54de90..38efb07aeb4971 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__exempt_modules.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__exempt_modules.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -exempt_modules.py:14:12: TCH002 [*] Move third-party import `flask` into a type-checking block +exempt_modules.py:14:12: TCH002 [**] Move third-party import `flask` into a type-checking block | 13 | def f(): 14 | import flask diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__import_from.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__import_from.snap index 1b427e0f3a0851..cba1ab76cbb8be 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__import_from.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__import_from.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -:5:5: TCH002 [*] Move third-party import `pandas.DataFrame` into a type-checking block +:5:5: TCH002 [**] Move third-party import `pandas.DataFrame` into a type-checking block | 4 | from pandas import ( 5 | DataFrame, # DataFrame diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__import_from_type_checking_block.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__import_from_type_checking_block.snap index ac5b0d17f97c55..7780df061523bd 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__import_from_type_checking_block.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__import_from_type_checking_block.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -:7:5: TCH002 [*] Move third-party import `pandas.DataFrame` into a type-checking block +:7:5: TCH002 [**] Move third-party import `pandas.DataFrame` into a type-checking block | 6 | from pandas import ( 7 | DataFrame, # DataFrame diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__multiple_members.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__multiple_members.snap index 4256b3199e1cef..56c08f0a1c507e 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__multiple_members.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__multiple_members.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -:7:5: TCH002 [*] Move third-party import `pandas.DataFrame` into a type-checking block +:7:5: TCH002 [**] Move third-party import `pandas.DataFrame` into a type-checking block | 6 | from pandas import ( 7 | DataFrame, # DataFrame @@ -29,7 +29,7 @@ source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs 11 13 | def f(x: DataFrame, y: Series): 12 14 | pass -:8:5: TCH002 [*] Move third-party import `pandas.Series` into a type-checking block +:8:5: TCH002 [**] Move third-party import `pandas.Series` into a type-checking block | 6 | from pandas import ( 7 | DataFrame, # DataFrame diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__multiple_modules_different_types.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__multiple_modules_different_types.snap index c293b6fe552cb8..2ad2c7c0521d70 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__multiple_modules_different_types.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__multiple_modules_different_types.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -:6:8: TCH003 [*] Move standard library import `os` into a type-checking block +:6:8: TCH003 [**] Move standard library import `os` into a type-checking block | 4 | from typing import TYPE_CHECKING 5 | @@ -25,7 +25,7 @@ source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs 8 11 | def f(x: os, y: pandas): 9 12 | pass -:6:12: TCH002 [*] Move third-party import `pandas` into a type-checking block +:6:12: TCH002 [**] Move third-party import `pandas` into a type-checking block | 4 | from typing import TYPE_CHECKING 5 | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__multiple_modules_same_type.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__multiple_modules_same_type.snap index fa23f5d87a8478..0d8c2c4fe86dd4 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__multiple_modules_same_type.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__multiple_modules_same_type.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -:6:8: TCH003 [*] Move standard library import `os` into a type-checking block +:6:8: TCH003 [**] Move standard library import `os` into a type-checking block | 4 | from typing import TYPE_CHECKING 5 | @@ -24,7 +24,7 @@ source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs 8 10 | def f(x: os, y: sys): 9 11 | pass -:6:12: TCH003 [*] Move standard library import `sys` into a type-checking block +:6:12: TCH003 [**] Move standard library import `sys` into a type-checking block | 4 | from typing import TYPE_CHECKING 5 | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__no_typing_import.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__no_typing_import.snap index 16a94fdcad49cf..a4b8dda5ca0d98 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__no_typing_import.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__no_typing_import.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -:4:18: TCH002 [*] Move third-party import `pandas` into a type-checking block +:4:18: TCH002 [**] Move third-party import `pandas` into a type-checking block | 2 | from __future__ import annotations 3 | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_1.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_1.py.snap index ce1d06b0cfa7f7..9730b3f358bcd5 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -TCH004_1.py:4:26: TCH004 [*] Move import `datetime.datetime` out of type-checking block. Import is used for more than type hinting. +TCH004_1.py:4:26: TCH004 [**] Move import `datetime.datetime` out of type-checking block. Import is used for more than type hinting. | 3 | if TYPE_CHECKING: 4 | from datetime import datetime diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_11.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_11.py.snap index 66a8bb5b574e02..a08f402c3dff89 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_11.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_11.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -TCH004_11.py:4:24: TCH004 [*] Move import `typing.List` out of type-checking block. Import is used for more than type hinting. +TCH004_11.py:4:24: TCH004 [**] Move import `typing.List` out of type-checking block. Import is used for more than type hinting. | 3 | if TYPE_CHECKING: 4 | from typing import List diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_12.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_12.py.snap index 2e6d2751e9ba56..23fcfab5ac807b 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_12.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_12.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -TCH004_12.py:6:33: TCH004 [*] Move import `collections.abc.Callable` out of type-checking block. Import is used for more than type hinting. +TCH004_12.py:6:33: TCH004 [**] Move import `collections.abc.Callable` out of type-checking block. Import is used for more than type hinting. | 5 | if TYPE_CHECKING: 6 | from collections.abc import Callable diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_2.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_2.py.snap index b2090156ef9b68..f429eb190d1cdd 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -TCH004_2.py:4:26: TCH004 [*] Move import `datetime.date` out of type-checking block. Import is used for more than type hinting. +TCH004_2.py:4:26: TCH004 [**] Move import `datetime.date` out of type-checking block. Import is used for more than type hinting. | 3 | if TYPE_CHECKING: 4 | from datetime import date diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_4.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_4.py.snap index 1a3ecb0c2cf348..cd6eb25d5d6fbe 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_4.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_4.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -TCH004_4.py:4:24: TCH004 [*] Move import `typing.Any` out of type-checking block. Import is used for more than type hinting. +TCH004_4.py:4:24: TCH004 [**] Move import `typing.Any` out of type-checking block. Import is used for more than type hinting. | 3 | if TYPE_CHECKING: 4 | from typing import Any diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_5.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_5.py.snap index 4bded770e5b7d5..7e76ac7e8b5e06 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_5.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_5.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -TCH004_5.py:4:24: TCH004 [*] Move import `typing.List` out of type-checking block. Import is used for more than type hinting. +TCH004_5.py:4:24: TCH004 [**] Move import `typing.List` out of type-checking block. Import is used for more than type hinting. | 3 | if TYPE_CHECKING: 4 | from typing import List, Sequence, Set @@ -20,7 +20,7 @@ TCH004_5.py:4:24: TCH004 [*] Move import `typing.List` out of type-checking bloc 6 7 | 7 8 | def example(a: List[int], /, b: Sequence[int], *, c: Set[int]): -TCH004_5.py:4:30: TCH004 [*] Move import `typing.Sequence` out of type-checking block. Import is used for more than type hinting. +TCH004_5.py:4:30: TCH004 [**] Move import `typing.Sequence` out of type-checking block. Import is used for more than type hinting. | 3 | if TYPE_CHECKING: 4 | from typing import List, Sequence, Set @@ -39,7 +39,7 @@ TCH004_5.py:4:30: TCH004 [*] Move import `typing.Sequence` out of type-checking 6 7 | 7 8 | def example(a: List[int], /, b: Sequence[int], *, c: Set[int]): -TCH004_5.py:4:40: TCH004 [*] Move import `typing.Set` out of type-checking block. Import is used for more than type hinting. +TCH004_5.py:4:40: TCH004 [**] Move import `typing.Set` out of type-checking block. Import is used for more than type hinting. | 3 | if TYPE_CHECKING: 4 | from typing import List, Sequence, Set diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_9.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_9.py.snap index 3af36dde409ab0..090725192c9c3a 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_9.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_9.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -TCH004_9.py:4:24: TCH004 [*] Move import `typing.Tuple` out of type-checking block. Import is used for more than type hinting. +TCH004_9.py:4:24: TCH004 [**] Move import `typing.Tuple` out of type-checking block. Import is used for more than type hinting. | 3 | if TYPE_CHECKING: 4 | from typing import Tuple, List, Dict @@ -22,7 +22,7 @@ TCH004_9.py:4:24: TCH004 [*] Move import `typing.Tuple` out of type-checking blo 6 7 | x: Tuple 7 8 | -TCH004_9.py:4:31: TCH004 [*] Move import `typing.List` out of type-checking block. Import is used for more than type hinting. +TCH004_9.py:4:31: TCH004 [**] Move import `typing.List` out of type-checking block. Import is used for more than type hinting. | 3 | if TYPE_CHECKING: 4 | from typing import Tuple, List, Dict diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap index 263990b605feda..e8bd62a5573a62 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -runtime_evaluated_base_classes_1.py:10:12: TCH004 [*] Move import `datetime` out of type-checking block. Import is used for more than type hinting. +runtime_evaluated_base_classes_1.py:10:12: TCH004 [**] Move import `datetime` out of type-checking block. Import is used for more than type hinting. | 9 | if TYPE_CHECKING: 10 | import datetime # TCH004 @@ -22,7 +22,7 @@ runtime_evaluated_base_classes_1.py:10:12: TCH004 [*] Move import `datetime` out 12 12 | 13 13 | import pandas # TCH004 -runtime_evaluated_base_classes_1.py:11:23: TCH004 [*] Move import `array.array` out of type-checking block. Import is used for more than type hinting. +runtime_evaluated_base_classes_1.py:11:23: TCH004 [**] Move import `array.array` out of type-checking block. Import is used for more than type hinting. | 9 | if TYPE_CHECKING: 10 | import datetime # TCH004 @@ -46,7 +46,7 @@ runtime_evaluated_base_classes_1.py:11:23: TCH004 [*] Move import `array.array` 13 13 | import pandas # TCH004 14 14 | import pyproj -runtime_evaluated_base_classes_1.py:13:12: TCH004 [*] Move import `pandas` out of type-checking block. Import is used for more than type hinting. +runtime_evaluated_base_classes_1.py:13:12: TCH004 [**] Move import `pandas` out of type-checking block. Import is used for more than type hinting. | 11 | from array import array # TCH004 12 | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap index c472d3f9d84b44..1de54e8835307d 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -runtime_evaluated_decorators_1.py:12:12: TCH004 [*] Move import `datetime` out of type-checking block. Import is used for more than type hinting. +runtime_evaluated_decorators_1.py:12:12: TCH004 [**] Move import `datetime` out of type-checking block. Import is used for more than type hinting. | 11 | if TYPE_CHECKING: 12 | import datetime # TCH004 @@ -22,7 +22,7 @@ runtime_evaluated_decorators_1.py:12:12: TCH004 [*] Move import `datetime` out o 14 14 | 15 15 | import pandas # TCH004 -runtime_evaluated_decorators_1.py:13:23: TCH004 [*] Move import `array.array` out of type-checking block. Import is used for more than type hinting. +runtime_evaluated_decorators_1.py:13:23: TCH004 [**] Move import `array.array` out of type-checking block. Import is used for more than type hinting. | 11 | if TYPE_CHECKING: 12 | import datetime # TCH004 @@ -46,7 +46,7 @@ runtime_evaluated_decorators_1.py:13:23: TCH004 [*] Move import `array.array` ou 15 15 | import pandas # TCH004 16 16 | import pyproj -runtime_evaluated_decorators_1.py:15:12: TCH004 [*] Move import `pandas` out of type-checking block. Import is used for more than type hinting. +runtime_evaluated_decorators_1.py:15:12: TCH004 [**] Move import `pandas` out of type-checking block. Import is used for more than type hinting. | 13 | from array import array # TCH004 14 | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__strict.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__strict.snap index 835a51bce361ca..fb86ccfd84dd34 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__strict.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__strict.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -strict.py:27:21: TCH002 [*] Move third-party import `pkg.A` into a type-checking block +strict.py:27:21: TCH002 [**] Move third-party import `pkg.A` into a type-checking block | 25 | # In un-strict mode, this shouldn't raise an error, since `pkg` is used at runtime. 26 | import pkg @@ -30,7 +30,7 @@ strict.py:27:21: TCH002 [*] Move third-party import `pkg.A` into a type-checking 29 32 | def test(value: A): 30 33 | return pkg.B() -strict.py:35:21: TCH002 [*] Move third-party import `pkg.A` into a type-checking block +strict.py:35:21: TCH002 [**] Move third-party import `pkg.A` into a type-checking block | 33 | def f(): 34 | # In un-strict mode, this shouldn't raise an error, since `pkg` is used at runtime. @@ -60,7 +60,7 @@ strict.py:35:21: TCH002 [*] Move third-party import `pkg.A` into a type-checking 37 41 | def test(value: A): 38 42 | return B() -strict.py:54:25: TCH002 [*] Move third-party import `pkg.bar.A` into a type-checking block +strict.py:54:25: TCH002 [**] Move third-party import `pkg.bar.A` into a type-checking block | 52 | # In un-strict mode, this _should_ raise an error, since `pkg.bar` isn't used at runtime 53 | import pkg @@ -89,7 +89,7 @@ strict.py:54:25: TCH002 [*] Move third-party import `pkg.bar.A` into a type-chec 56 59 | def test(value: A): 57 60 | return pkg.B() -strict.py:62:12: TCH002 [*] Move third-party import `pkg` into a type-checking block +strict.py:62:12: TCH002 [**] Move third-party import `pkg` into a type-checking block | 60 | def f(): 61 | # In un-strict mode, this shouldn't raise an error, since `pkg.bar` is used at runtime. @@ -117,7 +117,7 @@ strict.py:62:12: TCH002 [*] Move third-party import `pkg` into a type-checking b 64 67 | 65 68 | def test(value: pkg.A): -strict.py:71:23: TCH002 [*] Move third-party import `pkg.foo` into a type-checking block +strict.py:71:23: TCH002 [**] Move third-party import `pkg.foo` into a type-checking block | 69 | def f(): 70 | # In un-strict mode, this shouldn't raise an error, since `pkg.foo.bar` is used at runtime. @@ -145,7 +145,7 @@ strict.py:71:23: TCH002 [*] Move third-party import `pkg.foo` into a type-checki 73 76 | 74 77 | def test(value: F.Foo): -strict.py:80:12: TCH002 [*] Move third-party import `pkg` into a type-checking block +strict.py:80:12: TCH002 [**] Move third-party import `pkg` into a type-checking block | 78 | def f(): 79 | # In un-strict mode, this shouldn't raise an error, since `pkg.foo.bar` is used at runtime. @@ -173,7 +173,7 @@ strict.py:80:12: TCH002 [*] Move third-party import `pkg` into a type-checking b 82 85 | 83 86 | def test(value: pkg.A): -strict.py:91:12: TCH002 [*] Move third-party import `pkg` into a type-checking block +strict.py:91:12: TCH002 [**] Move third-party import `pkg` into a type-checking block | 89 | # Note that `pkg` is a prefix of `pkgfoo` which are both different modules. This is 90 | # testing the implementation. @@ -201,7 +201,7 @@ strict.py:91:12: TCH002 [*] Move third-party import `pkg` into a type-checking b 93 96 | 94 97 | def test(value: pkg.A): -strict.py:101:23: TCH002 [*] Move third-party import `pkg.foo` into a type-checking block +strict.py:101:23: TCH002 [**] Move third-party import `pkg.foo` into a type-checking block | 99 | # In un-strict mode, this shouldn't raise an error, since `pkg` is used at runtime. 100 | import pkg.bar as B diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__type_checking_block_after_usage.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__type_checking_block_after_usage.snap index f97e331017f9e0..11ad5c07d9cba3 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__type_checking_block_after_usage.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__type_checking_block_after_usage.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -:6:18: TCH002 [*] Move third-party import `pandas` into a type-checking block +:6:18: TCH002 [**] Move third-party import `pandas` into a type-checking block | 4 | from typing import TYPE_CHECKING 5 | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__type_checking_block_comment.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__type_checking_block_comment.snap index d554a00b1621a3..307c8de85f3e9b 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__type_checking_block_comment.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__type_checking_block_comment.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -:6:18: TCH002 [*] Move third-party import `pandas` into a type-checking block +:6:18: TCH002 [**] Move third-party import `pandas` into a type-checking block | 4 | from typing import TYPE_CHECKING 5 | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__type_checking_block_inline.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__type_checking_block_inline.snap index 027b2a6826b09b..244270feda3061 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__type_checking_block_inline.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__type_checking_block_inline.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -:6:18: TCH002 [*] Move third-party import `pandas` into a type-checking block +:6:18: TCH002 [**] Move third-party import `pandas` into a type-checking block | 4 | from typing import TYPE_CHECKING 5 | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__type_checking_block_own_line.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__type_checking_block_own_line.snap index 60a5c92f63d5b7..8e5df1614ef24d 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__type_checking_block_own_line.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__type_checking_block_own_line.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -:6:18: TCH002 [*] Move third-party import `pandas` into a type-checking block +:6:18: TCH002 [**] Move third-party import `pandas` into a type-checking block | 4 | from typing import TYPE_CHECKING 5 | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-first-party-import_TCH001.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-first-party-import_TCH001.py.snap index 8a486f94ba8d17..4afe967b32bc18 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-first-party-import_TCH001.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-first-party-import_TCH001.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -TCH001.py:20:19: TCH001 [*] Move application import `.TYP001` into a type-checking block +TCH001.py:20:19: TCH001 [**] Move application import `.TYP001` into a type-checking block | 19 | def f(): 20 | from . import TYP001 diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_TCH003.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_TCH003.py.snap index f1e2a0bfe2f664..3bc3fa77b9acd5 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_TCH003.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_TCH003.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -TCH003.py:8:12: TCH003 [*] Move standard library import `os` into a type-checking block +TCH003.py:8:12: TCH003 [**] Move standard library import `os` into a type-checking block | 7 | def f(): 8 | import os diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_base_classes_3.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_base_classes_3.py.snap index 8e151b89dab2bb..ab3abd21a4744f 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_base_classes_3.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_base_classes_3.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -runtime_evaluated_base_classes_3.py:5:18: TCH003 [*] Move standard library import `uuid.UUID` into a type-checking block +runtime_evaluated_base_classes_3.py:5:18: TCH003 [**] Move standard library import `uuid.UUID` into a type-checking block | 3 | import datetime 4 | import pathlib diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_decorators_3.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_decorators_3.py.snap index 99dade0f9976cc..aa680d7ea3970a 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_decorators_3.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_decorators_3.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -runtime_evaluated_decorators_3.py:6:18: TCH003 [*] Move standard library import `uuid.UUID` into a type-checking block +runtime_evaluated_decorators_3.py:6:18: TCH003 [**] Move standard library import `uuid.UUID` into a type-checking block | 4 | from array import array 5 | from dataclasses import dataclass diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_TCH002.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_TCH002.py.snap index 5f1ea76784cf13..f82ba61f9ba26f 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_TCH002.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_TCH002.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -TCH002.py:5:22: TCH002 [*] Move third-party import `pandas` into a type-checking block +TCH002.py:5:22: TCH002 [**] Move third-party import `pandas` into a type-checking block | 4 | def f(): 5 | import pandas as pd # TCH002 @@ -25,7 +25,7 @@ TCH002.py:5:22: TCH002 [*] Move third-party import `pandas` into a type-checking 7 10 | x: pd.DataFrame 8 11 | -TCH002.py:11:24: TCH002 [*] Move third-party import `pandas.DataFrame` into a type-checking block +TCH002.py:11:24: TCH002 [**] Move third-party import `pandas.DataFrame` into a type-checking block | 10 | def f(): 11 | from pandas import DataFrame # TCH002 @@ -53,7 +53,7 @@ TCH002.py:11:24: TCH002 [*] Move third-party import `pandas.DataFrame` into a ty 13 16 | x: DataFrame 14 17 | -TCH002.py:17:37: TCH002 [*] Move third-party import `pandas.DataFrame` into a type-checking block +TCH002.py:17:37: TCH002 [**] Move third-party import `pandas.DataFrame` into a type-checking block | 16 | def f(): 17 | from pandas import DataFrame as df # TCH002 @@ -81,7 +81,7 @@ TCH002.py:17:37: TCH002 [*] Move third-party import `pandas.DataFrame` into a ty 19 22 | x: df 20 23 | -TCH002.py:23:22: TCH002 [*] Move third-party import `pandas` into a type-checking block +TCH002.py:23:22: TCH002 [**] Move third-party import `pandas` into a type-checking block | 22 | def f(): 23 | import pandas as pd # TCH002 @@ -109,7 +109,7 @@ TCH002.py:23:22: TCH002 [*] Move third-party import `pandas` into a type-checkin 25 28 | x: pd.DataFrame = 1 26 29 | -TCH002.py:29:24: TCH002 [*] Move third-party import `pandas.DataFrame` into a type-checking block +TCH002.py:29:24: TCH002 [**] Move third-party import `pandas.DataFrame` into a type-checking block | 28 | def f(): 29 | from pandas import DataFrame # TCH002 @@ -137,7 +137,7 @@ TCH002.py:29:24: TCH002 [*] Move third-party import `pandas.DataFrame` into a ty 31 34 | x: DataFrame = 2 32 35 | -TCH002.py:35:37: TCH002 [*] Move third-party import `pandas.DataFrame` into a type-checking block +TCH002.py:35:37: TCH002 [**] Move third-party import `pandas.DataFrame` into a type-checking block | 34 | def f(): 35 | from pandas import DataFrame as df # TCH002 @@ -165,7 +165,7 @@ TCH002.py:35:37: TCH002 [*] Move third-party import `pandas.DataFrame` into a ty 37 40 | x: df = 3 38 41 | -TCH002.py:41:22: TCH002 [*] Move third-party import `pandas` into a type-checking block +TCH002.py:41:22: TCH002 [**] Move third-party import `pandas` into a type-checking block | 40 | def f(): 41 | import pandas as pd # TCH002 @@ -193,7 +193,7 @@ TCH002.py:41:22: TCH002 [*] Move third-party import `pandas` into a type-checkin 43 46 | x: "pd.DataFrame" = 1 44 47 | -TCH002.py:47:22: TCH002 [*] Move third-party import `pandas` into a type-checking block +TCH002.py:47:22: TCH002 [**] Move third-party import `pandas` into a type-checking block | 46 | def f(): 47 | import pandas as pd # TCH002 @@ -221,7 +221,7 @@ TCH002.py:47:22: TCH002 [*] Move third-party import `pandas` into a type-checkin 49 52 | x = dict["pd.DataFrame", "pd.DataFrame"] 50 53 | -TCH002.py:172:24: TCH002 [*] Move third-party import `module.Member` into a type-checking block +TCH002.py:172:24: TCH002 [**] Move third-party import `module.Member` into a type-checking block | 170 | global Member 171 | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_base_classes_2.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_base_classes_2.py.snap index ac865d383c7747..a51fa68aa2609d 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_base_classes_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_base_classes_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -runtime_evaluated_base_classes_2.py:3:21: TCH002 [*] Move third-party import `geopandas` into a type-checking block +runtime_evaluated_base_classes_2.py:3:21: TCH002 [**] Move third-party import `geopandas` into a type-checking block | 1 | from __future__ import annotations 2 | @@ -29,7 +29,7 @@ runtime_evaluated_base_classes_2.py:3:21: TCH002 [*] Move third-party import `ge 10 13 | 11 14 | class A(BaseModel): -runtime_evaluated_base_classes_2.py:5:8: TCH002 [*] Move third-party import `pyproj` into a type-checking block +runtime_evaluated_base_classes_2.py:5:8: TCH002 [**] Move third-party import `pyproj` into a type-checking block | 3 | import geopandas as gpd # TCH002 4 | import pydantic diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap index dafbc94d64aa82..ec04ff48847e33 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -runtime_evaluated_decorators_2.py:10:8: TCH002 [*] Move third-party import `numpy` into a type-checking block +runtime_evaluated_decorators_2.py:10:8: TCH002 [**] Move third-party import `numpy` into a type-checking block | 8 | from attrs import frozen 9 | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_strict.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_strict.py.snap index 496d0f55877f31..d98282d1feda99 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_strict.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_strict.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -strict.py:54:25: TCH002 [*] Move third-party import `pkg.bar.A` into a type-checking block +strict.py:54:25: TCH002 [**] Move third-party import `pkg.bar.A` into a type-checking block | 52 | # In un-strict mode, this _should_ raise an error, since `pkg.bar` isn't used at runtime 53 | import pkg @@ -30,7 +30,7 @@ strict.py:54:25: TCH002 [*] Move third-party import `pkg.bar.A` into a type-chec 56 59 | def test(value: A): 57 60 | return pkg.B() -strict.py:91:12: TCH002 [*] Move third-party import `pkg` into a type-checking block +strict.py:91:12: TCH002 [**] Move third-party import `pkg` into a type-checking block | 89 | # Note that `pkg` is a prefix of `pkgfoo` which are both different modules. This is 90 | # testing the implementation. diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing_import_after_package_import.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing_import_after_package_import.snap index df0299e8a79c22..dd024a9860b04b 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing_import_after_package_import.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing_import_after_package_import.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -:4:18: TCH002 [*] Move third-party import `pandas` into a type-checking block +:4:18: TCH002 [**] Move third-party import `pandas` into a type-checking block | 2 | from __future__ import annotations 3 | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing_import_before_package_import.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing_import_before_package_import.snap index 361042da6bc491..21773db16365f3 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing_import_before_package_import.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing_import_before_package_import.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs --- -:6:18: TCH002 [*] Move third-party import `pandas` into a type-checking block +:6:18: TCH002 [**] Move third-party import `pandas` into a type-checking block | 4 | from typing import TYPE_CHECKING 5 | diff --git a/crates/ruff_linter/src/rules/flynt/snapshots/ruff_linter__rules__flynt__tests__FLY002_FLY002.py.snap b/crates/ruff_linter/src/rules/flynt/snapshots/ruff_linter__rules__flynt__tests__FLY002_FLY002.py.snap index 17ac7a8ef9812e..25c204a99da9fb 100644 --- a/crates/ruff_linter/src/rules/flynt/snapshots/ruff_linter__rules__flynt__tests__FLY002_FLY002.py.snap +++ b/crates/ruff_linter/src/rules/flynt/snapshots/ruff_linter__rules__flynt__tests__FLY002_FLY002.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/flynt/mod.rs --- -FLY002.py:5:7: FLY002 [*] Consider `f"{a} World"` instead of string join +FLY002.py:5:7: FLY002 [**] Consider `f"{a} World"` instead of string join | 4 | a = "Hello" 5 | ok1 = " ".join([a, " World"]) # OK @@ -21,7 +21,7 @@ FLY002.py:5:7: FLY002 [*] Consider `f"{a} World"` instead of string join 7 7 | ok3 = "x".join(("1", "2", "3")) # OK 8 8 | ok4 = "y".join([1, 2, 3]) # Technically OK, though would've been an error originally -FLY002.py:6:7: FLY002 [*] Consider `f"Finally, {a} World"` instead of string join +FLY002.py:6:7: FLY002 [**] Consider `f"Finally, {a} World"` instead of string join | 4 | a = "Hello" 5 | ok1 = " ".join([a, " World"]) # OK @@ -42,7 +42,7 @@ FLY002.py:6:7: FLY002 [*] Consider `f"Finally, {a} World"` instead of string joi 8 8 | ok4 = "y".join([1, 2, 3]) # Technically OK, though would've been an error originally 9 9 | ok5 = "a".join([random(), random()]) # OK (simple calls) -FLY002.py:7:7: FLY002 [*] Consider `"1x2x3"` instead of string join +FLY002.py:7:7: FLY002 [**] Consider `"1x2x3"` instead of string join | 5 | ok1 = " ".join([a, " World"]) # OK 6 | ok2 = "".join(["Finally, ", a, " World"]) # OK @@ -63,7 +63,7 @@ FLY002.py:7:7: FLY002 [*] Consider `"1x2x3"` instead of string join 9 9 | ok5 = "a".join([random(), random()]) # OK (simple calls) 10 10 | ok6 = "a".join([secrets.token_urlsafe(), secrets.token_hex()]) # OK (attr calls) -FLY002.py:8:7: FLY002 [*] Consider `f"{1}y{2}y{3}"` instead of string join +FLY002.py:8:7: FLY002 [**] Consider `f"{1}y{2}y{3}"` instead of string join | 6 | ok2 = "".join(["Finally, ", a, " World"]) # OK 7 | ok3 = "x".join(("1", "2", "3")) # OK @@ -84,7 +84,7 @@ FLY002.py:8:7: FLY002 [*] Consider `f"{1}y{2}y{3}"` instead of string join 10 10 | ok6 = "a".join([secrets.token_urlsafe(), secrets.token_hex()]) # OK (attr calls) 11 11 | -FLY002.py:9:7: FLY002 [*] Consider `f"{random()}a{random()}"` instead of string join +FLY002.py:9:7: FLY002 [**] Consider `f"{random()}a{random()}"` instead of string join | 7 | ok3 = "x".join(("1", "2", "3")) # OK 8 | ok4 = "y".join([1, 2, 3]) # Technically OK, though would've been an error originally @@ -104,7 +104,7 @@ FLY002.py:9:7: FLY002 [*] Consider `f"{random()}a{random()}"` instead of string 11 11 | 12 12 | nok1 = "x".join({"4", "5", "yee"}) # Not OK (set) -FLY002.py:10:7: FLY002 [*] Consider `f"{secrets.token_urlsafe()}a{secrets.token_hex()}"` instead of string join +FLY002.py:10:7: FLY002 [**] Consider `f"{secrets.token_urlsafe()}a{secrets.token_hex()}"` instead of string join | 8 | ok4 = "y".join([1, 2, 3]) # Technically OK, though would've been an error originally 9 | ok5 = "a".join([random(), random()]) # OK (simple calls) @@ -125,7 +125,7 @@ FLY002.py:10:7: FLY002 [*] Consider `f"{secrets.token_urlsafe()}a{secrets.token_ 12 12 | nok1 = "x".join({"4", "5", "yee"}) # Not OK (set) 13 13 | nok2 = a.join(["1", "2", "3"]) # Not OK (not a static joiner) -FLY002.py:23:11: FLY002 [*] Consider `f"{url}{filename}"` instead of string join +FLY002.py:23:11: FLY002 [**] Consider `f"{url}{filename}"` instead of string join | 21 | # Regression test for: https://github.com/astral-sh/ruff/issues/7197 22 | def create_file_public_url(url, filename): diff --git a/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-deprecated-function_NPY003.py.snap b/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-deprecated-function_NPY003.py.snap index 1d8aa9dc02fdc1..973a498d92cd29 100644 --- a/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-deprecated-function_NPY003.py.snap +++ b/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-deprecated-function_NPY003.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/numpy/mod.rs --- -NPY003.py:4:5: NPY003 [*] `np.round_` is deprecated; use `np.round` instead +NPY003.py:4:5: NPY003 [**] `np.round_` is deprecated; use `np.round` instead | 2 | import numpy as np 3 | @@ -22,7 +22,7 @@ NPY003.py:4:5: NPY003 [*] `np.round_` is deprecated; use `np.round` instead 6 6 | np.cumproduct(np.random.rand(5, 5)) 7 7 | np.sometrue(np.random.rand(5, 5)) -NPY003.py:5:5: NPY003 [*] `np.product` is deprecated; use `np.prod` instead +NPY003.py:5:5: NPY003 [**] `np.product` is deprecated; use `np.prod` instead | 4 | np.round_(np.random.rand(5, 5), 2) 5 | np.product(np.random.rand(5, 5)) @@ -42,7 +42,7 @@ NPY003.py:5:5: NPY003 [*] `np.product` is deprecated; use `np.prod` instead 7 7 | np.sometrue(np.random.rand(5, 5)) 8 8 | np.alltrue(np.random.rand(5, 5)) -NPY003.py:6:5: NPY003 [*] `np.cumproduct` is deprecated; use `np.cumprod` instead +NPY003.py:6:5: NPY003 [**] `np.cumproduct` is deprecated; use `np.cumprod` instead | 4 | np.round_(np.random.rand(5, 5), 2) 5 | np.product(np.random.rand(5, 5)) @@ -63,7 +63,7 @@ NPY003.py:6:5: NPY003 [*] `np.cumproduct` is deprecated; use `np.cumprod` instea 8 8 | np.alltrue(np.random.rand(5, 5)) 9 9 | -NPY003.py:7:5: NPY003 [*] `np.sometrue` is deprecated; use `np.any` instead +NPY003.py:7:5: NPY003 [**] `np.sometrue` is deprecated; use `np.any` instead | 5 | np.product(np.random.rand(5, 5)) 6 | np.cumproduct(np.random.rand(5, 5)) @@ -83,7 +83,7 @@ NPY003.py:7:5: NPY003 [*] `np.sometrue` is deprecated; use `np.any` instead 9 9 | 10 10 | -NPY003.py:8:5: NPY003 [*] `np.alltrue` is deprecated; use `np.all` instead +NPY003.py:8:5: NPY003 [**] `np.alltrue` is deprecated; use `np.all` instead | 6 | np.cumproduct(np.random.rand(5, 5)) 7 | np.sometrue(np.random.rand(5, 5)) @@ -102,7 +102,7 @@ NPY003.py:8:5: NPY003 [*] `np.alltrue` is deprecated; use `np.all` instead 10 10 | 11 11 | def func(): -NPY003.py:14:5: NPY003 [*] `np.round_` is deprecated; use `np.round` instead +NPY003.py:14:5: NPY003 [**] `np.round_` is deprecated; use `np.round` instead | 12 | from numpy import round_, product, cumproduct, sometrue, alltrue 13 | @@ -128,7 +128,7 @@ NPY003.py:14:5: NPY003 [*] `np.round_` is deprecated; use `np.round` instead 16 17 | cumproduct(np.random.rand(5, 5)) 17 18 | sometrue(np.random.rand(5, 5)) -NPY003.py:15:5: NPY003 [*] `np.product` is deprecated; use `np.prod` instead +NPY003.py:15:5: NPY003 [**] `np.product` is deprecated; use `np.prod` instead | 14 | round_(np.random.rand(5, 5), 2) 15 | product(np.random.rand(5, 5)) @@ -153,7 +153,7 @@ NPY003.py:15:5: NPY003 [*] `np.product` is deprecated; use `np.prod` instead 17 18 | sometrue(np.random.rand(5, 5)) 18 19 | alltrue(np.random.rand(5, 5)) -NPY003.py:16:5: NPY003 [*] `np.cumproduct` is deprecated; use `np.cumprod` instead +NPY003.py:16:5: NPY003 [**] `np.cumproduct` is deprecated; use `np.cumprod` instead | 14 | round_(np.random.rand(5, 5), 2) 15 | product(np.random.rand(5, 5)) @@ -178,7 +178,7 @@ NPY003.py:16:5: NPY003 [*] `np.cumproduct` is deprecated; use `np.cumprod` inste 17 18 | sometrue(np.random.rand(5, 5)) 18 19 | alltrue(np.random.rand(5, 5)) -NPY003.py:17:5: NPY003 [*] `np.sometrue` is deprecated; use `np.any` instead +NPY003.py:17:5: NPY003 [**] `np.sometrue` is deprecated; use `np.any` instead | 15 | product(np.random.rand(5, 5)) 16 | cumproduct(np.random.rand(5, 5)) @@ -201,7 +201,7 @@ NPY003.py:17:5: NPY003 [*] `np.sometrue` is deprecated; use `np.any` instead 18 |+ any(np.random.rand(5, 5)) 18 19 | alltrue(np.random.rand(5, 5)) -NPY003.py:18:5: NPY003 [*] `np.alltrue` is deprecated; use `np.all` instead +NPY003.py:18:5: NPY003 [**] `np.alltrue` is deprecated; use `np.all` instead | 16 | cumproduct(np.random.rand(5, 5)) 17 | sometrue(np.random.rand(5, 5)) diff --git a/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap b/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap index f83b5e3a322c5b..f729fcf052c38b 100644 --- a/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap +++ b/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/numpy/mod.rs --- -NPY001.py:6:1: NPY001 [*] Type alias `np.bool` is deprecated, replace with builtin type +NPY001.py:6:1: NPY001 [**] Type alias `np.bool` is deprecated, replace with builtin type | 5 | # Error 6 | npy.bool @@ -20,7 +20,7 @@ NPY001.py:6:1: NPY001 [*] Type alias `np.bool` is deprecated, replace with built 8 8 | 9 9 | if dtype == np.object: -NPY001.py:7:1: NPY001 [*] Type alias `np.int` is deprecated, replace with builtin type +NPY001.py:7:1: NPY001 [**] Type alias `np.int` is deprecated, replace with builtin type | 5 | # Error 6 | npy.bool @@ -41,7 +41,7 @@ NPY001.py:7:1: NPY001 [*] Type alias `np.int` is deprecated, replace with builti 9 9 | if dtype == np.object: 10 10 | ... -NPY001.py:9:13: NPY001 [*] Type alias `np.object` is deprecated, replace with builtin type +NPY001.py:9:13: NPY001 [**] Type alias `np.object` is deprecated, replace with builtin type | 7 | npy.int 8 | @@ -61,7 +61,7 @@ NPY001.py:9:13: NPY001 [*] Type alias `np.object` is deprecated, replace with bu 11 11 | 12 12 | result = result.select_dtypes([np.byte, np.ubyte, np.short, np.ushort, np.int, np.long]) -NPY001.py:12:72: NPY001 [*] Type alias `np.int` is deprecated, replace with builtin type +NPY001.py:12:72: NPY001 [**] Type alias `np.int` is deprecated, replace with builtin type | 10 | ... 11 | @@ -82,7 +82,7 @@ NPY001.py:12:72: NPY001 [*] Type alias `np.int` is deprecated, replace with buil 14 14 | pdf = pd.DataFrame( 15 15 | data=[[1, 2, 3]], -NPY001.py:12:80: NPY001 [*] Type alias `np.long` is deprecated, replace with builtin type +NPY001.py:12:80: NPY001 [**] Type alias `np.long` is deprecated, replace with builtin type | 10 | ... 11 | @@ -103,7 +103,7 @@ NPY001.py:12:80: NPY001 [*] Type alias `np.long` is deprecated, replace with bui 14 14 | pdf = pd.DataFrame( 15 15 | data=[[1, 2, 3]], -NPY001.py:17:11: NPY001 [*] Type alias `np.object` is deprecated, replace with builtin type +NPY001.py:17:11: NPY001 [**] Type alias `np.object` is deprecated, replace with builtin type | 15 | data=[[1, 2, 3]], 16 | columns=["a", "b", "c"], @@ -123,7 +123,7 @@ NPY001.py:17:11: NPY001 [*] Type alias `np.object` is deprecated, replace with b 19 19 | 20 20 | _ = arr.astype(np.int) -NPY001.py:20:16: NPY001 [*] Type alias `np.int` is deprecated, replace with builtin type +NPY001.py:20:16: NPY001 [**] Type alias `np.int` is deprecated, replace with builtin type | 18 | ) 19 | diff --git a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD002_PD002.py.snap b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD002_PD002.py.snap index 8fd8323c46ecdf..6ebfce7b4c231e 100644 --- a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD002_PD002.py.snap +++ b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD002_PD002.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pandas_vet/mod.rs --- -PD002.py:5:23: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior +PD002.py:5:23: PD002 [**] `inplace=True` should be avoided; it has inconsistent behavior | 3 | x = pd.DataFrame() 4 | @@ -22,7 +22,7 @@ PD002.py:5:23: PD002 [*] `inplace=True` should be avoided; it has inconsistent b 7 7 | x.y.drop(["a"], axis=1, inplace=True) 8 8 | -PD002.py:7:25: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior +PD002.py:7:25: PD002 [**] `inplace=True` should be avoided; it has inconsistent behavior | 5 | x.drop(["a"], axis=1, inplace=True) 6 | @@ -43,7 +43,7 @@ PD002.py:7:25: PD002 [*] `inplace=True` should be avoided; it has inconsistent b 9 9 | x["y"].drop(["a"], axis=1, inplace=True) 10 10 | -PD002.py:9:28: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior +PD002.py:9:28: PD002 [**] `inplace=True` should be avoided; it has inconsistent behavior | 7 | x.y.drop(["a"], axis=1, inplace=True) 8 | @@ -64,7 +64,7 @@ PD002.py:9:28: PD002 [*] `inplace=True` should be avoided; it has inconsistent b 11 11 | x.drop( 12 12 | inplace=True, -PD002.py:12:5: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior +PD002.py:12:5: PD002 [**] `inplace=True` should be avoided; it has inconsistent behavior | 11 | x.drop( 12 | inplace=True, @@ -85,7 +85,7 @@ PD002.py:12:5: PD002 [*] `inplace=True` should be avoided; it has inconsistent b 14 13 | axis=1, 15 14 | ) -PD002.py:19:9: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior +PD002.py:19:9: PD002 [**] `inplace=True` should be avoided; it has inconsistent behavior | 17 | if True: 18 | x.drop( @@ -107,7 +107,7 @@ PD002.py:19:9: PD002 [*] `inplace=True` should be avoided; it has inconsistent b 21 20 | axis=1, 22 21 | ) -PD002.py:24:33: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior +PD002.py:24:33: PD002 [**] `inplace=True` should be avoided; it has inconsistent behavior | 22 | ) 23 | @@ -158,7 +158,7 @@ PD002.py:28:38: PD002 `inplace=True` should be avoided; it has inconsistent beha | = help: Assign to variable; remove `inplace` arg -PD002.py:33:24: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior +PD002.py:33:24: PD002 [**] `inplace=True` should be avoided; it has inconsistent behavior | 31 | torch.m.ReLU(inplace=True) # safe because this isn't a pandas call 32 | diff --git a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD002_fail.snap b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD002_fail.snap index d88f95e11436c5..00de5c1c668961 100644 --- a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD002_fail.snap +++ b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD002_fail.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pandas_vet/mod.rs --- -:4:23: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior +:4:23: PD002 [**] `inplace=True` should be avoided; it has inconsistent behavior | 2 | import pandas as pd 3 | x = pd.DataFrame() diff --git a/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF102_PERF102.py.snap b/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF102_PERF102.py.snap index f38200c0dec33e..2cd54164805b25 100644 --- a/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF102_PERF102.py.snap +++ b/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF102_PERF102.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/perflint/mod.rs --- -PERF102.py:5:21: PERF102 [*] When using only the values of a dict use the `values()` method +PERF102.py:5:21: PERF102 [**] When using only the values of a dict use the `values()` method | 4 | def f(): 5 | for _, value in some_dict.items(): # PERF102 @@ -20,7 +20,7 @@ PERF102.py:5:21: PERF102 [*] When using only the values of a dict use the `value 7 7 | 8 8 | -PERF102.py:10:19: PERF102 [*] When using only the keys of a dict use the `keys()` method +PERF102.py:10:19: PERF102 [**] When using only the keys of a dict use the `keys()` method | 9 | def f(): 10 | for key, _ in some_dict.items(): # PERF102 @@ -39,7 +39,7 @@ PERF102.py:10:19: PERF102 [*] When using only the keys of a dict use the `keys() 12 12 | 13 13 | -PERF102.py:15:30: PERF102 [*] When using only the keys of a dict use the `keys()` method +PERF102.py:15:30: PERF102 [**] When using only the keys of a dict use the `keys()` method | 14 | def f(): 15 | for weird_arg_name, _ in some_dict.items(): # PERF102 @@ -58,7 +58,7 @@ PERF102.py:15:30: PERF102 [*] When using only the keys of a dict use the `keys() 17 17 | 18 18 | -PERF102.py:20:25: PERF102 [*] When using only the keys of a dict use the `keys()` method +PERF102.py:20:25: PERF102 [**] When using only the keys of a dict use the `keys()` method | 19 | def f(): 20 | for name, (_, _) in some_dict.items(): # PERF102 @@ -77,7 +77,7 @@ PERF102.py:20:25: PERF102 [*] When using only the keys of a dict use the `keys() 22 22 | 23 23 | -PERF102.py:30:30: PERF102 [*] When using only the keys of a dict use the `keys()` method +PERF102.py:30:30: PERF102 [**] When using only the keys of a dict use the `keys()` method | 29 | def f(): 30 | for (key1, _), (_, _) in some_dict.items(): # PERF102 @@ -96,7 +96,7 @@ PERF102.py:30:30: PERF102 [*] When using only the keys of a dict use the `keys() 32 32 | 33 33 | -PERF102.py:35:36: PERF102 [*] When using only the values of a dict use the `values()` method +PERF102.py:35:36: PERF102 [**] When using only the values of a dict use the `values()` method | 34 | def f(): 35 | for (_, (_, _)), (value, _) in some_dict.items(): # PERF102 @@ -115,7 +115,7 @@ PERF102.py:35:36: PERF102 [*] When using only the values of a dict use the `valu 37 37 | 38 38 | -PERF102.py:50:32: PERF102 [*] When using only the keys of a dict use the `keys()` method +PERF102.py:50:32: PERF102 [**] When using only the keys of a dict use the `keys()` method | 49 | def f(): 50 | for ((_, key2), (_, _)) in some_dict.items(): # PERF102 @@ -134,7 +134,7 @@ PERF102.py:50:32: PERF102 [*] When using only the keys of a dict use the `keys() 52 52 | 53 53 | -PERF102.py:85:25: PERF102 [*] When using only the keys of a dict use the `keys()` method +PERF102.py:85:25: PERF102 [**] When using only the keys of a dict use the `keys()` method | 84 | def f(): 85 | for name, (_, _) in (some_function()).items(): # PERF102 @@ -153,7 +153,7 @@ PERF102.py:85:25: PERF102 [*] When using only the keys of a dict use the `keys() 87 87 | 88 88 | -PERF102.py:90:25: PERF102 [*] When using only the keys of a dict use the `keys()` method +PERF102.py:90:25: PERF102 [**] When using only the keys of a dict use the `keys()` method | 89 | def f(): 90 | for name, (_, _) in (some_function().some_attribute).items(): # PERF102 @@ -172,7 +172,7 @@ PERF102.py:90:25: PERF102 [*] When using only the keys of a dict use the `keys() 92 92 | 93 93 | -PERF102.py:95:31: PERF102 [*] When using only the keys of a dict use the `keys()` method +PERF102.py:95:31: PERF102 [**] When using only the keys of a dict use the `keys()` method | 94 | def f(): 95 | for name, unused_value in some_dict.items(): # PERF102 @@ -191,7 +191,7 @@ PERF102.py:95:31: PERF102 [*] When using only the keys of a dict use the `keys() 97 97 | 98 98 | -PERF102.py:100:31: PERF102 [*] When using only the values of a dict use the `values()` method +PERF102.py:100:31: PERF102 [**] When using only the values of a dict use the `values()` method | 99 | def f(): 100 | for unused_name, value in some_dict.items(): # PERF102 @@ -210,7 +210,7 @@ PERF102.py:100:31: PERF102 [*] When using only the values of a dict use the `val 102 102 | 103 103 | -PERF102.py:106:16: PERF102 [*] When using only the keys of a dict use the `keys()` method +PERF102.py:106:16: PERF102 [**] When using only the keys of a dict use the `keys()` method | 104 | # Regression test for: https://github.com/astral-sh/ruff/issues/7097 105 | def _create_context(name_to_value): diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E711_E711.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E711_E711.py.snap index 0929543ee6c8a7..226cd3007a5d9b 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E711_E711.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E711_E711.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pycodestyle/mod.rs --- -E711.py:2:11: E711 [*] Comparison to `None` should be `cond is None` +E711.py:2:11: E711 [**] Comparison to `None` should be `cond is None` | 1 | #: E711 2 | if res == None: @@ -19,7 +19,7 @@ E711.py:2:11: E711 [*] Comparison to `None` should be `cond is None` 4 4 | #: E711 5 5 | if res != None: -E711.py:5:11: E711 [*] Comparison to `None` should be `cond is not None` +E711.py:5:11: E711 [**] Comparison to `None` should be `cond is not None` | 3 | pass 4 | #: E711 @@ -40,7 +40,7 @@ E711.py:5:11: E711 [*] Comparison to `None` should be `cond is not None` 7 7 | #: E711 8 8 | if None == res: -E711.py:8:4: E711 [*] Comparison to `None` should be `cond is None` +E711.py:8:4: E711 [**] Comparison to `None` should be `cond is None` | 6 | pass 7 | #: E711 @@ -61,7 +61,7 @@ E711.py:8:4: E711 [*] Comparison to `None` should be `cond is None` 10 10 | #: E711 11 11 | if None != res: -E711.py:11:4: E711 [*] Comparison to `None` should be `cond is not None` +E711.py:11:4: E711 [**] Comparison to `None` should be `cond is not None` | 9 | pass 10 | #: E711 @@ -82,7 +82,7 @@ E711.py:11:4: E711 [*] Comparison to `None` should be `cond is not None` 13 13 | #: E711 14 14 | if res[1] == None: -E711.py:14:14: E711 [*] Comparison to `None` should be `cond is None` +E711.py:14:14: E711 [**] Comparison to `None` should be `cond is None` | 12 | pass 13 | #: E711 @@ -103,7 +103,7 @@ E711.py:14:14: E711 [*] Comparison to `None` should be `cond is None` 16 16 | #: E711 17 17 | if res[1] != None: -E711.py:17:14: E711 [*] Comparison to `None` should be `cond is not None` +E711.py:17:14: E711 [**] Comparison to `None` should be `cond is not None` | 15 | pass 16 | #: E711 @@ -124,7 +124,7 @@ E711.py:17:14: E711 [*] Comparison to `None` should be `cond is not None` 19 19 | #: E711 20 20 | if None != res[1]: -E711.py:20:4: E711 [*] Comparison to `None` should be `cond is not None` +E711.py:20:4: E711 [**] Comparison to `None` should be `cond is not None` | 18 | pass 19 | #: E711 @@ -145,7 +145,7 @@ E711.py:20:4: E711 [*] Comparison to `None` should be `cond is not None` 22 22 | #: E711 23 23 | if None == res[1]: -E711.py:23:4: E711 [*] Comparison to `None` should be `cond is None` +E711.py:23:4: E711 [**] Comparison to `None` should be `cond is None` | 21 | pass 22 | #: E711 @@ -165,7 +165,7 @@ E711.py:23:4: E711 [*] Comparison to `None` should be `cond is None` 25 25 | 26 26 | if x == None != None: -E711.py:26:9: E711 [*] Comparison to `None` should be `cond is None` +E711.py:26:9: E711 [**] Comparison to `None` should be `cond is None` | 24 | pass 25 | @@ -185,7 +185,7 @@ E711.py:26:9: E711 [*] Comparison to `None` should be `cond is None` 28 28 | 29 29 | #: Okay -E711.py:26:17: E711 [*] Comparison to `None` should be `cond is not None` +E711.py:26:17: E711 [**] Comparison to `None` should be `cond is not None` | 24 | pass 25 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E712_E712.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E712_E712.py.snap index 6f4b23c2defc4c..bcfce5f35e2f28 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E712_E712.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E712_E712.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pycodestyle/mod.rs --- -E712.py:2:11: E712 [*] Comparison to `True` should be `cond is True` or `if cond:` +E712.py:2:11: E712 [**] Comparison to `True` should be `cond is True` or `if cond:` | 1 | #: E712 2 | if res == True: @@ -19,7 +19,7 @@ E712.py:2:11: E712 [*] Comparison to `True` should be `cond is True` or `if cond 4 4 | #: E712 5 5 | if res != False: -E712.py:5:11: E712 [*] Comparison to `False` should be `cond is not False` or `if cond:` +E712.py:5:11: E712 [**] Comparison to `False` should be `cond is not False` or `if cond:` | 3 | pass 4 | #: E712 @@ -40,7 +40,7 @@ E712.py:5:11: E712 [*] Comparison to `False` should be `cond is not False` or `i 7 7 | #: E712 8 8 | if True != res: -E712.py:8:4: E712 [*] Comparison to `True` should be `cond is not True` or `if not cond:` +E712.py:8:4: E712 [**] Comparison to `True` should be `cond is not True` or `if not cond:` | 6 | pass 7 | #: E712 @@ -61,7 +61,7 @@ E712.py:8:4: E712 [*] Comparison to `True` should be `cond is not True` or `if n 10 10 | #: E712 11 11 | if False == res: -E712.py:11:4: E712 [*] Comparison to `False` should be `cond is False` or `if not cond:` +E712.py:11:4: E712 [**] Comparison to `False` should be `cond is False` or `if not cond:` | 9 | pass 10 | #: E712 @@ -82,7 +82,7 @@ E712.py:11:4: E712 [*] Comparison to `False` should be `cond is False` or `if no 13 13 | #: E712 14 14 | if res[1] == True: -E712.py:14:14: E712 [*] Comparison to `True` should be `cond is True` or `if cond:` +E712.py:14:14: E712 [**] Comparison to `True` should be `cond is True` or `if cond:` | 12 | pass 13 | #: E712 @@ -103,7 +103,7 @@ E712.py:14:14: E712 [*] Comparison to `True` should be `cond is True` or `if con 16 16 | #: E712 17 17 | if res[1] != False: -E712.py:17:14: E712 [*] Comparison to `False` should be `cond is not False` or `if cond:` +E712.py:17:14: E712 [**] Comparison to `False` should be `cond is not False` or `if cond:` | 15 | pass 16 | #: E712 @@ -124,7 +124,7 @@ E712.py:17:14: E712 [*] Comparison to `False` should be `cond is not False` or ` 19 19 | #: E712 20 20 | var = 1 if cond == True else -1 if cond == False else cond -E712.py:20:20: E712 [*] Comparison to `True` should be `cond is True` or `if cond:` +E712.py:20:20: E712 [**] Comparison to `True` should be `cond is True` or `if cond:` | 18 | pass 19 | #: E712 @@ -145,7 +145,7 @@ E712.py:20:20: E712 [*] Comparison to `True` should be `cond is True` or `if con 22 22 | if (True) == TrueElement or x == TrueElement: 23 23 | pass -E712.py:20:44: E712 [*] Comparison to `False` should be `cond is False` or `if not cond:` +E712.py:20:44: E712 [**] Comparison to `False` should be `cond is False` or `if not cond:` | 18 | pass 19 | #: E712 @@ -166,7 +166,7 @@ E712.py:20:44: E712 [*] Comparison to `False` should be `cond is False` or `if n 22 22 | if (True) == TrueElement or x == TrueElement: 23 23 | pass -E712.py:22:5: E712 [*] Comparison to `True` should be `cond is True` or `if cond:` +E712.py:22:5: E712 [**] Comparison to `True` should be `cond is True` or `if cond:` | 20 | var = 1 if cond == True else -1 if cond == False else cond 21 | #: E712 @@ -186,7 +186,7 @@ E712.py:22:5: E712 [*] Comparison to `True` should be `cond is True` or `if cond 24 24 | 25 25 | if res == True != False: -E712.py:25:11: E712 [*] Comparison to `True` should be `cond is True` or `if cond:` +E712.py:25:11: E712 [**] Comparison to `True` should be `cond is True` or `if cond:` | 23 | pass 24 | @@ -206,7 +206,7 @@ E712.py:25:11: E712 [*] Comparison to `True` should be `cond is True` or `if con 27 27 | 28 28 | if(True) == TrueElement or x == TrueElement: -E712.py:25:19: E712 [*] Comparison to `False` should be `cond is not False` or `if cond:` +E712.py:25:19: E712 [**] Comparison to `False` should be `cond is not False` or `if cond:` | 23 | pass 24 | @@ -226,7 +226,7 @@ E712.py:25:19: E712 [*] Comparison to `False` should be `cond is not False` or ` 27 27 | 28 28 | if(True) == TrueElement or x == TrueElement: -E712.py:28:4: E712 [*] Comparison to `True` should be `cond is True` or `if cond:` +E712.py:28:4: E712 [**] Comparison to `True` should be `cond is True` or `if cond:` | 26 | pass 27 | @@ -246,7 +246,7 @@ E712.py:28:4: E712 [*] Comparison to `True` should be `cond is True` or `if cond 30 30 | 31 31 | if (yield i) == True: -E712.py:31:17: E712 [*] Comparison to `True` should be `cond is True` or `if cond:` +E712.py:31:17: E712 [**] Comparison to `True` should be `cond is True` or `if cond:` | 29 | pass 30 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E731_E731.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E731_E731.py.snap index ce00ec0a9a768c..55ec0c4b1b6277 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E731_E731.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E731_E731.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pycodestyle/mod.rs --- -E731.py:3:5: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:3:5: E731 [**] Do not assign a `lambda` expression, use a `def` | 1 | def scope(): 2 | # E731 @@ -20,7 +20,7 @@ E731.py:3:5: E731 [*] Do not assign a `lambda` expression, use a `def` 5 6 | 6 7 | def scope(): -E731.py:8:5: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:8:5: E731 [**] Do not assign a `lambda` expression, use a `def` | 6 | def scope(): 7 | # E731 @@ -40,7 +40,7 @@ E731.py:8:5: E731 [*] Do not assign a `lambda` expression, use a `def` 10 11 | 11 12 | def scope(): -E731.py:14:9: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:14:9: E731 [**] Do not assign a `lambda` expression, use a `def` | 12 | # E731 13 | while False: @@ -60,7 +60,7 @@ E731.py:14:9: E731 [*] Do not assign a `lambda` expression, use a `def` 16 17 | 17 18 | def scope(): -E731.py:19:5: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:19:5: E731 [**] Do not assign a `lambda` expression, use a `def` | 17 | def scope(): 18 | # E731 @@ -80,7 +80,7 @@ E731.py:19:5: E731 [*] Do not assign a `lambda` expression, use a `def` 21 22 | 22 23 | def scope(): -E731.py:24:5: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:24:5: E731 [**] Do not assign a `lambda` expression, use a `def` | 22 | def scope(): 23 | # E731 @@ -182,7 +182,7 @@ E731.py:75:9: E731 [*] Do not assign a `lambda` expression, use a `def` 77 78 | 78 79 | -E731.py:86:5: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:86:5: E731 [**] Do not assign a `lambda` expression, use a `def` | 84 | # ParamSpec cannot be used in this context, so do not preserve the annotation. 85 | P = ParamSpec("P") @@ -202,7 +202,7 @@ E731.py:86:5: E731 [*] Do not assign a `lambda` expression, use a `def` 88 89 | 89 90 | def scope(): -E731.py:94:5: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:94:5: E731 [**] Do not assign a `lambda` expression, use a `def` | 92 | from typing import Callable 93 | @@ -222,7 +222,7 @@ E731.py:94:5: E731 [*] Do not assign a `lambda` expression, use a `def` 96 97 | 97 98 | def scope(): -E731.py:102:5: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:102:5: E731 [**] Do not assign a `lambda` expression, use a `def` | 100 | from typing import Callable 101 | @@ -242,7 +242,7 @@ E731.py:102:5: E731 [*] Do not assign a `lambda` expression, use a `def` 104 105 | 105 106 | def scope(): -E731.py:110:5: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:110:5: E731 [**] Do not assign a `lambda` expression, use a `def` | 108 | from typing import Callable 109 | @@ -262,7 +262,7 @@ E731.py:110:5: E731 [*] Do not assign a `lambda` expression, use a `def` 112 113 | 113 114 | # Let's use the `Callable` type from `collections.abc` instead. -E731.py:119:5: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:119:5: E731 [**] Do not assign a `lambda` expression, use a `def` | 117 | from collections.abc import Callable 118 | @@ -282,7 +282,7 @@ E731.py:119:5: E731 [*] Do not assign a `lambda` expression, use a `def` 121 122 | 122 123 | def scope(): -E731.py:127:5: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:127:5: E731 [**] Do not assign a `lambda` expression, use a `def` | 125 | from collections.abc import Callable 126 | @@ -302,7 +302,7 @@ E731.py:127:5: E731 [*] Do not assign a `lambda` expression, use a `def` 129 130 | 130 131 | def scope(): -E731.py:135:5: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:135:5: E731 [**] Do not assign a `lambda` expression, use a `def` | 133 | from collections.abc import Callable 134 | @@ -362,7 +362,7 @@ E731.py:140:5: E731 [*] Do not assign a `lambda` expression, use a `def` 142 143 | 143 144 | # Regression test for: https://github.com/astral-sh/ruff/issues/7141 -E731.py:147:5: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:147:5: E731 [**] Do not assign a `lambda` expression, use a `def` | 145 | # E731 146 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__constant_literals.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__constant_literals.snap index e8a55ce2fbb6e2..1a6d1eca9a4b49 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__constant_literals.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__constant_literals.snap @@ -106,7 +106,7 @@ constant_literals.py:12:4: F632 [*] Use `==` to compare constant literals 14 14 | if False == None: # E711, E712 (fix) 15 15 | pass -constant_literals.py:14:4: E712 [*] Comparison to `False` should be `cond is False` or `if not cond:` +constant_literals.py:14:4: E712 [**] Comparison to `False` should be `cond is False` or `if not cond:` | 12 | if False is "abc": # F632 (fix, but leaves behind unfixable E712) 13 | pass @@ -127,7 +127,7 @@ constant_literals.py:14:4: E712 [*] Comparison to `False` should be `cond is Fal 16 16 | if None == False: # E711, E712 (fix) 17 17 | pass -constant_literals.py:14:13: E711 [*] Comparison to `None` should be `cond is None` +constant_literals.py:14:13: E711 [**] Comparison to `None` should be `cond is None` | 12 | if False is "abc": # F632 (fix, but leaves behind unfixable E712) 13 | pass @@ -148,7 +148,7 @@ constant_literals.py:14:13: E711 [*] Comparison to `None` should be `cond is Non 16 16 | if None == False: # E711, E712 (fix) 17 17 | pass -constant_literals.py:16:4: E711 [*] Comparison to `None` should be `cond is None` +constant_literals.py:16:4: E711 [**] Comparison to `None` should be `cond is None` | 14 | if False == None: # E711, E712 (fix) 15 | pass @@ -168,7 +168,7 @@ constant_literals.py:16:4: E711 [*] Comparison to `None` should be `cond is None 18 18 | 19 19 | ### -constant_literals.py:16:12: E712 [*] Comparison to `False` should be `cond is False` or `if not cond:` +constant_literals.py:16:12: E712 [**] Comparison to `False` should be `cond is False` or `if not cond:` | 14 | if False == None: # E711, E712 (fix) 15 | pass diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D.py.snap index 2e9ab57a982b68..20568a3cc22d32 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pydocstyle/mod.rs --- -D.py:129:5: D200 [*] One-line docstring should fit on one line +D.py:129:5: D200 [**] One-line docstring should fit on one line | 127 | @expect('D212: Multi-line docstring summary should start at the first line') 128 | def asdlkfasd(): @@ -25,7 +25,7 @@ D.py:129:5: D200 [*] One-line docstring should fit on one line 133 131 | 134 132 | @expect('D201: No blank lines allowed before function docstring (found 1)') -D.py:597:5: D200 [*] One-line docstring should fit on one line +D.py:597:5: D200 [**] One-line docstring should fit on one line | 595 | @expect('D212: Multi-line docstring summary should start at the first line') 596 | def one_liner(): @@ -49,7 +49,7 @@ D.py:597:5: D200 [*] One-line docstring should fit on one line 601 599 | 602 600 | @expect('D200: One-line docstring should fit on one line with quotes ' -D.py:606:5: D200 [*] One-line docstring should fit on one line +D.py:606:5: D200 [**] One-line docstring should fit on one line | 604 | @expect('D212: Multi-line docstring summary should start at the first line') 605 | def one_liner(): diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D200.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D200.py.snap index d4f68ce602e277..bcbf0c4182f3ef 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D200.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D200.py.snap @@ -11,7 +11,7 @@ D200.py:2:5: D200 One-line docstring should fit on one line | = help: Reformat to one line -D200.py:7:5: D200 [*] One-line docstring should fit on one line +D200.py:7:5: D200 [**] One-line docstring should fit on one line | 6 | def func(): 7 | """\\ diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D.py.snap index 7d0eafb11dffba..ba5be6e1cb6bb2 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pydocstyle/mod.rs --- -D.py:355:5: D400 [*] First line should end with a period +D.py:355:5: D400 [**] First line should end with a period | 353 | "or exclamation point (not 'y')") 354 | def lwnlkjl(): @@ -20,7 +20,7 @@ D.py:355:5: D400 [*] First line should end with a period 357 357 | 358 358 | @expect("D401: First line should be in imperative mood " -D.py:406:25: D400 [*] First line should end with a period +D.py:406:25: D400 [**] First line should end with a period | 404 | @expect("D415: First line should end with a period, question mark," 405 | " or exclamation point (not 'r')") @@ -39,7 +39,7 @@ D.py:406:25: D400 [*] First line should end with a period 408 408 | 409 409 | def ignored_decorator(func): # noqa: D400,D401,D415 -D.py:410:5: D400 [*] First line should end with a period +D.py:410:5: D400 [**] First line should end with a period | 409 | def ignored_decorator(func): # noqa: D400,D401,D415 410 | """Runs something""" @@ -59,7 +59,7 @@ D.py:410:5: D400 [*] First line should end with a period 412 412 | pass 413 413 | -D.py:416:5: D400 [*] First line should end with a period +D.py:416:5: D400 [**] First line should end with a period | 415 | def decorator_for_test(func): # noqa: D400,D401,D415 416 | """Runs something""" @@ -79,7 +79,7 @@ D.py:416:5: D400 [*] First line should end with a period 418 418 | pass 419 419 | -D.py:422:35: D400 [*] First line should end with a period +D.py:422:35: D400 [**] First line should end with a period | 421 | @ignored_decorator 422 | def oneliner_ignored_decorator(): """One liner""" @@ -97,7 +97,7 @@ D.py:422:35: D400 [*] First line should end with a period 424 424 | 425 425 | @decorator_for_test -D.py:429:49: D400 [*] First line should end with a period +D.py:429:49: D400 [**] First line should end with a period | 427 | @expect("D415: First line should end with a period, question mark," 428 | " or exclamation point (not 'r')") @@ -116,7 +116,7 @@ D.py:429:49: D400 [*] First line should end with a period 431 431 | 432 432 | @decorator_for_test -D.py:470:5: D400 [*] First line should end with a period +D.py:470:5: D400 [**] First line should end with a period | 468 | "or exclamation point (not 'g')") 469 | def docstring_bad(): @@ -136,7 +136,7 @@ D.py:470:5: D400 [*] First line should end with a period 472 472 | 473 473 | -D.py:475:5: D400 [*] First line should end with a period +D.py:475:5: D400 [**] First line should end with a period | 474 | def docstring_bad_ignore_all(): # noqa 475 | """Runs something""" @@ -155,7 +155,7 @@ D.py:475:5: D400 [*] First line should end with a period 477 477 | 478 478 | -D.py:480:5: D400 [*] First line should end with a period +D.py:480:5: D400 [**] First line should end with a period | 479 | def docstring_bad_ignore_one(): # noqa: D400,D401,D415 480 | """Runs something""" @@ -174,7 +174,7 @@ D.py:480:5: D400 [*] First line should end with a period 482 482 | 483 483 | -D.py:487:5: D400 [*] First line should end with a period +D.py:487:5: D400 [**] First line should end with a period | 485 | "(perhaps 'Run', not 'Runs')") 486 | def docstring_ignore_some_violations_but_catch_D401(): # noqa: E501,D400,D415 @@ -194,7 +194,7 @@ D.py:487:5: D400 [*] First line should end with a period 489 489 | 490 490 | -D.py:514:5: D400 [*] First line should end with a period +D.py:514:5: D400 [**] First line should end with a period | 513 | def valid_google_string(): # noqa: D400 514 | """Test a valid something!""" @@ -212,7 +212,7 @@ D.py:514:5: D400 [*] First line should end with a period 516 516 | 517 517 | @expect("D415: First line should end with a period, question mark, " -D.py:520:5: D400 [*] First line should end with a period +D.py:520:5: D400 [**] First line should end with a period | 518 | "or exclamation point (not 'g')") 519 | def bad_google_string(): # noqa: D400 @@ -231,7 +231,7 @@ D.py:520:5: D400 [*] First line should end with a period 522 522 | 523 523 | # This is reproducing a bug where AttributeError is raised when parsing class -D.py:581:5: D400 [*] First line should end with a period +D.py:581:5: D400 [**] First line should end with a period | 579 | "or exclamation point (not '\"')") 580 | def endswith_quote(): @@ -250,7 +250,7 @@ D.py:581:5: D400 [*] First line should end with a period 583 583 | 584 584 | @expect('D209: Multi-line docstring closing quotes should be on a separate ' -D.py:615:5: D400 [*] First line should end with a period +D.py:615:5: D400 [**] First line should end with a period | 613 | @expect('D212: Multi-line docstring summary should start at the first line') 614 | def one_liner(): @@ -272,7 +272,7 @@ D.py:615:5: D400 [*] First line should end with a period 617 617 | """ 618 618 | -D.py:639:17: D400 [*] First line should end with a period +D.py:639:17: D400 [**] First line should end with a period | 639 | class SameLine: """This is a docstring on the same line""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D400 @@ -291,7 +291,7 @@ D.py:639:17: D400 [*] First line should end with a period 641 641 | def same_line(): """This is a docstring on the same line""" 642 642 | -D.py:641:18: D400 [*] First line should end with a period +D.py:641:18: D400 [**] First line should end with a period | 639 | class SameLine: """This is a docstring on the same line""" 640 | @@ -310,7 +310,7 @@ D.py:641:18: D400 [*] First line should end with a period 643 643 | 644 644 | def single_line_docstring_with_an_escaped_backslash(): -D.py:664:5: D400 [*] First line should end with a period +D.py:664:5: D400 [**] First line should end with a period | 663 | def newline_after_closing_quote(self): 664 | "We enforce a newline after the closing quote for a multi-line docstring \ diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D400.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D400.py.snap index 4404e556416780..0bb03df8de9187 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D400.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D400.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pydocstyle/mod.rs --- -D400.py:2:5: D400 [*] First line should end with a period +D400.py:2:5: D400 [**] First line should end with a period | 1 | def f(): 2 | "Here's a line without a period" @@ -18,7 +18,7 @@ D400.py:2:5: D400 [*] First line should end with a period 4 4 | 5 5 | -D400.py:7:5: D400 [*] First line should end with a period +D400.py:7:5: D400 [**] First line should end with a period | 6 | def f(): 7 | """Here's a line without a period""" @@ -37,7 +37,7 @@ D400.py:7:5: D400 [*] First line should end with a period 9 9 | 10 10 | -D400.py:12:5: D400 [*] First line should end with a period +D400.py:12:5: D400 [**] First line should end with a period | 11 | def f(): 12 | """ @@ -60,7 +60,7 @@ D400.py:12:5: D400 [*] First line should end with a period 16 16 | ... 17 17 | -D400.py:20:5: D400 [*] First line should end with a period +D400.py:20:5: D400 [**] First line should end with a period | 19 | def f(): 20 | """Here's a line without a period""" @@ -79,7 +79,7 @@ D400.py:20:5: D400 [*] First line should end with a period 22 22 | 23 23 | -D400.py:25:5: D400 [*] First line should end with a period +D400.py:25:5: D400 [**] First line should end with a period | 24 | def f(): 25 | """ @@ -101,7 +101,7 @@ D400.py:25:5: D400 [*] First line should end with a period 29 29 | 30 30 | -D400.py:32:5: D400 [*] First line should end with a period +D400.py:32:5: D400 [**] First line should end with a period | 31 | def f(): 32 | """ @@ -123,7 +123,7 @@ D400.py:32:5: D400 [*] First line should end with a period 36 36 | 37 37 | -D400.py:39:5: D400 [*] First line should end with a period +D400.py:39:5: D400 [**] First line should end with a period | 38 | def f(): 39 | r"Here's a line without a period" @@ -142,7 +142,7 @@ D400.py:39:5: D400 [*] First line should end with a period 41 41 | 42 42 | -D400.py:44:5: D400 [*] First line should end with a period +D400.py:44:5: D400 [**] First line should end with a period | 43 | def f(): 44 | r"""Here's a line without a period""" @@ -161,7 +161,7 @@ D400.py:44:5: D400 [*] First line should end with a period 46 46 | 47 47 | -D400.py:49:5: D400 [*] First line should end with a period +D400.py:49:5: D400 [**] First line should end with a period | 48 | def f(): 49 | r""" @@ -184,7 +184,7 @@ D400.py:49:5: D400 [*] First line should end with a period 53 53 | ... 54 54 | -D400.py:57:5: D400 [*] First line should end with a period +D400.py:57:5: D400 [**] First line should end with a period | 56 | def f(): 57 | r"""Here's a line without a period""" @@ -203,7 +203,7 @@ D400.py:57:5: D400 [*] First line should end with a period 59 59 | 60 60 | -D400.py:62:5: D400 [*] First line should end with a period +D400.py:62:5: D400 [**] First line should end with a period | 61 | def f(): 62 | r""" @@ -225,7 +225,7 @@ D400.py:62:5: D400 [*] First line should end with a period 66 66 | 67 67 | -D400.py:69:5: D400 [*] First line should end with a period +D400.py:69:5: D400 [**] First line should end with a period | 68 | def f(): 69 | r""" diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D.py.snap index 3bdc949e58ea59..4cac0b7d927fa4 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pydocstyle/mod.rs --- -D.py:355:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:355:5: D415 [**] First line should end with a period, question mark, or exclamation point | 353 | "or exclamation point (not 'y')") 354 | def lwnlkjl(): @@ -20,7 +20,7 @@ D.py:355:5: D415 [*] First line should end with a period, question mark, or excl 357 357 | 358 358 | @expect("D401: First line should be in imperative mood " -D.py:406:25: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:406:25: D415 [**] First line should end with a period, question mark, or exclamation point | 404 | @expect("D415: First line should end with a period, question mark," 405 | " or exclamation point (not 'r')") @@ -39,7 +39,7 @@ D.py:406:25: D415 [*] First line should end with a period, question mark, or exc 408 408 | 409 409 | def ignored_decorator(func): # noqa: D400,D401,D415 -D.py:410:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:410:5: D415 [**] First line should end with a period, question mark, or exclamation point | 409 | def ignored_decorator(func): # noqa: D400,D401,D415 410 | """Runs something""" @@ -59,7 +59,7 @@ D.py:410:5: D415 [*] First line should end with a period, question mark, or excl 412 412 | pass 413 413 | -D.py:416:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:416:5: D415 [**] First line should end with a period, question mark, or exclamation point | 415 | def decorator_for_test(func): # noqa: D400,D401,D415 416 | """Runs something""" @@ -79,7 +79,7 @@ D.py:416:5: D415 [*] First line should end with a period, question mark, or excl 418 418 | pass 419 419 | -D.py:422:35: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:422:35: D415 [**] First line should end with a period, question mark, or exclamation point | 421 | @ignored_decorator 422 | def oneliner_ignored_decorator(): """One liner""" @@ -97,7 +97,7 @@ D.py:422:35: D415 [*] First line should end with a period, question mark, or exc 424 424 | 425 425 | @decorator_for_test -D.py:429:49: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:429:49: D415 [**] First line should end with a period, question mark, or exclamation point | 427 | @expect("D415: First line should end with a period, question mark," 428 | " or exclamation point (not 'r')") @@ -116,7 +116,7 @@ D.py:429:49: D415 [*] First line should end with a period, question mark, or exc 431 431 | 432 432 | @decorator_for_test -D.py:470:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:470:5: D415 [**] First line should end with a period, question mark, or exclamation point | 468 | "or exclamation point (not 'g')") 469 | def docstring_bad(): @@ -136,7 +136,7 @@ D.py:470:5: D415 [*] First line should end with a period, question mark, or excl 472 472 | 473 473 | -D.py:475:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:475:5: D415 [**] First line should end with a period, question mark, or exclamation point | 474 | def docstring_bad_ignore_all(): # noqa 475 | """Runs something""" @@ -155,7 +155,7 @@ D.py:475:5: D415 [*] First line should end with a period, question mark, or excl 477 477 | 478 478 | -D.py:480:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:480:5: D415 [**] First line should end with a period, question mark, or exclamation point | 479 | def docstring_bad_ignore_one(): # noqa: D400,D401,D415 480 | """Runs something""" @@ -174,7 +174,7 @@ D.py:480:5: D415 [*] First line should end with a period, question mark, or excl 482 482 | 483 483 | -D.py:487:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:487:5: D415 [**] First line should end with a period, question mark, or exclamation point | 485 | "(perhaps 'Run', not 'Runs')") 486 | def docstring_ignore_some_violations_but_catch_D401(): # noqa: E501,D400,D415 @@ -194,7 +194,7 @@ D.py:487:5: D415 [*] First line should end with a period, question mark, or excl 489 489 | 490 490 | -D.py:520:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:520:5: D415 [**] First line should end with a period, question mark, or exclamation point | 518 | "or exclamation point (not 'g')") 519 | def bad_google_string(): # noqa: D400 @@ -213,7 +213,7 @@ D.py:520:5: D415 [*] First line should end with a period, question mark, or excl 522 522 | 523 523 | # This is reproducing a bug where AttributeError is raised when parsing class -D.py:581:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:581:5: D415 [**] First line should end with a period, question mark, or exclamation point | 579 | "or exclamation point (not '\"')") 580 | def endswith_quote(): @@ -232,7 +232,7 @@ D.py:581:5: D415 [*] First line should end with a period, question mark, or excl 583 583 | 584 584 | @expect('D209: Multi-line docstring closing quotes should be on a separate ' -D.py:615:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:615:5: D415 [**] First line should end with a period, question mark, or exclamation point | 613 | @expect('D212: Multi-line docstring summary should start at the first line') 614 | def one_liner(): @@ -254,7 +254,7 @@ D.py:615:5: D415 [*] First line should end with a period, question mark, or excl 617 617 | """ 618 618 | -D.py:639:17: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:639:17: D415 [**] First line should end with a period, question mark, or exclamation point | 639 | class SameLine: """This is a docstring on the same line""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D415 @@ -273,7 +273,7 @@ D.py:639:17: D415 [*] First line should end with a period, question mark, or exc 641 641 | def same_line(): """This is a docstring on the same line""" 642 642 | -D.py:641:18: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:641:18: D415 [**] First line should end with a period, question mark, or exclamation point | 639 | class SameLine: """This is a docstring on the same line""" 640 | @@ -292,7 +292,7 @@ D.py:641:18: D415 [*] First line should end with a period, question mark, or exc 643 643 | 644 644 | def single_line_docstring_with_an_escaped_backslash(): -D.py:664:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:664:5: D415 [**] First line should end with a period, question mark, or exclamation point | 663 | def newline_after_closing_quote(self): 664 | "We enforce a newline after the closing quote for a multi-line docstring \ diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d209_d400.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d209_d400.snap index 17a4753d2b8818..e74aa5ad1045a3 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d209_d400.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d209_d400.snap @@ -18,7 +18,7 @@ D209_D400.py:2:5: D209 [*] Multi-line docstring closing quotes should be on a se 3 |+ sed do eiusmod tempor incididunt ut labore et dolore magna aliqua 4 |+ """ -D209_D400.py:2:5: D400 [*] First line should end with a period +D209_D400.py:2:5: D400 [**] First line should end with a period | 1 | def lorem(): 2 | """lorem ipsum dolor sit amet consectetur adipiscing elit diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F601_F601.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F601_F601.py.snap index f1d52d7d3430f6..23c456dd6ae96a 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F601_F601.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F601_F601.py.snap @@ -66,7 +66,7 @@ F601.py:17:5: F601 Dictionary key literal `"a"` repeated | = help: Remove repeated key literal `"a"` -F601.py:18:5: F601 [*] Dictionary key literal `"a"` repeated +F601.py:18:5: F601 [**] Dictionary key literal `"a"` repeated | 16 | "a": 2, 17 | "a": 3, @@ -107,7 +107,7 @@ F601.py:24:5: F601 Dictionary key literal `"a"` repeated | = help: Remove repeated key literal `"a"` -F601.py:25:5: F601 [*] Dictionary key literal `"a"` repeated +F601.py:25:5: F601 [**] Dictionary key literal `"a"` repeated | 23 | "a": 2, 24 | "a": 3, @@ -137,7 +137,7 @@ F601.py:26:5: F601 Dictionary key literal `"a"` repeated | = help: Remove repeated key literal `"a"` -F601.py:31:5: F601 [*] Dictionary key literal `"a"` repeated +F601.py:31:5: F601 [**] Dictionary key literal `"a"` repeated | 29 | x = { 30 | "a": 1, @@ -211,7 +211,7 @@ F601.py:43:5: F601 Dictionary key literal `"a"` repeated | = help: Remove repeated key literal `"a"` -F601.py:45:5: F601 [*] Dictionary key literal `"a"` repeated +F601.py:45:5: F601 [**] Dictionary key literal `"a"` repeated | 43 | "a": 3, 44 | a: 3, @@ -231,7 +231,7 @@ F601.py:45:5: F601 [*] Dictionary key literal `"a"` repeated 47 46 | } 48 47 | -F601.py:49:14: F601 [*] Dictionary key literal `"a"` repeated +F601.py:49:14: F601 [**] Dictionary key literal `"a"` repeated | 47 | } 48 | @@ -251,7 +251,7 @@ F601.py:49:14: F601 [*] Dictionary key literal `"a"` repeated 51 51 | 52 52 | x = { -F601.py:50:22: F601 [*] Dictionary key literal `"a"` repeated +F601.py:50:22: F601 [**] Dictionary key literal `"a"` repeated | 49 | x = {"a": 1, "a": 1} 50 | x = {"a": 1, "b": 2, "a": 1} @@ -281,7 +281,7 @@ F601.py:54:5: F601 Dictionary key literal `('a', 'b')` repeated | = help: Remove repeated key literal `('a', 'b')` -F601.py:58:19: F601 [*] Dictionary key literal `"x"` repeated +F601.py:58:19: F601 [**] Dictionary key literal `"x"` repeated | 57 | # Regression test for: https://github.com/astral-sh/ruff/issues/4897 58 | t={"x":"test123", "x":("test123")} @@ -300,7 +300,7 @@ F601.py:58:19: F601 [*] Dictionary key literal `"x"` repeated 59 59 | 60 60 | t={"x":("test123"), "x":"test123"} -F601.py:60:21: F601 [*] Dictionary key literal `"x"` repeated +F601.py:60:21: F601 [**] Dictionary key literal `"x"` repeated | 58 | t={"x":"test123", "x":("test123")} 59 | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F602_F602.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F602_F602.py.snap index 378346592ac378..f166f2a5e5c0a8 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F602_F602.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F602_F602.py.snap @@ -34,7 +34,7 @@ F602.py:12:5: F602 Dictionary key `a` repeated | = help: Remove repeated key `a` -F602.py:13:5: F602 [*] Dictionary key `a` repeated +F602.py:13:5: F602 [**] Dictionary key `a` repeated | 11 | a: 2, 12 | a: 3, @@ -75,7 +75,7 @@ F602.py:19:5: F602 Dictionary key `a` repeated | = help: Remove repeated key `a` -F602.py:20:5: F602 [*] Dictionary key `a` repeated +F602.py:20:5: F602 [**] Dictionary key `a` repeated | 18 | a: 2, 19 | a: 3, @@ -105,7 +105,7 @@ F602.py:21:5: F602 Dictionary key `a` repeated | = help: Remove repeated key `a` -F602.py:26:5: F602 [*] Dictionary key `a` repeated +F602.py:26:5: F602 [**] Dictionary key `a` repeated | 24 | x = { 25 | a: 1, @@ -157,7 +157,7 @@ F602.py:29:5: F602 Dictionary key `a` repeated | = help: Remove repeated key `a` -F602.py:35:5: F602 [*] Dictionary key `a` repeated +F602.py:35:5: F602 [**] Dictionary key `a` repeated | 33 | a: 1, 34 | "a": 1, @@ -209,7 +209,7 @@ F602.py:41:5: F602 Dictionary key `a` repeated | = help: Remove repeated key `a` -F602.py:44:12: F602 [*] Dictionary key `a` repeated +F602.py:44:12: F602 [**] Dictionary key `a` repeated | 42 | } 43 | @@ -227,7 +227,7 @@ F602.py:44:12: F602 [*] Dictionary key `a` repeated 44 |+x = {a: 1} 45 45 | x = {a: 1, b: 2, a: 1} -F602.py:45:18: F602 [*] Dictionary key `a` repeated +F602.py:45:18: F602 [**] Dictionary key `a` repeated | 44 | x = {a: 1, a: 1} 45 | x = {a: 1, b: 2, a: 1} diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_0.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_0.py.snap index e3f2fc6d0237ef..f09809aa5b7350 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_0.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_0.py.snap @@ -20,7 +20,7 @@ F841_0.py:3:22: F841 [*] Local variable `e` is assigned to but never used 5 5 | 6 6 | -F841_0.py:16:5: F841 [*] Local variable `z` is assigned to but never used +F841_0.py:16:5: F841 [**] Local variable `z` is assigned to but never used | 14 | x = 1 15 | y = 2 @@ -39,7 +39,7 @@ F841_0.py:16:5: F841 [*] Local variable `z` is assigned to but never used 18 18 | 19 19 | def f(): -F841_0.py:20:5: F841 [*] Local variable `foo` is assigned to but never used +F841_0.py:20:5: F841 [**] Local variable `foo` is assigned to but never used | 19 | def f(): 20 | foo = (1, 2) @@ -79,7 +79,7 @@ F841_0.py:21:9: F841 Local variable `b` is assigned to but never used | = help: Remove assignment to unused variable `b` -F841_0.py:26:14: F841 [*] Local variable `baz` is assigned to but never used +F841_0.py:26:14: F841 [**] Local variable `baz` is assigned to but never used | 24 | (c, d) = bar 25 | @@ -98,7 +98,7 @@ F841_0.py:26:14: F841 [*] Local variable `baz` is assigned to but never used 28 28 | 29 29 | def f(): -F841_0.py:51:9: F841 [*] Local variable `b` is assigned to but never used +F841_0.py:51:9: F841 [**] Local variable `b` is assigned to but never used | 49 | def c(): 50 | # F841 @@ -119,7 +119,7 @@ F841_0.py:51:9: F841 [*] Local variable `b` is assigned to but never used 53 53 | def d(): 54 54 | nonlocal b -F841_0.py:79:26: F841 [*] Local variable `my_file` is assigned to but never used +F841_0.py:79:26: F841 [**] Local variable `my_file` is assigned to but never used | 78 | def f(): 79 | with open("file") as my_file, open("") as ((this, that)): @@ -138,7 +138,7 @@ F841_0.py:79:26: F841 [*] Local variable `my_file` is assigned to but never used 81 81 | 82 82 | -F841_0.py:85:25: F841 [*] Local variable `my_file` is assigned to but never used +F841_0.py:85:25: F841 [**] Local variable `my_file` is assigned to but never used | 83 | def f(): 84 | with ( @@ -159,7 +159,7 @@ F841_0.py:85:25: F841 [*] Local variable `my_file` is assigned to but never used 87 87 | ): 88 88 | print("hello") -F841_0.py:102:5: F841 [*] Local variable `msg3` is assigned to but never used +F841_0.py:102:5: F841 [**] Local variable `msg3` is assigned to but never used | 100 | msg1 = "Hello, world!" 101 | msg2 = "Hello, world!" @@ -179,7 +179,7 @@ F841_0.py:102:5: F841 [*] Local variable `msg3` is assigned to but never used 104 103 | case 1: 105 104 | print(msg1) -F841_0.py:115:5: F841 [*] Local variable `Baz` is assigned to but never used +F841_0.py:115:5: F841 [**] Local variable `Baz` is assigned to but never used | 113 | Foo = enum.Enum("Foo", "A B") 114 | Bar = enum.Enum("Bar", "A B") diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_1.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_1.py.snap index 21aec0a0e51aeb..835d65f1c1517a 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_1.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_1.py.snap @@ -17,7 +17,7 @@ F841_1.py:6:8: F841 Local variable `y` is assigned to but never used | = help: Remove assignment to unused variable `y` -F841_1.py:16:14: F841 [*] Local variable `coords` is assigned to but never used +F841_1.py:16:14: F841 [**] Local variable `coords` is assigned to but never used | 15 | def f(): 16 | (x, y) = coords = 1, 2 # this triggers F841 on coords @@ -35,7 +35,7 @@ F841_1.py:16:14: F841 [*] Local variable `coords` is assigned to but never used 18 18 | 19 19 | def f(): -F841_1.py:20:5: F841 [*] Local variable `coords` is assigned to but never used +F841_1.py:20:5: F841 [**] Local variable `coords` is assigned to but never used | 19 | def f(): 20 | coords = (x, y) = 1, 2 # this triggers F841 on coords diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_3.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_3.py.snap index 7527c4e2cd8462..37d9cbaec3b74a 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_3.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_3.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- -F841_3.py:5:5: F841 [*] Local variable `x` is assigned to but never used +F841_3.py:5:5: F841 [**] Local variable `x` is assigned to but never used | 4 | def f(): 5 | x = 1 @@ -19,7 +19,7 @@ F841_3.py:5:5: F841 [*] Local variable `x` is assigned to but never used 7 6 | 8 7 | z = 3 -F841_3.py:6:5: F841 [*] Local variable `y` is assigned to but never used +F841_3.py:6:5: F841 [**] Local variable `y` is assigned to but never used | 4 | def f(): 5 | x = 1 @@ -39,7 +39,7 @@ F841_3.py:6:5: F841 [*] Local variable `y` is assigned to but never used 8 7 | z = 3 9 8 | print(z) -F841_3.py:13:5: F841 [*] Local variable `x` is assigned to but never used +F841_3.py:13:5: F841 [**] Local variable `x` is assigned to but never used | 12 | def f(): 13 | x: int = 1 @@ -57,7 +57,7 @@ F841_3.py:13:5: F841 [*] Local variable `x` is assigned to but never used 15 14 | 16 15 | z: int = 3 -F841_3.py:14:5: F841 [*] Local variable `y` is assigned to but never used +F841_3.py:14:5: F841 [**] Local variable `y` is assigned to but never used | 12 | def f(): 13 | x: int = 1 @@ -77,7 +77,7 @@ F841_3.py:14:5: F841 [*] Local variable `y` is assigned to but never used 16 15 | z: int = 3 17 16 | print(z) -F841_3.py:21:19: F841 [*] Local variable `x1` is assigned to but never used +F841_3.py:21:19: F841 [**] Local variable `x1` is assigned to but never used | 20 | def f(): 21 | with foo() as x1: @@ -96,7 +96,7 @@ F841_3.py:21:19: F841 [*] Local variable `x1` is assigned to but never used 23 23 | 24 24 | with foo() as (x2, y2): -F841_3.py:27:20: F841 [*] Local variable `x3` is assigned to but never used +F841_3.py:27:20: F841 [**] Local variable `x3` is assigned to but never used | 25 | pass 26 | @@ -116,7 +116,7 @@ F841_3.py:27:20: F841 [*] Local variable `x3` is assigned to but never used 29 29 | 30 30 | -F841_3.py:27:33: F841 [*] Local variable `y3` is assigned to but never used +F841_3.py:27:33: F841 [**] Local variable `y3` is assigned to but never used | 25 | pass 26 | @@ -136,7 +136,7 @@ F841_3.py:27:33: F841 [*] Local variable `y3` is assigned to but never used 29 29 | 30 30 | -F841_3.py:27:46: F841 [*] Local variable `z3` is assigned to but never used +F841_3.py:27:46: F841 [**] Local variable `z3` is assigned to but never used | 25 | pass 26 | @@ -176,7 +176,7 @@ F841_3.py:32:10: F841 Local variable `y1` is assigned to but never used | = help: Remove assignment to unused variable `y1` -F841_3.py:33:16: F841 [*] Local variable `coords2` is assigned to but never used +F841_3.py:33:16: F841 [**] Local variable `coords2` is assigned to but never used | 31 | def f(): 32 | (x1, y1) = (1, 2) @@ -196,7 +196,7 @@ F841_3.py:33:16: F841 [*] Local variable `coords2` is assigned to but never used 35 35 | 36 36 | -F841_3.py:34:5: F841 [*] Local variable `coords3` is assigned to but never used +F841_3.py:34:5: F841 [**] Local variable `coords3` is assigned to but never used | 32 | (x1, y1) = (1, 2) 33 | (x2, y2) = coords2 = (1, 2) @@ -255,7 +255,7 @@ F841_3.py:45:47: F841 [*] Local variable `x2` is assigned to but never used 47 47 | 48 48 | -F841_3.py:50:5: F841 [*] Local variable `x` is assigned to but never used +F841_3.py:50:5: F841 [**] Local variable `x` is assigned to but never used | 49 | def f(a, b): 50 | x = ( @@ -275,7 +275,7 @@ F841_3.py:50:5: F841 [*] Local variable `x` is assigned to but never used 52 52 | if a is not None 53 53 | else b -F841_3.py:56:5: F841 [*] Local variable `y` is assigned to but never used +F841_3.py:56:5: F841 [**] Local variable `y` is assigned to but never used | 54 | ) 55 | @@ -296,7 +296,7 @@ F841_3.py:56:5: F841 [*] Local variable `y` is assigned to but never used 59 58 | 60 59 | def f(a, b): -F841_3.py:61:5: F841 [*] Local variable `x` is assigned to but never used +F841_3.py:61:5: F841 [**] Local variable `x` is assigned to but never used | 60 | def f(a, b): 61 | x = ( @@ -319,7 +319,7 @@ F841_3.py:61:5: F841 [*] Local variable `x` is assigned to but never used 67 62 | y = \ 68 63 | a if a is not None else b -F841_3.py:67:5: F841 [*] Local variable `y` is assigned to but never used +F841_3.py:67:5: F841 [**] Local variable `y` is assigned to but never used | 65 | ) 66 | @@ -339,7 +339,7 @@ F841_3.py:67:5: F841 [*] Local variable `y` is assigned to but never used 70 68 | 71 69 | def f(): -F841_3.py:72:24: F841 [*] Local variable `cm` is assigned to but never used +F841_3.py:72:24: F841 [**] Local variable `cm` is assigned to but never used | 71 | def f(): 72 | with Nested(m) as (cm): @@ -358,7 +358,7 @@ F841_3.py:72:24: F841 [*] Local variable `cm` is assigned to but never used 74 74 | 75 75 | -F841_3.py:77:25: F841 [*] Local variable `cm` is assigned to but never used +F841_3.py:77:25: F841 [**] Local variable `cm` is assigned to but never used | 76 | def f(): 77 | with (Nested(m) as (cm),): @@ -377,7 +377,7 @@ F841_3.py:77:25: F841 [*] Local variable `cm` is assigned to but never used 79 79 | 80 80 | -F841_3.py:87:26: F841 [*] Local variable `cm` is assigned to but never used +F841_3.py:87:26: F841 [**] Local variable `cm` is assigned to but never used | 86 | def f(): 87 | with (Nested(m)) as (cm): @@ -396,7 +396,7 @@ F841_3.py:87:26: F841 [*] Local variable `cm` is assigned to but never used 89 89 | 90 90 | -F841_3.py:92:5: F841 [*] Local variable `toplevel` is assigned to but never used +F841_3.py:92:5: F841 [**] Local variable `toplevel` is assigned to but never used | 91 | def f(): 92 | toplevel = tt = lexer.get_token() @@ -416,7 +416,7 @@ F841_3.py:92:5: F841 [*] Local variable `toplevel` is assigned to but never used 94 94 | break 95 95 | -F841_3.py:98:5: F841 [*] Local variable `toplevel` is assigned to but never used +F841_3.py:98:5: F841 [**] Local variable `toplevel` is assigned to but never used | 97 | def f(): 98 | toplevel = tt = lexer.get_token() @@ -434,7 +434,7 @@ F841_3.py:98:5: F841 [*] Local variable `toplevel` is assigned to but never used 100 100 | 101 101 | def f(): -F841_3.py:98:16: F841 [*] Local variable `tt` is assigned to but never used +F841_3.py:98:16: F841 [**] Local variable `tt` is assigned to but never used | 97 | def f(): 98 | toplevel = tt = lexer.get_token() @@ -452,7 +452,7 @@ F841_3.py:98:16: F841 [*] Local variable `tt` is assigned to but never used 100 100 | 101 101 | def f(): -F841_3.py:102:5: F841 [*] Local variable `toplevel` is assigned to but never used +F841_3.py:102:5: F841 [**] Local variable `toplevel` is assigned to but never used | 101 | def f(): 102 | toplevel = (a, b) = lexer.get_token() @@ -470,7 +470,7 @@ F841_3.py:102:5: F841 [*] Local variable `toplevel` is assigned to but never use 104 104 | 105 105 | def f(): -F841_3.py:106:14: F841 [*] Local variable `toplevel` is assigned to but never used +F841_3.py:106:14: F841 [**] Local variable `toplevel` is assigned to but never used | 105 | def f(): 106 | (a, b) = toplevel = lexer.get_token() @@ -488,7 +488,7 @@ F841_3.py:106:14: F841 [*] Local variable `toplevel` is assigned to but never us 108 108 | 109 109 | def f(): -F841_3.py:110:5: F841 [*] Local variable `toplevel` is assigned to but never used +F841_3.py:110:5: F841 [**] Local variable `toplevel` is assigned to but never used | 109 | def f(): 110 | toplevel = tt = 1 @@ -506,7 +506,7 @@ F841_3.py:110:5: F841 [*] Local variable `toplevel` is assigned to but never use 112 112 | 113 113 | def f(provided: int) -> int: -F841_3.py:110:16: F841 [*] Local variable `tt` is assigned to but never used +F841_3.py:110:16: F841 [**] Local variable `tt` is assigned to but never used | 109 | def f(): 110 | toplevel = tt = 1 @@ -604,7 +604,7 @@ F841_3.py:155:17: F841 [*] Local variable `e` is assigned to but never used 157 157 | 158 158 | -F841_3.py:160:5: F841 [*] Local variable `x` is assigned to but never used +F841_3.py:160:5: F841 [**] Local variable `x` is assigned to but never used | 159 | def f(): 160 | x = 1 @@ -622,7 +622,7 @@ F841_3.py:160:5: F841 [*] Local variable `x` is assigned to but never used 162 161 | 163 162 | -F841_3.py:161:5: F841 [*] Local variable `y` is assigned to but never used +F841_3.py:161:5: F841 [**] Local variable `y` is assigned to but never used | 159 | def f(): 160 | x = 1 @@ -640,7 +640,7 @@ F841_3.py:161:5: F841 [*] Local variable `y` is assigned to but never used 163 162 | 164 163 | def f(): -F841_3.py:165:5: F841 [*] Local variable `x` is assigned to but never used +F841_3.py:165:5: F841 [**] Local variable `x` is assigned to but never used | 164 | def f(): 165 | x = 1 @@ -659,7 +659,7 @@ F841_3.py:165:5: F841 [*] Local variable `x` is assigned to but never used 167 166 | y = 2 168 167 | -F841_3.py:167:5: F841 [*] Local variable `y` is assigned to but never used +F841_3.py:167:5: F841 [**] Local variable `y` is assigned to but never used | 165 | x = 1 166 | @@ -677,7 +677,7 @@ F841_3.py:167:5: F841 [*] Local variable `y` is assigned to but never used 169 168 | 170 169 | def f(): -F841_3.py:173:6: F841 [*] Local variable `x` is assigned to but never used +F841_3.py:173:6: F841 [**] Local variable `x` is assigned to but never used | 171 | (x) = foo() 172 | ((x)) = foo() diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f841_dummy_variable_rgx.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f841_dummy_variable_rgx.snap index c117fdff6e54dd..bb00f6126bc00d 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f841_dummy_variable_rgx.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f841_dummy_variable_rgx.snap @@ -20,7 +20,7 @@ F841_0.py:3:22: F841 [*] Local variable `e` is assigned to but never used 5 5 | 6 6 | -F841_0.py:20:5: F841 [*] Local variable `foo` is assigned to but never used +F841_0.py:20:5: F841 [**] Local variable `foo` is assigned to but never used | 19 | def f(): 20 | foo = (1, 2) @@ -60,7 +60,7 @@ F841_0.py:21:9: F841 Local variable `b` is assigned to but never used | = help: Remove assignment to unused variable `b` -F841_0.py:26:14: F841 [*] Local variable `baz` is assigned to but never used +F841_0.py:26:14: F841 [**] Local variable `baz` is assigned to but never used | 24 | (c, d) = bar 25 | @@ -79,7 +79,7 @@ F841_0.py:26:14: F841 [*] Local variable `baz` is assigned to but never used 28 28 | 29 29 | def f(): -F841_0.py:35:5: F841 [*] Local variable `_` is assigned to but never used +F841_0.py:35:5: F841 [**] Local variable `_` is assigned to but never used | 34 | def f(): 35 | _ = 1 @@ -98,7 +98,7 @@ F841_0.py:35:5: F841 [*] Local variable `_` is assigned to but never used 37 36 | _discarded = 1 38 37 | -F841_0.py:36:5: F841 [*] Local variable `__` is assigned to but never used +F841_0.py:36:5: F841 [**] Local variable `__` is assigned to but never used | 34 | def f(): 35 | _ = 1 @@ -117,7 +117,7 @@ F841_0.py:36:5: F841 [*] Local variable `__` is assigned to but never used 38 37 | 39 38 | -F841_0.py:37:5: F841 [*] Local variable `_discarded` is assigned to but never used +F841_0.py:37:5: F841 [**] Local variable `_discarded` is assigned to but never used | 35 | _ = 1 36 | __ = 1 @@ -135,7 +135,7 @@ F841_0.py:37:5: F841 [*] Local variable `_discarded` is assigned to but never us 39 38 | 40 39 | a = 1 -F841_0.py:51:9: F841 [*] Local variable `b` is assigned to but never used +F841_0.py:51:9: F841 [**] Local variable `b` is assigned to but never used | 49 | def c(): 50 | # F841 @@ -156,7 +156,7 @@ F841_0.py:51:9: F841 [*] Local variable `b` is assigned to but never used 53 53 | def d(): 54 54 | nonlocal b -F841_0.py:79:26: F841 [*] Local variable `my_file` is assigned to but never used +F841_0.py:79:26: F841 [**] Local variable `my_file` is assigned to but never used | 78 | def f(): 79 | with open("file") as my_file, open("") as ((this, that)): @@ -175,7 +175,7 @@ F841_0.py:79:26: F841 [*] Local variable `my_file` is assigned to but never used 81 81 | 82 82 | -F841_0.py:85:25: F841 [*] Local variable `my_file` is assigned to but never used +F841_0.py:85:25: F841 [**] Local variable `my_file` is assigned to but never used | 83 | def f(): 84 | with ( @@ -196,7 +196,7 @@ F841_0.py:85:25: F841 [*] Local variable `my_file` is assigned to but never used 87 87 | ): 88 88 | print("hello") -F841_0.py:102:5: F841 [*] Local variable `msg3` is assigned to but never used +F841_0.py:102:5: F841 [**] Local variable `msg3` is assigned to but never used | 100 | msg1 = "Hello, world!" 101 | msg2 = "Hello, world!" @@ -216,7 +216,7 @@ F841_0.py:102:5: F841 [*] Local variable `msg3` is assigned to but never used 104 103 | case 1: 105 104 | print(msg1) -F841_0.py:115:5: F841 [*] Local variable `Baz` is assigned to but never used +F841_0.py:115:5: F841 [**] Local variable `Baz` is assigned to but never used | 113 | Foo = enum.Enum("Foo", "A B") 114 | Bar = enum.Enum("Bar", "A B") diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0414_import_aliasing.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0414_import_aliasing.py.snap index 800e9671d8799e..44a778a7b88a08 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0414_import_aliasing.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0414_import_aliasing.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pylint/mod.rs --- -import_aliasing.py:6:8: PLC0414 [*] Import alias does not rename original package +import_aliasing.py:6:8: PLC0414 [**] Import alias does not rename original package | 4 | # 2. consider-using-from-import 5 | @@ -22,7 +22,7 @@ import_aliasing.py:6:8: PLC0414 [*] Import alias does not rename original packag 8 8 | from collections import OrderedDict as o_dict 9 9 | import os.path as path # [consider-using-from-import] -import_aliasing.py:7:25: PLC0414 [*] Import alias does not rename original package +import_aliasing.py:7:25: PLC0414 [**] Import alias does not rename original package | 6 | import collections as collections # [useless-import-alias] 7 | from collections import OrderedDict as OrderedDict # [useless-import-alias] @@ -42,7 +42,7 @@ import_aliasing.py:7:25: PLC0414 [*] Import alias does not rename original packa 9 9 | import os.path as path # [consider-using-from-import] 10 10 | import os.path as p -import_aliasing.py:16:15: PLC0414 [*] Import alias does not rename original package +import_aliasing.py:16:15: PLC0414 [**] Import alias does not rename original package | 14 | import os as OS 15 | from sys import version @@ -63,7 +63,7 @@ import_aliasing.py:16:15: PLC0414 [*] Import alias does not rename original pack 18 18 | from . import bar 19 19 | from ..foo import bar as bar # [useless-import-alias] -import_aliasing.py:19:19: PLC0414 [*] Import alias does not rename original package +import_aliasing.py:19:19: PLC0414 [**] Import alias does not rename original package | 17 | from . import bar as Bar 18 | from . import bar @@ -84,7 +84,7 @@ import_aliasing.py:19:19: PLC0414 [*] Import alias does not rename original pack 21 21 | from ..foo.bar import foobar as anotherfoobar 22 22 | from . import foo as foo, foo2 as bar2 # [useless-import-alias] -import_aliasing.py:20:23: PLC0414 [*] Import alias does not rename original package +import_aliasing.py:20:23: PLC0414 [**] Import alias does not rename original package | 18 | from . import bar 19 | from ..foo import bar as bar # [useless-import-alias] @@ -105,7 +105,7 @@ import_aliasing.py:20:23: PLC0414 [*] Import alias does not rename original pack 22 22 | from . import foo as foo, foo2 as bar2 # [useless-import-alias] 23 23 | from . import foo as bar, foo2 as foo2 # [useless-import-alias] -import_aliasing.py:22:15: PLC0414 [*] Import alias does not rename original package +import_aliasing.py:22:15: PLC0414 [**] Import alias does not rename original package | 20 | from ..foo.bar import foobar as foobar # [useless-import-alias] 21 | from ..foo.bar import foobar as anotherfoobar @@ -126,7 +126,7 @@ import_aliasing.py:22:15: PLC0414 [*] Import alias does not rename original pack 24 24 | from . import foo as bar, foo2 as bar2 25 25 | from foo.bar import foobar as foobar # [useless-import-alias] -import_aliasing.py:23:27: PLC0414 [*] Import alias does not rename original package +import_aliasing.py:23:27: PLC0414 [**] Import alias does not rename original package | 21 | from ..foo.bar import foobar as anotherfoobar 22 | from . import foo as foo, foo2 as bar2 # [useless-import-alias] @@ -147,7 +147,7 @@ import_aliasing.py:23:27: PLC0414 [*] Import alias does not rename original pack 25 25 | from foo.bar import foobar as foobar # [useless-import-alias] 26 26 | from foo.bar import foobar as foo -import_aliasing.py:25:21: PLC0414 [*] Import alias does not rename original package +import_aliasing.py:25:21: PLC0414 [**] Import alias does not rename original package | 23 | from . import foo as bar, foo2 as foo2 # [useless-import-alias] 24 | from . import foo as bar, foo2 as bar2 diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_0.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_0.py.snap index 397b48cabc19a4..d794ebe58d6a1f 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_0.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pylint/mod.rs --- -sys_exit_alias_0.py:1:1: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_0.py:1:1: PLR1722 [**] Use `sys.exit()` instead of `exit` | 1 | exit(0) | ^^^^ PLR1722 @@ -17,7 +17,7 @@ sys_exit_alias_0.py:1:1: PLR1722 [*] Use `sys.exit()` instead of `exit` 3 4 | 4 5 | -sys_exit_alias_0.py:2:1: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_0.py:2:1: PLR1722 [**] Use `sys.exit()` instead of `quit` | 1 | exit(0) 2 | quit(0) @@ -34,7 +34,7 @@ sys_exit_alias_0.py:2:1: PLR1722 [*] Use `sys.exit()` instead of `quit` 4 5 | 5 6 | def main(): -sys_exit_alias_0.py:6:5: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_0.py:6:5: PLR1722 [**] Use `sys.exit()` instead of `exit` | 5 | def main(): 6 | exit(2) @@ -54,7 +54,7 @@ sys_exit_alias_0.py:6:5: PLR1722 [*] Use `sys.exit()` instead of `exit` 7 |+ sys.exit(2) 7 8 | quit(2) -sys_exit_alias_0.py:7:5: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_0.py:7:5: PLR1722 [**] Use `sys.exit()` instead of `quit` | 5 | def main(): 6 | exit(2) diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_1.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_1.py.snap index aa9c93714b984d..1499b196df99e5 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_1.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pylint/mod.rs --- -sys_exit_alias_1.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_1.py:3:1: PLR1722 [**] Use `sys.exit()` instead of `exit` | 1 | import sys 2 | @@ -20,7 +20,7 @@ sys_exit_alias_1.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` 5 5 | 6 6 | -sys_exit_alias_1.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_1.py:4:1: PLR1722 [**] Use `sys.exit()` instead of `quit` | 3 | exit(0) 4 | quit(0) @@ -38,7 +38,7 @@ sys_exit_alias_1.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` 6 6 | 7 7 | def main(): -sys_exit_alias_1.py:8:5: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_1.py:8:5: PLR1722 [**] Use `sys.exit()` instead of `exit` | 7 | def main(): 8 | exit(1) @@ -57,7 +57,7 @@ sys_exit_alias_1.py:8:5: PLR1722 [*] Use `sys.exit()` instead of `exit` 10 10 | 11 11 | -sys_exit_alias_1.py:9:5: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_1.py:9:5: PLR1722 [**] Use `sys.exit()` instead of `quit` | 7 | def main(): 8 | exit(1) diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_11.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_11.py.snap index 0fd61d5d82d151..fd65bba2841db8 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_11.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_11.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pylint/mod.rs --- -sys_exit_alias_11.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_11.py:3:1: PLR1722 [**] Use `sys.exit()` instead of `exit` | 1 | from sys import * 2 | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_12.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_12.py.snap index 24108309b0394a..36e0562dd2a252 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_12.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_12.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pylint/mod.rs --- -sys_exit_alias_12.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_12.py:3:1: PLR1722 [**] Use `sys.exit()` instead of `exit` | 1 | import os \ 2 | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_2.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_2.py.snap index 18c4cb9aceb542..7f4ed3ae677f13 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_2.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pylint/mod.rs --- -sys_exit_alias_2.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_2.py:3:1: PLR1722 [**] Use `sys.exit()` instead of `exit` | 1 | import sys as sys2 2 | @@ -20,7 +20,7 @@ sys_exit_alias_2.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` 5 5 | 6 6 | -sys_exit_alias_2.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_2.py:4:1: PLR1722 [**] Use `sys.exit()` instead of `quit` | 3 | exit(0) 4 | quit(0) @@ -38,7 +38,7 @@ sys_exit_alias_2.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` 6 6 | 7 7 | def main(): -sys_exit_alias_2.py:8:5: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_2.py:8:5: PLR1722 [**] Use `sys.exit()` instead of `exit` | 7 | def main(): 8 | exit(1) @@ -55,7 +55,7 @@ sys_exit_alias_2.py:8:5: PLR1722 [*] Use `sys.exit()` instead of `exit` 8 |+ sys2.exit(1) 9 9 | quit(1) -sys_exit_alias_2.py:9:5: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_2.py:9:5: PLR1722 [**] Use `sys.exit()` instead of `quit` | 7 | def main(): 8 | exit(1) diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_3.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_3.py.snap index 183ad4c91030d1..c787537c00f6be 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_3.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_3.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pylint/mod.rs --- -sys_exit_alias_3.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_3.py:4:1: PLR1722 [**] Use `sys.exit()` instead of `quit` | 3 | exit(0) 4 | quit(0) @@ -19,7 +19,7 @@ sys_exit_alias_3.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` 6 6 | 7 7 | def main(): -sys_exit_alias_3.py:9:5: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_3.py:9:5: PLR1722 [**] Use `sys.exit()` instead of `quit` | 7 | def main(): 8 | exit(1) diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_4.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_4.py.snap index 8b17e1511902fd..0492396b9e850e 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_4.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_4.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pylint/mod.rs --- -sys_exit_alias_4.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_4.py:3:1: PLR1722 [**] Use `sys.exit()` instead of `exit` | 1 | from sys import exit as exit2 2 | @@ -20,7 +20,7 @@ sys_exit_alias_4.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` 5 5 | 6 6 | -sys_exit_alias_4.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_4.py:4:1: PLR1722 [**] Use `sys.exit()` instead of `quit` | 3 | exit(0) 4 | quit(0) @@ -38,7 +38,7 @@ sys_exit_alias_4.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` 6 6 | 7 7 | def main(): -sys_exit_alias_4.py:8:5: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_4.py:8:5: PLR1722 [**] Use `sys.exit()` instead of `exit` | 7 | def main(): 8 | exit(1) @@ -55,7 +55,7 @@ sys_exit_alias_4.py:8:5: PLR1722 [*] Use `sys.exit()` instead of `exit` 8 |+ exit2(1) 9 9 | quit(1) -sys_exit_alias_4.py:9:5: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_4.py:9:5: PLR1722 [**] Use `sys.exit()` instead of `quit` | 7 | def main(): 8 | exit(1) diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_5.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_5.py.snap index 80b8423a352d9e..0bd1350a3c8d51 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_5.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_5.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pylint/mod.rs --- -sys_exit_alias_5.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_5.py:3:1: PLR1722 [**] Use `sys.exit()` instead of `exit` | 1 | from sys import * 2 | @@ -21,7 +21,7 @@ sys_exit_alias_5.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` 5 6 | 6 7 | -sys_exit_alias_5.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_5.py:4:1: PLR1722 [**] Use `sys.exit()` instead of `quit` | 3 | exit(0) 4 | quit(0) @@ -40,7 +40,7 @@ sys_exit_alias_5.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` 6 7 | 7 8 | def main(): -sys_exit_alias_5.py:8:5: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_5.py:8:5: PLR1722 [**] Use `sys.exit()` instead of `exit` | 7 | def main(): 8 | exit(1) @@ -62,7 +62,7 @@ sys_exit_alias_5.py:8:5: PLR1722 [*] Use `sys.exit()` instead of `exit` 9 |+ sys.exit(1) 9 10 | quit(1) -sys_exit_alias_5.py:9:5: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_5.py:9:5: PLR1722 [**] Use `sys.exit()` instead of `quit` | 7 | def main(): 8 | exit(1) diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_6.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_6.py.snap index b257b7b923dbaa..48e652154f5d6d 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_6.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_6.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pylint/mod.rs --- -sys_exit_alias_6.py:1:1: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_6.py:1:1: PLR1722 [**] Use `sys.exit()` instead of `exit` | 1 | exit(0) | ^^^^ PLR1722 @@ -17,7 +17,7 @@ sys_exit_alias_6.py:1:1: PLR1722 [*] Use `sys.exit()` instead of `exit` 3 4 | 4 5 | -sys_exit_alias_6.py:2:1: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_6.py:2:1: PLR1722 [**] Use `sys.exit()` instead of `quit` | 1 | exit(0) 2 | quit(0) diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_7.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_7.py.snap index 5d64c2ee631939..c2400160908aa5 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_7.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_7.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pylint/mod.rs --- -sys_exit_alias_7.py:2:5: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_7.py:2:5: PLR1722 [**] Use `sys.exit()` instead of `exit` | 1 | def main(): 2 | exit(0) diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_8.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_8.py.snap index fa796c091fa4bb..d71599d72ccee4 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_8.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_8.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pylint/mod.rs --- -sys_exit_alias_8.py:5:5: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_8.py:5:5: PLR1722 [**] Use `sys.exit()` instead of `exit` | 4 | def main(): 5 | exit(0) diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_9.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_9.py.snap index 99d5f3389fc3a1..344032ff81c71c 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_9.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_9.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pylint/mod.rs --- -sys_exit_alias_9.py:2:5: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_9.py:2:5: PLR1722 [**] Use `sys.exit()` instead of `exit` | 1 | def main(): 2 | exit(0) diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW3301_nested_min_max.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW3301_nested_min_max.py.snap index 268f805ab852bd..3bd813c3a11a50 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW3301_nested_min_max.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW3301_nested_min_max.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pylint/mod.rs --- -nested_min_max.py:2:1: PLW3301 [*] Nested `min` calls can be flattened +nested_min_max.py:2:1: PLW3301 [**] Nested `min` calls can be flattened | 1 | min(1, 2, 3) 2 | min(1, min(2, 3)) @@ -19,7 +19,7 @@ nested_min_max.py:2:1: PLW3301 [*] Nested `min` calls can be flattened 4 4 | min(1, foo("a", "b"), min(3, 4)) 5 5 | min(1, max(2, 3)) -nested_min_max.py:3:1: PLW3301 [*] Nested `min` calls can be flattened +nested_min_max.py:3:1: PLW3301 [**] Nested `min` calls can be flattened | 1 | min(1, 2, 3) 2 | min(1, min(2, 3)) @@ -39,7 +39,7 @@ nested_min_max.py:3:1: PLW3301 [*] Nested `min` calls can be flattened 5 5 | min(1, max(2, 3)) 6 6 | max(1, 2, 3) -nested_min_max.py:3:8: PLW3301 [*] Nested `min` calls can be flattened +nested_min_max.py:3:8: PLW3301 [**] Nested `min` calls can be flattened | 1 | min(1, 2, 3) 2 | min(1, min(2, 3)) @@ -59,7 +59,7 @@ nested_min_max.py:3:8: PLW3301 [*] Nested `min` calls can be flattened 5 5 | min(1, max(2, 3)) 6 6 | max(1, 2, 3) -nested_min_max.py:4:1: PLW3301 [*] Nested `min` calls can be flattened +nested_min_max.py:4:1: PLW3301 [**] Nested `min` calls can be flattened | 2 | min(1, min(2, 3)) 3 | min(1, min(2, min(3, 4))) @@ -80,7 +80,7 @@ nested_min_max.py:4:1: PLW3301 [*] Nested `min` calls can be flattened 6 6 | max(1, 2, 3) 7 7 | max(1, max(2, 3)) -nested_min_max.py:7:1: PLW3301 [*] Nested `max` calls can be flattened +nested_min_max.py:7:1: PLW3301 [**] Nested `max` calls can be flattened | 5 | min(1, max(2, 3)) 6 | max(1, 2, 3) @@ -101,7 +101,7 @@ nested_min_max.py:7:1: PLW3301 [*] Nested `max` calls can be flattened 9 9 | max(1, foo("a", "b"), max(3, 4)) 10 10 | -nested_min_max.py:8:1: PLW3301 [*] Nested `max` calls can be flattened +nested_min_max.py:8:1: PLW3301 [**] Nested `max` calls can be flattened | 6 | max(1, 2, 3) 7 | max(1, max(2, 3)) @@ -121,7 +121,7 @@ nested_min_max.py:8:1: PLW3301 [*] Nested `max` calls can be flattened 10 10 | 11 11 | # These should not trigger; we do not flag cases with keyword args. -nested_min_max.py:8:8: PLW3301 [*] Nested `max` calls can be flattened +nested_min_max.py:8:8: PLW3301 [**] Nested `max` calls can be flattened | 6 | max(1, 2, 3) 7 | max(1, max(2, 3)) @@ -141,7 +141,7 @@ nested_min_max.py:8:8: PLW3301 [*] Nested `max` calls can be flattened 10 10 | 11 11 | # These should not trigger; we do not flag cases with keyword args. -nested_min_max.py:9:1: PLW3301 [*] Nested `max` calls can be flattened +nested_min_max.py:9:1: PLW3301 [**] Nested `max` calls can be flattened | 7 | max(1, max(2, 3)) 8 | max(1, max(2, max(3, 4))) @@ -162,7 +162,7 @@ nested_min_max.py:9:1: PLW3301 [*] Nested `max` calls can be flattened 11 11 | # These should not trigger; we do not flag cases with keyword args. 12 12 | min(1, min(2, 3), key=test) -nested_min_max.py:15:1: PLW3301 [*] Nested `min` calls can be flattened +nested_min_max.py:15:1: PLW3301 [**] Nested `min` calls can be flattened | 13 | min(1, min(2, 3, key=test)) 14 | # This will still trigger, to merge the calls without keyword args. @@ -196,7 +196,7 @@ nested_min_max.py:18:1: PLW3301 Nested `min` calls can be flattened | = help: Flatten nested `min` calls -nested_min_max.py:24:1: PLW3301 [*] Nested `min` calls can be flattened +nested_min_max.py:24:1: PLW3301 [**] Nested `min` calls can be flattened | 23 | # Handle iterable expressions. 24 | min(1, min(a)) @@ -216,7 +216,7 @@ nested_min_max.py:24:1: PLW3301 [*] Nested `min` calls can be flattened 26 26 | max(1, max(a)) 27 27 | max(1, max(i for i in range(10))) -nested_min_max.py:25:1: PLW3301 [*] Nested `min` calls can be flattened +nested_min_max.py:25:1: PLW3301 [**] Nested `min` calls can be flattened | 23 | # Handle iterable expressions. 24 | min(1, min(a)) @@ -237,7 +237,7 @@ nested_min_max.py:25:1: PLW3301 [*] Nested `min` calls can be flattened 27 27 | max(1, max(i for i in range(10))) 28 28 | -nested_min_max.py:26:1: PLW3301 [*] Nested `max` calls can be flattened +nested_min_max.py:26:1: PLW3301 [**] Nested `max` calls can be flattened | 24 | min(1, min(a)) 25 | min(1, min(i for i in range(10))) @@ -257,7 +257,7 @@ nested_min_max.py:26:1: PLW3301 [*] Nested `max` calls can be flattened 28 28 | 29 29 | tuples_list = [ -nested_min_max.py:27:1: PLW3301 [*] Nested `max` calls can be flattened +nested_min_max.py:27:1: PLW3301 [**] Nested `max` calls can be flattened | 25 | min(1, min(i for i in range(10))) 26 | max(1, max(a)) @@ -278,7 +278,7 @@ nested_min_max.py:27:1: PLW3301 [*] Nested `max` calls can be flattened 29 29 | tuples_list = [ 30 30 | (1, 2), -nested_min_max.py:41:1: PLW3301 [*] Nested `max` calls can be flattened +nested_min_max.py:41:1: PLW3301 [**] Nested `max` calls can be flattened | 40 | # Starred argument should be copied as it is. 41 | max(1, max(*a)) diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP005.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP005.py.snap index eb262e352161d8..8bf07be8bf2655 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP005.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP005.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP005.py:6:9: UP005 [*] `assertEquals` is deprecated, use `assertEqual` +UP005.py:6:9: UP005 [**] `assertEquals` is deprecated, use `assertEqual` | 4 | class Suite(unittest.TestCase): 5 | def test(self) -> None: @@ -22,7 +22,7 @@ UP005.py:6:9: UP005 [*] `assertEquals` is deprecated, use `assertEqual` 8 8 | self.assertEqual(3, 4) 9 9 | self.failUnlessAlmostEqual(1, 1.1) -UP005.py:7:9: UP005 [*] `assertEquals` is deprecated, use `assertEqual` +UP005.py:7:9: UP005 [**] `assertEquals` is deprecated, use `assertEqual` | 5 | def test(self) -> None: 6 | self.assertEquals (1, 2) @@ -43,7 +43,7 @@ UP005.py:7:9: UP005 [*] `assertEquals` is deprecated, use `assertEqual` 9 9 | self.failUnlessAlmostEqual(1, 1.1) 10 10 | self.assertNotRegexpMatches("a", "b") -UP005.py:9:9: UP005 [*] `failUnlessAlmostEqual` is deprecated, use `assertAlmostEqual` +UP005.py:9:9: UP005 [**] `failUnlessAlmostEqual` is deprecated, use `assertAlmostEqual` | 7 | self.assertEquals(1, 2) 8 | self.assertEqual(3, 4) @@ -61,7 +61,7 @@ UP005.py:9:9: UP005 [*] `failUnlessAlmostEqual` is deprecated, use `assertAlmost 9 |+ self.assertAlmostEqual(1, 1.1) 10 10 | self.assertNotRegexpMatches("a", "b") -UP005.py:10:9: UP005 [*] `assertNotRegexpMatches` is deprecated, use `assertNotRegex` +UP005.py:10:9: UP005 [**] `assertNotRegexpMatches` is deprecated, use `assertNotRegex` | 8 | self.assertEqual(3, 4) 9 | self.failUnlessAlmostEqual(1, 1.1) diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP006_0.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP006_0.py.snap index c102b6d608464e..e86ec8dc6fb45a 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP006_0.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP006_0.py.snap @@ -231,7 +231,7 @@ UP006_0.py:57:10: UP006 Use `list` instead of `List` for type annotation | = help: Replace with `list` -UP006_0.py:61:10: UP006 [*] Use `collections.deque` instead of `typing.Deque` for type annotation +UP006_0.py:61:10: UP006 [**] Use `collections.deque` instead of `typing.Deque` for type annotation | 61 | def f(x: typing.Deque[str]) -> None: | ^^^^^^^^^^^^ UP006 @@ -257,7 +257,7 @@ UP006_0.py:61:10: UP006 [*] Use `collections.deque` instead of `typing.Deque` fo 63 64 | 64 65 | -UP006_0.py:65:10: UP006 [*] Use `collections.defaultdict` instead of `typing.DefaultDict` for type annotation +UP006_0.py:65:10: UP006 [**] Use `collections.defaultdict` instead of `typing.DefaultDict` for type annotation | 65 | def f(x: typing.DefaultDict[str, str]) -> None: | ^^^^^^^^^^^^^^^^^^ UP006 diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP006_1.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP006_1.py.snap index 1cf174112856e7..39ac97bd668062 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP006_1.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP006_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP006_1.py:9:10: UP006 [*] Use `collections.defaultdict` instead of `typing.DefaultDict` for type annotation +UP006_1.py:9:10: UP006 [**] Use `collections.defaultdict` instead of `typing.DefaultDict` for type annotation | 9 | def f(x: typing.DefaultDict[str, str]) -> None: | ^^^^^^^^^^^^^^^^^^ UP006 diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP006_3.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP006_3.py.snap index 58ea6c2c8acc4e..ed18b6bf6e1d2f 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP006_3.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP006_3.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP006_3.py:7:11: UP006 [*] Use `collections.defaultdict` instead of `typing.DefaultDict` for type annotation +UP006_3.py:7:11: UP006 [**] Use `collections.defaultdict` instead of `typing.DefaultDict` for type annotation | 7 | def f(x: "typing.DefaultDict[str, str]") -> None: | ^^^^^^^^^^^^^^^^^^ UP006 diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP007.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP007.py.snap index 9f97cb06324d5c..03966d2beb552f 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP007.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP007.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP007.py:6:10: UP007 [*] Use `X | Y` for type annotations +UP007.py:6:10: UP007 [**] Use `X | Y` for type annotations | 6 | def f(x: Optional[str]) -> None: | ^^^^^^^^^^^^^ UP007 @@ -19,7 +19,7 @@ UP007.py:6:10: UP007 [*] Use `X | Y` for type annotations 8 8 | 9 9 | -UP007.py:10:10: UP007 [*] Use `X | Y` for type annotations +UP007.py:10:10: UP007 [**] Use `X | Y` for type annotations | 10 | def f(x: typing.Optional[str]) -> None: | ^^^^^^^^^^^^^^^^^^^^ UP007 @@ -37,7 +37,7 @@ UP007.py:10:10: UP007 [*] Use `X | Y` for type annotations 12 12 | 13 13 | -UP007.py:14:10: UP007 [*] Use `X | Y` for type annotations +UP007.py:14:10: UP007 [**] Use `X | Y` for type annotations | 14 | def f(x: Union[str, int, Union[float, bytes]]) -> None: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP007 @@ -55,7 +55,7 @@ UP007.py:14:10: UP007 [*] Use `X | Y` for type annotations 16 16 | 17 17 | -UP007.py:14:26: UP007 [*] Use `X | Y` for type annotations +UP007.py:14:26: UP007 [**] Use `X | Y` for type annotations | 14 | def f(x: Union[str, int, Union[float, bytes]]) -> None: | ^^^^^^^^^^^^^^^^^^^ UP007 @@ -73,7 +73,7 @@ UP007.py:14:26: UP007 [*] Use `X | Y` for type annotations 16 16 | 17 17 | -UP007.py:18:10: UP007 [*] Use `X | Y` for type annotations +UP007.py:18:10: UP007 [**] Use `X | Y` for type annotations | 18 | def f(x: typing.Union[str, int]) -> None: | ^^^^^^^^^^^^^^^^^^^^^^ UP007 @@ -91,7 +91,7 @@ UP007.py:18:10: UP007 [*] Use `X | Y` for type annotations 20 20 | 21 21 | -UP007.py:22:10: UP007 [*] Use `X | Y` for type annotations +UP007.py:22:10: UP007 [**] Use `X | Y` for type annotations | 22 | def f(x: typing.Union[(str, int)]) -> None: | ^^^^^^^^^^^^^^^^^^^^^^^^ UP007 @@ -109,7 +109,7 @@ UP007.py:22:10: UP007 [*] Use `X | Y` for type annotations 24 24 | 25 25 | -UP007.py:26:10: UP007 [*] Use `X | Y` for type annotations +UP007.py:26:10: UP007 [**] Use `X | Y` for type annotations | 26 | def f(x: typing.Union[(str, int), float]) -> None: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP007 @@ -127,7 +127,7 @@ UP007.py:26:10: UP007 [*] Use `X | Y` for type annotations 28 28 | 29 29 | -UP007.py:30:10: UP007 [*] Use `X | Y` for type annotations +UP007.py:30:10: UP007 [**] Use `X | Y` for type annotations | 30 | def f(x: typing.Union[(int,)]) -> None: | ^^^^^^^^^^^^^^^^^^^^ UP007 @@ -145,7 +145,7 @@ UP007.py:30:10: UP007 [*] Use `X | Y` for type annotations 32 32 | 33 33 | -UP007.py:34:10: UP007 [*] Use `X | Y` for type annotations +UP007.py:34:10: UP007 [**] Use `X | Y` for type annotations | 34 | def f(x: typing.Union[()]) -> None: | ^^^^^^^^^^^^^^^^ UP007 @@ -163,7 +163,7 @@ UP007.py:34:10: UP007 [*] Use `X | Y` for type annotations 36 36 | 37 37 | -UP007.py:38:11: UP007 [*] Use `X | Y` for type annotations +UP007.py:38:11: UP007 [**] Use `X | Y` for type annotations | 38 | def f(x: "Union[str, int, Union[float, bytes]]") -> None: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP007 @@ -181,7 +181,7 @@ UP007.py:38:11: UP007 [*] Use `X | Y` for type annotations 40 40 | 41 41 | -UP007.py:38:27: UP007 [*] Use `X | Y` for type annotations +UP007.py:38:27: UP007 [**] Use `X | Y` for type annotations | 38 | def f(x: "Union[str, int, Union[float, bytes]]") -> None: | ^^^^^^^^^^^^^^^^^^^ UP007 @@ -199,7 +199,7 @@ UP007.py:38:27: UP007 [*] Use `X | Y` for type annotations 40 40 | 41 41 | -UP007.py:42:11: UP007 [*] Use `X | Y` for type annotations +UP007.py:42:11: UP007 [**] Use `X | Y` for type annotations | 42 | def f(x: "typing.Union[str, int]") -> None: | ^^^^^^^^^^^^^^^^^^^^^^ UP007 @@ -217,7 +217,7 @@ UP007.py:42:11: UP007 [*] Use `X | Y` for type annotations 44 44 | 45 45 | -UP007.py:55:8: UP007 [*] Use `X | Y` for type annotations +UP007.py:55:8: UP007 [**] Use `X | Y` for type annotations | 54 | def f() -> None: 55 | x: Optional[str] @@ -258,7 +258,7 @@ UP007.py:58:9: UP007 Use `X | Y` for type annotations | = help: Convert to `X | Y` -UP007.py:60:8: UP007 [*] Use `X | Y` for type annotations +UP007.py:60:8: UP007 [**] Use `X | Y` for type annotations | 58 | x = Union[str, int] 59 | x = Union["str", "int"] @@ -278,7 +278,7 @@ UP007.py:60:8: UP007 [*] Use `X | Y` for type annotations 62 62 | 63 63 | -UP007.py:61:8: UP007 [*] Use `X | Y` for type annotations +UP007.py:61:8: UP007 [**] Use `X | Y` for type annotations | 59 | x = Union["str", "int"] 60 | x: Union[str, int] @@ -369,7 +369,7 @@ UP007.py:96:10: UP007 Use `X | Y` for type annotations | = help: Convert to `X | Y` -UP007.py:102:28: UP007 [*] Use `X | Y` for type annotations +UP007.py:102:28: UP007 [**] Use `X | Y` for type annotations | 100 | # Regression test for: https://github.com/astral-sh/ruff/issues/7131 101 | class ServiceRefOrValue: @@ -395,7 +395,7 @@ UP007.py:102:28: UP007 [*] Use `X | Y` for type annotations 107 104 | 108 105 | # Regression test for: https://github.com/astral-sh/ruff/issues/7201 -UP007.py:110:28: UP007 [*] Use `X | Y` for type annotations +UP007.py:110:28: UP007 [**] Use `X | Y` for type annotations | 108 | # Regression test for: https://github.com/astral-sh/ruff/issues/7201 109 | class ServiceRefOrValue: diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP008.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP008.py.snap index 0ff5607820a4ce..289cefd4d35ef3 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP008.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP008.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP008.py:17:23: UP008 [*] Use `super()` instead of `super(__class__, self)` +UP008.py:17:23: UP008 [**] Use `super()` instead of `super(__class__, self)` | 16 | def wrong(self): 17 | parent = super(Child, self) # wrong @@ -21,7 +21,7 @@ UP008.py:17:23: UP008 [*] Use `super()` instead of `super(__class__, self)` 19 19 | super( 20 20 | Child, -UP008.py:18:14: UP008 [*] Use `super()` instead of `super(__class__, self)` +UP008.py:18:14: UP008 [**] Use `super()` instead of `super(__class__, self)` | 16 | def wrong(self): 17 | parent = super(Child, self) # wrong @@ -42,7 +42,7 @@ UP008.py:18:14: UP008 [*] Use `super()` instead of `super(__class__, self)` 20 20 | Child, 21 21 | self, -UP008.py:19:14: UP008 [*] Use `super()` instead of `super(__class__, self)` +UP008.py:19:14: UP008 [**] Use `super()` instead of `super(__class__, self)` | 17 | parent = super(Child, self) # wrong 18 | super(Child, self).method # wrong @@ -68,7 +68,7 @@ UP008.py:19:14: UP008 [*] Use `super()` instead of `super(__class__, self)` 24 21 | 25 22 | class BaseClass: -UP008.py:36:14: UP008 [*] Use `super()` instead of `super(__class__, self)` +UP008.py:36:14: UP008 [**] Use `super()` instead of `super(__class__, self)` | 34 | class MyClass(BaseClass): 35 | def normal(self): @@ -88,7 +88,7 @@ UP008.py:36:14: UP008 [*] Use `super()` instead of `super(__class__, self)` 38 38 | 39 39 | def different_argument(self, other): -UP008.py:50:18: UP008 [*] Use `super()` instead of `super(__class__, self)` +UP008.py:50:18: UP008 [**] Use `super()` instead of `super(__class__, self)` | 49 | def inner_argument(self): 50 | super(MyClass, self).f() # can use super() diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP010.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP010.py.snap index e6ec10b65009ff..2f5b2a665711ef 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP010.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP010.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP010.py:1:1: UP010 [*] Unnecessary `__future__` imports `generators`, `nested_scopes` for target Python version +UP010.py:1:1: UP010 [**] Unnecessary `__future__` imports `generators`, `nested_scopes` for target Python version | 1 | from __future__ import nested_scopes, generators | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP010 @@ -16,7 +16,7 @@ UP010.py:1:1: UP010 [*] Unnecessary `__future__` imports `generators`, `nested_s 3 2 | from __future__ import absolute_import, division 4 3 | from __future__ import generator_stop -UP010.py:2:1: UP010 [*] Unnecessary `__future__` imports `unicode_literals`, `with_statement` for target Python version +UP010.py:2:1: UP010 [**] Unnecessary `__future__` imports `unicode_literals`, `with_statement` for target Python version | 1 | from __future__ import nested_scopes, generators 2 | from __future__ import with_statement, unicode_literals @@ -33,7 +33,7 @@ UP010.py:2:1: UP010 [*] Unnecessary `__future__` imports `unicode_literals`, `wi 4 3 | from __future__ import generator_stop 5 4 | from __future__ import print_function, generator_stop -UP010.py:3:1: UP010 [*] Unnecessary `__future__` imports `absolute_import`, `division` for target Python version +UP010.py:3:1: UP010 [**] Unnecessary `__future__` imports `absolute_import`, `division` for target Python version | 1 | from __future__ import nested_scopes, generators 2 | from __future__ import with_statement, unicode_literals @@ -52,7 +52,7 @@ UP010.py:3:1: UP010 [*] Unnecessary `__future__` imports `absolute_import`, `div 5 4 | from __future__ import print_function, generator_stop 6 5 | from __future__ import invalid_module, generators -UP010.py:4:1: UP010 [*] Unnecessary `__future__` import `generator_stop` for target Python version +UP010.py:4:1: UP010 [**] Unnecessary `__future__` import `generator_stop` for target Python version | 2 | from __future__ import with_statement, unicode_literals 3 | from __future__ import absolute_import, division @@ -72,7 +72,7 @@ UP010.py:4:1: UP010 [*] Unnecessary `__future__` import `generator_stop` for tar 6 5 | from __future__ import invalid_module, generators 7 6 | -UP010.py:5:1: UP010 [*] Unnecessary `__future__` imports `generator_stop`, `print_function` for target Python version +UP010.py:5:1: UP010 [**] Unnecessary `__future__` imports `generator_stop`, `print_function` for target Python version | 3 | from __future__ import absolute_import, division 4 | from __future__ import generator_stop @@ -91,7 +91,7 @@ UP010.py:5:1: UP010 [*] Unnecessary `__future__` imports `generator_stop`, `prin 7 6 | 8 7 | if True: -UP010.py:6:1: UP010 [*] Unnecessary `__future__` import `generators` for target Python version +UP010.py:6:1: UP010 [**] Unnecessary `__future__` import `generators` for target Python version | 4 | from __future__ import generator_stop 5 | from __future__ import print_function, generator_stop @@ -112,7 +112,7 @@ UP010.py:6:1: UP010 [*] Unnecessary `__future__` import `generators` for target 8 8 | if True: 9 9 | from __future__ import generator_stop -UP010.py:9:5: UP010 [*] Unnecessary `__future__` import `generator_stop` for target Python version +UP010.py:9:5: UP010 [**] Unnecessary `__future__` import `generator_stop` for target Python version | 8 | if True: 9 | from __future__ import generator_stop @@ -130,7 +130,7 @@ UP010.py:9:5: UP010 [*] Unnecessary `__future__` import `generator_stop` for tar 11 10 | 12 11 | if True: -UP010.py:10:5: UP010 [*] Unnecessary `__future__` import `generators` for target Python version +UP010.py:10:5: UP010 [**] Unnecessary `__future__` import `generators` for target Python version | 8 | if True: 9 | from __future__ import generator_stop @@ -150,7 +150,7 @@ UP010.py:10:5: UP010 [*] Unnecessary `__future__` import `generators` for target 12 11 | if True: 13 12 | from __future__ import generator_stop -UP010.py:13:5: UP010 [*] Unnecessary `__future__` import `generator_stop` for target Python version +UP010.py:13:5: UP010 [**] Unnecessary `__future__` import `generator_stop` for target Python version | 12 | if True: 13 | from __future__ import generator_stop @@ -166,7 +166,7 @@ UP010.py:13:5: UP010 [*] Unnecessary `__future__` import `generator_stop` for ta 13 |- from __future__ import generator_stop 14 13 | from __future__ import invalid_module, generators -UP010.py:14:5: UP010 [*] Unnecessary `__future__` import `generators` for target Python version +UP010.py:14:5: UP010 [**] Unnecessary `__future__` import `generators` for target Python version | 12 | if True: 13 | from __future__ import generator_stop diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP013.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP013.py.snap index 7f6103fcdb1166..8a5057c2923fa1 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP013.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP013.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP013.py:5:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:5:1: UP013 [**] Convert `MyType` from `TypedDict` functional to class syntax | 4 | # dict literal 5 | MyType = TypedDict("MyType", {"a": int, "b": str}) @@ -23,7 +23,7 @@ UP013.py:5:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class sy 7 9 | # dict call 8 10 | MyType = TypedDict("MyType", dict(a=int, b=str)) -UP013.py:8:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:8:1: UP013 [**] Convert `MyType` from `TypedDict` functional to class syntax | 7 | # dict call 8 | MyType = TypedDict("MyType", dict(a=int, b=str)) @@ -45,7 +45,7 @@ UP013.py:8:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class sy 10 12 | # kwargs 11 13 | MyType = TypedDict("MyType", a=int, b=str) -UP013.py:11:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:11:1: UP013 [**] Convert `MyType` from `TypedDict` functional to class syntax | 10 | # kwargs 11 | MyType = TypedDict("MyType", a=int, b=str) @@ -67,7 +67,7 @@ UP013.py:11:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class s 13 15 | # Empty TypedDict 14 16 | MyType = TypedDict("MyType") -UP013.py:14:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:14:1: UP013 [**] Convert `MyType` from `TypedDict` functional to class syntax | 13 | # Empty TypedDict 14 | MyType = TypedDict("MyType") @@ -88,7 +88,7 @@ UP013.py:14:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class s 16 17 | # Literal values 17 18 | MyType = TypedDict("MyType", {"a": "hello"}) -UP013.py:17:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:17:1: UP013 [**] Convert `MyType` from `TypedDict` functional to class syntax | 16 | # Literal values 17 | MyType = TypedDict("MyType", {"a": "hello"}) @@ -108,7 +108,7 @@ UP013.py:17:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class s 19 20 | 20 21 | # NotRequired -UP013.py:18:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:18:1: UP013 [**] Convert `MyType` from `TypedDict` functional to class syntax | 16 | # Literal values 17 | MyType = TypedDict("MyType", {"a": "hello"}) @@ -130,7 +130,7 @@ UP013.py:18:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class s 20 21 | # NotRequired 21 22 | MyType = TypedDict("MyType", {"a": NotRequired[dict]}) -UP013.py:21:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:21:1: UP013 [**] Convert `MyType` from `TypedDict` functional to class syntax | 20 | # NotRequired 21 | MyType = TypedDict("MyType", {"a": NotRequired[dict]}) @@ -151,7 +151,7 @@ UP013.py:21:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class s 23 24 | # total 24 25 | MyType = TypedDict("MyType", {"x": int, "y": int}, total=False) -UP013.py:24:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:24:1: UP013 [**] Convert `MyType` from `TypedDict` functional to class syntax | 23 | # total 24 | MyType = TypedDict("MyType", {"x": int, "y": int}, total=False) @@ -173,7 +173,7 @@ UP013.py:24:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class s 26 28 | # using Literal type 27 29 | MyType = TypedDict("MyType", {"key": Literal["value"]}) -UP013.py:27:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:27:1: UP013 [**] Convert `MyType` from `TypedDict` functional to class syntax | 26 | # using Literal type 27 | MyType = TypedDict("MyType", {"key": Literal["value"]}) @@ -194,7 +194,7 @@ UP013.py:27:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class s 29 30 | # using namespace TypedDict 30 31 | MyType = typing.TypedDict("MyType", {"key": int}) -UP013.py:30:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:30:1: UP013 [**] Convert `MyType` from `TypedDict` functional to class syntax | 29 | # using namespace TypedDict 30 | MyType = typing.TypedDict("MyType", {"key": int}) @@ -215,7 +215,7 @@ UP013.py:30:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class s 32 33 | # invalid identifiers (OK) 33 34 | MyType = TypedDict("MyType", {"in": int, "x-y": int}) -UP013.py:40:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:40:1: UP013 [**] Convert `MyType` from `TypedDict` functional to class syntax | 39 | # Empty dict literal 40 | MyType = TypedDict("MyType", {}) @@ -236,7 +236,7 @@ UP013.py:40:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class s 42 43 | # Empty dict call 43 44 | MyType = TypedDict("MyType", dict()) -UP013.py:43:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:43:1: UP013 [**] Convert `MyType` from `TypedDict` functional to class syntax | 42 | # Empty dict call 43 | MyType = TypedDict("MyType", dict()) diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP014.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP014.py.snap index f7e9dd895e6270..e13aad4bd109cf 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP014.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP014.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP014.py:5:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class syntax +UP014.py:5:1: UP014 [**] Convert `MyType` from `NamedTuple` functional to class syntax | 4 | # with complex annotations 5 | MyType = NamedTuple("MyType", [("a", int), ("b", tuple[str, ...])]) @@ -23,7 +23,7 @@ UP014.py:5:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class s 7 9 | # with namespace 8 10 | MyType = typing.NamedTuple("MyType", [("a", int), ("b", str)]) -UP014.py:8:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class syntax +UP014.py:8:1: UP014 [**] Convert `MyType` from `NamedTuple` functional to class syntax | 7 | # with namespace 8 | MyType = typing.NamedTuple("MyType", [("a", int), ("b", str)]) @@ -45,7 +45,7 @@ UP014.py:8:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class s 10 12 | # invalid identifiers (OK) 11 13 | MyType = NamedTuple("MyType", [("x-y", int), ("b", tuple[str, ...])]) -UP014.py:14:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class syntax +UP014.py:14:1: UP014 [**] Convert `MyType` from `NamedTuple` functional to class syntax | 13 | # no fields 14 | MyType = typing.NamedTuple("MyType") @@ -66,7 +66,7 @@ UP014.py:14:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class 16 17 | # empty fields 17 18 | MyType = typing.NamedTuple("MyType", []) -UP014.py:17:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class syntax +UP014.py:17:1: UP014 [**] Convert `MyType` from `NamedTuple` functional to class syntax | 16 | # empty fields 17 | MyType = typing.NamedTuple("MyType", []) @@ -87,7 +87,7 @@ UP014.py:17:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class 19 20 | # keywords 20 21 | MyType = typing.NamedTuple("MyType", a=int, b=tuple[str, ...]) -UP014.py:20:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class syntax +UP014.py:20:1: UP014 [**] Convert `MyType` from `NamedTuple` functional to class syntax | 19 | # keywords 20 | MyType = typing.NamedTuple("MyType", a=int, b=tuple[str, ...]) diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP020.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP020.py.snap index 6638a8cc904a74..896e53d7cd5736 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP020.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP020.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP020.py:3:6: UP020 [*] Use builtin `open` +UP020.py:3:6: UP020 [**] Use builtin `open` | 1 | import io 2 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP021.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP021.py.snap index 484e53f1d84aab..0f6be39f186317 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP021.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP021.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP021.py:5:25: UP021 [*] `universal_newlines` is deprecated, use `text` +UP021.py:5:25: UP021 [**] `universal_newlines` is deprecated, use `text` | 4 | # Errors 5 | subprocess.run(["foo"], universal_newlines=True, check=True) @@ -21,7 +21,7 @@ UP021.py:5:25: UP021 [*] `universal_newlines` is deprecated, use `text` 7 7 | run(["foo"], universal_newlines=True, check=False) 8 8 | -UP021.py:6:25: UP021 [*] `universal_newlines` is deprecated, use `text` +UP021.py:6:25: UP021 [**] `universal_newlines` is deprecated, use `text` | 4 | # Errors 5 | subprocess.run(["foo"], universal_newlines=True, check=True) @@ -41,7 +41,7 @@ UP021.py:6:25: UP021 [*] `universal_newlines` is deprecated, use `text` 8 8 | 9 9 | # OK -UP021.py:7:14: UP021 [*] `universal_newlines` is deprecated, use `text` +UP021.py:7:14: UP021 [**] `universal_newlines` is deprecated, use `text` | 5 | subprocess.run(["foo"], universal_newlines=True, check=True) 6 | subprocess.run(["foo"], universal_newlines=True, text=True) diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP022.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP022.py.snap index 186db762542e54..8b37f71834e5eb 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP022.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP022.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP022.py:4:10: UP022 [*] Sending `stdout` and `stderr` to `PIPE` is deprecated, use `capture_output` +UP022.py:4:10: UP022 [**] Sending `stdout` and `stderr` to `PIPE` is deprecated, use `capture_output` | 2 | import subprocess 3 | @@ -22,7 +22,7 @@ UP022.py:4:10: UP022 [*] Sending `stdout` and `stderr` to `PIPE` is deprecated, 6 6 | output = subprocess.run(["foo"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 7 7 | -UP022.py:6:10: UP022 [*] Sending `stdout` and `stderr` to `PIPE` is deprecated, use `capture_output` +UP022.py:6:10: UP022 [**] Sending `stdout` and `stderr` to `PIPE` is deprecated, use `capture_output` | 4 | output = run(["foo"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 5 | @@ -43,7 +43,7 @@ UP022.py:6:10: UP022 [*] Sending `stdout` and `stderr` to `PIPE` is deprecated, 8 8 | output = subprocess.run(stdout=subprocess.PIPE, args=["foo"], stderr=subprocess.PIPE) 9 9 | -UP022.py:8:10: UP022 [*] Sending `stdout` and `stderr` to `PIPE` is deprecated, use `capture_output` +UP022.py:8:10: UP022 [**] Sending `stdout` and `stderr` to `PIPE` is deprecated, use `capture_output` | 6 | output = subprocess.run(["foo"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 7 | @@ -64,7 +64,7 @@ UP022.py:8:10: UP022 [*] Sending `stdout` and `stderr` to `PIPE` is deprecated, 10 10 | output = subprocess.run( 11 11 | ["foo"], stdout=subprocess.PIPE, check=True, stderr=subprocess.PIPE -UP022.py:10:10: UP022 [*] Sending `stdout` and `stderr` to `PIPE` is deprecated, use `capture_output` +UP022.py:10:10: UP022 [**] Sending `stdout` and `stderr` to `PIPE` is deprecated, use `capture_output` | 8 | output = subprocess.run(stdout=subprocess.PIPE, args=["foo"], stderr=subprocess.PIPE) 9 | @@ -88,7 +88,7 @@ UP022.py:10:10: UP022 [*] Sending `stdout` and `stderr` to `PIPE` is deprecated, 13 13 | 14 14 | output = subprocess.run( -UP022.py:14:10: UP022 [*] Sending `stdout` and `stderr` to `PIPE` is deprecated, use `capture_output` +UP022.py:14:10: UP022 [**] Sending `stdout` and `stderr` to `PIPE` is deprecated, use `capture_output` | 12 | ) 13 | @@ -112,7 +112,7 @@ UP022.py:14:10: UP022 [*] Sending `stdout` and `stderr` to `PIPE` is deprecated, 17 17 | 18 18 | output = subprocess.run( -UP022.py:18:10: UP022 [*] Sending `stdout` and `stderr` to `PIPE` is deprecated, use `capture_output` +UP022.py:18:10: UP022 [**] Sending `stdout` and `stderr` to `PIPE` is deprecated, use `capture_output` | 16 | ) 17 | @@ -144,7 +144,7 @@ UP022.py:18:10: UP022 [*] Sending `stdout` and `stderr` to `PIPE` is deprecated, 24 23 | encoding="utf-8", 25 24 | close_fds=True, -UP022.py:29:14: UP022 [*] Sending `stdout` and `stderr` to `PIPE` is deprecated, use `capture_output` +UP022.py:29:14: UP022 [**] Sending `stdout` and `stderr` to `PIPE` is deprecated, use `capture_output` | 28 | if output: 29 | output = subprocess.run( diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP023.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP023.py.snap index 6944c7925b1758..37cbfe306959a2 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP023.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP023.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP023.py:2:1: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:2:1: UP023 [**] `cElementTree` is deprecated, use `ElementTree` | 1 | # These two imports have something after cElementTree, so they should be fixed. 2 | from xml.etree.cElementTree import XML, Element, SubElement @@ -18,7 +18,7 @@ UP023.py:2:1: UP023 [*] `cElementTree` is deprecated, use `ElementTree` 4 4 | 5 5 | # Weird spacing should not cause issues. -UP023.py:3:8: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:3:8: UP023 [**] `cElementTree` is deprecated, use `ElementTree` | 1 | # These two imports have something after cElementTree, so they should be fixed. 2 | from xml.etree.cElementTree import XML, Element, SubElement @@ -38,7 +38,7 @@ UP023.py:3:8: UP023 [*] `cElementTree` is deprecated, use `ElementTree` 5 5 | # Weird spacing should not cause issues. 6 6 | from xml.etree.cElementTree import XML -UP023.py:6:1: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:6:1: UP023 [**] `cElementTree` is deprecated, use `ElementTree` | 5 | # Weird spacing should not cause issues. 6 | from xml.etree.cElementTree import XML @@ -57,7 +57,7 @@ UP023.py:6:1: UP023 [*] `cElementTree` is deprecated, use `ElementTree` 8 8 | 9 9 | # Multi line imports should also work fine. -UP023.py:7:11: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:7:11: UP023 [**] `cElementTree` is deprecated, use `ElementTree` | 5 | # Weird spacing should not cause issues. 6 | from xml.etree.cElementTree import XML @@ -78,7 +78,7 @@ UP023.py:7:11: UP023 [*] `cElementTree` is deprecated, use `ElementTree` 9 9 | # Multi line imports should also work fine. 10 10 | from xml.etree.cElementTree import ( -UP023.py:10:1: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:10:1: UP023 [**] `cElementTree` is deprecated, use `ElementTree` | 9 | # Multi line imports should also work fine. 10 | / from xml.etree.cElementTree import ( @@ -102,7 +102,7 @@ UP023.py:10:1: UP023 [*] `cElementTree` is deprecated, use `ElementTree` 12 12 | Element, 13 13 | SubElement, -UP023.py:16:12: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:16:12: UP023 [**] `cElementTree` is deprecated, use `ElementTree` | 14 | ) 15 | if True: @@ -122,7 +122,7 @@ UP023.py:16:12: UP023 [*] `cElementTree` is deprecated, use `ElementTree` 18 18 | 19 19 | from xml.etree import cElementTree as ET -UP023.py:17:27: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:17:27: UP023 [**] `cElementTree` is deprecated, use `ElementTree` | 15 | if True: 16 | import xml.etree.cElementTree as ET @@ -143,7 +143,7 @@ UP023.py:17:27: UP023 [*] `cElementTree` is deprecated, use `ElementTree` 19 19 | from xml.etree import cElementTree as ET 20 20 | -UP023.py:19:23: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:19:23: UP023 [**] `cElementTree` is deprecated, use `ElementTree` | 17 | from xml.etree import cElementTree as CET 18 | @@ -164,7 +164,7 @@ UP023.py:19:23: UP023 [*] `cElementTree` is deprecated, use `ElementTree` 21 21 | import contextlib, xml.etree.cElementTree as ET 22 22 | -UP023.py:21:20: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:21:20: UP023 [**] `cElementTree` is deprecated, use `ElementTree` | 19 | from xml.etree import cElementTree as ET 20 | @@ -185,7 +185,7 @@ UP023.py:21:20: UP023 [*] `cElementTree` is deprecated, use `ElementTree` 23 23 | # This should fix the second, but not the first invocation. 24 24 | import xml.etree.cElementTree, xml.etree.cElementTree as ET -UP023.py:24:32: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:24:32: UP023 [**] `cElementTree` is deprecated, use `ElementTree` | 23 | # This should fix the second, but not the first invocation. 24 | import xml.etree.cElementTree, xml.etree.cElementTree as ET diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP026.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP026.py.snap index fb8ecac7ec0a9b..b4c6a9b54ffced 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP026.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP026.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP026.py:3:12: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:3:12: UP026 [**] `mock` is deprecated, use `unittest.mock` | 1 | # Error (`from unittest import mock`) 2 | if True: @@ -21,7 +21,7 @@ UP026.py:3:12: UP026 [*] `mock` is deprecated, use `unittest.mock` 5 5 | # Error (`from unittest import mock`) 6 6 | if True: -UP026.py:7:12: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:7:12: UP026 [**] `mock` is deprecated, use `unittest.mock` | 5 | # Error (`from unittest import mock`) 6 | if True: @@ -43,7 +43,7 @@ UP026.py:7:12: UP026 [*] `mock` is deprecated, use `unittest.mock` 9 10 | # Error (`from unittest.mock import *`) 10 11 | if True: -UP026.py:11:5: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:11:5: UP026 [**] `mock` is deprecated, use `unittest.mock` | 9 | # Error (`from unittest.mock import *`) 10 | if True: @@ -64,7 +64,7 @@ UP026.py:11:5: UP026 [*] `mock` is deprecated, use `unittest.mock` 13 13 | # Error (`from unittest import mock`) 14 14 | import mock.mock -UP026.py:14:8: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:14:8: UP026 [**] `mock` is deprecated, use `unittest.mock` | 13 | # Error (`from unittest import mock`) 14 | import mock.mock @@ -84,7 +84,7 @@ UP026.py:14:8: UP026 [*] `mock` is deprecated, use `unittest.mock` 16 16 | # Error (`from unittest import mock`) 17 17 | import contextlib, mock, sys -UP026.py:17:20: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:17:20: UP026 [**] `mock` is deprecated, use `unittest.mock` | 16 | # Error (`from unittest import mock`) 17 | import contextlib, mock, sys @@ -105,7 +105,7 @@ UP026.py:17:20: UP026 [*] `mock` is deprecated, use `unittest.mock` 19 20 | # Error (`from unittest import mock`) 20 21 | import mock, sys -UP026.py:20:8: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:20:8: UP026 [**] `mock` is deprecated, use `unittest.mock` | 19 | # Error (`from unittest import mock`) 20 | import mock, sys @@ -125,7 +125,7 @@ UP026.py:20:8: UP026 [*] `mock` is deprecated, use `unittest.mock` 22 23 | 23 24 | # Error (`from unittest import mock`) -UP026.py:24:1: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:24:1: UP026 [**] `mock` is deprecated, use `unittest.mock` | 23 | # Error (`from unittest import mock`) 24 | from mock import mock @@ -145,7 +145,7 @@ UP026.py:24:1: UP026 [*] `mock` is deprecated, use `unittest.mock` 26 26 | # Error (keep trailing comma) 27 27 | from mock import ( -UP026.py:27:1: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:27:1: UP026 [**] `mock` is deprecated, use `unittest.mock` | 26 | # Error (keep trailing comma) 27 | / from mock import ( @@ -176,7 +176,7 @@ UP026.py:27:1: UP026 [*] `mock` is deprecated, use `unittest.mock` 34 34 | a, 35 35 | b, -UP026.py:33:1: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:33:1: UP026 [**] `mock` is deprecated, use `unittest.mock` | 31 | c, 32 | ) @@ -208,7 +208,7 @@ UP026.py:33:1: UP026 [*] `mock` is deprecated, use `unittest.mock` 40 40 | # Error (avoid trailing comma) 41 41 | from mock import ( -UP026.py:41:1: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:41:1: UP026 [**] `mock` is deprecated, use `unittest.mock` | 40 | # Error (avoid trailing comma) 41 | / from mock import ( @@ -239,7 +239,7 @@ UP026.py:41:1: UP026 [*] `mock` is deprecated, use `unittest.mock` 48 48 | a, 49 49 | b, -UP026.py:47:1: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:47:1: UP026 [**] `mock` is deprecated, use `unittest.mock` | 45 | c 46 | ) @@ -272,7 +272,7 @@ UP026.py:47:1: UP026 [*] `mock` is deprecated, use `unittest.mock` 54 54 | from mock import a, b, c, mock 55 55 | -UP026.py:53:1: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:53:1: UP026 [**] `mock` is deprecated, use `unittest.mock` | 51 | mock 52 | ) @@ -293,7 +293,7 @@ UP026.py:53:1: UP026 [*] `mock` is deprecated, use `unittest.mock` 55 56 | 56 57 | if True: -UP026.py:54:1: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:54:1: UP026 [**] `mock` is deprecated, use `unittest.mock` | 52 | ) 53 | from mock import mock, a, b, c @@ -315,7 +315,7 @@ UP026.py:54:1: UP026 [*] `mock` is deprecated, use `unittest.mock` 56 57 | if True: 57 58 | if False: -UP026.py:58:9: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:58:9: UP026 [**] `mock` is deprecated, use `unittest.mock` | 56 | if True: 57 | if False: @@ -348,7 +348,7 @@ UP026.py:58:9: UP026 [*] `mock` is deprecated, use `unittest.mock` 65 65 | # OK 66 66 | import os, io -UP026.py:69:8: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:69:8: UP026 [**] `mock` is deprecated, use `unittest.mock` | 68 | # Error (`from unittest import mock`) 69 | import mock, mock @@ -369,7 +369,7 @@ UP026.py:69:8: UP026 [*] `mock` is deprecated, use `unittest.mock` 71 72 | # Error (`from unittest import mock as foo`) 72 73 | import mock as foo -UP026.py:69:14: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:69:14: UP026 [**] `mock` is deprecated, use `unittest.mock` | 68 | # Error (`from unittest import mock`) 69 | import mock, mock @@ -390,7 +390,7 @@ UP026.py:69:14: UP026 [*] `mock` is deprecated, use `unittest.mock` 71 72 | # Error (`from unittest import mock as foo`) 72 73 | import mock as foo -UP026.py:72:8: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:72:8: UP026 [**] `mock` is deprecated, use `unittest.mock` | 71 | # Error (`from unittest import mock as foo`) 72 | import mock as foo @@ -410,7 +410,7 @@ UP026.py:72:8: UP026 [*] `mock` is deprecated, use `unittest.mock` 74 74 | # Error (`from unittest import mock as foo`) 75 75 | from mock import mock as foo -UP026.py:75:1: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:75:1: UP026 [**] `mock` is deprecated, use `unittest.mock` | 74 | # Error (`from unittest import mock as foo`) 75 | from mock import mock as foo @@ -430,7 +430,7 @@ UP026.py:75:1: UP026 [*] `mock` is deprecated, use `unittest.mock` 77 77 | if True: 78 78 | # This should yield multiple, aliased imports. -UP026.py:79:12: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:79:12: UP026 [**] `mock` is deprecated, use `unittest.mock` | 77 | if True: 78 | # This should yield multiple, aliased imports. @@ -453,7 +453,7 @@ UP026.py:79:12: UP026 [*] `mock` is deprecated, use `unittest.mock` 81 83 | # This should yield multiple, aliased imports, and preserve `os`. 82 84 | import mock as foo, mock as bar, mock, os -UP026.py:79:25: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:79:25: UP026 [**] `mock` is deprecated, use `unittest.mock` | 77 | if True: 78 | # This should yield multiple, aliased imports. @@ -476,7 +476,7 @@ UP026.py:79:25: UP026 [*] `mock` is deprecated, use `unittest.mock` 81 83 | # This should yield multiple, aliased imports, and preserve `os`. 82 84 | import mock as foo, mock as bar, mock, os -UP026.py:79:38: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:79:38: UP026 [**] `mock` is deprecated, use `unittest.mock` | 77 | if True: 78 | # This should yield multiple, aliased imports. @@ -499,7 +499,7 @@ UP026.py:79:38: UP026 [*] `mock` is deprecated, use `unittest.mock` 81 83 | # This should yield multiple, aliased imports, and preserve `os`. 82 84 | import mock as foo, mock as bar, mock, os -UP026.py:82:12: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:82:12: UP026 [**] `mock` is deprecated, use `unittest.mock` | 81 | # This should yield multiple, aliased imports, and preserve `os`. 82 | import mock as foo, mock as bar, mock, os @@ -522,7 +522,7 @@ UP026.py:82:12: UP026 [*] `mock` is deprecated, use `unittest.mock` 84 87 | if True: 85 88 | # This should yield multiple, aliased imports. -UP026.py:82:25: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:82:25: UP026 [**] `mock` is deprecated, use `unittest.mock` | 81 | # This should yield multiple, aliased imports, and preserve `os`. 82 | import mock as foo, mock as bar, mock, os @@ -545,7 +545,7 @@ UP026.py:82:25: UP026 [*] `mock` is deprecated, use `unittest.mock` 84 87 | if True: 85 88 | # This should yield multiple, aliased imports. -UP026.py:82:38: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:82:38: UP026 [**] `mock` is deprecated, use `unittest.mock` | 81 | # This should yield multiple, aliased imports, and preserve `os`. 82 | import mock as foo, mock as bar, mock, os @@ -568,7 +568,7 @@ UP026.py:82:38: UP026 [*] `mock` is deprecated, use `unittest.mock` 84 87 | if True: 85 88 | # This should yield multiple, aliased imports. -UP026.py:86:5: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:86:5: UP026 [**] `mock` is deprecated, use `unittest.mock` | 84 | if True: 85 | # This should yield multiple, aliased imports. @@ -589,7 +589,7 @@ UP026.py:86:5: UP026 [*] `mock` is deprecated, use `unittest.mock` 88 90 | 89 91 | # OK. -UP026.py:93:5: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:93:5: UP026 [**] `mock` is deprecated, use `unittest.mock` | 92 | # Error (`mock.Mock()`). 93 | x = mock.mock.Mock() diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP027.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP027.py.snap index db56ed7f7d5934..95eaadcfa13310 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP027.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP027.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP027.py:2:17: UP027 [*] Replace unpacked list comprehension with a generator expression +UP027.py:2:17: UP027 [**] Replace unpacked list comprehension with a generator expression | 1 | # Should change 2 | foo, bar, baz = [fn(x) for x in items] @@ -19,7 +19,7 @@ UP027.py:2:17: UP027 [*] Replace unpacked list comprehension with a generator ex 4 4 | foo, bar, baz =[fn(x) for x in items] 5 5 | -UP027.py:4:16: UP027 [*] Replace unpacked list comprehension with a generator expression +UP027.py:4:16: UP027 [**] Replace unpacked list comprehension with a generator expression | 2 | foo, bar, baz = [fn(x) for x in items] 3 | @@ -40,7 +40,7 @@ UP027.py:4:16: UP027 [*] Replace unpacked list comprehension with a generator ex 6 6 | foo, bar, baz = [fn(x) for x in items] 7 7 | -UP027.py:6:26: UP027 [*] Replace unpacked list comprehension with a generator expression +UP027.py:6:26: UP027 [**] Replace unpacked list comprehension with a generator expression | 4 | foo, bar, baz =[fn(x) for x in items] 5 | @@ -61,7 +61,7 @@ UP027.py:6:26: UP027 [*] Replace unpacked list comprehension with a generator ex 8 8 | foo, bar, baz = [[i for i in fn(x)] for x in items] 9 9 | -UP027.py:8:17: UP027 [*] Replace unpacked list comprehension with a generator expression +UP027.py:8:17: UP027 [**] Replace unpacked list comprehension with a generator expression | 6 | foo, bar, baz = [fn(x) for x in items] 7 | @@ -82,7 +82,7 @@ UP027.py:8:17: UP027 [*] Replace unpacked list comprehension with a generator ex 10 10 | foo, bar, baz = [ 11 11 | fn(x) -UP027.py:10:17: UP027 [*] Replace unpacked list comprehension with a generator expression +UP027.py:10:17: UP027 [**] Replace unpacked list comprehension with a generator expression | 8 | foo, bar, baz = [[i for i in fn(x)] for x in items] 9 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP028_0.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP028_0.py.snap index 12c38221bfd00c..555ee3158a2477 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP028_0.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP028_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP028_0.py:2:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:2:5: UP028 [**] Replace `yield` over `for` loop with `yield from` | 1 | def f(): 2 | for x in y: @@ -20,7 +20,7 @@ UP028_0.py:2:5: UP028 [*] Replace `yield` over `for` loop with `yield from` 5 4 | 6 5 | def g(): -UP028_0.py:7:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:7:5: UP028 [**] Replace `yield` over `for` loop with `yield from` | 6 | def g(): 7 | for x, y in z: @@ -41,7 +41,7 @@ UP028_0.py:7:5: UP028 [*] Replace `yield` over `for` loop with `yield from` 10 9 | 11 10 | def h(): -UP028_0.py:12:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:12:5: UP028 [**] Replace `yield` over `for` loop with `yield from` | 11 | def h(): 12 | for x in [1, 2, 3]: @@ -62,7 +62,7 @@ UP028_0.py:12:5: UP028 [*] Replace `yield` over `for` loop with `yield from` 15 14 | 16 15 | def i(): -UP028_0.py:17:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:17:5: UP028 [**] Replace `yield` over `for` loop with `yield from` | 16 | def i(): 17 | for x in {x for x in y}: @@ -83,7 +83,7 @@ UP028_0.py:17:5: UP028 [*] Replace `yield` over `for` loop with `yield from` 20 19 | 21 20 | def j(): -UP028_0.py:22:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:22:5: UP028 [**] Replace `yield` over `for` loop with `yield from` | 21 | def j(): 22 | for x in (1, 2, 3): @@ -104,7 +104,7 @@ UP028_0.py:22:5: UP028 [*] Replace `yield` over `for` loop with `yield from` 25 24 | 26 25 | def k(): -UP028_0.py:27:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:27:5: UP028 [**] Replace `yield` over `for` loop with `yield from` | 26 | def k(): 27 | for x, y in {3: "x", 6: "y"}: @@ -125,7 +125,7 @@ UP028_0.py:27:5: UP028 [*] Replace `yield` over `for` loop with `yield from` 30 29 | 31 30 | def f(): # Comment one\n' -UP028_0.py:33:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:33:5: UP028 [**] Replace `yield` over `for` loop with `yield from` | 31 | def f(): # Comment one\n' 32 | # Comment two\n' @@ -159,7 +159,7 @@ UP028_0.py:33:5: UP028 [*] Replace `yield` over `for` loop with `yield from` 41 39 | 42 40 | -UP028_0.py:44:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:44:5: UP028 [**] Replace `yield` over `for` loop with `yield from` | 43 | def f(): 44 | for x, y in [{3: (3, [44, "long ss"]), 6: "y"}]: @@ -180,7 +180,7 @@ UP028_0.py:44:5: UP028 [*] Replace `yield` over `for` loop with `yield from` 47 46 | 48 47 | def f(): -UP028_0.py:49:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:49:5: UP028 [**] Replace `yield` over `for` loop with `yield from` | 48 | def f(): 49 | for x, y in z(): @@ -203,7 +203,7 @@ UP028_0.py:49:5: UP028 [*] Replace `yield` over `for` loop with `yield from` 52 51 | def f(): 53 52 | def func(): -UP028_0.py:55:9: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:55:9: UP028 [**] Replace `yield` over `for` loop with `yield from` | 53 | def func(): 54 | # This comment is preserved\n' @@ -229,7 +229,7 @@ UP028_0.py:55:9: UP028 [*] Replace `yield` over `for` loop with `yield from` 59 57 | # Comment\n' 60 58 | def g(): -UP028_0.py:67:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:67:5: UP028 [**] Replace `yield` over `for` loop with `yield from` | 65 | for x in y: 66 | yield x @@ -251,7 +251,7 @@ UP028_0.py:67:5: UP028 [*] Replace `yield` over `for` loop with `yield from` 70 69 | 71 70 | def f(): -UP028_0.py:72:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:72:5: UP028 [**] Replace `yield` over `for` loop with `yield from` | 71 | def f(): 72 | for x, y in z(): @@ -273,7 +273,7 @@ UP028_0.py:72:5: UP028 [*] Replace `yield` over `for` loop with `yield from` 75 74 | 76 75 | -UP028_0.py:79:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:79:5: UP028 [**] Replace `yield` over `for` loop with `yield from` | 77 | # Regression test for: https://github.com/astral-sh/ruff/issues/7103 78 | def _serve_method(fn): diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP029.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP029.py.snap index f094fbd50c3a62..100e3da5260fa1 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP029.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP029.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP029.py:1:1: UP029 [*] Unnecessary builtin import: `*` +UP029.py:1:1: UP029 [**] Unnecessary builtin import: `*` | 1 | from builtins import * | ^^^^^^^^^^^^^^^^^^^^^^ UP029 @@ -16,7 +16,7 @@ UP029.py:1:1: UP029 [*] Unnecessary builtin import: `*` 3 2 | from builtins import str as _str 4 3 | from six.moves import filter, zip, zip_longest -UP029.py:2:1: UP029 [*] Unnecessary builtin imports: `ascii`, `bytes` +UP029.py:2:1: UP029 [**] Unnecessary builtin imports: `ascii`, `bytes` | 1 | from builtins import * 2 | from builtins import ascii, bytes, compile @@ -34,7 +34,7 @@ UP029.py:2:1: UP029 [*] Unnecessary builtin imports: `ascii`, `bytes` 4 4 | from six.moves import filter, zip, zip_longest 5 5 | from io import open -UP029.py:4:1: UP029 [*] Unnecessary builtin imports: `filter`, `zip` +UP029.py:4:1: UP029 [**] Unnecessary builtin imports: `filter`, `zip` | 2 | from builtins import ascii, bytes, compile 3 | from builtins import str as _str @@ -55,7 +55,7 @@ UP029.py:4:1: UP029 [*] Unnecessary builtin imports: `filter`, `zip` 6 6 | import io 7 7 | import six -UP029.py:5:1: UP029 [*] Unnecessary builtin import: `open` +UP029.py:5:1: UP029 [**] Unnecessary builtin import: `open` | 3 | from builtins import str as _str 4 | from six.moves import filter, zip, zip_longest diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP030_0.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP030_0.py.snap index 58595ab3a73cbc..b0d847cac9a711 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP030_0.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP030_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP030_0.py:3:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:3:1: UP030 [**] Use implicit references for positional format fields | 1 | # Invalid calls; errors expected. 2 | @@ -21,7 +21,7 @@ UP030_0.py:3:1: UP030 [*] Use implicit references for positional format fields 5 5 | "a {3} complicated {1} string with {0} {2}".format( 6 6 | "first", "second", "third", "fourth" -UP030_0.py:5:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:5:1: UP030 [**] Use implicit references for positional format fields | 3 | "{0}" "{1}" "{2}".format(1, 2, 3) 4 | @@ -46,7 +46,7 @@ UP030_0.py:5:1: UP030 [*] Use implicit references for positional format fields 8 8 | 9 9 | '{0}'.format(1) -UP030_0.py:9:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:9:1: UP030 [**] Use implicit references for positional format fields | 7 | ) 8 | @@ -67,7 +67,7 @@ UP030_0.py:9:1: UP030 [*] Use implicit references for positional format fields 11 11 | '{0:x}'.format(30) 12 12 | -UP030_0.py:11:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:11:1: UP030 [**] Use implicit references for positional format fields | 9 | '{0}'.format(1) 10 | @@ -88,7 +88,7 @@ UP030_0.py:11:1: UP030 [*] Use implicit references for positional format fields 13 13 | x = '{0}'.format(1) 14 14 | -UP030_0.py:13:5: UP030 [*] Use implicit references for positional format fields +UP030_0.py:13:5: UP030 [**] Use implicit references for positional format fields | 11 | '{0:x}'.format(30) 12 | @@ -109,7 +109,7 @@ UP030_0.py:13:5: UP030 [*] Use implicit references for positional format fields 15 15 | '''{0}\n{1}\n'''.format(1, 2) 16 16 | -UP030_0.py:15:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:15:1: UP030 [**] Use implicit references for positional format fields | 13 | x = '{0}'.format(1) 14 | @@ -130,7 +130,7 @@ UP030_0.py:15:1: UP030 [*] Use implicit references for positional format fields 17 17 | x = "foo {0}" \ 18 18 | "bar {1}".format(1, 2) -UP030_0.py:17:5: UP030 [*] Use implicit references for positional format fields +UP030_0.py:17:5: UP030 [**] Use implicit references for positional format fields | 15 | '''{0}\n{1}\n'''.format(1, 2) 16 | @@ -155,7 +155,7 @@ UP030_0.py:17:5: UP030 [*] Use implicit references for positional format fields 20 20 | ("{0}").format(1) 21 21 | -UP030_0.py:20:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:20:1: UP030 [**] Use implicit references for positional format fields | 18 | "bar {1}".format(1, 2) 19 | @@ -176,7 +176,7 @@ UP030_0.py:20:1: UP030 [*] Use implicit references for positional format fields 22 22 | "\N{snowman} {0}".format(1) 23 23 | -UP030_0.py:22:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:22:1: UP030 [**] Use implicit references for positional format fields | 20 | ("{0}").format(1) 21 | @@ -197,7 +197,7 @@ UP030_0.py:22:1: UP030 [*] Use implicit references for positional format fields 24 24 | print( 25 25 | 'foo{0}' -UP030_0.py:25:5: UP030 [*] Use implicit references for positional format fields +UP030_0.py:25:5: UP030 [**] Use implicit references for positional format fields | 24 | print( 25 | 'foo{0}' @@ -220,7 +220,7 @@ UP030_0.py:25:5: UP030 [*] Use implicit references for positional format fields 28 28 | 29 29 | print( -UP030_0.py:30:5: UP030 [*] Use implicit references for positional format fields +UP030_0.py:30:5: UP030 [**] Use implicit references for positional format fields | 29 | print( 30 | 'foo{0}' # ohai\n" @@ -254,7 +254,7 @@ UP030_0.py:34:1: UP030 Use implicit references for positional format fields | = help: Remove explicit positional indices -UP030_0.py:39:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:39:1: UP030 [**] Use implicit references for positional format fields | 37 | kwargs = {x: x for x in range(10)} 38 | @@ -275,7 +275,7 @@ UP030_0.py:39:1: UP030 [*] Use implicit references for positional format fields 41 41 | "{0}".format(**kwargs) 42 42 | -UP030_0.py:41:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:41:1: UP030 [**] Use implicit references for positional format fields | 39 | "{0}".format(*args) 40 | @@ -296,7 +296,7 @@ UP030_0.py:41:1: UP030 [*] Use implicit references for positional format fields 43 43 | "{0}_{1}".format(*args) 44 44 | -UP030_0.py:43:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:43:1: UP030 [**] Use implicit references for positional format fields | 41 | "{0}".format(**kwargs) 42 | @@ -317,7 +317,7 @@ UP030_0.py:43:1: UP030 [*] Use implicit references for positional format fields 45 45 | "{0}_{1}".format(1, *args) 46 46 | -UP030_0.py:45:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:45:1: UP030 [**] Use implicit references for positional format fields | 43 | "{0}_{1}".format(*args) 44 | @@ -338,7 +338,7 @@ UP030_0.py:45:1: UP030 [*] Use implicit references for positional format fields 47 47 | "{0}_{1}".format(1, 2, *args) 48 48 | -UP030_0.py:47:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:47:1: UP030 [**] Use implicit references for positional format fields | 45 | "{0}_{1}".format(1, *args) 46 | @@ -359,7 +359,7 @@ UP030_0.py:47:1: UP030 [*] Use implicit references for positional format fields 49 49 | "{0}_{1}".format(*args, 1, 2) 50 50 | -UP030_0.py:49:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:49:1: UP030 [**] Use implicit references for positional format fields | 47 | "{0}_{1}".format(1, 2, *args) 48 | @@ -380,7 +380,7 @@ UP030_0.py:49:1: UP030 [*] Use implicit references for positional format fields 51 51 | "{0}_{1}_{2}".format(1, **kwargs) 52 52 | -UP030_0.py:51:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:51:1: UP030 [**] Use implicit references for positional format fields | 49 | "{0}_{1}".format(*args, 1, 2) 50 | @@ -401,7 +401,7 @@ UP030_0.py:51:1: UP030 [*] Use implicit references for positional format fields 53 53 | "{0}_{1}_{2}".format(1, 2, **kwargs) 54 54 | -UP030_0.py:53:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:53:1: UP030 [**] Use implicit references for positional format fields | 51 | "{0}_{1}_{2}".format(1, **kwargs) 52 | @@ -422,7 +422,7 @@ UP030_0.py:53:1: UP030 [*] Use implicit references for positional format fields 55 55 | "{0}_{1}_{2}".format(1, 2, 3, **kwargs) 56 56 | -UP030_0.py:55:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:55:1: UP030 [**] Use implicit references for positional format fields | 53 | "{0}_{1}_{2}".format(1, 2, **kwargs) 54 | @@ -443,7 +443,7 @@ UP030_0.py:55:1: UP030 [*] Use implicit references for positional format fields 57 57 | "{0}_{1}_{2}".format(1, 2, 3, *args, **kwargs) 58 58 | -UP030_0.py:57:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:57:1: UP030 [**] Use implicit references for positional format fields | 55 | "{0}_{1}_{2}".format(1, 2, 3, **kwargs) 56 | @@ -464,7 +464,7 @@ UP030_0.py:57:1: UP030 [*] Use implicit references for positional format fields 59 59 | "{1}_{0}".format(1, 2, *args) 60 60 | -UP030_0.py:59:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:59:1: UP030 [**] Use implicit references for positional format fields | 57 | "{0}_{1}_{2}".format(1, 2, 3, *args, **kwargs) 58 | @@ -484,7 +484,7 @@ UP030_0.py:59:1: UP030 [*] Use implicit references for positional format fields 60 60 | 61 61 | "{1}_{0}".format(1, 2) -UP030_0.py:61:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:61:1: UP030 [**] Use implicit references for positional format fields | 59 | "{1}_{0}".format(1, 2, *args) 60 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP031_0.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP031_0.py.snap index 45ed171e744b43..58751746014ae5 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP031_0.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP031_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP031_0.py:4:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:4:7: UP031 [**] Use format specifiers instead of percent format | 3 | # UP031 4 | print('%s %s' % (a, b)) @@ -21,7 +21,7 @@ UP031_0.py:4:7: UP031 [*] Use format specifiers instead of percent format 6 6 | print('%s%s' % (a, b)) 7 7 | -UP031_0.py:6:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:6:7: UP031 [**] Use format specifiers instead of percent format | 4 | print('%s %s' % (a, b)) 5 | @@ -42,7 +42,7 @@ UP031_0.py:6:7: UP031 [*] Use format specifiers instead of percent format 8 8 | print("trivial" % ()) 9 9 | -UP031_0.py:8:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:8:7: UP031 [**] Use format specifiers instead of percent format | 6 | print('%s%s' % (a, b)) 7 | @@ -63,7 +63,7 @@ UP031_0.py:8:7: UP031 [*] Use format specifiers instead of percent format 10 10 | print("%s" % ("simple",)) 11 11 | -UP031_0.py:10:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:10:7: UP031 [**] Use format specifiers instead of percent format | 8 | print("trivial" % ()) 9 | @@ -84,7 +84,7 @@ UP031_0.py:10:7: UP031 [*] Use format specifiers instead of percent format 12 12 | print("%s" % ("%s" % ("nested",),)) 13 13 | -UP031_0.py:12:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:12:7: UP031 [**] Use format specifiers instead of percent format | 10 | print("%s" % ("simple",)) 11 | @@ -105,7 +105,7 @@ UP031_0.py:12:7: UP031 [*] Use format specifiers instead of percent format 14 14 | print("%s%% percent" % (15,)) 15 15 | -UP031_0.py:12:15: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:12:15: UP031 [**] Use format specifiers instead of percent format | 10 | print("%s" % ("simple",)) 11 | @@ -126,7 +126,7 @@ UP031_0.py:12:15: UP031 [*] Use format specifiers instead of percent format 14 14 | print("%s%% percent" % (15,)) 15 15 | -UP031_0.py:14:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:14:7: UP031 [**] Use format specifiers instead of percent format | 12 | print("%s" % ("%s" % ("nested",),)) 13 | @@ -147,7 +147,7 @@ UP031_0.py:14:7: UP031 [*] Use format specifiers instead of percent format 16 16 | print("%f" % (15,)) 17 17 | -UP031_0.py:16:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:16:7: UP031 [**] Use format specifiers instead of percent format | 14 | print("%s%% percent" % (15,)) 15 | @@ -168,7 +168,7 @@ UP031_0.py:16:7: UP031 [*] Use format specifiers instead of percent format 18 18 | print("%.f" % (15,)) 19 19 | -UP031_0.py:18:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:18:7: UP031 [**] Use format specifiers instead of percent format | 16 | print("%f" % (15,)) 17 | @@ -189,7 +189,7 @@ UP031_0.py:18:7: UP031 [*] Use format specifiers instead of percent format 20 20 | print("%.3f" % (15,)) 21 21 | -UP031_0.py:20:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:20:7: UP031 [**] Use format specifiers instead of percent format | 18 | print("%.f" % (15,)) 19 | @@ -210,7 +210,7 @@ UP031_0.py:20:7: UP031 [*] Use format specifiers instead of percent format 22 22 | print("%3f" % (15,)) 23 23 | -UP031_0.py:22:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:22:7: UP031 [**] Use format specifiers instead of percent format | 20 | print("%.3f" % (15,)) 21 | @@ -231,7 +231,7 @@ UP031_0.py:22:7: UP031 [*] Use format specifiers instead of percent format 24 24 | print("%-5f" % (5,)) 25 25 | -UP031_0.py:24:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:24:7: UP031 [**] Use format specifiers instead of percent format | 22 | print("%3f" % (15,)) 23 | @@ -252,7 +252,7 @@ UP031_0.py:24:7: UP031 [*] Use format specifiers instead of percent format 26 26 | print("%9f" % (5,)) 27 27 | -UP031_0.py:26:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:26:7: UP031 [**] Use format specifiers instead of percent format | 24 | print("%-5f" % (5,)) 25 | @@ -273,7 +273,7 @@ UP031_0.py:26:7: UP031 [*] Use format specifiers instead of percent format 28 28 | print("%#o" % (123,)) 29 29 | -UP031_0.py:28:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:28:7: UP031 [**] Use format specifiers instead of percent format | 26 | print("%9f" % (5,)) 27 | @@ -294,7 +294,7 @@ UP031_0.py:28:7: UP031 [*] Use format specifiers instead of percent format 30 30 | print("brace {} %s" % (1,)) 31 31 | -UP031_0.py:30:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:30:7: UP031 [**] Use format specifiers instead of percent format | 28 | print("%#o" % (123,)) 29 | @@ -315,7 +315,7 @@ UP031_0.py:30:7: UP031 [*] Use format specifiers instead of percent format 32 32 | print( 33 33 | "%s" % ( -UP031_0.py:33:3: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:33:3: UP031 [**] Use format specifiers instead of percent format | 32 | print( 33 | "%s" % ( @@ -337,7 +337,7 @@ UP031_0.py:33:3: UP031 [*] Use format specifiers instead of percent format 35 35 | ) 36 36 | ) -UP031_0.py:38:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:38:7: UP031 [**] Use format specifiers instead of percent format | 36 | ) 37 | @@ -358,7 +358,7 @@ UP031_0.py:38:7: UP031 [*] Use format specifiers instead of percent format 40 40 | print("%(k)s" % {"k": "v"}) 41 41 | -UP031_0.py:40:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:40:7: UP031 [**] Use format specifiers instead of percent format | 38 | print("foo %s " % (x,)) 39 | @@ -379,7 +379,7 @@ UP031_0.py:40:7: UP031 [*] Use format specifiers instead of percent format 42 42 | print("%(k)s" % { 43 43 | "k": "v", -UP031_0.py:42:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:42:7: UP031 [**] Use format specifiers instead of percent format | 40 | print("%(k)s" % {"k": "v"}) 41 | @@ -410,7 +410,7 @@ UP031_0.py:42:7: UP031 [*] Use format specifiers instead of percent format 47 47 | print("%(to_list)s" % {"to_list": []}) 48 48 | -UP031_0.py:47:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:47:7: UP031 [**] Use format specifiers instead of percent format | 45 | }) 46 | @@ -431,7 +431,7 @@ UP031_0.py:47:7: UP031 [*] Use format specifiers instead of percent format 49 49 | print("%(k)s" % {"k": "v", "i": 1, "j": []}) 50 50 | -UP031_0.py:49:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:49:7: UP031 [**] Use format specifiers instead of percent format | 47 | print("%(to_list)s" % {"to_list": []}) 48 | @@ -452,7 +452,7 @@ UP031_0.py:49:7: UP031 [*] Use format specifiers instead of percent format 51 51 | print("%(ab)s" % {"a" "b": 1}) 52 52 | -UP031_0.py:51:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:51:7: UP031 [**] Use format specifiers instead of percent format | 49 | print("%(k)s" % {"k": "v", "i": 1, "j": []}) 50 | @@ -473,7 +473,7 @@ UP031_0.py:51:7: UP031 [*] Use format specifiers instead of percent format 53 53 | print("%(a)s" % {"a" : 1}) 54 54 | -UP031_0.py:53:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:53:7: UP031 [**] Use format specifiers instead of percent format | 51 | print("%(ab)s" % {"a" "b": 1}) 52 | @@ -494,7 +494,7 @@ UP031_0.py:53:7: UP031 [*] Use format specifiers instead of percent format 55 55 | print(( 56 56 | "foo %s " -UP031_0.py:56:5: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:56:5: UP031 [**] Use format specifiers instead of percent format | 55 | print(( 56 | "foo %s " @@ -517,7 +517,7 @@ UP031_0.py:56:5: UP031 [*] Use format specifiers instead of percent format 59 59 | 60 60 | print( -UP031_0.py:61:5: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:61:5: UP031 [**] Use format specifiers instead of percent format | 60 | print( 61 | "foo %(foo)s " @@ -540,7 +540,7 @@ UP031_0.py:61:5: UP031 [*] Use format specifiers instead of percent format 64 64 | 65 65 | bar = {"bar": y} -UP031_0.py:67:5: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:67:5: UP031 [**] Use format specifiers instead of percent format | 65 | bar = {"bar": y} 66 | print( @@ -564,7 +564,7 @@ UP031_0.py:67:5: UP031 [*] Use format specifiers instead of percent format 70 70 | 71 71 | print("%s \N{snowman}" % (a,)) -UP031_0.py:71:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:71:7: UP031 [**] Use format specifiers instead of percent format | 69 | ) 70 | @@ -585,7 +585,7 @@ UP031_0.py:71:7: UP031 [*] Use format specifiers instead of percent format 73 73 | print("%(foo)s \N{snowman}" % {"foo": 1}) 74 74 | -UP031_0.py:73:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:73:7: UP031 [**] Use format specifiers instead of percent format | 71 | print("%s \N{snowman}" % (a,)) 72 | @@ -606,7 +606,7 @@ UP031_0.py:73:7: UP031 [*] Use format specifiers instead of percent format 75 75 | print(("foo %s " "bar %s") % (x, y)) 76 76 | -UP031_0.py:75:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:75:7: UP031 [**] Use format specifiers instead of percent format | 73 | print("%(foo)s \N{snowman}" % {"foo": 1}) 74 | @@ -627,7 +627,7 @@ UP031_0.py:75:7: UP031 [*] Use format specifiers instead of percent format 77 77 | # Single-value expressions 78 78 | print('Hello %s' % "World") -UP031_0.py:78:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:78:7: UP031 [**] Use format specifiers instead of percent format | 77 | # Single-value expressions 78 | print('Hello %s' % "World") @@ -647,7 +647,7 @@ UP031_0.py:78:7: UP031 [*] Use format specifiers instead of percent format 80 80 | print('Hello %s (%s)' % bar) 81 81 | print('Hello %s (%s)' % bar.baz) -UP031_0.py:79:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:79:7: UP031 [**] Use format specifiers instead of percent format | 77 | # Single-value expressions 78 | print('Hello %s' % "World") @@ -668,7 +668,7 @@ UP031_0.py:79:7: UP031 [*] Use format specifiers instead of percent format 81 81 | print('Hello %s (%s)' % bar.baz) 82 82 | print('Hello %s (%s)' % bar['bop']) -UP031_0.py:80:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:80:7: UP031 [**] Use format specifiers instead of percent format | 78 | print('Hello %s' % "World") 79 | print('Hello %s' % f"World") @@ -689,7 +689,7 @@ UP031_0.py:80:7: UP031 [*] Use format specifiers instead of percent format 82 82 | print('Hello %s (%s)' % bar['bop']) 83 83 | print('Hello %(arg)s' % bar) -UP031_0.py:81:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:81:7: UP031 [**] Use format specifiers instead of percent format | 79 | print('Hello %s' % f"World") 80 | print('Hello %s (%s)' % bar) @@ -710,7 +710,7 @@ UP031_0.py:81:7: UP031 [*] Use format specifiers instead of percent format 83 83 | print('Hello %(arg)s' % bar) 84 84 | print('Hello %(arg)s' % bar.baz) -UP031_0.py:82:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:82:7: UP031 [**] Use format specifiers instead of percent format | 80 | print('Hello %s (%s)' % bar) 81 | print('Hello %s (%s)' % bar.baz) @@ -731,7 +731,7 @@ UP031_0.py:82:7: UP031 [*] Use format specifiers instead of percent format 84 84 | print('Hello %(arg)s' % bar.baz) 85 85 | print('Hello %(arg)s' % bar['bop']) -UP031_0.py:83:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:83:7: UP031 [**] Use format specifiers instead of percent format | 81 | print('Hello %s (%s)' % bar.baz) 82 | print('Hello %s (%s)' % bar['bop']) @@ -752,7 +752,7 @@ UP031_0.py:83:7: UP031 [*] Use format specifiers instead of percent format 85 85 | print('Hello %(arg)s' % bar['bop']) 86 86 | -UP031_0.py:84:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:84:7: UP031 [**] Use format specifiers instead of percent format | 82 | print('Hello %s (%s)' % bar['bop']) 83 | print('Hello %(arg)s' % bar) @@ -772,7 +772,7 @@ UP031_0.py:84:7: UP031 [*] Use format specifiers instead of percent format 86 86 | 87 87 | # Hanging modulos -UP031_0.py:85:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:85:7: UP031 [**] Use format specifiers instead of percent format | 83 | print('Hello %(arg)s' % bar) 84 | print('Hello %(arg)s' % bar.baz) @@ -793,7 +793,7 @@ UP031_0.py:85:7: UP031 [*] Use format specifiers instead of percent format 87 87 | # Hanging modulos 88 88 | ( -UP031_0.py:88:1: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:88:1: UP031 [**] Use format specifiers instead of percent format | 87 | # Hanging modulos 88 | / ( @@ -820,7 +820,7 @@ UP031_0.py:88:1: UP031 [*] Use format specifiers instead of percent format 93 93 | ( 94 94 | "foo %(foo)s " -UP031_0.py:93:1: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:93:1: UP031 [**] Use format specifiers instead of percent format | 91 | ) % (x, y) 92 | @@ -848,7 +848,7 @@ UP031_0.py:93:1: UP031 [*] Use format specifiers instead of percent format 98 98 | ( 99 99 | """foo %s""" -UP031_0.py:99:5: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:99:5: UP031 [**] Use format specifiers instead of percent format | 98 | ( 99 | """foo %s""" @@ -870,7 +870,7 @@ UP031_0.py:99:5: UP031 [*] Use format specifiers instead of percent format 102 101 | 103 102 | ( -UP031_0.py:104:5: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:104:5: UP031 [**] Use format specifiers instead of percent format | 103 | ( 104 | """ diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_0.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_0.py.snap index 8771bfd691ac23..51b045dc87c335 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_0.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP032_0.py:5:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:5:1: UP032 [**] Use f-string instead of `format` call | 3 | ### 4 | @@ -22,7 +22,7 @@ UP032_0.py:5:1: UP032 [*] Use f-string instead of `format` call 7 7 | "{1} {0}".format(a, b) 8 8 | -UP032_0.py:7:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:7:1: UP032 [**] Use f-string instead of `format` call | 5 | "{} {}".format(a, b) 6 | @@ -43,7 +43,7 @@ UP032_0.py:7:1: UP032 [*] Use f-string instead of `format` call 9 9 | "{0} {1} {0}".format(a, b) 10 10 | -UP032_0.py:9:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:9:1: UP032 [**] Use f-string instead of `format` call | 7 | "{1} {0}".format(a, b) 8 | @@ -64,7 +64,7 @@ UP032_0.py:9:1: UP032 [*] Use f-string instead of `format` call 11 11 | "{x.y}".format(x=z) 12 12 | -UP032_0.py:11:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:11:1: UP032 [**] Use f-string instead of `format` call | 9 | "{0} {1} {0}".format(a, b) 10 | @@ -85,7 +85,7 @@ UP032_0.py:11:1: UP032 [*] Use f-string instead of `format` call 13 13 | "{x} {y} {x}".format(x=a, y=b) 14 14 | -UP032_0.py:13:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:13:1: UP032 [**] Use f-string instead of `format` call | 11 | "{x.y}".format(x=z) 12 | @@ -106,7 +106,7 @@ UP032_0.py:13:1: UP032 [*] Use f-string instead of `format` call 15 15 | "{.x} {.y}".format(a, b) 16 16 | -UP032_0.py:15:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:15:1: UP032 [**] Use f-string instead of `format` call | 13 | "{x} {y} {x}".format(x=a, y=b) 14 | @@ -127,7 +127,7 @@ UP032_0.py:15:1: UP032 [*] Use f-string instead of `format` call 17 17 | "{} {}".format(a.b, c.d) 18 18 | -UP032_0.py:17:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:17:1: UP032 [**] Use f-string instead of `format` call | 15 | "{.x} {.y}".format(a, b) 16 | @@ -148,7 +148,7 @@ UP032_0.py:17:1: UP032 [*] Use f-string instead of `format` call 19 19 | "{}".format(a()) 20 20 | -UP032_0.py:19:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:19:1: UP032 [**] Use f-string instead of `format` call | 17 | "{} {}".format(a.b, c.d) 18 | @@ -169,7 +169,7 @@ UP032_0.py:19:1: UP032 [*] Use f-string instead of `format` call 21 21 | "{}".format(a.b()) 22 22 | -UP032_0.py:21:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:21:1: UP032 [**] Use f-string instead of `format` call | 19 | "{}".format(a()) 20 | @@ -190,7 +190,7 @@ UP032_0.py:21:1: UP032 [*] Use f-string instead of `format` call 23 23 | "{}".format(a.b().c()) 24 24 | -UP032_0.py:23:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:23:1: UP032 [**] Use f-string instead of `format` call | 21 | "{}".format(a.b()) 22 | @@ -211,7 +211,7 @@ UP032_0.py:23:1: UP032 [*] Use f-string instead of `format` call 25 25 | "hello {}!".format(name) 26 26 | -UP032_0.py:25:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:25:1: UP032 [**] Use f-string instead of `format` call | 23 | "{}".format(a.b().c()) 24 | @@ -232,7 +232,7 @@ UP032_0.py:25:1: UP032 [*] Use f-string instead of `format` call 27 27 | "{}{b}{}".format(a, c, b=b) 28 28 | -UP032_0.py:27:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:27:1: UP032 [**] Use f-string instead of `format` call | 25 | "hello {}!".format(name) 26 | @@ -253,7 +253,7 @@ UP032_0.py:27:1: UP032 [*] Use f-string instead of `format` call 29 29 | "{}".format(0x0) 30 30 | -UP032_0.py:29:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:29:1: UP032 [**] Use f-string instead of `format` call | 27 | "{}{b}{}".format(a, c, b=b) 28 | @@ -274,7 +274,7 @@ UP032_0.py:29:1: UP032 [*] Use f-string instead of `format` call 31 31 | "{} {}".format(a, b) 32 32 | -UP032_0.py:31:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:31:1: UP032 [**] Use f-string instead of `format` call | 29 | "{}".format(0x0) 30 | @@ -295,7 +295,7 @@ UP032_0.py:31:1: UP032 [*] Use f-string instead of `format` call 33 33 | """{} {}""".format(a, b) 34 34 | -UP032_0.py:33:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:33:1: UP032 [**] Use f-string instead of `format` call | 31 | "{} {}".format(a, b) 32 | @@ -316,7 +316,7 @@ UP032_0.py:33:1: UP032 [*] Use f-string instead of `format` call 35 35 | "foo{}".format(1) 36 36 | -UP032_0.py:35:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:35:1: UP032 [**] Use f-string instead of `format` call | 33 | """{} {}""".format(a, b) 34 | @@ -337,7 +337,7 @@ UP032_0.py:35:1: UP032 [*] Use f-string instead of `format` call 37 37 | r"foo{}".format(1) 38 38 | -UP032_0.py:37:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:37:1: UP032 [**] Use f-string instead of `format` call | 35 | "foo{}".format(1) 36 | @@ -358,7 +358,7 @@ UP032_0.py:37:1: UP032 [*] Use f-string instead of `format` call 39 39 | x = "{a}".format(a=1) 40 40 | -UP032_0.py:39:5: UP032 [*] Use f-string instead of `format` call +UP032_0.py:39:5: UP032 [**] Use f-string instead of `format` call | 37 | r"foo{}".format(1) 38 | @@ -379,7 +379,7 @@ UP032_0.py:39:5: UP032 [*] Use f-string instead of `format` call 41 41 | print("foo {} ".format(x)) 42 42 | -UP032_0.py:41:7: UP032 [*] Use f-string instead of `format` call +UP032_0.py:41:7: UP032 [**] Use f-string instead of `format` call | 39 | x = "{a}".format(a=1) 40 | @@ -400,7 +400,7 @@ UP032_0.py:41:7: UP032 [*] Use f-string instead of `format` call 43 43 | "{a[b]}".format(a=a) 44 44 | -UP032_0.py:43:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:43:1: UP032 [**] Use f-string instead of `format` call | 41 | print("foo {} ".format(x)) 42 | @@ -421,7 +421,7 @@ UP032_0.py:43:1: UP032 [*] Use f-string instead of `format` call 45 45 | "{a.a[b]}".format(a=a) 46 46 | -UP032_0.py:45:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:45:1: UP032 [**] Use f-string instead of `format` call | 43 | "{a[b]}".format(a=a) 44 | @@ -442,7 +442,7 @@ UP032_0.py:45:1: UP032 [*] Use f-string instead of `format` call 47 47 | "{}{{}}{}".format(escaped, y) 48 48 | -UP032_0.py:47:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:47:1: UP032 [**] Use f-string instead of `format` call | 45 | "{a.a[b]}".format(a=a) 46 | @@ -463,7 +463,7 @@ UP032_0.py:47:1: UP032 [*] Use f-string instead of `format` call 49 49 | "{}".format(a) 50 50 | -UP032_0.py:49:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:49:1: UP032 [**] Use f-string instead of `format` call | 47 | "{}{{}}{}".format(escaped, y) 48 | @@ -484,7 +484,7 @@ UP032_0.py:49:1: UP032 [*] Use f-string instead of `format` call 51 51 | '({}={{0!e}})'.format(a) 52 52 | -UP032_0.py:51:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:51:1: UP032 [**] Use f-string instead of `format` call | 49 | "{}".format(a) 50 | @@ -505,7 +505,7 @@ UP032_0.py:51:1: UP032 [*] Use f-string instead of `format` call 53 53 | "{[b]}".format(a) 54 54 | -UP032_0.py:53:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:53:1: UP032 [**] Use f-string instead of `format` call | 51 | '({}={{0!e}})'.format(a) 52 | @@ -526,7 +526,7 @@ UP032_0.py:53:1: UP032 [*] Use f-string instead of `format` call 55 55 | '{[b]}'.format(a) 56 56 | -UP032_0.py:55:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:55:1: UP032 [**] Use f-string instead of `format` call | 53 | "{[b]}".format(a) 54 | @@ -547,7 +547,7 @@ UP032_0.py:55:1: UP032 [*] Use f-string instead of `format` call 57 57 | """{[b]}""".format(a) 58 58 | -UP032_0.py:57:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:57:1: UP032 [**] Use f-string instead of `format` call | 55 | '{[b]}'.format(a) 56 | @@ -568,7 +568,7 @@ UP032_0.py:57:1: UP032 [*] Use f-string instead of `format` call 59 59 | '''{[b]}'''.format(a) 60 60 | -UP032_0.py:59:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:59:1: UP032 [**] Use f-string instead of `format` call | 57 | """{[b]}""".format(a) 58 | @@ -589,7 +589,7 @@ UP032_0.py:59:1: UP032 [*] Use f-string instead of `format` call 61 61 | "{}".format( 62 62 | 1 -UP032_0.py:61:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:61:1: UP032 [**] Use f-string instead of `format` call | 59 | '''{[b]}'''.format(a) 60 | @@ -614,7 +614,7 @@ UP032_0.py:61:1: UP032 [*] Use f-string instead of `format` call 65 63 | "123456789 {}".format( 66 64 | 1111111111111111111111111111111111111111111111111111111111111111111111111, -UP032_0.py:65:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:65:1: UP032 [**] Use f-string instead of `format` call | 63 | ) 64 | @@ -639,7 +639,7 @@ UP032_0.py:65:1: UP032 [*] Use f-string instead of `format` call 69 67 | """ 70 68 | {} -UP032_0.py:69:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:69:1: UP032 [**] Use f-string instead of `format` call | 67 | ) 68 | @@ -665,7 +665,7 @@ UP032_0.py:69:1: UP032 [*] Use f-string instead of `format` call 73 73 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = """ 74 74 | {} -UP032_0.py:73:85: UP032 [*] Use f-string instead of `format` call +UP032_0.py:73:85: UP032 [**] Use f-string instead of `format` call | 71 | """.format(1) 72 | @@ -697,7 +697,7 @@ UP032_0.py:73:85: UP032 [*] Use f-string instead of `format` call 79 77 | "{a}" "{b}".format(a=1, b=1) 80 78 | -UP032_0.py:79:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:79:1: UP032 [**] Use f-string instead of `format` call | 77 | ) 78 | @@ -718,7 +718,7 @@ UP032_0.py:79:1: UP032 [*] Use f-string instead of `format` call 81 81 | ( 82 82 | "{a}" -UP032_0.py:81:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:81:1: UP032 [**] Use f-string instead of `format` call | 79 | "{a}" "{b}".format(a=1, b=1) 80 | @@ -746,7 +746,7 @@ UP032_0.py:81:1: UP032 [*] Use f-string instead of `format` call 86 86 | ( 87 87 | "{a}" -UP032_0.py:86:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:86:1: UP032 [**] Use f-string instead of `format` call | 84 | ).format(a=1, b=1) 85 | @@ -778,7 +778,7 @@ UP032_0.py:86:1: UP032 [*] Use f-string instead of `format` call 93 93 | ( 94 94 | ( -UP032_0.py:94:5: UP032 [*] Use f-string instead of `format` call +UP032_0.py:94:5: UP032 [**] Use f-string instead of `format` call | 93 | ( 94 | ( @@ -812,7 +812,7 @@ UP032_0.py:94:5: UP032 [*] Use f-string instead of `format` call 103 103 | 104 104 | ( -UP032_0.py:104:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:104:1: UP032 [**] Use f-string instead of `format` call | 102 | ) 103 | @@ -837,7 +837,7 @@ UP032_0.py:104:1: UP032 [*] Use f-string instead of `format` call 109 109 | 110 110 | def d(osname, version, release): -UP032_0.py:111:11: UP032 [*] Use f-string instead of `format` call +UP032_0.py:111:11: UP032 [**] Use f-string instead of `format` call | 110 | def d(osname, version, release): 111 | return"{}-{}.{}".format(osname, version, release) @@ -855,7 +855,7 @@ UP032_0.py:111:11: UP032 [*] Use f-string instead of `format` call 113 113 | 114 114 | def e(): -UP032_0.py:115:10: UP032 [*] Use f-string instead of `format` call +UP032_0.py:115:10: UP032 [**] Use f-string instead of `format` call | 114 | def e(): 115 | yield"{}".format(1) @@ -873,7 +873,7 @@ UP032_0.py:115:10: UP032 [*] Use f-string instead of `format` call 117 117 | 118 118 | assert"{}".format(1) -UP032_0.py:118:7: UP032 [*] Use f-string instead of `format` call +UP032_0.py:118:7: UP032 [**] Use f-string instead of `format` call | 118 | assert"{}".format(1) | ^^^^^^^^^^^^^^ UP032 @@ -890,7 +890,7 @@ UP032_0.py:118:7: UP032 [*] Use f-string instead of `format` call 120 120 | 121 121 | async def c(): -UP032_0.py:122:12: UP032 [*] Use f-string instead of `format` call +UP032_0.py:122:12: UP032 [**] Use f-string instead of `format` call | 121 | async def c(): 122 | return "{}".format(await 3) @@ -908,7 +908,7 @@ UP032_0.py:122:12: UP032 [*] Use f-string instead of `format` call 124 124 | 125 125 | async def c(): -UP032_0.py:126:12: UP032 [*] Use f-string instead of `format` call +UP032_0.py:126:12: UP032 [**] Use f-string instead of `format` call | 125 | async def c(): 126 | return "{}".format(1 + await 3) @@ -926,7 +926,7 @@ UP032_0.py:126:12: UP032 [*] Use f-string instead of `format` call 128 128 | 129 129 | "{}".format(1 * 2) -UP032_0.py:129:1: UP032 [*] Use f-string instead of `format` call +UP032_0.py:129:1: UP032 [**] Use f-string instead of `format` call | 129 | "{}".format(1 * 2) | ^^^^^^^^^^^^^^^^^^ UP032 diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_1.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_1.py.snap index 1d879bf62a1ec0..4c9b55db80c815 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_1.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP032_1.py:1:1: UP032 [*] Use f-string instead of `format` call +UP032_1.py:1:1: UP032 [**] Use f-string instead of `format` call | 1 | "{} {}".format(a, b) # Intentionally at start-of-file, to ensure graceful handling. | ^^^^^^^^^^^^^^^^^^^^ UP032 diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_2.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_2.py.snap index 5751783cf76ab2..0dbb9b0d745d5f 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_2.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP032_2.py:2:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:2:1: UP032 [**] Use f-string instead of `format` call | 1 | # Errors 2 | "{.real}".format(1) @@ -19,7 +19,7 @@ UP032_2.py:2:1: UP032 [*] Use f-string instead of `format` call 4 4 | "{a.real}".format(a=1) 5 5 | -UP032_2.py:3:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:3:1: UP032 [**] Use f-string instead of `format` call | 1 | # Errors 2 | "{.real}".format(1) @@ -38,7 +38,7 @@ UP032_2.py:3:1: UP032 [*] Use f-string instead of `format` call 5 5 | 6 6 | "{.real}".format(1.0) -UP032_2.py:4:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:4:1: UP032 [**] Use f-string instead of `format` call | 2 | "{.real}".format(1) 3 | "{0.real}".format(1) @@ -59,7 +59,7 @@ UP032_2.py:4:1: UP032 [*] Use f-string instead of `format` call 6 6 | "{.real}".format(1.0) 7 7 | "{0.real}".format(1.0) -UP032_2.py:6:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:6:1: UP032 [**] Use f-string instead of `format` call | 4 | "{a.real}".format(a=1) 5 | @@ -80,7 +80,7 @@ UP032_2.py:6:1: UP032 [*] Use f-string instead of `format` call 8 8 | "{a.real}".format(a=1.0) 9 9 | -UP032_2.py:7:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:7:1: UP032 [**] Use f-string instead of `format` call | 6 | "{.real}".format(1.0) 7 | "{0.real}".format(1.0) @@ -99,7 +99,7 @@ UP032_2.py:7:1: UP032 [*] Use f-string instead of `format` call 9 9 | 10 10 | "{.real}".format(1j) -UP032_2.py:8:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:8:1: UP032 [**] Use f-string instead of `format` call | 6 | "{.real}".format(1.0) 7 | "{0.real}".format(1.0) @@ -120,7 +120,7 @@ UP032_2.py:8:1: UP032 [*] Use f-string instead of `format` call 10 10 | "{.real}".format(1j) 11 11 | "{0.real}".format(1j) -UP032_2.py:10:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:10:1: UP032 [**] Use f-string instead of `format` call | 8 | "{a.real}".format(a=1.0) 9 | @@ -141,7 +141,7 @@ UP032_2.py:10:1: UP032 [*] Use f-string instead of `format` call 12 12 | "{a.real}".format(a=1j) 13 13 | -UP032_2.py:11:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:11:1: UP032 [**] Use f-string instead of `format` call | 10 | "{.real}".format(1j) 11 | "{0.real}".format(1j) @@ -160,7 +160,7 @@ UP032_2.py:11:1: UP032 [*] Use f-string instead of `format` call 13 13 | 14 14 | "{.real}".format(0b01) -UP032_2.py:12:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:12:1: UP032 [**] Use f-string instead of `format` call | 10 | "{.real}".format(1j) 11 | "{0.real}".format(1j) @@ -181,7 +181,7 @@ UP032_2.py:12:1: UP032 [*] Use f-string instead of `format` call 14 14 | "{.real}".format(0b01) 15 15 | "{0.real}".format(0b01) -UP032_2.py:14:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:14:1: UP032 [**] Use f-string instead of `format` call | 12 | "{a.real}".format(a=1j) 13 | @@ -202,7 +202,7 @@ UP032_2.py:14:1: UP032 [*] Use f-string instead of `format` call 16 16 | "{a.real}".format(a=0b01) 17 17 | -UP032_2.py:15:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:15:1: UP032 [**] Use f-string instead of `format` call | 14 | "{.real}".format(0b01) 15 | "{0.real}".format(0b01) @@ -221,7 +221,7 @@ UP032_2.py:15:1: UP032 [*] Use f-string instead of `format` call 17 17 | 18 18 | "{}".format(1 + 2) -UP032_2.py:16:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:16:1: UP032 [**] Use f-string instead of `format` call | 14 | "{.real}".format(0b01) 15 | "{0.real}".format(0b01) @@ -242,7 +242,7 @@ UP032_2.py:16:1: UP032 [*] Use f-string instead of `format` call 18 18 | "{}".format(1 + 2) 19 19 | "{}".format([1, 2]) -UP032_2.py:18:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:18:1: UP032 [**] Use f-string instead of `format` call | 16 | "{a.real}".format(a=0b01) 17 | @@ -263,7 +263,7 @@ UP032_2.py:18:1: UP032 [*] Use f-string instead of `format` call 20 20 | "{}".format({1, 2}) 21 21 | "{}".format({1: 2, 3: 4}) -UP032_2.py:19:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:19:1: UP032 [**] Use f-string instead of `format` call | 18 | "{}".format(1 + 2) 19 | "{}".format([1, 2]) @@ -283,7 +283,7 @@ UP032_2.py:19:1: UP032 [*] Use f-string instead of `format` call 21 21 | "{}".format({1: 2, 3: 4}) 22 22 | "{}".format((i for i in range(2))) -UP032_2.py:20:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:20:1: UP032 [**] Use f-string instead of `format` call | 18 | "{}".format(1 + 2) 19 | "{}".format([1, 2]) @@ -304,7 +304,7 @@ UP032_2.py:20:1: UP032 [*] Use f-string instead of `format` call 22 22 | "{}".format((i for i in range(2))) 23 23 | -UP032_2.py:21:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:21:1: UP032 [**] Use f-string instead of `format` call | 19 | "{}".format([1, 2]) 20 | "{}".format({1, 2}) @@ -324,7 +324,7 @@ UP032_2.py:21:1: UP032 [*] Use f-string instead of `format` call 23 23 | 24 24 | "{.real}".format(1 + 2) -UP032_2.py:22:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:22:1: UP032 [**] Use f-string instead of `format` call | 20 | "{}".format({1, 2}) 21 | "{}".format({1: 2, 3: 4}) @@ -345,7 +345,7 @@ UP032_2.py:22:1: UP032 [*] Use f-string instead of `format` call 24 24 | "{.real}".format(1 + 2) 25 25 | "{.real}".format([1, 2]) -UP032_2.py:24:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:24:1: UP032 [**] Use f-string instead of `format` call | 22 | "{}".format((i for i in range(2))) 23 | @@ -366,7 +366,7 @@ UP032_2.py:24:1: UP032 [*] Use f-string instead of `format` call 26 26 | "{.real}".format({1, 2}) 27 27 | "{.real}".format({1: 2, 3: 4}) -UP032_2.py:25:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:25:1: UP032 [**] Use f-string instead of `format` call | 24 | "{.real}".format(1 + 2) 25 | "{.real}".format([1, 2]) @@ -386,7 +386,7 @@ UP032_2.py:25:1: UP032 [*] Use f-string instead of `format` call 27 27 | "{.real}".format({1: 2, 3: 4}) 28 28 | "{}".format((i for i in range(2))) -UP032_2.py:26:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:26:1: UP032 [**] Use f-string instead of `format` call | 24 | "{.real}".format(1 + 2) 25 | "{.real}".format([1, 2]) @@ -406,7 +406,7 @@ UP032_2.py:26:1: UP032 [*] Use f-string instead of `format` call 27 27 | "{.real}".format({1: 2, 3: 4}) 28 28 | "{}".format((i for i in range(2))) -UP032_2.py:27:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:27:1: UP032 [**] Use f-string instead of `format` call | 25 | "{.real}".format([1, 2]) 26 | "{.real}".format({1, 2}) @@ -424,7 +424,7 @@ UP032_2.py:27:1: UP032 [*] Use f-string instead of `format` call 27 |+f"{({1: 2, 3: 4}).real}" 28 28 | "{}".format((i for i in range(2))) -UP032_2.py:28:1: UP032 [*] Use f-string instead of `format` call +UP032_2.py:28:1: UP032 [**] Use f-string instead of `format` call | 26 | "{.real}".format({1, 2}) 27 | "{.real}".format({1: 2, 3: 4}) diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP035.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP035.py.snap index 4f8c750737ee2e..ac70395f62ac41 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP035.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP035.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP035.py:2:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:2:1: UP035 [**] Import from `collections.abc` instead: `Mapping` | 1 | # UP035 2 | from collections import Mapping @@ -19,7 +19,7 @@ UP035.py:2:1: UP035 [*] Import from `collections.abc` instead: `Mapping` 4 4 | from collections import Mapping as MAP 5 5 | -UP035.py:4:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:4:1: UP035 [**] Import from `collections.abc` instead: `Mapping` | 2 | from collections import Mapping 3 | @@ -40,7 +40,7 @@ UP035.py:4:1: UP035 [*] Import from `collections.abc` instead: `Mapping` 6 6 | from collections import Mapping, Sequence 7 7 | -UP035.py:6:1: UP035 [*] Import from `collections.abc` instead: `Mapping`, `Sequence` +UP035.py:6:1: UP035 [**] Import from `collections.abc` instead: `Mapping`, `Sequence` | 4 | from collections import Mapping as MAP 5 | @@ -61,7 +61,7 @@ UP035.py:6:1: UP035 [*] Import from `collections.abc` instead: `Mapping`, `Seque 8 8 | from collections import Counter, Mapping 9 9 | -UP035.py:8:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:8:1: UP035 [**] Import from `collections.abc` instead: `Mapping` | 6 | from collections import Mapping, Sequence 7 | @@ -83,7 +83,7 @@ UP035.py:8:1: UP035 [*] Import from `collections.abc` instead: `Mapping` 10 11 | from collections import (Counter, Mapping) 11 12 | -UP035.py:10:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:10:1: UP035 [**] Import from `collections.abc` instead: `Mapping` | 8 | from collections import Counter, Mapping 9 | @@ -105,7 +105,7 @@ UP035.py:10:1: UP035 [*] Import from `collections.abc` instead: `Mapping` 12 13 | from collections import (Counter, 13 14 | Mapping) -UP035.py:12:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:12:1: UP035 [**] Import from `collections.abc` instead: `Mapping` | 10 | from collections import (Counter, Mapping) 11 | @@ -129,7 +129,7 @@ UP035.py:12:1: UP035 [*] Import from `collections.abc` instead: `Mapping` 15 15 | from collections import Counter, \ 16 16 | Mapping -UP035.py:15:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:15:1: UP035 [**] Import from `collections.abc` instead: `Mapping` | 13 | Mapping) 14 | @@ -153,7 +153,7 @@ UP035.py:15:1: UP035 [*] Import from `collections.abc` instead: `Mapping` 18 18 | from collections import Counter, Mapping, Sequence 19 19 | -UP035.py:18:1: UP035 [*] Import from `collections.abc` instead: `Mapping`, `Sequence` +UP035.py:18:1: UP035 [**] Import from `collections.abc` instead: `Mapping`, `Sequence` | 16 | Mapping 17 | @@ -175,7 +175,7 @@ UP035.py:18:1: UP035 [*] Import from `collections.abc` instead: `Mapping`, `Sequ 20 21 | from collections import Mapping as mapping, Counter 21 22 | -UP035.py:20:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:20:1: UP035 [**] Import from `collections.abc` instead: `Mapping` | 18 | from collections import Counter, Mapping, Sequence 19 | @@ -197,7 +197,7 @@ UP035.py:20:1: UP035 [*] Import from `collections.abc` instead: `Mapping` 22 23 | if True: 23 24 | from collections import Mapping, Counter -UP035.py:23:5: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:23:5: UP035 [**] Import from `collections.abc` instead: `Mapping` | 22 | if True: 23 | from collections import Mapping, Counter @@ -218,7 +218,7 @@ UP035.py:23:5: UP035 [*] Import from `collections.abc` instead: `Mapping` 25 26 | if True: 26 27 | if True: -UP035.py:28:5: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:28:5: UP035 [**] Import from `collections.abc` instead: `Mapping` | 26 | if True: 27 | pass @@ -240,7 +240,7 @@ UP035.py:28:5: UP035 [*] Import from `collections.abc` instead: `Mapping` 30 31 | if True: from collections import Mapping 31 32 | -UP035.py:30:10: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:30:10: UP035 [**] Import from `collections.abc` instead: `Mapping` | 28 | from collections import Mapping, Counter 29 | @@ -261,7 +261,7 @@ UP035.py:30:10: UP035 [*] Import from `collections.abc` instead: `Mapping` 32 32 | import os 33 33 | from collections import Counter, Mapping -UP035.py:33:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:33:1: UP035 [**] Import from `collections.abc` instead: `Mapping` | 32 | import os 33 | from collections import Counter, Mapping @@ -281,7 +281,7 @@ UP035.py:33:1: UP035 [*] Import from `collections.abc` instead: `Mapping` 35 36 | 36 37 | if True: -UP035.py:37:5: UP035 [*] Import from `collections.abc` instead: `Mapping`, `Callable` +UP035.py:37:5: UP035 [**] Import from `collections.abc` instead: `Mapping`, `Callable` | 36 | if True: 37 | from collections import ( @@ -311,7 +311,7 @@ UP035.py:37:5: UP035 [*] Import from `collections.abc` instead: `Mapping`, `Call 44 43 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager 45 44 | -UP035.py:44:1: UP035 [*] Import from `collections.abc` instead: `Callable` +UP035.py:44:1: UP035 [**] Import from `collections.abc` instead: `Callable` | 42 | ) 43 | @@ -333,7 +333,7 @@ UP035.py:44:1: UP035 [*] Import from `collections.abc` instead: `Callable` 46 47 | if True: from collections import ( 47 48 | Mapping, Counter) -UP035.py:44:1: UP035 [*] Import from `collections` instead: `OrderedDict` +UP035.py:44:1: UP035 [**] Import from `collections` instead: `OrderedDict` | 42 | ) 43 | @@ -355,7 +355,7 @@ UP035.py:44:1: UP035 [*] Import from `collections` instead: `OrderedDict` 46 47 | if True: from collections import ( 47 48 | Mapping, Counter) -UP035.py:44:1: UP035 [*] Import from `re` instead: `Match`, `Pattern` +UP035.py:44:1: UP035 [**] Import from `re` instead: `Match`, `Pattern` | 42 | ) 43 | @@ -429,7 +429,7 @@ UP035.py:50:1: UP035 `typing.ContextManager` is deprecated, use `contextlib.Abst 52 | from typing_extensions import OrderedDict | -UP035.py:51:1: UP035 [*] Import from `collections` instead: `OrderedDict` +UP035.py:51:1: UP035 [**] Import from `collections` instead: `OrderedDict` | 49 | # Bad imports from PYI027 that are now handled by PYI022 (UP035) 50 | from typing import ContextManager @@ -450,7 +450,7 @@ UP035.py:51:1: UP035 [*] Import from `collections` instead: `OrderedDict` 53 53 | from typing import Callable 54 54 | from typing import ByteString -UP035.py:52:1: UP035 [*] Import from `typing` instead: `OrderedDict` +UP035.py:52:1: UP035 [**] Import from `typing` instead: `OrderedDict` | 50 | from typing import ContextManager 51 | from typing import OrderedDict @@ -471,7 +471,7 @@ UP035.py:52:1: UP035 [*] Import from `typing` instead: `OrderedDict` 54 54 | from typing import ByteString 55 55 | from typing import Container -UP035.py:53:1: UP035 [*] Import from `collections.abc` instead: `Callable` +UP035.py:53:1: UP035 [**] Import from `collections.abc` instead: `Callable` | 51 | from typing import OrderedDict 52 | from typing_extensions import OrderedDict @@ -492,7 +492,7 @@ UP035.py:53:1: UP035 [*] Import from `collections.abc` instead: `Callable` 55 55 | from typing import Container 56 56 | from typing import Hashable -UP035.py:54:1: UP035 [*] Import from `collections.abc` instead: `ByteString` +UP035.py:54:1: UP035 [**] Import from `collections.abc` instead: `ByteString` | 52 | from typing_extensions import OrderedDict 53 | from typing import Callable @@ -513,7 +513,7 @@ UP035.py:54:1: UP035 [*] Import from `collections.abc` instead: `ByteString` 56 56 | from typing import Hashable 57 57 | from typing import ItemsView -UP035.py:55:1: UP035 [*] Import from `collections.abc` instead: `Container` +UP035.py:55:1: UP035 [**] Import from `collections.abc` instead: `Container` | 53 | from typing import Callable 54 | from typing import ByteString @@ -534,7 +534,7 @@ UP035.py:55:1: UP035 [*] Import from `collections.abc` instead: `Container` 57 57 | from typing import ItemsView 58 58 | from typing import Iterable -UP035.py:56:1: UP035 [*] Import from `collections.abc` instead: `Hashable` +UP035.py:56:1: UP035 [**] Import from `collections.abc` instead: `Hashable` | 54 | from typing import ByteString 55 | from typing import Container @@ -555,7 +555,7 @@ UP035.py:56:1: UP035 [*] Import from `collections.abc` instead: `Hashable` 58 58 | from typing import Iterable 59 59 | from typing import Iterator -UP035.py:57:1: UP035 [*] Import from `collections.abc` instead: `ItemsView` +UP035.py:57:1: UP035 [**] Import from `collections.abc` instead: `ItemsView` | 55 | from typing import Container 56 | from typing import Hashable @@ -576,7 +576,7 @@ UP035.py:57:1: UP035 [*] Import from `collections.abc` instead: `ItemsView` 59 59 | from typing import Iterator 60 60 | from typing import KeysView -UP035.py:58:1: UP035 [*] Import from `collections.abc` instead: `Iterable` +UP035.py:58:1: UP035 [**] Import from `collections.abc` instead: `Iterable` | 56 | from typing import Hashable 57 | from typing import ItemsView @@ -597,7 +597,7 @@ UP035.py:58:1: UP035 [*] Import from `collections.abc` instead: `Iterable` 60 60 | from typing import KeysView 61 61 | from typing import Mapping -UP035.py:59:1: UP035 [*] Import from `collections.abc` instead: `Iterator` +UP035.py:59:1: UP035 [**] Import from `collections.abc` instead: `Iterator` | 57 | from typing import ItemsView 58 | from typing import Iterable @@ -618,7 +618,7 @@ UP035.py:59:1: UP035 [*] Import from `collections.abc` instead: `Iterator` 61 61 | from typing import Mapping 62 62 | from typing import MappingView -UP035.py:60:1: UP035 [*] Import from `collections.abc` instead: `KeysView` +UP035.py:60:1: UP035 [**] Import from `collections.abc` instead: `KeysView` | 58 | from typing import Iterable 59 | from typing import Iterator @@ -639,7 +639,7 @@ UP035.py:60:1: UP035 [*] Import from `collections.abc` instead: `KeysView` 62 62 | from typing import MappingView 63 63 | from typing import MutableMapping -UP035.py:61:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:61:1: UP035 [**] Import from `collections.abc` instead: `Mapping` | 59 | from typing import Iterator 60 | from typing import KeysView @@ -660,7 +660,7 @@ UP035.py:61:1: UP035 [*] Import from `collections.abc` instead: `Mapping` 63 63 | from typing import MutableMapping 64 64 | from typing import MutableSequence -UP035.py:62:1: UP035 [*] Import from `collections.abc` instead: `MappingView` +UP035.py:62:1: UP035 [**] Import from `collections.abc` instead: `MappingView` | 60 | from typing import KeysView 61 | from typing import Mapping @@ -681,7 +681,7 @@ UP035.py:62:1: UP035 [*] Import from `collections.abc` instead: `MappingView` 64 64 | from typing import MutableSequence 65 65 | from typing import MutableSet -UP035.py:63:1: UP035 [*] Import from `collections.abc` instead: `MutableMapping` +UP035.py:63:1: UP035 [**] Import from `collections.abc` instead: `MutableMapping` | 61 | from typing import Mapping 62 | from typing import MappingView @@ -702,7 +702,7 @@ UP035.py:63:1: UP035 [*] Import from `collections.abc` instead: `MutableMapping` 65 65 | from typing import MutableSet 66 66 | from typing import Sequence -UP035.py:64:1: UP035 [*] Import from `collections.abc` instead: `MutableSequence` +UP035.py:64:1: UP035 [**] Import from `collections.abc` instead: `MutableSequence` | 62 | from typing import MappingView 63 | from typing import MutableMapping @@ -723,7 +723,7 @@ UP035.py:64:1: UP035 [*] Import from `collections.abc` instead: `MutableSequence 66 66 | from typing import Sequence 67 67 | from typing import Sized -UP035.py:65:1: UP035 [*] Import from `collections.abc` instead: `MutableSet` +UP035.py:65:1: UP035 [**] Import from `collections.abc` instead: `MutableSet` | 63 | from typing import MutableMapping 64 | from typing import MutableSequence @@ -744,7 +744,7 @@ UP035.py:65:1: UP035 [*] Import from `collections.abc` instead: `MutableSet` 67 67 | from typing import Sized 68 68 | from typing import ValuesView -UP035.py:66:1: UP035 [*] Import from `collections.abc` instead: `Sequence` +UP035.py:66:1: UP035 [**] Import from `collections.abc` instead: `Sequence` | 64 | from typing import MutableSequence 65 | from typing import MutableSet @@ -765,7 +765,7 @@ UP035.py:66:1: UP035 [*] Import from `collections.abc` instead: `Sequence` 68 68 | from typing import ValuesView 69 69 | from typing import Awaitable -UP035.py:67:1: UP035 [*] Import from `collections.abc` instead: `Sized` +UP035.py:67:1: UP035 [**] Import from `collections.abc` instead: `Sized` | 65 | from typing import MutableSet 66 | from typing import Sequence @@ -786,7 +786,7 @@ UP035.py:67:1: UP035 [*] Import from `collections.abc` instead: `Sized` 69 69 | from typing import Awaitable 70 70 | from typing import AsyncIterator -UP035.py:68:1: UP035 [*] Import from `collections.abc` instead: `ValuesView` +UP035.py:68:1: UP035 [**] Import from `collections.abc` instead: `ValuesView` | 66 | from typing import Sequence 67 | from typing import Sized @@ -807,7 +807,7 @@ UP035.py:68:1: UP035 [*] Import from `collections.abc` instead: `ValuesView` 70 70 | from typing import AsyncIterator 71 71 | from typing import AsyncIterable -UP035.py:69:1: UP035 [*] Import from `collections.abc` instead: `Awaitable` +UP035.py:69:1: UP035 [**] Import from `collections.abc` instead: `Awaitable` | 67 | from typing import Sized 68 | from typing import ValuesView @@ -828,7 +828,7 @@ UP035.py:69:1: UP035 [*] Import from `collections.abc` instead: `Awaitable` 71 71 | from typing import AsyncIterable 72 72 | from typing import Coroutine -UP035.py:70:1: UP035 [*] Import from `collections.abc` instead: `AsyncIterator` +UP035.py:70:1: UP035 [**] Import from `collections.abc` instead: `AsyncIterator` | 68 | from typing import ValuesView 69 | from typing import Awaitable @@ -849,7 +849,7 @@ UP035.py:70:1: UP035 [*] Import from `collections.abc` instead: `AsyncIterator` 72 72 | from typing import Coroutine 73 73 | from typing import Collection -UP035.py:71:1: UP035 [*] Import from `collections.abc` instead: `AsyncIterable` +UP035.py:71:1: UP035 [**] Import from `collections.abc` instead: `AsyncIterable` | 69 | from typing import Awaitable 70 | from typing import AsyncIterator @@ -870,7 +870,7 @@ UP035.py:71:1: UP035 [*] Import from `collections.abc` instead: `AsyncIterable` 73 73 | from typing import Collection 74 74 | from typing import AsyncGenerator -UP035.py:72:1: UP035 [*] Import from `collections.abc` instead: `Coroutine` +UP035.py:72:1: UP035 [**] Import from `collections.abc` instead: `Coroutine` | 70 | from typing import AsyncIterator 71 | from typing import AsyncIterable @@ -891,7 +891,7 @@ UP035.py:72:1: UP035 [*] Import from `collections.abc` instead: `Coroutine` 74 74 | from typing import AsyncGenerator 75 75 | from typing import Reversible -UP035.py:73:1: UP035 [*] Import from `collections.abc` instead: `Collection` +UP035.py:73:1: UP035 [**] Import from `collections.abc` instead: `Collection` | 71 | from typing import AsyncIterable 72 | from typing import Coroutine @@ -912,7 +912,7 @@ UP035.py:73:1: UP035 [*] Import from `collections.abc` instead: `Collection` 75 75 | from typing import Reversible 76 76 | from typing import Generator -UP035.py:74:1: UP035 [*] Import from `collections.abc` instead: `AsyncGenerator` +UP035.py:74:1: UP035 [**] Import from `collections.abc` instead: `AsyncGenerator` | 72 | from typing import Coroutine 73 | from typing import Collection @@ -933,7 +933,7 @@ UP035.py:74:1: UP035 [*] Import from `collections.abc` instead: `AsyncGenerator` 76 76 | from typing import Generator 77 77 | from typing import Callable -UP035.py:75:1: UP035 [*] Import from `collections.abc` instead: `Reversible` +UP035.py:75:1: UP035 [**] Import from `collections.abc` instead: `Reversible` | 73 | from typing import Collection 74 | from typing import AsyncGenerator @@ -954,7 +954,7 @@ UP035.py:75:1: UP035 [*] Import from `collections.abc` instead: `Reversible` 77 77 | from typing import Callable 78 78 | from typing import cast -UP035.py:76:1: UP035 [*] Import from `collections.abc` instead: `Generator` +UP035.py:76:1: UP035 [**] Import from `collections.abc` instead: `Generator` | 74 | from typing import AsyncGenerator 75 | from typing import Reversible @@ -975,7 +975,7 @@ UP035.py:76:1: UP035 [*] Import from `collections.abc` instead: `Generator` 78 78 | from typing import cast 79 79 | -UP035.py:77:1: UP035 [*] Import from `collections.abc` instead: `Callable` +UP035.py:77:1: UP035 [**] Import from `collections.abc` instead: `Callable` | 75 | from typing import Reversible 76 | from typing import Generator @@ -995,7 +995,7 @@ UP035.py:77:1: UP035 [*] Import from `collections.abc` instead: `Callable` 79 79 | 80 80 | # OK -UP035.py:87:1: UP035 [*] Import from `typing` instead: `NamedTuple` +UP035.py:87:1: UP035 [**] Import from `typing` instead: `NamedTuple` | 86 | # Ok: `typing_extensions` contains backported improvements. 87 | from typing_extensions import NamedTuple @@ -1015,7 +1015,7 @@ UP035.py:87:1: UP035 [*] Import from `typing` instead: `NamedTuple` 89 89 | # Ok: `typing_extensions` supports `frozen_default` (backported from 3.12). 90 90 | from typing_extensions import dataclass_transform -UP035.py:90:1: UP035 [*] Import from `typing` instead: `dataclass_transform` +UP035.py:90:1: UP035 [**] Import from `typing` instead: `dataclass_transform` | 89 | # Ok: `typing_extensions` supports `frozen_default` (backported from 3.12). 90 | from typing_extensions import dataclass_transform diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_0.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_0.py.snap index 6d66d23ef17be9..385b374ffe6aee 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_0.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP036_0.py:3:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:3:4: UP036 [**] Version block is outdated for minimum Python version | 1 | import sys 2 | @@ -24,7 +24,7 @@ UP036_0.py:3:4: UP036 [*] Version block is outdated for minimum Python version 8 5 | if sys.version_info < (3,0): 9 6 | if True: -UP036_0.py:8:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:8:4: UP036 [**] Version block is outdated for minimum Python version | 6 | print("py3") 7 | @@ -51,7 +51,7 @@ UP036_0.py:8:4: UP036 [*] Version block is outdated for minimum Python version 16 10 | if sys.version_info < (3,0): print("PY2!") 17 11 | else: print("PY3!") -UP036_0.py:16:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:16:4: UP036 [**] Version block is outdated for minimum Python version | 14 | print("py3") 15 | @@ -72,7 +72,7 @@ UP036_0.py:16:4: UP036 [*] Version block is outdated for minimum Python version 19 18 | if True: 20 19 | if sys.version_info < (3,0): -UP036_0.py:20:8: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:20:8: UP036 [**] Version block is outdated for minimum Python version | 19 | if True: 20 | if sys.version_info < (3,0): @@ -95,7 +95,7 @@ UP036_0.py:20:8: UP036 [*] Version block is outdated for minimum Python version 25 22 | if sys.version_info < (3,0): print(1 if True else 3) 26 23 | else: -UP036_0.py:25:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:25:4: UP036 [**] Version block is outdated for minimum Python version | 23 | print("PY3") 24 | @@ -118,7 +118,7 @@ UP036_0.py:25:4: UP036 [*] Version block is outdated for minimum Python version 29 27 | if sys.version_info < (3,0): 30 28 | def f(): -UP036_0.py:29:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:29:4: UP036 [**] Version block is outdated for minimum Python version | 27 | print("py3") 28 | @@ -147,7 +147,7 @@ UP036_0.py:29:4: UP036 [*] Version block is outdated for minimum Python version 37 33 | if sys.version_info > (3,0): 38 34 | print("py3") -UP036_0.py:37:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:37:4: UP036 [**] Version block is outdated for minimum Python version | 35 | print("This the next") 36 | @@ -171,7 +171,7 @@ UP036_0.py:37:4: UP036 [*] Version block is outdated for minimum Python version 42 39 | 43 40 | x = 1 -UP036_0.py:45:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:45:4: UP036 [**] Version block is outdated for minimum Python version | 43 | x = 1 44 | @@ -195,7 +195,7 @@ UP036_0.py:45:4: UP036 [*] Version block is outdated for minimum Python version 50 47 | 51 48 | x = 1 -UP036_0.py:53:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:53:4: UP036 [**] Version block is outdated for minimum Python version | 51 | x = 1 52 | @@ -216,7 +216,7 @@ UP036_0.py:53:4: UP036 [*] Version block is outdated for minimum Python version 56 55 | if sys.version_info > (3,): 57 56 | print("py3") -UP036_0.py:56:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:56:4: UP036 [**] Version block is outdated for minimum Python version | 54 | else: print("py2") 55 | @@ -240,7 +240,7 @@ UP036_0.py:56:4: UP036 [*] Version block is outdated for minimum Python version 61 58 | if True: 62 59 | if sys.version_info > (3,): -UP036_0.py:62:8: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:62:8: UP036 [**] Version block is outdated for minimum Python version | 61 | if True: 62 | if sys.version_info > (3,): @@ -263,7 +263,7 @@ UP036_0.py:62:8: UP036 [*] Version block is outdated for minimum Python version 67 64 | if sys.version_info < (3,): 68 65 | print("py2") -UP036_0.py:67:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:67:4: UP036 [**] Version block is outdated for minimum Python version | 65 | print("py2") 66 | @@ -287,7 +287,7 @@ UP036_0.py:67:4: UP036 [*] Version block is outdated for minimum Python version 72 69 | def f(): 73 70 | if sys.version_info < (3,0): -UP036_0.py:73:8: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:73:8: UP036 [**] Version block is outdated for minimum Python version | 72 | def f(): 73 | if sys.version_info < (3,0): @@ -313,7 +313,7 @@ UP036_0.py:73:8: UP036 [*] Version block is outdated for minimum Python version 81 75 | 82 76 | class C: -UP036_0.py:86:8: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:86:8: UP036 [**] Version block is outdated for minimum Python version | 84 | pass 85 | @@ -340,7 +340,7 @@ UP036_0.py:86:8: UP036 [*] Version block is outdated for minimum Python version 93 89 | def h(): 94 90 | pass -UP036_0.py:97:8: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:97:8: UP036 [**] Version block is outdated for minimum Python version | 96 | if True: 97 | if sys.version_info < (3,0): @@ -363,7 +363,7 @@ UP036_0.py:97:8: UP036 [*] Version block is outdated for minimum Python version 102 99 | # comment 103 100 | -UP036_0.py:104:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:104:4: UP036 [**] Version block is outdated for minimum Python version | 102 | # comment 103 | @@ -396,7 +396,7 @@ UP036_0.py:104:4: UP036 [*] Version block is outdated for minimum Python version 115 109 | if True: 116 110 | if sys.version_info > (3,): -UP036_0.py:116:8: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:116:8: UP036 [**] Version block is outdated for minimum Python version | 115 | if True: 116 | if sys.version_info > (3,): @@ -417,7 +417,7 @@ UP036_0.py:116:8: UP036 [*] Version block is outdated for minimum Python version 119 118 | print(2+3) 120 119 | -UP036_0.py:122:8: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:122:8: UP036 [**] Version block is outdated for minimum Python version | 121 | if True: 122 | if sys.version_info > (3,): print(3) @@ -437,7 +437,7 @@ UP036_0.py:122:8: UP036 [*] Version block is outdated for minimum Python version 124 124 | if True: 125 125 | if sys.version_info > (3,): -UP036_0.py:125:8: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:125:8: UP036 [**] Version block is outdated for minimum Python version | 124 | if True: 125 | if sys.version_info > (3,): @@ -457,7 +457,7 @@ UP036_0.py:125:8: UP036 [*] Version block is outdated for minimum Python version 128 127 | 129 128 | if True: -UP036_0.py:130:8: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:130:8: UP036 [**] Version block is outdated for minimum Python version | 129 | if True: 130 | if sys.version_info <= (3, 0): @@ -485,7 +485,7 @@ UP036_0.py:130:8: UP036 [*] Version block is outdated for minimum Python version 139 136 | 140 137 | if sys.version_info <= (3, 0): -UP036_0.py:140:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:140:4: UP036 [**] Version block is outdated for minimum Python version | 140 | if sys.version_info <= (3, 0): | ^^^^^^^^^^^^^^^^^^^^^^^^^^ UP036 @@ -512,7 +512,7 @@ UP036_0.py:140:4: UP036 [*] Version block is outdated for minimum Python version 149 146 | 150 147 | if sys.version_info > (3,0): -UP036_0.py:150:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:150:4: UP036 [**] Version block is outdated for minimum Python version | 150 | if sys.version_info > (3,0): | ^^^^^^^^^^^^^^^^^^^^^^^^ UP036 @@ -546,7 +546,7 @@ UP036_0.py:150:4: UP036 [*] Version block is outdated for minimum Python version 163 162 | if sys.version_info > (3, 0): expected_error = \ 164 163 | [] -UP036_0.py:163:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:163:4: UP036 [**] Version block is outdated for minimum Python version | 161 | "this for some reason") 162 | @@ -566,7 +566,7 @@ UP036_0.py:163:4: UP036 [*] Version block is outdated for minimum Python version 165 165 | 166 166 | if sys.version_info > (3, 0): expected_error = [] -UP036_0.py:166:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:166:4: UP036 [**] Version block is outdated for minimum Python version | 164 | [] 165 | @@ -587,7 +587,7 @@ UP036_0.py:166:4: UP036 [*] Version block is outdated for minimum Python version 168 168 | if sys.version_info > (3, 0): \ 169 169 | expected_error = [] -UP036_0.py:168:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:168:4: UP036 [**] Version block is outdated for minimum Python version | 166 | if sys.version_info > (3, 0): expected_error = [] 167 | @@ -608,7 +608,7 @@ UP036_0.py:168:4: UP036 [*] Version block is outdated for minimum Python version 171 170 | if True: 172 171 | if sys.version_info > (3, 0): expected_error = \ -UP036_0.py:172:8: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:172:8: UP036 [**] Version block is outdated for minimum Python version | 171 | if True: 172 | if sys.version_info > (3, 0): expected_error = \ @@ -627,7 +627,7 @@ UP036_0.py:172:8: UP036 [*] Version block is outdated for minimum Python version 174 174 | 175 175 | if True: -UP036_0.py:176:8: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:176:8: UP036 [**] Version block is outdated for minimum Python version | 175 | if True: 176 | if sys.version_info > (3, 0): expected_error = [] @@ -647,7 +647,7 @@ UP036_0.py:176:8: UP036 [*] Version block is outdated for minimum Python version 178 178 | if True: 179 179 | if sys.version_info > (3, 0): \ -UP036_0.py:179:8: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:179:8: UP036 [**] Version block is outdated for minimum Python version | 178 | if True: 179 | if sys.version_info > (3, 0): \ @@ -665,7 +665,7 @@ UP036_0.py:179:8: UP036 [*] Version block is outdated for minimum Python version 181 180 | 182 181 | if sys.version_info < (3,12): -UP036_0.py:182:4: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:182:4: UP036 [**] Version block is outdated for minimum Python version | 180 | expected_error = [] 181 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_1.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_1.py.snap index 2a585cc3f9c97d..1326eb2f4dbb47 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_1.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP036_1.py:3:4: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:3:4: UP036 [**] Version block is outdated for minimum Python version | 1 | import sys 2 | @@ -24,7 +24,7 @@ UP036_1.py:3:4: UP036 [*] Version block is outdated for minimum Python version 8 5 | if sys.version_info < (3,): 9 6 | 2 -UP036_1.py:8:4: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:8:4: UP036 [**] Version block is outdated for minimum Python version | 6 | 3 7 | @@ -48,7 +48,7 @@ UP036_1.py:8:4: UP036 [*] Version block is outdated for minimum Python version 13 10 | if sys.version_info < (3,0): 14 11 | 2 -UP036_1.py:13:4: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:13:4: UP036 [**] Version block is outdated for minimum Python version | 11 | 3 12 | @@ -72,7 +72,7 @@ UP036_1.py:13:4: UP036 [*] Version block is outdated for minimum Python version 18 15 | if sys.version_info == 3: 19 16 | 3 -UP036_1.py:18:4: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:18:4: UP036 [**] Version block is outdated for minimum Python version | 16 | 3 17 | @@ -96,7 +96,7 @@ UP036_1.py:18:4: UP036 [*] Version block is outdated for minimum Python version 23 20 | if sys.version_info > (3,): 24 21 | 3 -UP036_1.py:23:4: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:23:4: UP036 [**] Version block is outdated for minimum Python version | 21 | 2 22 | @@ -120,7 +120,7 @@ UP036_1.py:23:4: UP036 [*] Version block is outdated for minimum Python version 28 25 | if sys.version_info >= (3,): 29 26 | 3 -UP036_1.py:28:4: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:28:4: UP036 [**] Version block is outdated for minimum Python version | 26 | 2 27 | @@ -144,7 +144,7 @@ UP036_1.py:28:4: UP036 [*] Version block is outdated for minimum Python version 33 30 | from sys import version_info 34 31 | -UP036_1.py:35:4: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:35:4: UP036 [**] Version block is outdated for minimum Python version | 33 | from sys import version_info 34 | @@ -168,7 +168,7 @@ UP036_1.py:35:4: UP036 [*] Version block is outdated for minimum Python version 40 37 | if True: 41 38 | print(1) -UP036_1.py:42:6: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:42:6: UP036 [**] Version block is outdated for minimum Python version | 40 | if True: 41 | print(1) @@ -189,7 +189,7 @@ UP036_1.py:42:6: UP036 [*] Version block is outdated for minimum Python version 45 43 | print(3) 46 44 | -UP036_1.py:49:6: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:49:6: UP036 [**] Version block is outdated for minimum Python version | 47 | if True: 48 | print(1) @@ -213,7 +213,7 @@ UP036_1.py:49:6: UP036 [*] Version block is outdated for minimum Python version 54 52 | if True: 55 53 | print(1) -UP036_1.py:56:6: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:56:6: UP036 [**] Version block is outdated for minimum Python version | 54 | if True: 55 | print(1) @@ -233,7 +233,7 @@ UP036_1.py:56:6: UP036 [*] Version block is outdated for minimum Python version 58 58 | 59 59 | def f(): -UP036_1.py:62:10: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:62:10: UP036 [**] Version block is outdated for minimum Python version | 60 | if True: 61 | print(1) @@ -253,7 +253,7 @@ UP036_1.py:62:10: UP036 [*] Version block is outdated for minimum Python version 64 64 | 65 65 | if True: -UP036_1.py:67:6: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:67:6: UP036 [**] Version block is outdated for minimum Python version | 65 | if True: 66 | print(1) @@ -274,7 +274,7 @@ UP036_1.py:67:6: UP036 [*] Version block is outdated for minimum Python version 70 68 | print(3) 71 69 | -UP036_1.py:75:10: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:75:10: UP036 [**] Version block is outdated for minimum Python version | 73 | if True: 74 | print(1) diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_2.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_2.py.snap index 8e8332bdd9ebf2..631af594dc981e 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_2.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP036_2.py:4:4: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:4:4: UP036 [**] Version block is outdated for minimum Python version | 2 | from sys import version_info 3 | @@ -25,7 +25,7 @@ UP036_2.py:4:4: UP036 [*] Version block is outdated for minimum Python version 9 6 | if version_info > (3, 5): 10 7 | 3+6 -UP036_2.py:9:4: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:9:4: UP036 [**] Version block is outdated for minimum Python version | 7 | 3-5 8 | @@ -49,7 +49,7 @@ UP036_2.py:9:4: UP036 [*] Version block is outdated for minimum Python version 14 11 | if sys.version_info >= (3,6): 15 12 | 3+6 -UP036_2.py:14:4: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:14:4: UP036 [**] Version block is outdated for minimum Python version | 12 | 3-5 13 | @@ -73,7 +73,7 @@ UP036_2.py:14:4: UP036 [*] Version block is outdated for minimum Python version 19 16 | if version_info >= (3,6): 20 17 | 3+6 -UP036_2.py:19:4: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:19:4: UP036 [**] Version block is outdated for minimum Python version | 17 | 3-5 18 | @@ -97,7 +97,7 @@ UP036_2.py:19:4: UP036 [*] Version block is outdated for minimum Python version 24 21 | if sys.version_info < (3,6): 25 22 | 3-5 -UP036_2.py:24:4: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:24:4: UP036 [**] Version block is outdated for minimum Python version | 22 | 3-5 23 | @@ -121,7 +121,7 @@ UP036_2.py:24:4: UP036 [*] Version block is outdated for minimum Python version 29 26 | if sys.version_info <= (3,5): 30 27 | 3-5 -UP036_2.py:29:4: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:29:4: UP036 [**] Version block is outdated for minimum Python version | 27 | 3+6 28 | @@ -145,7 +145,7 @@ UP036_2.py:29:4: UP036 [*] Version block is outdated for minimum Python version 34 31 | if sys.version_info <= (3, 5): 35 32 | 3-5 -UP036_2.py:34:4: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:34:4: UP036 [**] Version block is outdated for minimum Python version | 32 | 3+6 33 | @@ -169,7 +169,7 @@ UP036_2.py:34:4: UP036 [*] Version block is outdated for minimum Python version 39 36 | if sys.version_info >= (3, 5): 40 37 | pass -UP036_2.py:39:4: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:39:4: UP036 [**] Version block is outdated for minimum Python version | 37 | 3+6 38 | @@ -190,7 +190,7 @@ UP036_2.py:39:4: UP036 [*] Version block is outdated for minimum Python version 42 41 | if sys.version_info < (3,0): 43 42 | pass -UP036_2.py:42:4: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:42:4: UP036 [**] Version block is outdated for minimum Python version | 40 | pass 41 | @@ -210,7 +210,7 @@ UP036_2.py:42:4: UP036 [*] Version block is outdated for minimum Python version 45 43 | if True: 46 44 | if sys.version_info < (3,0): -UP036_2.py:46:8: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:46:8: UP036 [**] Version block is outdated for minimum Python version | 45 | if True: 46 | if sys.version_info < (3,0): @@ -230,7 +230,7 @@ UP036_2.py:46:8: UP036 [*] Version block is outdated for minimum Python version 49 48 | if sys.version_info < (3,0): 50 49 | pass -UP036_2.py:49:4: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:49:4: UP036 [**] Version block is outdated for minimum Python version | 47 | pass 48 | @@ -253,7 +253,7 @@ UP036_2.py:49:4: UP036 [*] Version block is outdated for minimum Python version 53 51 | 54 52 | if sys.version_info > (3,): -UP036_2.py:54:4: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:54:4: UP036 [**] Version block is outdated for minimum Python version | 52 | pass 53 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_3.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_3.py.snap index d38cfd8b0bf2a1..589e8af691bef0 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_3.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_3.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP036_3.py:3:15: UP036 [*] Version block is outdated for minimum Python version +UP036_3.py:3:15: UP036 [**] Version block is outdated for minimum Python version | 1 | import sys 2 | @@ -30,7 +30,7 @@ UP036_3.py:3:15: UP036 [*] Version block is outdated for minimum Python version 12 7 | if False: 13 8 | if sys.version_info < (3,0): -UP036_3.py:13:19: UP036 [*] Version block is outdated for minimum Python version +UP036_3.py:13:19: UP036 [**] Version block is outdated for minimum Python version | 12 | if False: 13 | if sys.version_info < (3,0): @@ -59,7 +59,7 @@ UP036_3.py:13:19: UP036 [*] Version block is outdated for minimum Python version 22 17 | 23 18 | if sys.version_info < (3,0): print("PY2!") -UP036_3.py:23:15: UP036 [*] Version block is outdated for minimum Python version +UP036_3.py:23:15: UP036 [**] Version block is outdated for minimum Python version | 23 | if sys.version_info < (3,0): print("PY2!") | ^^^^^^^^^^^^^^^^^^^^^^^^ UP036 diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_4.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_4.py.snap index 28701a4d0a3b30..0d5b8438eb156a 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_4.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_4.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP036_4.py:4:8: UP036 [*] Version block is outdated for minimum Python version +UP036_4.py:4:8: UP036 [**] Version block is outdated for minimum Python version | 3 | if True: 4 | if sys.version_info < (3, 3): @@ -21,7 +21,7 @@ UP036_4.py:4:8: UP036 [*] Version block is outdated for minimum Python version 7 6 | 8 7 | if True: -UP036_4.py:11:10: UP036 [*] Version block is outdated for minimum Python version +UP036_4.py:11:10: UP036 [**] Version block is outdated for minimum Python version | 9 | if foo: 10 | print() @@ -42,7 +42,7 @@ UP036_4.py:11:10: UP036 [*] Version block is outdated for minimum Python version 14 13 | if True: 15 14 | if foo: -UP036_4.py:17:10: UP036 [*] Version block is outdated for minimum Python version +UP036_4.py:17:10: UP036 [**] Version block is outdated for minimum Python version | 15 | if foo: 16 | print() @@ -63,7 +63,7 @@ UP036_4.py:17:10: UP036 [*] Version block is outdated for minimum Python version 20 18 | cmd = [sys.executable, "-m", "test", "-j0"] 21 19 | -UP036_4.py:24:10: UP036 [*] Version block is outdated for minimum Python version +UP036_4.py:24:10: UP036 [**] Version block is outdated for minimum Python version | 22 | if foo: 23 | print() @@ -84,7 +84,7 @@ UP036_4.py:24:10: UP036 [*] Version block is outdated for minimum Python version 27 26 | if sys.version_info < (3, 3): 28 27 | cmd = [sys.executable, "-m", "test.regrtest"] -UP036_4.py:27:8: UP036 [*] Version block is outdated for minimum Python version +UP036_4.py:27:8: UP036 [**] Version block is outdated for minimum Python version | 25 | cmd = [sys.executable, "-m", "test.regrtest"] 26 | @@ -104,7 +104,7 @@ UP036_4.py:27:8: UP036 [*] Version block is outdated for minimum Python version 30 28 | if foo: 31 29 | print() -UP036_4.py:32:10: UP036 [*] Version block is outdated for minimum Python version +UP036_4.py:32:10: UP036 [**] Version block is outdated for minimum Python version | 30 | if foo: 31 | print() @@ -125,7 +125,7 @@ UP036_4.py:32:10: UP036 [*] Version block is outdated for minimum Python version 35 33 | cmd = [sys.executable, "-m", "test", "-j0"] 36 34 | -UP036_4.py:37:8: UP036 [*] Version block is outdated for minimum Python version +UP036_4.py:37:8: UP036 [**] Version block is outdated for minimum Python version | 35 | cmd = [sys.executable, "-m", "test", "-j0"] 36 | @@ -149,7 +149,7 @@ UP036_4.py:37:8: UP036 [*] Version block is outdated for minimum Python version 42 39 | if sys.version_info < (3, 3): 43 40 | cmd = [sys.executable, "-m", "test.regrtest"] -UP036_4.py:42:8: UP036 [*] Version block is outdated for minimum Python version +UP036_4.py:42:8: UP036 [**] Version block is outdated for minimum Python version | 40 | cmd = [sys.executable, "-m", "test", "-j0"] 41 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_5.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_5.py.snap index f4a5ed27874b29..c66b462506abd9 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_5.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP036_5.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP036_5.py:3:4: UP036 [*] Version block is outdated for minimum Python version +UP036_5.py:3:4: UP036 [**] Version block is outdated for minimum Python version | 1 | import sys 2 | @@ -31,7 +31,7 @@ UP036_5.py:3:4: UP036 [*] Version block is outdated for minimum Python version 15 5 | 16 6 | import sys -UP036_5.py:18:4: UP036 [*] Version block is outdated for minimum Python version +UP036_5.py:18:4: UP036 [**] Version block is outdated for minimum Python version | 16 | import sys 17 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP038.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP038.py.snap index dcba7e8fcff569..f678cc9fdf49f0 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP038.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP038.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP038.py:1:1: UP038 [*] Use `X | Y` in `isinstance` call instead of `(X, Y)` +UP038.py:1:1: UP038 [**] Use `X | Y` in `isinstance` call instead of `(X, Y)` | 1 | isinstance(1, (int, float)) # UP038 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP038 @@ -16,7 +16,7 @@ UP038.py:1:1: UP038 [*] Use `X | Y` in `isinstance` call instead of `(X, Y)` 3 3 | 4 4 | isinstance(1, int) # OK -UP038.py:2:1: UP038 [*] Use `X | Y` in `issubclass` call instead of `(X, Y)` +UP038.py:2:1: UP038 [**] Use `X | Y` in `issubclass` call instead of `(X, Y)` | 1 | isinstance(1, (int, float)) # UP038 2 | issubclass("yes", (int, float, str)) # UP038 diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__datetime_utc_alias_py311.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__datetime_utc_alias_py311.snap index 3cde3025383daa..db36d46d4d5e94 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__datetime_utc_alias_py311.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__datetime_utc_alias_py311.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -UP017.py:7:7: UP017 [*] Use `datetime.UTC` alias +UP017.py:7:7: UP017 [**] Use `datetime.UTC` alias | 6 | print(datetime.timezone(-1)) 7 | print(timezone.utc) @@ -20,7 +20,7 @@ UP017.py:7:7: UP017 [*] Use `datetime.UTC` alias 9 9 | 10 10 | print(datetime.timezone.utc) -UP017.py:8:7: UP017 [*] Use `datetime.UTC` alias +UP017.py:8:7: UP017 [**] Use `datetime.UTC` alias | 6 | print(datetime.timezone(-1)) 7 | print(timezone.utc) @@ -41,7 +41,7 @@ UP017.py:8:7: UP017 [*] Use `datetime.UTC` alias 10 10 | print(datetime.timezone.utc) 11 11 | print(dt.timezone.utc) -UP017.py:10:7: UP017 [*] Use `datetime.UTC` alias +UP017.py:10:7: UP017 [**] Use `datetime.UTC` alias | 8 | print(tz.utc) 9 | @@ -59,7 +59,7 @@ UP017.py:10:7: UP017 [*] Use `datetime.UTC` alias 10 |+print(datetime.UTC) 11 11 | print(dt.timezone.utc) -UP017.py:11:7: UP017 [*] Use `datetime.UTC` alias +UP017.py:11:7: UP017 [**] Use `datetime.UTC` alias | 10 | print(datetime.timezone.utc) 11 | print(dt.timezone.utc) diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_pep_604_p37.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_pep_604_p37.snap index 6c62e6ffb7f60c..eea6bdc5c485dc 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_pep_604_p37.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_pep_604_p37.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -future_annotations.py:40:4: UP007 [*] Use `X | Y` for type annotations +future_annotations.py:40:4: UP007 [**] Use `X | Y` for type annotations | 40 | x: Optional[int] = None | ^^^^^^^^^^^^^ UP007 diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap index c9e4008d7aac7f..6d50e8a5de3de2 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/pyupgrade/mod.rs --- -future_annotations.py:40:4: UP007 [*] Use `X | Y` for type annotations +future_annotations.py:40:4: UP007 [**] Use `X | Y` for type annotations | 40 | x: Optional[int] = None | ^^^^^^^^^^^^^ UP007 @@ -19,7 +19,7 @@ future_annotations.py:40:4: UP007 [*] Use `X | Y` for type annotations 41 41 | 42 42 | MyList: TypeAlias = Union[List[int], List[str]] -future_annotations.py:42:21: UP007 [*] Use `X | Y` for type annotations +future_annotations.py:42:21: UP007 [**] Use `X | Y` for type annotations | 40 | x: Optional[int] = None 41 | diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB105_FURB105.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB105_FURB105.py.snap index ebec270762c4c2..27229b18aa2230 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB105_FURB105.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB105_FURB105.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/refurb/mod.rs --- -FURB105.py:3:1: FURB105 [*] Unnecessary empty string passed to `print` +FURB105.py:3:1: FURB105 [**] Unnecessary empty string passed to `print` | 1 | # Errors. 2 | @@ -21,7 +21,7 @@ FURB105.py:3:1: FURB105 [*] Unnecessary empty string passed to `print` 5 5 | print("", end="bar") 6 6 | print("", sep=",", end="bar") -FURB105.py:4:1: FURB105 [*] Unnecessary empty string and separator passed to `print` +FURB105.py:4:1: FURB105 [**] Unnecessary empty string and separator passed to `print` | 3 | print("") 4 | print("", sep=",") @@ -41,7 +41,7 @@ FURB105.py:4:1: FURB105 [*] Unnecessary empty string and separator passed to `pr 6 6 | print("", sep=",", end="bar") 7 7 | print(sep="") -FURB105.py:5:1: FURB105 [*] Unnecessary empty string passed to `print` +FURB105.py:5:1: FURB105 [**] Unnecessary empty string passed to `print` | 3 | print("") 4 | print("", sep=",") @@ -62,7 +62,7 @@ FURB105.py:5:1: FURB105 [*] Unnecessary empty string passed to `print` 7 7 | print(sep="") 8 8 | print("", sep="") -FURB105.py:6:1: FURB105 [*] Unnecessary empty string and separator passed to `print` +FURB105.py:6:1: FURB105 [**] Unnecessary empty string and separator passed to `print` | 4 | print("", sep=",") 5 | print("", end="bar") @@ -83,7 +83,7 @@ FURB105.py:6:1: FURB105 [*] Unnecessary empty string and separator passed to `pr 8 8 | print("", sep="") 9 9 | print("", "", sep="") -FURB105.py:7:1: FURB105 [*] Unnecessary separator passed to `print` +FURB105.py:7:1: FURB105 [**] Unnecessary separator passed to `print` | 5 | print("", end="bar") 6 | print("", sep=",", end="bar") @@ -104,7 +104,7 @@ FURB105.py:7:1: FURB105 [*] Unnecessary separator passed to `print` 9 9 | print("", "", sep="") 10 10 | print("", "", sep="", end="") -FURB105.py:8:1: FURB105 [*] Unnecessary empty string and separator passed to `print` +FURB105.py:8:1: FURB105 [**] Unnecessary empty string and separator passed to `print` | 6 | print("", sep=",", end="bar") 7 | print(sep="") @@ -125,7 +125,7 @@ FURB105.py:8:1: FURB105 [*] Unnecessary empty string and separator passed to `pr 10 10 | print("", "", sep="", end="") 11 11 | print("", "", sep="", end="bar") -FURB105.py:9:1: FURB105 [*] Unnecessary empty string and separator passed to `print` +FURB105.py:9:1: FURB105 [**] Unnecessary empty string and separator passed to `print` | 7 | print(sep="") 8 | print("", sep="") @@ -146,7 +146,7 @@ FURB105.py:9:1: FURB105 [*] Unnecessary empty string and separator passed to `pr 11 11 | print("", "", sep="", end="bar") 12 12 | print("", sep="", end="bar") -FURB105.py:10:1: FURB105 [*] Unnecessary empty string and separator passed to `print` +FURB105.py:10:1: FURB105 [**] Unnecessary empty string and separator passed to `print` | 8 | print("", sep="") 9 | print("", "", sep="") @@ -167,7 +167,7 @@ FURB105.py:10:1: FURB105 [*] Unnecessary empty string and separator passed to `p 12 12 | print("", sep="", end="bar") 13 13 | print(sep="", end="bar") -FURB105.py:11:1: FURB105 [*] Unnecessary empty string and separator passed to `print` +FURB105.py:11:1: FURB105 [**] Unnecessary empty string and separator passed to `print` | 9 | print("", "", sep="") 10 | print("", "", sep="", end="") @@ -188,7 +188,7 @@ FURB105.py:11:1: FURB105 [*] Unnecessary empty string and separator passed to `p 13 13 | print(sep="", end="bar") 14 14 | print("", "foo", sep="") -FURB105.py:12:1: FURB105 [*] Unnecessary empty string and separator passed to `print` +FURB105.py:12:1: FURB105 [**] Unnecessary empty string and separator passed to `print` | 10 | print("", "", sep="", end="") 11 | print("", "", sep="", end="bar") @@ -209,7 +209,7 @@ FURB105.py:12:1: FURB105 [*] Unnecessary empty string and separator passed to `p 14 14 | print("", "foo", sep="") 15 15 | print("foo", "", sep="") -FURB105.py:13:1: FURB105 [*] Unnecessary separator passed to `print` +FURB105.py:13:1: FURB105 [**] Unnecessary separator passed to `print` | 11 | print("", "", sep="", end="bar") 12 | print("", sep="", end="bar") @@ -230,7 +230,7 @@ FURB105.py:13:1: FURB105 [*] Unnecessary separator passed to `print` 15 15 | print("foo", "", sep="") 16 16 | print("foo", "", "bar", sep="") -FURB105.py:14:1: FURB105 [*] Unnecessary empty string and separator passed to `print` +FURB105.py:14:1: FURB105 [**] Unnecessary empty string and separator passed to `print` | 12 | print("", sep="", end="bar") 13 | print(sep="", end="bar") @@ -251,7 +251,7 @@ FURB105.py:14:1: FURB105 [*] Unnecessary empty string and separator passed to `p 16 16 | print("foo", "", "bar", sep="") 17 17 | print("", *args) -FURB105.py:15:1: FURB105 [*] Unnecessary empty string and separator passed to `print` +FURB105.py:15:1: FURB105 [**] Unnecessary empty string and separator passed to `print` | 13 | print(sep="", end="bar") 14 | print("", "foo", sep="") @@ -272,7 +272,7 @@ FURB105.py:15:1: FURB105 [*] Unnecessary empty string and separator passed to `p 17 17 | print("", *args) 18 18 | print("", *args, sep="") -FURB105.py:16:1: FURB105 [*] Unnecessary empty string passed to `print` +FURB105.py:16:1: FURB105 [**] Unnecessary empty string passed to `print` | 14 | print("", "foo", sep="") 15 | print("foo", "", sep="") @@ -293,7 +293,7 @@ FURB105.py:16:1: FURB105 [*] Unnecessary empty string passed to `print` 18 18 | print("", *args, sep="") 19 19 | print("", **kwargs) -FURB105.py:18:1: FURB105 [*] Unnecessary empty string passed to `print` +FURB105.py:18:1: FURB105 [**] Unnecessary empty string passed to `print` | 16 | print("foo", "", "bar", sep="") 17 | print("", *args) @@ -314,7 +314,7 @@ FURB105.py:18:1: FURB105 [*] Unnecessary empty string passed to `print` 20 20 | print(sep="\t") 21 21 | -FURB105.py:19:1: FURB105 [*] Unnecessary empty string passed to `print` +FURB105.py:19:1: FURB105 [**] Unnecessary empty string passed to `print` | 17 | print("", *args) 18 | print("", *args, sep="") @@ -334,7 +334,7 @@ FURB105.py:19:1: FURB105 [*] Unnecessary empty string passed to `print` 21 21 | 22 22 | # OK. -FURB105.py:20:1: FURB105 [*] Unnecessary separator passed to `print` +FURB105.py:20:1: FURB105 [**] Unnecessary separator passed to `print` | 18 | print("", *args, sep="") 19 | print("", **kwargs) diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB113_FURB113.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB113_FURB113.py.snap index 4ce5ab6cd5a6ad..fd34207d7a1a2f 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB113_FURB113.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB113_FURB113.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/refurb/mod.rs --- -FURB113.py:23:1: FURB113 [*] Use `nums.extend((1, 2))` instead of repeatedly calling `nums.append()` +FURB113.py:23:1: FURB113 [**] Use `nums.extend((1, 2))` instead of repeatedly calling `nums.append()` | 22 | # FURB113 23 | / nums.append(1) @@ -22,7 +22,7 @@ FURB113.py:23:1: FURB113 [*] Use `nums.extend((1, 2))` instead of repeatedly cal 26 25 | 27 26 | -FURB113.py:29:1: FURB113 [*] Use `nums3.extend((1, 2))` instead of repeatedly calling `nums3.append()` +FURB113.py:29:1: FURB113 [**] Use `nums3.extend((1, 2))` instead of repeatedly calling `nums3.append()` | 28 | # FURB113 29 | / nums3.append(1) @@ -43,7 +43,7 @@ FURB113.py:29:1: FURB113 [*] Use `nums3.extend((1, 2))` instead of repeatedly ca 32 31 | 33 32 | -FURB113.py:35:1: FURB113 [*] Use `nums4.extend((1, 2))` instead of repeatedly calling `nums4.append()` +FURB113.py:35:1: FURB113 [**] Use `nums4.extend((1, 2))` instead of repeatedly calling `nums4.append()` | 34 | # FURB113 35 | / nums4.append(1) @@ -106,7 +106,7 @@ FURB113.py:53:1: FURB113 Use `nums3.extend((1, 2))` instead of repeatedly callin | = help: Replace with `nums3.extend((1, 2))` -FURB113.py:56:1: FURB113 [*] Use `nums4.extend((1, 2))` instead of repeatedly calling `nums4.append()` +FURB113.py:56:1: FURB113 [**] Use `nums4.extend((1, 2))` instead of repeatedly calling `nums4.append()` | 54 | nums.append(3) 55 | # FURB113 @@ -129,7 +129,7 @@ FURB113.py:56:1: FURB113 [*] Use `nums4.extend((1, 2))` instead of repeatedly ca 59 58 | pass 60 59 | -FURB113.py:62:1: FURB113 [*] Use `nums.extend((1, 2, 3))` instead of repeatedly calling `nums.append()` +FURB113.py:62:1: FURB113 [**] Use `nums.extend((1, 2, 3))` instead of repeatedly calling `nums.append()` | 61 | # FURB113 62 | / nums.append(1) @@ -151,7 +151,7 @@ FURB113.py:62:1: FURB113 [*] Use `nums.extend((1, 2, 3))` instead of repeatedly 66 64 | 67 65 | if True: -FURB113.py:69:5: FURB113 [*] Use `nums.extend((1, 2))` instead of repeatedly calling `nums.append()` +FURB113.py:69:5: FURB113 [**] Use `nums.extend((1, 2))` instead of repeatedly calling `nums.append()` | 67 | if True: 68 | # FURB113 @@ -173,7 +173,7 @@ FURB113.py:69:5: FURB113 [*] Use `nums.extend((1, 2))` instead of repeatedly cal 72 71 | 73 72 | if True: -FURB113.py:75:5: FURB113 [*] Use `nums.extend((1, 2))` instead of repeatedly calling `nums.append()` +FURB113.py:75:5: FURB113 [**] Use `nums.extend((1, 2))` instead of repeatedly calling `nums.append()` | 73 | if True: 74 | # FURB113 @@ -209,7 +209,7 @@ FURB113.py:82:5: FURB113 Use `nums.extend((1, 2, 3))` instead of repeatedly call | = help: Replace with `nums.extend((1, 2, 3))` -FURB113.py:90:5: FURB113 [*] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` +FURB113.py:90:5: FURB113 [**] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` | 88 | def yes_one(x: list[int]): 89 | # FURB113 @@ -231,7 +231,7 @@ FURB113.py:90:5: FURB113 [*] Use `x.extend((1, 2))` instead of repeatedly callin 93 92 | 94 93 | def yes_two(x: List[int]): -FURB113.py:96:5: FURB113 [*] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` +FURB113.py:96:5: FURB113 [**] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` | 94 | def yes_two(x: List[int]): 95 | # FURB113 @@ -253,7 +253,7 @@ FURB113.py:96:5: FURB113 [*] Use `x.extend((1, 2))` instead of repeatedly callin 99 98 | 100 99 | def yes_three(*, x: list[int]): -FURB113.py:102:5: FURB113 [*] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` +FURB113.py:102:5: FURB113 [**] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` | 100 | def yes_three(*, x: list[int]): 101 | # FURB113 @@ -275,7 +275,7 @@ FURB113.py:102:5: FURB113 [*] Use `x.extend((1, 2))` instead of repeatedly calli 105 104 | 106 105 | def yes_four(x: list[int], /): -FURB113.py:108:5: FURB113 [*] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` +FURB113.py:108:5: FURB113 [**] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` | 106 | def yes_four(x: list[int], /): 107 | # FURB113 @@ -310,7 +310,7 @@ FURB113.py:114:5: FURB113 Use `x.extend((1, 2, 3))` instead of repeatedly callin | = help: Replace with `x.extend((1, 2, 3))` -FURB113.py:122:5: FURB113 [*] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` +FURB113.py:122:5: FURB113 [**] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` | 120 | def yes_six(x: list): 121 | # FURB113 diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB131_FURB131.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB131_FURB131.py.snap index 14ad4d9c3cf9a3..53835ec8c180e5 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB131_FURB131.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB131_FURB131.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/refurb/mod.rs --- -FURB131.py:11:1: FURB131 [*] Prefer `clear` over deleting a full slice +FURB131.py:11:1: FURB131 [**] Prefer `clear` over deleting a full slice | 10 | # FURB131 11 | del nums[:] @@ -19,7 +19,7 @@ FURB131.py:11:1: FURB131 [*] Prefer `clear` over deleting a full slice 13 13 | 14 14 | # FURB131 -FURB131.py:15:1: FURB131 [*] Prefer `clear` over deleting a full slice +FURB131.py:15:1: FURB131 [**] Prefer `clear` over deleting a full slice | 14 | # FURB131 15 | del names[:] @@ -53,7 +53,7 @@ FURB131.py:23:1: FURB131 Prefer `clear` over deleting a full slice | = help: Replace with `clear()` -FURB131.py:28:5: FURB131 [*] Prefer `clear` over deleting a full slice +FURB131.py:28:5: FURB131 [**] Prefer `clear` over deleting a full slice | 26 | def yes_one(x: list[int]): 27 | # FURB131 @@ -72,7 +72,7 @@ FURB131.py:28:5: FURB131 [*] Prefer `clear` over deleting a full slice 30 30 | 31 31 | def yes_two(x: dict[int, str]): -FURB131.py:33:5: FURB131 [*] Prefer `clear` over deleting a full slice +FURB131.py:33:5: FURB131 [**] Prefer `clear` over deleting a full slice | 31 | def yes_two(x: dict[int, str]): 32 | # FURB131 @@ -91,7 +91,7 @@ FURB131.py:33:5: FURB131 [*] Prefer `clear` over deleting a full slice 35 35 | 36 36 | def yes_three(x: List[int]): -FURB131.py:38:5: FURB131 [*] Prefer `clear` over deleting a full slice +FURB131.py:38:5: FURB131 [**] Prefer `clear` over deleting a full slice | 36 | def yes_three(x: List[int]): 37 | # FURB131 @@ -110,7 +110,7 @@ FURB131.py:38:5: FURB131 [*] Prefer `clear` over deleting a full slice 40 40 | 41 41 | def yes_four(x: Dict[int, str]): -FURB131.py:43:5: FURB131 [*] Prefer `clear` over deleting a full slice +FURB131.py:43:5: FURB131 [**] Prefer `clear` over deleting a full slice | 41 | def yes_four(x: Dict[int, str]): 42 | # FURB131 diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB132_FURB132.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB132_FURB132.py.snap index 25c2e3746bb26d..7e21ec3d7bd8ba 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB132_FURB132.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB132_FURB132.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/refurb/mod.rs --- -FURB132.py:12:1: FURB132 [*] Use `s.discard("x")` instead of check and `remove` +FURB132.py:12:1: FURB132 [**] Use `s.discard("x")` instead of check and `remove` | 11 | # FURB132 12 | / if "x" in s: @@ -21,7 +21,7 @@ FURB132.py:12:1: FURB132 [*] Use `s.discard("x")` instead of check and `remove` 15 14 | 16 15 | # FURB132 -FURB132.py:22:1: FURB132 [*] Use `s3.discard("x")` instead of check and `remove` +FURB132.py:22:1: FURB132 [**] Use `s3.discard("x")` instead of check and `remove` | 21 | # FURB132 22 | / if "x" in s3: @@ -41,7 +41,7 @@ FURB132.py:22:1: FURB132 [*] Use `s3.discard("x")` instead of check and `remove` 25 24 | 26 25 | var = "y" -FURB132.py:28:1: FURB132 [*] Use `s.discard(var)` instead of check and `remove` +FURB132.py:28:1: FURB132 [**] Use `s.discard(var)` instead of check and `remove` | 26 | var = "y" 27 | # FURB132 @@ -62,7 +62,7 @@ FURB132.py:28:1: FURB132 [*] Use `s.discard(var)` instead of check and `remove` 31 30 | 32 31 | if f"{var}:{var}" in s: -FURB132.py:32:1: FURB132 [*] Use `s.discard(f"{var}:{var}")` instead of check and `remove` +FURB132.py:32:1: FURB132 [**] Use `s.discard(f"{var}:{var}")` instead of check and `remove` | 32 | / if f"{var}:{var}" in s: 33 | | s.remove(f"{var}:{var}") diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB140_FURB140.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB140_FURB140.py.snap index 89541187db04b7..52811c0d0e9ca0 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB140_FURB140.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB140_FURB140.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/refurb/mod.rs --- -FURB140.py:7:1: FURB140 [*] Use `itertools.starmap` instead of the generator +FURB140.py:7:1: FURB140 [**] Use `itertools.starmap` instead of the generator | 6 | # FURB140 7 | [print(x, y) for x, y in zipped()] @@ -25,7 +25,7 @@ FURB140.py:7:1: FURB140 [*] Use `itertools.starmap` instead of the generator 9 10 | # FURB140 10 11 | (print(x, y) for x, y in zipped()) -FURB140.py:10:1: FURB140 [*] Use `itertools.starmap` instead of the generator +FURB140.py:10:1: FURB140 [**] Use `itertools.starmap` instead of the generator | 9 | # FURB140 10 | (print(x, y) for x, y in zipped()) @@ -50,7 +50,7 @@ FURB140.py:10:1: FURB140 [*] Use `itertools.starmap` instead of the generator 12 13 | # FURB140 13 14 | {print(x, y) for x, y in zipped()} -FURB140.py:13:1: FURB140 [*] Use `itertools.starmap` instead of the generator +FURB140.py:13:1: FURB140 [**] Use `itertools.starmap` instead of the generator | 12 | # FURB140 13 | {print(x, y) for x, y in zipped()} @@ -73,7 +73,7 @@ FURB140.py:13:1: FURB140 [*] Use `itertools.starmap` instead of the generator 15 16 | 16 17 | from itertools import starmap as sm -FURB140.py:19:1: FURB140 [*] Use `itertools.starmap` instead of the generator +FURB140.py:19:1: FURB140 [**] Use `itertools.starmap` instead of the generator | 18 | # FURB140 19 | [print(x, y) for x, y in zipped()] @@ -93,7 +93,7 @@ FURB140.py:19:1: FURB140 [*] Use `itertools.starmap` instead of the generator 21 21 | # FURB140 22 22 | (print(x, y) for x, y in zipped()) -FURB140.py:22:1: FURB140 [*] Use `itertools.starmap` instead of the generator +FURB140.py:22:1: FURB140 [**] Use `itertools.starmap` instead of the generator | 21 | # FURB140 22 | (print(x, y) for x, y in zipped()) @@ -113,7 +113,7 @@ FURB140.py:22:1: FURB140 [*] Use `itertools.starmap` instead of the generator 24 24 | # FURB140 25 25 | {print(x, y) for x, y in zipped()} -FURB140.py:25:1: FURB140 [*] Use `itertools.starmap` instead of the generator +FURB140.py:25:1: FURB140 [**] Use `itertools.starmap` instead of the generator | 24 | # FURB140 25 | {print(x, y) for x, y in zipped()} @@ -133,7 +133,7 @@ FURB140.py:25:1: FURB140 [*] Use `itertools.starmap` instead of the generator 27 27 | # FURB140 (check it still flags starred arguments). 28 28 | # See https://github.com/astral-sh/ruff/issues/7636 -FURB140.py:29:1: FURB140 [*] Use `itertools.starmap` instead of the generator +FURB140.py:29:1: FURB140 [**] Use `itertools.starmap` instead of the generator | 27 | # FURB140 (check it still flags starred arguments). 28 | # See https://github.com/astral-sh/ruff/issues/7636 @@ -154,7 +154,7 @@ FURB140.py:29:1: FURB140 [*] Use `itertools.starmap` instead of the generator 31 31 | {foo(*t) for t in [(85, 60), (100, 80)]} 32 32 | -FURB140.py:30:1: FURB140 [*] Use `itertools.starmap` instead of the generator +FURB140.py:30:1: FURB140 [**] Use `itertools.starmap` instead of the generator | 28 | # See https://github.com/astral-sh/ruff/issues/7636 29 | [foo(*t) for t in [(85, 60), (100, 80)]] @@ -174,7 +174,7 @@ FURB140.py:30:1: FURB140 [*] Use `itertools.starmap` instead of the generator 32 32 | 33 33 | # Non-errors. -FURB140.py:31:1: FURB140 [*] Use `itertools.starmap` instead of the generator +FURB140.py:31:1: FURB140 [**] Use `itertools.starmap` instead of the generator | 29 | [foo(*t) for t in [(85, 60), (100, 80)]] 30 | (foo(*t) for t in [(85, 60), (100, 80)]) diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB145_FURB145.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB145_FURB145.py.snap index 742f089ebf25d3..7247ad82bcd758 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB145_FURB145.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB145_FURB145.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/refurb/mod.rs --- -FURB145.py:4:5: FURB145 [*] Prefer `copy` method over slicing +FURB145.py:4:5: FURB145 [**] Prefer `copy` method over slicing | 3 | # Errors. 4 | a = l[:] @@ -21,7 +21,7 @@ FURB145.py:4:5: FURB145 [*] Prefer `copy` method over slicing 6 6 | d, e = l[:], 1 7 7 | m = l[::] -FURB145.py:5:11: FURB145 [*] Prefer `copy` method over slicing +FURB145.py:5:11: FURB145 [**] Prefer `copy` method over slicing | 3 | # Errors. 4 | a = l[:] @@ -42,7 +42,7 @@ FURB145.py:5:11: FURB145 [*] Prefer `copy` method over slicing 7 7 | m = l[::] 8 8 | l[:] -FURB145.py:6:8: FURB145 [*] Prefer `copy` method over slicing +FURB145.py:6:8: FURB145 [**] Prefer `copy` method over slicing | 4 | a = l[:] 5 | b, c = 1, l[:] @@ -63,7 +63,7 @@ FURB145.py:6:8: FURB145 [*] Prefer `copy` method over slicing 8 8 | l[:] 9 9 | print(l[:]) -FURB145.py:7:5: FURB145 [*] Prefer `copy` method over slicing +FURB145.py:7:5: FURB145 [**] Prefer `copy` method over slicing | 5 | b, c = 1, l[:] 6 | d, e = l[:], 1 @@ -84,7 +84,7 @@ FURB145.py:7:5: FURB145 [*] Prefer `copy` method over slicing 9 9 | print(l[:]) 10 10 | -FURB145.py:8:1: FURB145 [*] Prefer `copy` method over slicing +FURB145.py:8:1: FURB145 [**] Prefer `copy` method over slicing | 6 | d, e = l[:], 1 7 | m = l[::] @@ -104,7 +104,7 @@ FURB145.py:8:1: FURB145 [*] Prefer `copy` method over slicing 10 10 | 11 11 | # False negatives. -FURB145.py:9:7: FURB145 [*] Prefer `copy` method over slicing +FURB145.py:9:7: FURB145 [**] Prefer `copy` method over slicing | 7 | m = l[::] 8 | l[:] diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB148_FURB148.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB148_FURB148.py.snap index a64560382bb591..fac8fc566037b2 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB148_FURB148.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB148_FURB148.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/refurb/mod.rs --- -FURB148.py:14:17: FURB148 [*] `enumerate` value is unused, use `for x in range(len(y))` instead +FURB148.py:14:17: FURB148 [**] `enumerate` value is unused, use `for x in range(len(y))` instead | 13 | # Errors 14 | for index, _ in enumerate(books): @@ -20,7 +20,7 @@ FURB148.py:14:17: FURB148 [*] `enumerate` value is unused, use `for x in range(l 16 16 | 17 17 | for index, _ in enumerate(books, start=0): -FURB148.py:17:17: FURB148 [*] `enumerate` value is unused, use `for x in range(len(y))` instead +FURB148.py:17:17: FURB148 [**] `enumerate` value is unused, use `for x in range(len(y))` instead | 15 | print(index) 16 | @@ -40,7 +40,7 @@ FURB148.py:17:17: FURB148 [*] `enumerate` value is unused, use `for x in range(l 19 19 | 20 20 | for index, _ in enumerate(books, 0): -FURB148.py:20:17: FURB148 [*] `enumerate` value is unused, use `for x in range(len(y))` instead +FURB148.py:20:17: FURB148 [**] `enumerate` value is unused, use `for x in range(len(y))` instead | 18 | print(index) 19 | @@ -100,7 +100,7 @@ FURB148.py:32:17: FURB148 `enumerate` value is unused, use `for x in range(len(y | = help: Replace with `range(len(...))` -FURB148.py:35:16: FURB148 [*] `enumerate` index is unused, use `for x in y` instead +FURB148.py:35:16: FURB148 [**] `enumerate` index is unused, use `for x in y` instead | 33 | print(book) 34 | @@ -120,7 +120,7 @@ FURB148.py:35:16: FURB148 [*] `enumerate` index is unused, use `for x in y` inst 37 37 | 38 38 | for _, book in enumerate(books, start=0): -FURB148.py:38:16: FURB148 [*] `enumerate` index is unused, use `for x in y` instead +FURB148.py:38:16: FURB148 [**] `enumerate` index is unused, use `for x in y` instead | 36 | print(book) 37 | @@ -140,7 +140,7 @@ FURB148.py:38:16: FURB148 [*] `enumerate` index is unused, use `for x in y` inst 40 40 | 41 41 | for _, book in enumerate(books, 0): -FURB148.py:41:16: FURB148 [*] `enumerate` index is unused, use `for x in y` instead +FURB148.py:41:16: FURB148 [**] `enumerate` index is unused, use `for x in y` instead | 39 | print(book) 40 | @@ -160,7 +160,7 @@ FURB148.py:41:16: FURB148 [*] `enumerate` index is unused, use `for x in y` inst 43 43 | 44 44 | for _, book in enumerate(books, start=1): -FURB148.py:44:16: FURB148 [*] `enumerate` index is unused, use `for x in y` instead +FURB148.py:44:16: FURB148 [**] `enumerate` index is unused, use `for x in y` instead | 42 | print(book) 43 | @@ -180,7 +180,7 @@ FURB148.py:44:16: FURB148 [*] `enumerate` index is unused, use `for x in y` inst 46 46 | 47 47 | for _, book in enumerate(books, 1): -FURB148.py:47:16: FURB148 [*] `enumerate` index is unused, use `for x in y` instead +FURB148.py:47:16: FURB148 [**] `enumerate` index is unused, use `for x in y` instead | 45 | print(book) 46 | @@ -200,7 +200,7 @@ FURB148.py:47:16: FURB148 [*] `enumerate` index is unused, use `for x in y` inst 49 49 | 50 50 | for _, book in enumerate(books, start=x): -FURB148.py:50:16: FURB148 [*] `enumerate` index is unused, use `for x in y` instead +FURB148.py:50:16: FURB148 [**] `enumerate` index is unused, use `for x in y` instead | 48 | print(book) 49 | @@ -220,7 +220,7 @@ FURB148.py:50:16: FURB148 [*] `enumerate` index is unused, use `for x in y` inst 52 52 | 53 53 | for _, book in enumerate(books, x): -FURB148.py:53:16: FURB148 [*] `enumerate` index is unused, use `for x in y` instead +FURB148.py:53:16: FURB148 [**] `enumerate` index is unused, use `for x in y` instead | 51 | print(book) 52 | @@ -240,7 +240,7 @@ FURB148.py:53:16: FURB148 [*] `enumerate` index is unused, use `for x in y` inst 55 55 | 56 56 | for index, (_, _) in enumerate(books): -FURB148.py:56:22: FURB148 [*] `enumerate` value is unused, use `for x in range(len(y))` instead +FURB148.py:56:22: FURB148 [**] `enumerate` value is unused, use `for x in range(len(y))` instead | 54 | print(book) 55 | @@ -260,7 +260,7 @@ FURB148.py:56:22: FURB148 [*] `enumerate` value is unused, use `for x in range(l 58 58 | 59 59 | for (_, _), book in enumerate(books): -FURB148.py:59:21: FURB148 [*] `enumerate` index is unused, use `for x in y` instead +FURB148.py:59:21: FURB148 [**] `enumerate` index is unused, use `for x in y` instead | 57 | print(index) 58 | @@ -280,7 +280,7 @@ FURB148.py:59:21: FURB148 [*] `enumerate` index is unused, use `for x in y` inst 61 61 | 62 62 | for(index, _)in enumerate(books): -FURB148.py:62:17: FURB148 [*] `enumerate` value is unused, use `for x in range(len(y))` instead +FURB148.py:62:17: FURB148 [**] `enumerate` value is unused, use `for x in range(len(y))` instead | 60 | print(book) 61 | @@ -300,7 +300,7 @@ FURB148.py:62:17: FURB148 [*] `enumerate` value is unused, use `for x in range(l 64 64 | 65 65 | for(index), _ in enumerate(books): -FURB148.py:65:18: FURB148 [*] `enumerate` value is unused, use `for x in range(len(y))` instead +FURB148.py:65:18: FURB148 [**] `enumerate` value is unused, use `for x in range(len(y))` instead | 63 | print(index) 64 | @@ -320,7 +320,7 @@ FURB148.py:65:18: FURB148 [*] `enumerate` value is unused, use `for x in range(l 67 67 | 68 68 | for index, _ in enumerate(books_and_authors): -FURB148.py:68:17: FURB148 [*] `enumerate` value is unused, use `for x in range(len(y))` instead +FURB148.py:68:17: FURB148 [**] `enumerate` value is unused, use `for x in range(len(y))` instead | 66 | print(index) 67 | @@ -340,7 +340,7 @@ FURB148.py:68:17: FURB148 [*] `enumerate` value is unused, use `for x in range(l 70 70 | 71 71 | for _, book in enumerate(books_and_authors): -FURB148.py:71:16: FURB148 [*] `enumerate` index is unused, use `for x in y` instead +FURB148.py:71:16: FURB148 [**] `enumerate` index is unused, use `for x in y` instead | 69 | print(index) 70 | @@ -360,7 +360,7 @@ FURB148.py:71:16: FURB148 [*] `enumerate` index is unused, use `for x in y` inst 73 73 | 74 74 | for index, _ in enumerate(books_set): -FURB148.py:74:17: FURB148 [*] `enumerate` value is unused, use `for x in range(len(y))` instead +FURB148.py:74:17: FURB148 [**] `enumerate` value is unused, use `for x in range(len(y))` instead | 72 | print(book) 73 | @@ -380,7 +380,7 @@ FURB148.py:74:17: FURB148 [*] `enumerate` value is unused, use `for x in range(l 76 76 | 77 77 | for _, book in enumerate(books_set): -FURB148.py:77:16: FURB148 [*] `enumerate` index is unused, use `for x in y` instead +FURB148.py:77:16: FURB148 [**] `enumerate` index is unused, use `for x in y` instead | 75 | print(index) 76 | @@ -400,7 +400,7 @@ FURB148.py:77:16: FURB148 [*] `enumerate` index is unused, use `for x in y` inst 79 79 | 80 80 | for index, _ in enumerate(books_tuple): -FURB148.py:80:17: FURB148 [*] `enumerate` value is unused, use `for x in range(len(y))` instead +FURB148.py:80:17: FURB148 [**] `enumerate` value is unused, use `for x in range(len(y))` instead | 78 | print(book) 79 | @@ -420,7 +420,7 @@ FURB148.py:80:17: FURB148 [*] `enumerate` value is unused, use `for x in range(l 82 82 | 83 83 | for _, book in enumerate(books_tuple): -FURB148.py:83:16: FURB148 [*] `enumerate` index is unused, use `for x in y` instead +FURB148.py:83:16: FURB148 [**] `enumerate` index is unused, use `for x in y` instead | 81 | print(index) 82 | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__PY39_RUF013_RUF013_0.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__PY39_RUF013_RUF013_0.py.snap index f472f1f9f2eaf4..f9c83b5aabbae0 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__PY39_RUF013_RUF013_0.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__PY39_RUF013_RUF013_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/ruff/mod.rs --- -RUF013_0.py:21:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:21:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 21 | def f(arg: int = None): # RUF013 | ^^^ RUF013 @@ -19,7 +19,7 @@ RUF013_0.py:21:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 23 23 | 24 24 | -RUF013_0.py:25:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:25:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 25 | def f(arg: str = None): # RUF013 | ^^^ RUF013 @@ -37,7 +37,7 @@ RUF013_0.py:25:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 27 27 | 28 28 | -RUF013_0.py:29:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:29:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 29 | def f(arg: typing.List[str] = None): # RUF013 | ^^^^^^^^^^^^^^^^ RUF013 @@ -55,7 +55,7 @@ RUF013_0.py:29:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 31 31 | 32 32 | -RUF013_0.py:33:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:33:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 33 | def f(arg: Tuple[str] = None): # RUF013 | ^^^^^^^^^^ RUF013 @@ -73,7 +73,7 @@ RUF013_0.py:33:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 35 35 | 36 36 | -RUF013_0.py:71:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:71:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 71 | def f(arg: Union = None): # RUF013 | ^^^^^ RUF013 @@ -91,7 +91,7 @@ RUF013_0.py:71:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 73 73 | 74 74 | -RUF013_0.py:75:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:75:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 75 | def f(arg: Union[int] = None): # RUF013 | ^^^^^^^^^^ RUF013 @@ -109,7 +109,7 @@ RUF013_0.py:75:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 77 77 | 78 78 | -RUF013_0.py:79:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:79:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 79 | def f(arg: Union[int, str] = None): # RUF013 | ^^^^^^^^^^^^^^^ RUF013 @@ -127,7 +127,7 @@ RUF013_0.py:79:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 81 81 | 82 82 | -RUF013_0.py:83:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:83:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 83 | def f(arg: typing.Union[int, str] = None): # RUF013 | ^^^^^^^^^^^^^^^^^^^^^^ RUF013 @@ -145,7 +145,7 @@ RUF013_0.py:83:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 85 85 | 86 86 | -RUF013_0.py:102:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:102:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 102 | def f(arg: int | float = None): # RUF013 | ^^^^^^^^^^^ RUF013 @@ -163,7 +163,7 @@ RUF013_0.py:102:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 104 104 | 105 105 | -RUF013_0.py:106:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:106:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 106 | def f(arg: int | float | str | bytes = None): # RUF013 | ^^^^^^^^^^^^^^^^^^^^^^^^^ RUF013 @@ -181,7 +181,7 @@ RUF013_0.py:106:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 108 108 | 109 109 | -RUF013_0.py:125:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:125:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 125 | def f(arg: Literal[1] = None): # RUF013 | ^^^^^^^^^^ RUF013 @@ -199,7 +199,7 @@ RUF013_0.py:125:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 127 127 | 128 128 | -RUF013_0.py:129:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:129:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 129 | def f(arg: Literal[1, "foo"] = None): # RUF013 | ^^^^^^^^^^^^^^^^^ RUF013 @@ -217,7 +217,7 @@ RUF013_0.py:129:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 131 131 | 132 132 | -RUF013_0.py:133:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:133:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 133 | def f(arg: typing.Literal[1, "foo", True] = None): # RUF013 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUF013 @@ -235,7 +235,7 @@ RUF013_0.py:133:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 135 135 | 136 136 | -RUF013_0.py:152:22: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:152:22: RUF013 [**] PEP 484 prohibits implicit `Optional` | 152 | def f(arg: Annotated[int, ...] = None): # RUF013 | ^^^ RUF013 @@ -253,7 +253,7 @@ RUF013_0.py:152:22: RUF013 [*] PEP 484 prohibits implicit `Optional` 154 154 | 155 155 | -RUF013_0.py:156:32: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:156:32: RUF013 [**] PEP 484 prohibits implicit `Optional` | 156 | def f(arg: Annotated[Annotated[int | str, ...], ...] = None): # RUF013 | ^^^^^^^^^ RUF013 @@ -271,7 +271,7 @@ RUF013_0.py:156:32: RUF013 [*] PEP 484 prohibits implicit `Optional` 158 158 | 159 159 | -RUF013_0.py:172:11: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:172:11: RUF013 [**] PEP 484 prohibits implicit `Optional` | 171 | def f( 172 | arg1: int = None, # RUF013 @@ -291,7 +291,7 @@ RUF013_0.py:172:11: RUF013 [*] PEP 484 prohibits implicit `Optional` 174 174 | arg3: Literal[1, 2, 3] = None, # RUF013 175 175 | ): -RUF013_0.py:173:11: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:173:11: RUF013 [**] PEP 484 prohibits implicit `Optional` | 171 | def f( 172 | arg1: int = None, # RUF013 @@ -312,7 +312,7 @@ RUF013_0.py:173:11: RUF013 [*] PEP 484 prohibits implicit `Optional` 175 175 | ): 176 176 | pass -RUF013_0.py:174:11: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:174:11: RUF013 [**] PEP 484 prohibits implicit `Optional` | 172 | arg1: int = None, # RUF013 173 | arg2: Union[int, float] = None, # RUF013 @@ -333,7 +333,7 @@ RUF013_0.py:174:11: RUF013 [*] PEP 484 prohibits implicit `Optional` 176 176 | pass 177 177 | -RUF013_0.py:202:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:202:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 202 | def f(arg: Union[Annotated[int, ...], Union[str, bytes]] = None): # RUF013 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUF013 @@ -351,7 +351,7 @@ RUF013_0.py:202:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 204 204 | 205 205 | -RUF013_0.py:209:13: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:209:13: RUF013 [**] PEP 484 prohibits implicit `Optional` | 209 | def f(arg: "int" = None): # RUF013 | ^^^ RUF013 @@ -369,7 +369,7 @@ RUF013_0.py:209:13: RUF013 [*] PEP 484 prohibits implicit `Optional` 211 211 | 212 212 | -RUF013_0.py:213:13: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:213:13: RUF013 [**] PEP 484 prohibits implicit `Optional` | 213 | def f(arg: "str" = None): # RUF013 | ^^^ RUF013 @@ -395,7 +395,7 @@ RUF013_0.py:217:12: RUF013 PEP 484 prohibits implicit `Optional` | = help: Convert to `Optional[T]` -RUF013_0.py:225:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:225:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 225 | def f(arg: Union["int", "str"] = None): # RUF013 | ^^^^^^^^^^^^^^^^^^^ RUF013 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__PY39_RUF013_RUF013_1.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__PY39_RUF013_RUF013_1.py.snap index 6647c659483723..330d1d707476bb 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__PY39_RUF013_RUF013_1.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__PY39_RUF013_RUF013_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/ruff/mod.rs --- -RUF013_1.py:4:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_1.py:4:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 4 | def f(arg: int = None): # RUF011 | ^^^ RUF013 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF005_RUF005.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF005_RUF005.py.snap index baf307a873ffe8..505c6f6ba86ec0 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF005_RUF005.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF005_RUF005.py.snap @@ -42,7 +42,7 @@ RUF005.py:16:10: RUF005 Consider `[*first, 4, 5, 6]` instead of concatenation | = help: Replace with `[*first, 4, 5, 6]` -RUF005.py:39:7: RUF005 [*] Consider `[1, 2, 3, *foo]` instead of concatenation +RUF005.py:39:7: RUF005 [**] Consider `[1, 2, 3, *foo]` instead of concatenation | 38 | foo = [4, 5, 6] 39 | bar = [1, 2, 3] + foo @@ -62,7 +62,7 @@ RUF005.py:39:7: RUF005 [*] Consider `[1, 2, 3, *foo]` instead of concatenation 41 41 | quux = (7, 8, 9) + zoob 42 42 | spam = quux + (10, 11, 12) -RUF005.py:41:8: RUF005 [*] Consider `(7, 8, 9, *zoob)` instead of concatenation +RUF005.py:41:8: RUF005 [**] Consider `(7, 8, 9, *zoob)` instead of concatenation | 39 | bar = [1, 2, 3] + foo 40 | zoob = tuple(bar) @@ -83,7 +83,7 @@ RUF005.py:41:8: RUF005 [*] Consider `(7, 8, 9, *zoob)` instead of concatenation 43 43 | spom = list(spam) 44 44 | eggs = spom + [13, 14, 15] -RUF005.py:42:8: RUF005 [*] Consider `(*quux, 10, 11, 12)` instead of concatenation +RUF005.py:42:8: RUF005 [**] Consider `(*quux, 10, 11, 12)` instead of concatenation | 40 | zoob = tuple(bar) 41 | quux = (7, 8, 9) + zoob @@ -104,7 +104,7 @@ RUF005.py:42:8: RUF005 [*] Consider `(*quux, 10, 11, 12)` instead of concatenati 44 44 | eggs = spom + [13, 14, 15] 45 45 | elatement = ("we all say",) + yay() -RUF005.py:44:8: RUF005 [*] Consider `[*spom, 13, 14, 15]` instead of concatenation +RUF005.py:44:8: RUF005 [**] Consider `[*spom, 13, 14, 15]` instead of concatenation | 42 | spam = quux + (10, 11, 12) 43 | spom = list(spam) @@ -125,7 +125,7 @@ RUF005.py:44:8: RUF005 [*] Consider `[*spom, 13, 14, 15]` instead of concatenati 46 46 | excitement = ("we all think",) + Fun().yay() 47 47 | astonishment = ("we all feel",) + Fun.words -RUF005.py:45:13: RUF005 [*] Consider `("we all say", *yay())` instead of concatenation +RUF005.py:45:13: RUF005 [**] Consider `("we all say", *yay())` instead of concatenation | 43 | spom = list(spam) 44 | eggs = spom + [13, 14, 15] @@ -146,7 +146,7 @@ RUF005.py:45:13: RUF005 [*] Consider `("we all say", *yay())` instead of concate 47 47 | astonishment = ("we all feel",) + Fun.words 48 48 | -RUF005.py:46:14: RUF005 [*] Consider `("we all think", *Fun().yay())` instead of concatenation +RUF005.py:46:14: RUF005 [**] Consider `("we all think", *Fun().yay())` instead of concatenation | 44 | eggs = spom + [13, 14, 15] 45 | elatement = ("we all say",) + yay() @@ -166,7 +166,7 @@ RUF005.py:46:14: RUF005 [*] Consider `("we all think", *Fun().yay())` instead of 48 48 | 49 49 | chain = ["a", "b", "c"] + eggs + list(("yes", "no", "pants") + zoob) -RUF005.py:47:16: RUF005 [*] Consider `("we all feel", *Fun.words)` instead of concatenation +RUF005.py:47:16: RUF005 [**] Consider `("we all feel", *Fun.words)` instead of concatenation | 45 | elatement = ("we all say",) + yay() 46 | excitement = ("we all think",) + Fun().yay() @@ -187,7 +187,7 @@ RUF005.py:47:16: RUF005 [*] Consider `("we all feel", *Fun.words)` instead of co 49 49 | chain = ["a", "b", "c"] + eggs + list(("yes", "no", "pants") + zoob) 50 50 | -RUF005.py:49:9: RUF005 [*] Consider iterable unpacking instead of concatenation +RUF005.py:49:9: RUF005 [**] Consider iterable unpacking instead of concatenation | 47 | astonishment = ("we all feel",) + Fun.words 48 | @@ -208,7 +208,7 @@ RUF005.py:49:9: RUF005 [*] Consider iterable unpacking instead of concatenation 51 51 | baz = () + zoob 52 52 | -RUF005.py:49:39: RUF005 [*] Consider `("yes", "no", "pants", *zoob)` instead of concatenation +RUF005.py:49:39: RUF005 [**] Consider `("yes", "no", "pants", *zoob)` instead of concatenation | 47 | astonishment = ("we all feel",) + Fun.words 48 | @@ -229,7 +229,7 @@ RUF005.py:49:39: RUF005 [*] Consider `("yes", "no", "pants", *zoob)` instead of 51 51 | baz = () + zoob 52 52 | -RUF005.py:51:7: RUF005 [*] Consider `(*zoob,)` instead of concatenation +RUF005.py:51:7: RUF005 [**] Consider `(*zoob,)` instead of concatenation | 49 | chain = ["a", "b", "c"] + eggs + list(("yes", "no", "pants") + zoob) 50 | @@ -250,7 +250,7 @@ RUF005.py:51:7: RUF005 [*] Consider `(*zoob,)` instead of concatenation 53 53 | [] + foo + [ 54 54 | ] -RUF005.py:53:1: RUF005 [*] Consider `[*foo]` instead of concatenation +RUF005.py:53:1: RUF005 [**] Consider `[*foo]` instead of concatenation | 51 | baz = () + zoob 52 | @@ -273,7 +273,7 @@ RUF005.py:53:1: RUF005 [*] Consider `[*foo]` instead of concatenation 56 55 | pylint_call = [sys.executable, "-m", "pylint"] + args + [path] 57 56 | pylint_call_tuple = (sys.executable, "-m", "pylint") + args + (path, path2) -RUF005.py:56:15: RUF005 [*] Consider `[sys.executable, "-m", "pylint", *args, path]` instead of concatenation +RUF005.py:56:15: RUF005 [**] Consider `[sys.executable, "-m", "pylint", *args, path]` instead of concatenation | 54 | ] 55 | @@ -294,7 +294,7 @@ RUF005.py:56:15: RUF005 [*] Consider `[sys.executable, "-m", "pylint", *args, pa 58 58 | b = a + [2, 3] + [4] 59 59 | -RUF005.py:57:21: RUF005 [*] Consider iterable unpacking instead of concatenation +RUF005.py:57:21: RUF005 [**] Consider iterable unpacking instead of concatenation | 56 | pylint_call = [sys.executable, "-m", "pylint"] + args + [path] 57 | pylint_call_tuple = (sys.executable, "-m", "pylint") + args + (path, path2) @@ -313,7 +313,7 @@ RUF005.py:57:21: RUF005 [*] Consider iterable unpacking instead of concatenation 59 59 | 60 60 | # Uses the non-preferred quote style, which should be retained. -RUF005.py:58:5: RUF005 [*] Consider `[*a, 2, 3, 4]` instead of concatenation +RUF005.py:58:5: RUF005 [**] Consider `[*a, 2, 3, 4]` instead of concatenation | 56 | pylint_call = [sys.executable, "-m", "pylint"] + args + [path] 57 | pylint_call_tuple = (sys.executable, "-m", "pylint") + args + (path, path2) @@ -334,7 +334,7 @@ RUF005.py:58:5: RUF005 [*] Consider `[*a, 2, 3, 4]` instead of concatenation 60 60 | # Uses the non-preferred quote style, which should be retained. 61 61 | f"{a() + ['b']}" -RUF005.py:61:4: RUF005 [*] Consider `[*a(), 'b']` instead of concatenation +RUF005.py:61:4: RUF005 [**] Consider `[*a(), 'b']` instead of concatenation | 60 | # Uses the non-preferred quote style, which should be retained. 61 | f"{a() + ['b']}" diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF013_RUF013_0.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF013_RUF013_0.py.snap index 10634c0520c031..ad642299b6ef94 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF013_RUF013_0.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF013_RUF013_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/ruff/mod.rs --- -RUF013_0.py:21:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:21:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 21 | def f(arg: int = None): # RUF013 | ^^^ RUF013 @@ -19,7 +19,7 @@ RUF013_0.py:21:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 23 23 | 24 24 | -RUF013_0.py:25:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:25:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 25 | def f(arg: str = None): # RUF013 | ^^^ RUF013 @@ -37,7 +37,7 @@ RUF013_0.py:25:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 27 27 | 28 28 | -RUF013_0.py:29:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:29:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 29 | def f(arg: typing.List[str] = None): # RUF013 | ^^^^^^^^^^^^^^^^ RUF013 @@ -55,7 +55,7 @@ RUF013_0.py:29:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 31 31 | 32 32 | -RUF013_0.py:33:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:33:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 33 | def f(arg: Tuple[str] = None): # RUF013 | ^^^^^^^^^^ RUF013 @@ -73,7 +73,7 @@ RUF013_0.py:33:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 35 35 | 36 36 | -RUF013_0.py:71:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:71:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 71 | def f(arg: Union = None): # RUF013 | ^^^^^ RUF013 @@ -91,7 +91,7 @@ RUF013_0.py:71:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 73 73 | 74 74 | -RUF013_0.py:75:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:75:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 75 | def f(arg: Union[int] = None): # RUF013 | ^^^^^^^^^^ RUF013 @@ -109,7 +109,7 @@ RUF013_0.py:75:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 77 77 | 78 78 | -RUF013_0.py:79:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:79:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 79 | def f(arg: Union[int, str] = None): # RUF013 | ^^^^^^^^^^^^^^^ RUF013 @@ -127,7 +127,7 @@ RUF013_0.py:79:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 81 81 | 82 82 | -RUF013_0.py:83:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:83:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 83 | def f(arg: typing.Union[int, str] = None): # RUF013 | ^^^^^^^^^^^^^^^^^^^^^^ RUF013 @@ -145,7 +145,7 @@ RUF013_0.py:83:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 85 85 | 86 86 | -RUF013_0.py:102:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:102:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 102 | def f(arg: int | float = None): # RUF013 | ^^^^^^^^^^^ RUF013 @@ -163,7 +163,7 @@ RUF013_0.py:102:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 104 104 | 105 105 | -RUF013_0.py:106:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:106:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 106 | def f(arg: int | float | str | bytes = None): # RUF013 | ^^^^^^^^^^^^^^^^^^^^^^^^^ RUF013 @@ -181,7 +181,7 @@ RUF013_0.py:106:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 108 108 | 109 109 | -RUF013_0.py:125:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:125:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 125 | def f(arg: Literal[1] = None): # RUF013 | ^^^^^^^^^^ RUF013 @@ -199,7 +199,7 @@ RUF013_0.py:125:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 127 127 | 128 128 | -RUF013_0.py:129:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:129:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 129 | def f(arg: Literal[1, "foo"] = None): # RUF013 | ^^^^^^^^^^^^^^^^^ RUF013 @@ -217,7 +217,7 @@ RUF013_0.py:129:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 131 131 | 132 132 | -RUF013_0.py:133:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:133:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 133 | def f(arg: typing.Literal[1, "foo", True] = None): # RUF013 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUF013 @@ -235,7 +235,7 @@ RUF013_0.py:133:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 135 135 | 136 136 | -RUF013_0.py:152:22: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:152:22: RUF013 [**] PEP 484 prohibits implicit `Optional` | 152 | def f(arg: Annotated[int, ...] = None): # RUF013 | ^^^ RUF013 @@ -253,7 +253,7 @@ RUF013_0.py:152:22: RUF013 [*] PEP 484 prohibits implicit `Optional` 154 154 | 155 155 | -RUF013_0.py:156:32: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:156:32: RUF013 [**] PEP 484 prohibits implicit `Optional` | 156 | def f(arg: Annotated[Annotated[int | str, ...], ...] = None): # RUF013 | ^^^^^^^^^ RUF013 @@ -271,7 +271,7 @@ RUF013_0.py:156:32: RUF013 [*] PEP 484 prohibits implicit `Optional` 158 158 | 159 159 | -RUF013_0.py:172:11: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:172:11: RUF013 [**] PEP 484 prohibits implicit `Optional` | 171 | def f( 172 | arg1: int = None, # RUF013 @@ -291,7 +291,7 @@ RUF013_0.py:172:11: RUF013 [*] PEP 484 prohibits implicit `Optional` 174 174 | arg3: Literal[1, 2, 3] = None, # RUF013 175 175 | ): -RUF013_0.py:173:11: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:173:11: RUF013 [**] PEP 484 prohibits implicit `Optional` | 171 | def f( 172 | arg1: int = None, # RUF013 @@ -312,7 +312,7 @@ RUF013_0.py:173:11: RUF013 [*] PEP 484 prohibits implicit `Optional` 175 175 | ): 176 176 | pass -RUF013_0.py:174:11: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:174:11: RUF013 [**] PEP 484 prohibits implicit `Optional` | 172 | arg1: int = None, # RUF013 173 | arg2: Union[int, float] = None, # RUF013 @@ -333,7 +333,7 @@ RUF013_0.py:174:11: RUF013 [*] PEP 484 prohibits implicit `Optional` 176 176 | pass 177 177 | -RUF013_0.py:202:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:202:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 202 | def f(arg: Union[Annotated[int, ...], Union[str, bytes]] = None): # RUF013 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUF013 @@ -351,7 +351,7 @@ RUF013_0.py:202:12: RUF013 [*] PEP 484 prohibits implicit `Optional` 204 204 | 205 205 | -RUF013_0.py:209:13: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:209:13: RUF013 [**] PEP 484 prohibits implicit `Optional` | 209 | def f(arg: "int" = None): # RUF013 | ^^^ RUF013 @@ -369,7 +369,7 @@ RUF013_0.py:209:13: RUF013 [*] PEP 484 prohibits implicit `Optional` 211 211 | 212 212 | -RUF013_0.py:213:13: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:213:13: RUF013 [**] PEP 484 prohibits implicit `Optional` | 213 | def f(arg: "str" = None): # RUF013 | ^^^ RUF013 @@ -395,7 +395,7 @@ RUF013_0.py:217:12: RUF013 PEP 484 prohibits implicit `Optional` | = help: Convert to `T | None` -RUF013_0.py:225:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_0.py:225:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 225 | def f(arg: Union["int", "str"] = None): # RUF013 | ^^^^^^^^^^^^^^^^^^^ RUF013 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF013_RUF013_1.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF013_RUF013_1.py.snap index df81fc0f7faf57..11c785db98c124 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF013_RUF013_1.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF013_RUF013_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/ruff/mod.rs --- -RUF013_1.py:4:12: RUF013 [*] PEP 484 prohibits implicit `Optional` +RUF013_1.py:4:12: RUF013 [**] PEP 484 prohibits implicit `Optional` | 4 | def f(arg: int = None): # RUF011 | ^^^ RUF013 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF015_RUF015.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF015_RUF015.py.snap index 6e7933a4116267..5224dc2ed9e3ed 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF015_RUF015.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF015_RUF015.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/ruff/mod.rs --- -RUF015.py:4:1: RUF015 [*] Prefer `next(iter(x))` over single element slice +RUF015.py:4:1: RUF015 [**] Prefer `next(iter(x))` over single element slice | 3 | # RUF015 4 | list(x)[0] @@ -21,7 +21,7 @@ RUF015.py:4:1: RUF015 [*] Prefer `next(iter(x))` over single element slice 6 6 | list(i for i in x)[0] 7 7 | [i for i in x][0] -RUF015.py:5:1: RUF015 [*] Prefer `next(iter(x))` over single element slice +RUF015.py:5:1: RUF015 [**] Prefer `next(iter(x))` over single element slice | 3 | # RUF015 4 | list(x)[0] @@ -42,7 +42,7 @@ RUF015.py:5:1: RUF015 [*] Prefer `next(iter(x))` over single element slice 7 7 | [i for i in x][0] 8 8 | -RUF015.py:6:1: RUF015 [*] Prefer `next(iter(x))` over single element slice +RUF015.py:6:1: RUF015 [**] Prefer `next(iter(x))` over single element slice | 4 | list(x)[0] 5 | tuple(x)[0] @@ -62,7 +62,7 @@ RUF015.py:6:1: RUF015 [*] Prefer `next(iter(x))` over single element slice 8 8 | 9 9 | # OK (not indexing (solely) the first element) -RUF015.py:7:1: RUF015 [*] Prefer `next(iter(x))` over single element slice +RUF015.py:7:1: RUF015 [**] Prefer `next(iter(x))` over single element slice | 5 | tuple(x)[0] 6 | list(i for i in x)[0] @@ -83,7 +83,7 @@ RUF015.py:7:1: RUF015 [*] Prefer `next(iter(x))` over single element slice 9 9 | # OK (not indexing (solely) the first element) 10 10 | list(x) -RUF015.py:29:1: RUF015 [*] Prefer `next(i + 1 for i in x)` over single element slice +RUF015.py:29:1: RUF015 [**] Prefer `next(i + 1 for i in x)` over single element slice | 28 | # RUF015 (doesn't mirror the underlying list) 29 | [i + 1 for i in x][0] @@ -103,7 +103,7 @@ RUF015.py:29:1: RUF015 [*] Prefer `next(i + 1 for i in x)` over single element s 31 31 | [(i, i + 1) for i in x][0] 32 32 | -RUF015.py:30:1: RUF015 [*] Prefer `next(i for i in x if i > 5)` over single element slice +RUF015.py:30:1: RUF015 [**] Prefer `next(i for i in x if i > 5)` over single element slice | 28 | # RUF015 (doesn't mirror the underlying list) 29 | [i + 1 for i in x][0] @@ -123,7 +123,7 @@ RUF015.py:30:1: RUF015 [*] Prefer `next(i for i in x if i > 5)` over single elem 32 32 | 33 33 | # RUF015 (multiple generators) -RUF015.py:31:1: RUF015 [*] Prefer `next((i, i + 1) for i in x)` over single element slice +RUF015.py:31:1: RUF015 [**] Prefer `next((i, i + 1) for i in x)` over single element slice | 29 | [i + 1 for i in x][0] 30 | [i for i in x if i > 5][0] @@ -144,7 +144,7 @@ RUF015.py:31:1: RUF015 [*] Prefer `next((i, i + 1) for i in x)` over single elem 33 33 | # RUF015 (multiple generators) 34 34 | y = range(10) -RUF015.py:35:1: RUF015 [*] Prefer `next(i + j for i in x for j in y)` over single element slice +RUF015.py:35:1: RUF015 [**] Prefer `next(i + j for i in x for j in y)` over single element slice | 33 | # RUF015 (multiple generators) 34 | y = range(10) @@ -165,7 +165,7 @@ RUF015.py:35:1: RUF015 [*] Prefer `next(i + j for i in x for j in y)` over singl 37 37 | # RUF015 38 38 | list(range(10))[0] -RUF015.py:38:1: RUF015 [*] Prefer `next(iter(range(10)))` over single element slice +RUF015.py:38:1: RUF015 [**] Prefer `next(iter(range(10)))` over single element slice | 37 | # RUF015 38 | list(range(10))[0] @@ -185,7 +185,7 @@ RUF015.py:38:1: RUF015 [*] Prefer `next(iter(range(10)))` over single element sl 40 40 | list(x["y"])[0] 41 41 | -RUF015.py:39:1: RUF015 [*] Prefer `next(iter(x.y))` over single element slice +RUF015.py:39:1: RUF015 [**] Prefer `next(iter(x.y))` over single element slice | 37 | # RUF015 38 | list(range(10))[0] @@ -205,7 +205,7 @@ RUF015.py:39:1: RUF015 [*] Prefer `next(iter(x.y))` over single element slice 41 41 | 42 42 | # RUF015 (multi-line) -RUF015.py:40:1: RUF015 [*] Prefer `next(iter(x["y"]))` over single element slice +RUF015.py:40:1: RUF015 [**] Prefer `next(iter(x["y"]))` over single element slice | 38 | list(range(10))[0] 39 | list(x.y)[0] @@ -226,7 +226,7 @@ RUF015.py:40:1: RUF015 [*] Prefer `next(iter(x["y"]))` over single element slice 42 42 | # RUF015 (multi-line) 43 43 | revision_heads_map_ast = [ -RUF015.py:43:26: RUF015 [*] Prefer `next(...)` over single element slice +RUF015.py:43:26: RUF015 [**] Prefer `next(...)` over single element slice | 42 | # RUF015 (multi-line) 43 | revision_heads_map_ast = [ diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF017_RUF017_0.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF017_RUF017_0.py.snap index 3d30ebbcbbbe6e..5bf23f636f0e64 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF017_RUF017_0.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF017_RUF017_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/ruff/mod.rs --- -RUF017_0.py:5:1: RUF017 [*] Avoid quadratic list summation +RUF017_0.py:5:1: RUF017 [**] Avoid quadratic list summation | 4 | # RUF017 5 | sum([x, y], start=[]) @@ -24,7 +24,7 @@ RUF017_0.py:5:1: RUF017 [*] Avoid quadratic list summation 7 9 | sum([[1, 2, 3], [4, 5, 6]], start=[]) 8 10 | sum([[1, 2, 3], [4, 5, 6]], []) -RUF017_0.py:6:1: RUF017 [*] Avoid quadratic list summation +RUF017_0.py:6:1: RUF017 [**] Avoid quadratic list summation | 4 | # RUF017 5 | sum([x, y], start=[]) @@ -49,7 +49,7 @@ RUF017_0.py:6:1: RUF017 [*] Avoid quadratic list summation 8 10 | sum([[1, 2, 3], [4, 5, 6]], []) 9 11 | sum([[1, 2, 3], [4, 5, 6]], -RUF017_0.py:7:1: RUF017 [*] Avoid quadratic list summation +RUF017_0.py:7:1: RUF017 [**] Avoid quadratic list summation | 5 | sum([x, y], start=[]) 6 | sum([x, y], []) @@ -75,7 +75,7 @@ RUF017_0.py:7:1: RUF017 [*] Avoid quadratic list summation 9 11 | sum([[1, 2, 3], [4, 5, 6]], 10 12 | []) -RUF017_0.py:8:1: RUF017 [*] Avoid quadratic list summation +RUF017_0.py:8:1: RUF017 [**] Avoid quadratic list summation | 6 | sum([x, y], []) 7 | sum([[1, 2, 3], [4, 5, 6]], start=[]) @@ -102,7 +102,7 @@ RUF017_0.py:8:1: RUF017 [*] Avoid quadratic list summation 10 12 | []) 11 13 | -RUF017_0.py:9:1: RUF017 [*] Avoid quadratic list summation +RUF017_0.py:9:1: RUF017 [**] Avoid quadratic list summation | 7 | sum([[1, 2, 3], [4, 5, 6]], start=[]) 8 | sum([[1, 2, 3], [4, 5, 6]], []) @@ -131,7 +131,7 @@ RUF017_0.py:9:1: RUF017 [*] Avoid quadratic list summation 12 13 | # OK 13 14 | sum([x, y]) -RUF017_0.py:21:5: RUF017 [*] Avoid quadratic list summation +RUF017_0.py:21:5: RUF017 [**] Avoid quadratic list summation | 19 | import functools, operator 20 | @@ -150,7 +150,7 @@ RUF017_0.py:21:5: RUF017 [*] Avoid quadratic list summation 23 23 | 24 24 | # Regression test for: https://github.com/astral-sh/ruff/issues/7718 -RUF017_0.py:26:5: RUF017 [*] Avoid quadratic list summation +RUF017_0.py:26:5: RUF017 [**] Avoid quadratic list summation | 24 | # Regression test for: https://github.com/astral-sh/ruff/issues/7718 25 | def func(): diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF017_RUF017_1.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF017_RUF017_1.py.snap index 65bb00fdeb0d04..8f9bc4fe7aa13e 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF017_RUF017_1.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF017_RUF017_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/ruff/mod.rs --- -RUF017_1.py:1:1: RUF017 [*] Avoid quadratic list summation +RUF017_1.py:1:1: RUF017 [**] Avoid quadratic list summation | 1 | sum((factor.dims for factor in bases), []) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUF017 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__noqa.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__noqa.snap index 17d3c4a376fbc1..12a5e6ce36e243 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__noqa.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__noqa.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/ruff/mod.rs --- -noqa.py:23:5: F841 [*] Local variable `I` is assigned to but never used +noqa.py:23:5: F841 [**] Local variable `I` is assigned to but never used | 21 | def f(): 22 | # Only `E741` should be ignored by the `noqa`. 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 d1842091b0d9ca..0c153033654183 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 @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/ruff/mod.rs --- -RUF100_0.py:9:12: RUF100 [*] Unused blanket `noqa` directive +RUF100_0.py:9:12: RUF100 [**] Unused blanket `noqa` directive | 8 | # Invalid 9 | c = 1 # noqa @@ -20,7 +20,7 @@ RUF100_0.py:9:12: RUF100 [*] Unused blanket `noqa` directive 11 11 | 12 12 | # Invalid -RUF100_0.py:13:12: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_0.py:13:12: RUF100 [**] Unused `noqa` directive (unused: `E501`) | 12 | # Invalid 13 | d = 1 # noqa: E501 @@ -40,7 +40,7 @@ RUF100_0.py:13:12: RUF100 [*] Unused `noqa` directive (unused: `E501`) 15 15 | # Invalid 16 16 | d = 1 # noqa: F841, E501 -RUF100_0.py:16:12: RUF100 [*] Unused `noqa` directive (unused: `F841`, `E501`) +RUF100_0.py:16:12: RUF100 [**] Unused `noqa` directive (unused: `F841`, `E501`) | 15 | # Invalid 16 | d = 1 # noqa: F841, E501 @@ -60,7 +60,7 @@ RUF100_0.py:16:12: RUF100 [*] Unused `noqa` directive (unused: `F841`, `E501`) 18 18 | # Invalid (and unimplemented or not enabled) 19 19 | d = 1 # noqa: F841, W191, F821 -RUF100_0.py:19:12: RUF100 [*] Unused `noqa` directive (unused: `F841`, `W191`; non-enabled: `F821`) +RUF100_0.py:19:12: RUF100 [**] Unused `noqa` directive (unused: `F841`, `W191`; non-enabled: `F821`) | 18 | # Invalid (and unimplemented or not enabled) 19 | d = 1 # noqa: F841, W191, F821 @@ -80,7 +80,7 @@ RUF100_0.py:19:12: RUF100 [*] Unused `noqa` directive (unused: `F841`, `W191`; n 21 21 | # Invalid (but external) 22 22 | d = 1 # noqa: F841, V101 -RUF100_0.py:22:12: RUF100 [*] Unused `noqa` directive (unused: `F841`) +RUF100_0.py:22:12: RUF100 [**] Unused `noqa` directive (unused: `F841`) | 21 | # Invalid (but external) 22 | d = 1 # noqa: F841, V101 @@ -100,7 +100,7 @@ RUF100_0.py:22:12: RUF100 [*] Unused `noqa` directive (unused: `F841`) 24 24 | # fmt: off 25 25 | # Invalid - no space before # -RUF100_0.py:26:10: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_0.py:26:10: RUF100 [**] Unused `noqa` directive (unused: `E501`) | 24 | # fmt: off 25 | # Invalid - no space before # @@ -121,7 +121,7 @@ RUF100_0.py:26:10: RUF100 [*] Unused `noqa` directive (unused: `E501`) 28 28 | # Invalid - many spaces before # 29 29 | d = 1 # noqa: E501 -RUF100_0.py:29:5: F841 [*] Local variable `d` is assigned to but never used +RUF100_0.py:29:5: F841 [**] Local variable `d` is assigned to but never used | 28 | # Invalid - many spaces before # 29 | d = 1 # noqa: E501 @@ -139,7 +139,7 @@ RUF100_0.py:29:5: F841 [*] Local variable `d` is assigned to but never used 31 30 | 32 31 | -RUF100_0.py:29:33: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_0.py:29:33: RUF100 [**] Unused `noqa` directive (unused: `E501`) | 28 | # Invalid - many spaces before # 29 | d = 1 # noqa: E501 @@ -158,7 +158,7 @@ RUF100_0.py:29:33: RUF100 [*] Unused `noqa` directive (unused: `E501`) 31 31 | 32 32 | -RUF100_0.py:55:6: RUF100 [*] Unused `noqa` directive (unused: `F841`) +RUF100_0.py:55:6: RUF100 [**] Unused `noqa` directive (unused: `F841`) | 54 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 55 | """ # noqa: E501, F841 @@ -178,7 +178,7 @@ RUF100_0.py:55:6: RUF100 [*] Unused `noqa` directive (unused: `F841`) 57 57 | # Invalid 58 58 | _ = """Lorem ipsum dolor sit amet. -RUF100_0.py:63:6: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_0.py:63:6: RUF100 [**] Unused `noqa` directive (unused: `E501`) | 62 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor. 63 | """ # noqa: E501 @@ -198,7 +198,7 @@ RUF100_0.py:63:6: RUF100 [*] Unused `noqa` directive (unused: `E501`) 65 65 | # Invalid 66 66 | _ = """Lorem ipsum dolor sit amet. -RUF100_0.py:71:6: RUF100 [*] Unused blanket `noqa` directive +RUF100_0.py:71:6: RUF100 [**] Unused blanket `noqa` directive | 70 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor. 71 | """ # noqa @@ -245,7 +245,7 @@ RUF100_0.py:90:89: E501 Line too long (89 > 88 characters) | ^ E501 | -RUF100_0.py:90:92: RUF100 [*] Unused `noqa` directive (unused: `F401`) +RUF100_0.py:90:92: RUF100 [**] Unused `noqa` directive (unused: `F401`) | 88 | print(sys.path) 89 | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_1.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_1.snap index 288d46d007d67a..4735ed8cb91a40 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_1.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_1.snap @@ -22,7 +22,7 @@ RUF100_1.py:37:9: F401 [*] `typing.Union` imported but unused 40 39 | 41 40 | def f(): -RUF100_1.py:52:20: RUF100 [*] Unused `noqa` directive (unused: `F401`) +RUF100_1.py:52:20: RUF100 [**] Unused `noqa` directive (unused: `F401`) | 50 | # This should ignore the error, but the inner noqa should be marked as unused. 51 | from typing import ( # noqa: F401 @@ -42,7 +42,7 @@ RUF100_1.py:52:20: RUF100 [*] Unused `noqa` directive (unused: `F401`) 54 54 | 55 55 | -RUF100_1.py:59:20: RUF100 [*] Unused `noqa` directive (unused: `F401`) +RUF100_1.py:59:20: RUF100 [**] Unused `noqa` directive (unused: `F401`) | 57 | # This should ignore the error, but the inner noqa should be marked as unused. 58 | from typing import ( # noqa @@ -62,7 +62,7 @@ RUF100_1.py:59:20: RUF100 [*] Unused `noqa` directive (unused: `F401`) 61 61 | 62 62 | -RUF100_1.py:66:16: RUF100 [*] Unused `noqa` directive (non-enabled: `F501`) +RUF100_1.py:66:16: RUF100 [**] Unused `noqa` directive (non-enabled: `F501`) | 64 | # This should ignore the error, but mark F501 as unused. 65 | from typing import ( # noqa: F401 @@ -82,7 +82,7 @@ RUF100_1.py:66:16: RUF100 [*] Unused `noqa` directive (non-enabled: `F501`) 68 68 | 69 69 | -RUF100_1.py:72:27: RUF100 [*] Unused `noqa` directive (non-enabled: `F501`) +RUF100_1.py:72:27: RUF100 [**] Unused `noqa` directive (non-enabled: `F501`) | 70 | def f(): 71 | # This should ignore the error, but mark F501 as unused. @@ -135,7 +135,7 @@ RUF100_1.py:89:35: F401 [*] `typing.AwaitableGenerator` imported but unused 89 |- from typing import Awaitable, AwaitableGenerator # noqa: F501 89 |+ pass # noqa: F501 -RUF100_1.py:89:55: RUF100 [*] Unused `noqa` directive (non-enabled: `F501`) +RUF100_1.py:89:55: RUF100 [**] Unused `noqa` directive (non-enabled: `F501`) | 87 | def f(): 88 | # This should mark F501 as unused. diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_2.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_2.snap index 3de393b1c95a4a..90e13752ec1b9e 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_2.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_2.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/ruff/mod.rs --- -RUF100_2.py:1:19: RUF100 [*] Unused `noqa` directive (unused: `F401`) +RUF100_2.py:1:19: RUF100 [**] Unused `noqa` directive (unused: `F401`) | 1 | import itertools # noqa: F401 | ^^^^^^^^^^^^ RUF100 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_3.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_3.snap index f7c08b2403df8d..9ad710e1886dfe 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_3.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_3.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/ruff/mod.rs --- -RUF100_3.py:1:1: RUF100 [*] Unused blanket `noqa` directive +RUF100_3.py:1:1: RUF100 [**] Unused blanket `noqa` directive | 1 | # noqa | ^^^^^^ RUF100 @@ -16,7 +16,7 @@ RUF100_3.py:1:1: RUF100 [*] Unused blanket `noqa` directive 3 2 | print() # noqa 4 3 | print() # noqa # comment -RUF100_3.py:2:1: RUF100 [*] Unused blanket `noqa` directive +RUF100_3.py:2:1: RUF100 [**] Unused blanket `noqa` directive | 1 | # noqa 2 | # noqa # comment @@ -34,7 +34,7 @@ RUF100_3.py:2:1: RUF100 [*] Unused blanket `noqa` directive 4 4 | print() # noqa # comment 5 5 | print() # noqa # comment -RUF100_3.py:3:10: RUF100 [*] Unused blanket `noqa` directive +RUF100_3.py:3:10: RUF100 [**] Unused blanket `noqa` directive | 1 | # noqa 2 | # noqa # comment @@ -54,7 +54,7 @@ RUF100_3.py:3:10: RUF100 [*] Unused blanket `noqa` directive 5 5 | print() # noqa # comment 6 6 | print() # noqa comment -RUF100_3.py:4:10: RUF100 [*] Unused blanket `noqa` directive +RUF100_3.py:4:10: RUF100 [**] Unused blanket `noqa` directive | 2 | # noqa # comment 3 | print() # noqa @@ -75,7 +75,7 @@ RUF100_3.py:4:10: RUF100 [*] Unused blanket `noqa` directive 6 6 | print() # noqa comment 7 7 | print() # noqa comment -RUF100_3.py:5:10: RUF100 [*] Unused blanket `noqa` directive +RUF100_3.py:5:10: RUF100 [**] Unused blanket `noqa` directive | 3 | print() # noqa 4 | print() # noqa # comment @@ -96,7 +96,7 @@ RUF100_3.py:5:10: RUF100 [*] Unused blanket `noqa` directive 7 7 | print() # noqa comment 8 8 | print(a) # noqa -RUF100_3.py:6:10: RUF100 [*] Unused blanket `noqa` directive +RUF100_3.py:6:10: RUF100 [**] Unused blanket `noqa` directive | 4 | print() # noqa # comment 5 | print() # noqa # comment @@ -117,7 +117,7 @@ RUF100_3.py:6:10: RUF100 [*] Unused blanket `noqa` directive 8 8 | print(a) # noqa 9 9 | print(a) # noqa # comment -RUF100_3.py:7:10: RUF100 [*] Unused blanket `noqa` directive +RUF100_3.py:7:10: RUF100 [**] Unused blanket `noqa` directive | 5 | print() # noqa # comment 6 | print() # noqa comment @@ -138,7 +138,7 @@ RUF100_3.py:7:10: RUF100 [*] Unused blanket `noqa` directive 9 9 | print(a) # noqa # comment 10 10 | print(a) # noqa # comment -RUF100_3.py:14:1: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) +RUF100_3.py:14:1: RUF100 [**] Unused `noqa` directive (unused: `E501`, `F821`) | 12 | print(a) # noqa comment 13 | @@ -158,7 +158,7 @@ RUF100_3.py:14:1: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) 16 15 | print() # noqa: E501, F821 17 16 | print() # noqa: E501, F821 # comment -RUF100_3.py:15:1: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) +RUF100_3.py:15:1: RUF100 [**] Unused `noqa` directive (unused: `E501`, `F821`) | 14 | # noqa: E501, F821 15 | # noqa: E501, F821 # comment @@ -178,7 +178,7 @@ RUF100_3.py:15:1: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) 17 17 | print() # noqa: E501, F821 # comment 18 18 | print() # noqa: E501, F821 # comment -RUF100_3.py:16:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) +RUF100_3.py:16:10: RUF100 [**] Unused `noqa` directive (unused: `E501`, `F821`) | 14 | # noqa: E501, F821 15 | # noqa: E501, F821 # comment @@ -199,7 +199,7 @@ RUF100_3.py:16:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) 18 18 | print() # noqa: E501, F821 # comment 19 19 | print() # noqa: E501, F821 comment -RUF100_3.py:17:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) +RUF100_3.py:17:10: RUF100 [**] Unused `noqa` directive (unused: `E501`, `F821`) | 15 | # noqa: E501, F821 # comment 16 | print() # noqa: E501, F821 @@ -220,7 +220,7 @@ RUF100_3.py:17:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) 19 19 | print() # noqa: E501, F821 comment 20 20 | print() # noqa: E501, F821 comment -RUF100_3.py:18:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) +RUF100_3.py:18:10: RUF100 [**] Unused `noqa` directive (unused: `E501`, `F821`) | 16 | print() # noqa: E501, F821 17 | print() # noqa: E501, F821 # comment @@ -241,7 +241,7 @@ RUF100_3.py:18:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) 20 20 | print() # noqa: E501, F821 comment 21 21 | print(a) # noqa: E501, F821 -RUF100_3.py:19:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) +RUF100_3.py:19:10: RUF100 [**] Unused `noqa` directive (unused: `E501`, `F821`) | 17 | print() # noqa: E501, F821 # comment 18 | print() # noqa: E501, F821 # comment @@ -262,7 +262,7 @@ RUF100_3.py:19:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) 21 21 | print(a) # noqa: E501, F821 22 22 | print(a) # noqa: E501, F821 # comment -RUF100_3.py:20:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) +RUF100_3.py:20:10: RUF100 [**] Unused `noqa` directive (unused: `E501`, `F821`) | 18 | print() # noqa: E501, F821 # comment 19 | print() # noqa: E501, F821 comment @@ -283,7 +283,7 @@ RUF100_3.py:20:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) 22 22 | print(a) # noqa: E501, F821 # comment 23 23 | print(a) # noqa: E501, F821 # comment -RUF100_3.py:21:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_3.py:21:11: RUF100 [**] Unused `noqa` directive (unused: `E501`) | 19 | print() # noqa: E501, F821 comment 20 | print() # noqa: E501, F821 comment @@ -304,7 +304,7 @@ RUF100_3.py:21:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) 23 23 | print(a) # noqa: E501, F821 # comment 24 24 | print(a) # noqa: E501, F821 comment -RUF100_3.py:22:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_3.py:22:11: RUF100 [**] Unused `noqa` directive (unused: `E501`) | 20 | print() # noqa: E501, F821 comment 21 | print(a) # noqa: E501, F821 @@ -325,7 +325,7 @@ RUF100_3.py:22:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) 24 24 | print(a) # noqa: E501, F821 comment 25 25 | print(a) # noqa: E501, F821 comment -RUF100_3.py:23:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_3.py:23:11: RUF100 [**] Unused `noqa` directive (unused: `E501`) | 21 | print(a) # noqa: E501, F821 22 | print(a) # noqa: E501, F821 # comment @@ -345,7 +345,7 @@ RUF100_3.py:23:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) 24 24 | print(a) # noqa: E501, F821 comment 25 25 | print(a) # noqa: E501, F821 comment -RUF100_3.py:24:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_3.py:24:11: RUF100 [**] Unused `noqa` directive (unused: `E501`) | 22 | print(a) # noqa: E501, F821 # comment 23 | print(a) # noqa: E501, F821 # comment @@ -363,7 +363,7 @@ RUF100_3.py:24:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) 24 |+print(a) # noqa: F821 comment 25 25 | print(a) # noqa: E501, F821 comment -RUF100_3.py:25:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_3.py:25:11: RUF100 [**] Unused `noqa` directive (unused: `E501`) | 23 | print(a) # noqa: E501, F821 # comment 24 | print(a) # noqa: E501, F821 comment diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_5.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_5.snap index 0808aaab058fe8..3dc0b89b463b46 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_5.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_5.snap @@ -33,7 +33,7 @@ RUF100_5.py:11:1: ERA001 [*] Found commented-out code 10 10 | 11 |-#import os # noqa: E501 -RUF100_5.py:11:13: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_5.py:11:13: RUF100 [**] Unused `noqa` directive (unused: `E501`) | 11 | #import os # noqa: E501 | ^^^^^^^^^^^^ RUF100 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_codes.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_codes.snap index 974eba08c4e831..dc5cd3af52a6a0 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_codes.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_codes.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/ruff/mod.rs --- -ruff_noqa_codes.py:8:5: F841 [*] Local variable `x` is assigned to but never used +ruff_noqa_codes.py:8:5: F841 [**] Local variable `x` is assigned to but never used | 7 | def f(): 8 | x = 1 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_invalid.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_invalid.snap index c267b245b6535a..94ba2d975e9478 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_invalid.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_invalid.snap @@ -14,7 +14,7 @@ ruff_noqa_invalid.py:1:8: F401 [*] `os` imported but unused 3 2 | 4 3 | def f(): -ruff_noqa_invalid.py:5:5: F841 [*] Local variable `x` is assigned to but never used +ruff_noqa_invalid.py:5:5: F841 [**] Local variable `x` is assigned to but never used | 4 | def f(): 5 | x = 1 diff --git a/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__verbose-raise_TRY201.py.snap b/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__verbose-raise_TRY201.py.snap index 6a15b3815f265a..a793b8bce48741 100644 --- a/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__verbose-raise_TRY201.py.snap +++ b/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__verbose-raise_TRY201.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/tryceratops/mod.rs --- -TRY201.py:20:15: TRY201 [*] Use `raise` without specifying exception name +TRY201.py:20:15: TRY201 [**] Use `raise` without specifying exception name | 18 | except MyException as e: 19 | logger.exception("process failed") @@ -20,7 +20,7 @@ TRY201.py:20:15: TRY201 [*] Use `raise` without specifying exception name 22 22 | 23 23 | def good(): -TRY201.py:63:19: TRY201 [*] Use `raise` without specifying exception name +TRY201.py:63:19: TRY201 [**] Use `raise` without specifying exception name | 61 | logger.exception("process failed") 62 | if True: @@ -39,7 +39,7 @@ TRY201.py:63:19: TRY201 [*] Use `raise` without specifying exception name 65 65 | 66 66 | def bad_that_needs_recursion_2(): -TRY201.py:74:23: TRY201 [*] Use `raise` without specifying exception name +TRY201.py:74:23: TRY201 [**] Use `raise` without specifying exception name | 73 | def foo(): 74 | raise e diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__unused_variable.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__unused_variable.snap index 24253dc073ad8b..be0132e57dbbde 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__unused_variable.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__unused_variable.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/linter.rs --- -unused_variable.ipynb:cell 1:2:5: F841 [*] Local variable `foo1` is assigned to but never used +unused_variable.ipynb:cell 1:2:5: F841 [**] Local variable `foo1` is assigned to but never used | 1 | def f(): 2 | foo1 = %matplotlib --list @@ -18,7 +18,7 @@ unused_variable.ipynb:cell 1:2:5: F841 [*] Local variable `foo1` is assigned to 4 4 | def f(): 5 5 | bar1 = !pwd -unused_variable.ipynb:cell 1:3:5: F841 [*] Local variable `foo2` is assigned to but never used +unused_variable.ipynb:cell 1:3:5: F841 [**] Local variable `foo2` is assigned to but never used | 1 | def f(): 2 | foo1 = %matplotlib --list @@ -36,7 +36,7 @@ unused_variable.ipynb:cell 1:3:5: F841 [*] Local variable `foo2` is assigned to 5 5 | bar1 = !pwd 6 6 | bar2: str = !pwd -unused_variable.ipynb:cell 2:2:5: F841 [*] Local variable `bar1` is assigned to but never used +unused_variable.ipynb:cell 2:2:5: F841 [**] Local variable `bar1` is assigned to but never used | 1 | def f(): 2 | bar1 = !pwd @@ -53,7 +53,7 @@ unused_variable.ipynb:cell 2:2:5: F841 [*] Local variable `bar1` is assigned to 5 |+ !pwd 6 6 | bar2: str = !pwd -unused_variable.ipynb:cell 2:3:5: F841 [*] Local variable `bar2` is assigned to but never used +unused_variable.ipynb:cell 2:3:5: F841 [**] Local variable `bar2` is assigned to but never used | 1 | def f(): 2 | bar1 = !pwd