From 838832a87d17f5ce5b9d642c511fed0fbab03b40 Mon Sep 17 00:00:00 2001 From: Jonathan Plasse <13716151+JonathanPlasse@users.noreply.github.com> Date: Fri, 17 Mar 2023 08:17:32 +0100 Subject: [PATCH] Separate iterations in snapshots --- ...s__eradicate__tests__ERA001_ERA001.py.snap | 162 +- ..._flake8_2020__tests__YTT101_YTT101.py.snap | 78 +- ..._flake8_2020__tests__YTT102_YTT102.py.snap | 52 +- ..._flake8_2020__tests__YTT103_YTT103.py.snap | 130 +- ..._flake8_2020__tests__YTT201_YTT201.py.snap | 104 +- ..._flake8_2020__tests__YTT202_YTT202.py.snap | 52 +- ..._flake8_2020__tests__YTT203_YTT203.py.snap | 52 +- ..._flake8_2020__tests__YTT204_YTT204.py.snap | 52 +- ..._flake8_2020__tests__YTT301_YTT301.py.snap | 52 +- ..._flake8_2020__tests__YTT302_YTT302.py.snap | 130 +- ..._flake8_2020__tests__YTT303_YTT303.py.snap | 52 +- ...tations__tests__allow_nested_overload.snap | 4 +- ...e8_annotations__tests__allow_overload.snap | 26 +- ...nnotations__tests__allow_star_arg_any.snap | 104 +- ...__flake8_annotations__tests__defaults.snap | 598 +++---- ...otations__tests__ignore_fully_untyped.snap | 130 +- ..._annotations__tests__mypy_init_return.snap | 122 +- ...notations__tests__suppress_dummy_args.snap | 4 +- ...tions__tests__suppress_none_returning.snap | 78 +- ...s__flake8_bandit__tests__S101_S101.py.snap | 78 +- ...s__flake8_bandit__tests__S102_S102.py.snap | 52 +- ...s__flake8_bandit__tests__S103_S103.py.snap | 338 ++-- ...s__flake8_bandit__tests__S104_S104.py.snap | 104 +- ...s__flake8_bandit__tests__S105_S105.py.snap | 1014 ++++++------ ...s__flake8_bandit__tests__S106_S106.py.snap | 26 +- ...s__flake8_bandit__tests__S107_S107.py.snap | 130 +- ...s__flake8_bandit__tests__S108_S108.py.snap | 78 +- ...es__flake8_bandit__tests__S108_extend.snap | 104 +- ...s__flake8_bandit__tests__S110_S110.py.snap | 52 +- ...les__flake8_bandit__tests__S110_typed.snap | 78 +- ...s__flake8_bandit__tests__S112_S112.py.snap | 104 +- ...s__flake8_bandit__tests__S113_S113.py.snap | 364 ++--- ...s__flake8_bandit__tests__S324_S324.py.snap | 338 ++-- ...s__flake8_bandit__tests__S501_S501.py.snap | 468 +++--- ...s__flake8_bandit__tests__S506_S506.py.snap | 52 +- ...s__flake8_bandit__tests__S508_S508.py.snap | 52 +- ...s__flake8_bandit__tests__S509_S509.py.snap | 52 +- ...s__flake8_bandit__tests__S608_S608.py.snap | 1170 ++++++------- ...s__flake8_bandit__tests__S612_S612.py.snap | 26 +- ...s__flake8_bandit__tests__S701_S701.py.snap | 130 +- ...e8_blind_except__tests__BLE001_BLE.py.snap | 260 +-- ...e8_boolean_trap__tests__FBT001_FBT.py.snap | 234 +-- ...e8_boolean_trap__tests__FBT002_FBT.py.snap | 104 +- ...e8_boolean_trap__tests__FBT003_FBT.py.snap | 78 +- ...__flake8_bugbear__tests__B002_B002.py.snap | 52 +- ...__flake8_bugbear__tests__B003_B003.py.snap | 26 +- ...__flake8_bugbear__tests__B004_B004.py.snap | 52 +- ...__flake8_bugbear__tests__B005_B005.py.snap | 208 +-- ...ke8_bugbear__tests__B006_B006_B008.py.snap | 364 ++--- ...__flake8_bugbear__tests__B007_B007.py.snap | 348 ++-- ...ke8_bugbear__tests__B008_B006_B008.py.snap | 390 ++--- ...ke8_bugbear__tests__B009_B009_B010.py.snap | 196 +-- ...ke8_bugbear__tests__B010_B009_B010.py.snap | 168 +- ...__flake8_bugbear__tests__B011_B011.py.snap | 62 +- ...__flake8_bugbear__tests__B012_B012.py.snap | 286 ++-- ...__flake8_bugbear__tests__B013_B013.py.snap | 28 +- ...__flake8_bugbear__tests__B014_B014.py.snap | 84 +- ...__flake8_bugbear__tests__B015_B015.py.snap | 104 +- ...__flake8_bugbear__tests__B016_B016.py.snap | 78 +- ...__flake8_bugbear__tests__B017_B017.py.snap | 26 +- ...__flake8_bugbear__tests__B018_B018.py.snap | 624 +++---- ...__flake8_bugbear__tests__B019_B019.py.snap | 208 +-- ...__flake8_bugbear__tests__B020_B020.py.snap | 78 +- ...__flake8_bugbear__tests__B021_B021.py.snap | 260 +-- ...__flake8_bugbear__tests__B022_B022.py.snap | 52 +- ...__flake8_bugbear__tests__B023_B023.py.snap | 624 +++---- ...__flake8_bugbear__tests__B024_B024.py.snap | 156 +- ...__flake8_bugbear__tests__B025_B025.py.snap | 104 +- ...__flake8_bugbear__tests__B026_B026.py.snap | 182 +-- ...__flake8_bugbear__tests__B027_B027.py.snap | 104 +- ..._flake8_bugbear__tests__B027_B027.pyi.snap | 2 +- ...__flake8_bugbear__tests__B029_B029.py.snap | 52 +- ...__flake8_bugbear__tests__B030_B030.py.snap | 104 +- ...__flake8_bugbear__tests__B032_B032.py.snap | 208 +-- ...__flake8_bugbear__tests__B904_B904.py.snap | 156 +- ...__flake8_bugbear__tests__B905_B905.py.snap | 182 +-- ...ugbear__tests__extend_immutable_calls.snap | 26 +- ..._flake8_builtins__tests__A001_A001.py.snap | 520 +++--- ...sts__A001_A001.py_builtins_ignorelist.snap | 468 +++--- ..._flake8_builtins__tests__A002_A002.py.snap | 234 +-- ...sts__A002_A002.py_builtins_ignorelist.snap | 182 +-- ..._flake8_builtins__tests__A003_A003.py.snap | 104 +- ...sts__A003_A003.py_builtins_ignorelist.snap | 52 +- ...rules__flake8_commas__tests__COM81.py.snap | 1452 ++++++++--------- ...8_comprehensions__tests__C400_C400.py.snap | 56 +- ...8_comprehensions__tests__C401_C401.py.snap | 140 +- ...8_comprehensions__tests__C402_C402.py.snap | 112 +- ...8_comprehensions__tests__C403_C403.py.snap | 56 +- ...8_comprehensions__tests__C404_C404.py.snap | 28 +- ...8_comprehensions__tests__C405_C405.py.snap | 252 +-- ...8_comprehensions__tests__C406_C406.py.snap | 112 +- ...8_comprehensions__tests__C408_C408.py.snap | 112 +- ...low_dict_calls_with_keyword_arguments.snap | 84 +- ...8_comprehensions__tests__C409_C409.py.snap | 140 +- ...8_comprehensions__tests__C410_C410.py.snap | 112 +- ...8_comprehensions__tests__C411_C411.py.snap | 28 +- ...8_comprehensions__tests__C413_C413.py.snap | 196 +-- ...8_comprehensions__tests__C414_C414.py.snap | 392 ++--- ...8_comprehensions__tests__C415_C415.py.snap | 104 +- ...8_comprehensions__tests__C416_C416.py.snap | 56 +- ...8_comprehensions__tests__C417_C417.py.snap | 362 ++-- ...e8_datetimez__tests__DTZ001_DTZ001.py.snap | 130 +- ...e8_datetimez__tests__DTZ002_DTZ002.py.snap | 52 +- ...e8_datetimez__tests__DTZ003_DTZ003.py.snap | 52 +- ...e8_datetimez__tests__DTZ004_DTZ004.py.snap | 52 +- ...e8_datetimez__tests__DTZ005_DTZ005.py.snap | 130 +- ...e8_datetimez__tests__DTZ006_DTZ006.py.snap | 130 +- ...e8_datetimez__tests__DTZ007_DTZ007.py.snap | 130 +- ...e8_datetimez__tests__DTZ011_DTZ011.py.snap | 52 +- ...e8_datetimez__tests__DTZ012_DTZ012.py.snap | 52 +- ..._flake8_debugger__tests__T100_T100.py.snap | 234 +-- ..._flake8_django__tests__DJ001_DJ001.py.snap | 468 +++--- ..._flake8_django__tests__DJ003_DJ003.py.snap | 52 +- ..._flake8_django__tests__DJ006_DJ006.py.snap | 26 +- ..._flake8_django__tests__DJ007_DJ007.py.snap | 52 +- ..._flake8_django__tests__DJ008_DJ008.py.snap | 78 +- ..._flake8_django__tests__DJ013_DJ013.py.snap | 52 +- ...__rules__flake8_errmsg__tests__custom.snap | 78 +- ...rules__flake8_errmsg__tests__defaults.snap | 104 +- ...flake8_executable__tests__EXE001_1.py.snap | 26 +- ...flake8_executable__tests__EXE001_2.py.snap | 4 +- ...flake8_executable__tests__EXE001_3.py.snap | 4 +- ...flake8_executable__tests__EXE002_1.py.snap | 26 +- ...flake8_executable__tests__EXE002_2.py.snap | 4 +- ...flake8_executable__tests__EXE002_3.py.snap | 4 +- ...__flake8_executable__tests__EXE003.py.snap | 26 +- ...flake8_executable__tests__EXE004_1.py.snap | 28 +- ...flake8_executable__tests__EXE004_2.py.snap | 4 +- ...flake8_executable__tests__EXE004_3.py.snap | 26 +- ...flake8_executable__tests__EXE005_1.py.snap | 26 +- ...flake8_executable__tests__EXE005_2.py.snap | 26 +- ...flake8_executable__tests__EXE005_3.py.snap | 26 +- ...icit_str_concat__tests__ISC001_ISC.py.snap | 52 +- ...icit_str_concat__tests__ISC002_ISC.py.snap | 26 +- ...icit_str_concat__tests__ISC003_ISC.py.snap | 104 +- ...oncat__tests__multiline_ISC001_ISC.py.snap | 52 +- ...oncat__tests__multiline_ISC002_ISC.py.snap | 104 +- ...oncat__tests__multiline_ISC003_ISC.py.snap | 104 +- ...ke8_import_conventions__tests__custom.snap | 728 ++++----- ...8_import_conventions__tests__defaults.snap | 260 +-- ...port_conventions__tests__from_imports.snap | 208 +-- ..._conventions__tests__override_default.snap | 260 +-- ...rt_conventions__tests__remove_default.snap | 208 +-- ...flake8_logging_format__tests__G001.py.snap | 26 +- ...flake8_logging_format__tests__G002.py.snap | 26 +- ...flake8_logging_format__tests__G003.py.snap | 26 +- ...flake8_logging_format__tests__G004.py.snap | 26 +- ...flake8_logging_format__tests__G010.py.snap | 28 +- ...ake8_logging_format__tests__G101_1.py.snap | 26 +- ...ake8_logging_format__tests__G101_2.py.snap | 26 +- ...flake8_logging_format__tests__G201.py.snap | 52 +- ...flake8_logging_format__tests__G202.py.snap | 52 +- ..._tests__G_argparse_parser_error_ok.py.snap | 4 +- ..._logging_format__tests__G_extra_ok.py.snap | 4 +- ...rmat__tests__G_extra_str_format_ok.py.snap | 4 +- ...logging_format__tests__G_simple_ok.py.snap | 4 +- ...gging_format__tests__G_warnings_ok.py.snap | 4 +- ...ke8_no_pep420__tests__test_fail_empty.snap | 26 +- ..._no_pep420__tests__test_fail_nonempty.snap | 26 +- ...8_no_pep420__tests__test_fail_shebang.snap | 26 +- ...flake8_no_pep420__tests__test_ignored.snap | 4 +- ...ake8_no_pep420__tests__test_pass_init.snap | 4 +- ...0__tests__test_pass_namespace_package.snap | 4 +- ...lake8_no_pep420__tests__test_pass_pyi.snap | 4 +- ...e8_no_pep420__tests__test_pass_script.snap | 2 +- ...__flake8_pie__tests__PIE790_PIE790.py.snap | 570 +++---- ...__flake8_pie__tests__PIE794_PIE794.py.snap | 136 +- ...__flake8_pie__tests__PIE796_PIE796.py.snap | 182 +-- ...__flake8_pie__tests__PIE800_PIE800.py.snap | 104 +- ...__flake8_pie__tests__PIE802_PIE802.py.snap | 136 +- ...__flake8_pie__tests__PIE804_PIE804.py.snap | 130 +- ...__flake8_pie__tests__PIE807_PIE807.py.snap | 84 +- ...__flake8_pie__tests__PIE810_PIE810.py.snap | 140 +- ...es__flake8_print__tests__T201_T201.py.snap | 104 +- ...es__flake8_print__tests__T203_T203.py.snap | 52 +- ...__flake8_pyi__tests__PYI001_PYI001.py.snap | 2 +- ..._flake8_pyi__tests__PYI001_PYI001.pyi.snap | 78 +- ...__flake8_pyi__tests__PYI006_PYI006.py.snap | 2 +- ..._flake8_pyi__tests__PYI006_PYI006.pyi.snap | 156 +- ...__flake8_pyi__tests__PYI007_PYI007.py.snap | 2 +- ..._flake8_pyi__tests__PYI007_PYI007.pyi.snap | 78 +- ...__flake8_pyi__tests__PYI008_PYI008.py.snap | 2 +- ..._flake8_pyi__tests__PYI008_PYI008.pyi.snap | 26 +- ...__flake8_pyi__tests__PYI009_PYI009.py.snap | 2 +- ..._flake8_pyi__tests__PYI009_PYI009.pyi.snap | 52 +- ...__flake8_pyi__tests__PYI010_PYI010.py.snap | 2 +- ..._flake8_pyi__tests__PYI010_PYI010.pyi.snap | 78 +- ...__flake8_pyi__tests__PYI011_PYI011.py.snap | 2 +- ..._flake8_pyi__tests__PYI011_PYI011.pyi.snap | 448 ++--- ...__flake8_pyi__tests__PYI014_PYI014.py.snap | 2 +- ..._flake8_pyi__tests__PYI014_PYI014.pyi.snap | 286 ++-- ...__flake8_pyi__tests__PYI021_PYI021.py.snap | 2 +- ..._flake8_pyi__tests__PYI021_PYI021.pyi.snap | 78 +- ...__flake8_pyi__tests__PYI033_PYI033.py.snap | 2 +- ..._flake8_pyi__tests__PYI033_PYI033.pyi.snap | 286 ++-- .../ruff/src/rules/flake8_pytest_style/mod.rs | 3 +- ...e8_pytest_style__tests__PT001_default.snap | 90 +- ...st_style__tests__PT001_no_parentheses.snap | 180 +- ...es__flake8_pytest_style__tests__PT002.snap | 52 +- ...es__flake8_pytest_style__tests__PT003.snap | 244 +-- ...es__flake8_pytest_style__tests__PT004.snap | 52 +- ...es__flake8_pytest_style__tests__PT005.snap | 78 +- ...flake8_pytest_style__tests__PT006_csv.snap | 164 +- ...e8_pytest_style__tests__PT006_default.snap | 224 +-- ...lake8_pytest_style__tests__PT006_list.snap | 168 +- ...est_style__tests__PT007_list_of_lists.snap | 260 +-- ...st_style__tests__PT007_list_of_tuples.snap | 260 +-- ...st_style__tests__PT007_tuple_of_lists.snap | 312 ++-- ...t_style__tests__PT007_tuple_of_tuples.snap | 312 ++-- ...es__flake8_pytest_style__tests__PT008.snap | 312 ++-- ...es__flake8_pytest_style__tests__PT009.snap | 902 +++++----- ...es__flake8_pytest_style__tests__PT010.snap | 26 +- ...e8_pytest_style__tests__PT011_default.snap | 130 +- ..._tests__PT011_extend_broad_exceptions.snap | 156 +- ...tests__PT011_replace_broad_exceptions.snap | 26 +- ...es__flake8_pytest_style__tests__PT012.snap | 208 +-- ...es__flake8_pytest_style__tests__PT013.snap | 78 +- ...es__flake8_pytest_style__tests__PT015.snap | 442 ++--- ...es__flake8_pytest_style__tests__PT016.snap | 130 +- ...es__flake8_pytest_style__tests__PT017.snap | 26 +- ...es__flake8_pytest_style__tests__PT018.snap | 742 ++++----- ...es__flake8_pytest_style__tests__PT019.snap | 52 +- ...es__flake8_pytest_style__tests__PT020.snap | 52 +- ...es__flake8_pytest_style__tests__PT021.snap | 52 +- ...es__flake8_pytest_style__tests__PT022.snap | 30 +- ...e8_pytest_style__tests__PT023_default.snap | 150 +- ...st_style__tests__PT023_no_parentheses.snap | 150 +- ...es__flake8_pytest_style__tests__PT024.snap | 136 +- ...es__flake8_pytest_style__tests__PT025.snap | 68 +- ...es__flake8_pytest_style__tests__PT026.snap | 60 +- ...ing_doubles_over_docstring_doubles.py.snap | 140 +- ...ubles_over_docstring_doubles_class.py.snap | 56 +- ...es_over_docstring_doubles_function.py.snap | 140 +- ...docstring_doubles_module_multiline.py.snap | 56 +- ...ocstring_doubles_module_singleline.py.snap | 56 +- ...ing_doubles_over_docstring_singles.py.snap | 84 +- ...ubles_over_docstring_singles_class.py.snap | 84 +- ...es_over_docstring_singles_function.py.snap | 84 +- ...docstring_singles_module_multiline.py.snap | 28 +- ...ocstring_singles_module_singleline.py.snap | 28 +- ...ing_singles_over_docstring_doubles.py.snap | 84 +- ...ngles_over_docstring_doubles_class.py.snap | 84 +- ...es_over_docstring_doubles_function.py.snap | 84 +- ...docstring_doubles_module_multiline.py.snap | 28 +- ...ocstring_doubles_module_singleline.py.snap | 28 +- ...ing_singles_over_docstring_singles.py.snap | 168 +- ...ngles_over_docstring_singles_class.py.snap | 56 +- ...es_over_docstring_singles_function.py.snap | 140 +- ...docstring_singles_module_multiline.py.snap | 56 +- ...ocstring_singles_module_singleline.py.snap | 56 +- ...ests__require_doubles_over_singles.py.snap | 84 +- ...quire_doubles_over_singles_escaped.py.snap | 56 +- ...uire_doubles_over_singles_implicit.py.snap | 196 +-- ...bles_over_singles_multiline_string.py.snap | 28 +- ..._require_doubles_over_singles_noqa.py.snap | 4 +- ...quire_doubles_over_singles_wrapped.py.snap | 4 +- ...ests__require_singles_over_doubles.py.snap | 84 +- ...quire_singles_over_doubles_escaped.py.snap | 84 +- ...uire_singles_over_doubles_implicit.py.snap | 196 +-- ...gles_over_doubles_multiline_string.py.snap | 28 +- ..._require_singles_over_doubles_noqa.py.snap | 4 +- ...quire_singles_over_doubles_wrapped.py.snap | 4 +- ...ry-paren-on-raise-exception_RSE102.py.snap | 174 +- ...lake8_return__tests__RET501_RET501.py.snap | 28 +- ...lake8_return__tests__RET502_RET502.py.snap | 28 +- ...lake8_return__tests__RET503_RET503.py.snap | 616 +++---- ...lake8_return__tests__RET504_RET504.py.snap | 52 +- ...lake8_return__tests__RET505_RET505.py.snap | 208 +-- ...lake8_return__tests__RET506_RET506.py.snap | 182 +-- ...lake8_return__tests__RET507_RET507.py.snap | 182 +-- ...lake8_return__tests__RET508_RET508.py.snap | 182 +-- ...ests__private-member-access_SLF001.py.snap | 286 ++-- ...ke8_simplify__tests__SIM101_SIM101.py.snap | 168 +- ...ke8_simplify__tests__SIM102_SIM102.py.snap | 404 ++--- ...ke8_simplify__tests__SIM103_SIM103.py.snap | 216 +-- ...ke8_simplify__tests__SIM105_SIM105.py.snap | 104 +- ...ke8_simplify__tests__SIM107_SIM107.py.snap | 26 +- ...ke8_simplify__tests__SIM108_SIM108.py.snap | 264 +-- ...ke8_simplify__tests__SIM109_SIM109.py.snap | 112 +- ...ke8_simplify__tests__SIM110_SIM110.py.snap | 376 ++--- ...ke8_simplify__tests__SIM110_SIM111.py.snap | 440 ++--- ...ke8_simplify__tests__SIM112_SIM112.py.snap | 112 +- ...ke8_simplify__tests__SIM114_SIM114.py.snap | 208 +-- ...ke8_simplify__tests__SIM115_SIM115.py.snap | 52 +- ...ke8_simplify__tests__SIM116_SIM116.py.snap | 182 +-- ...ke8_simplify__tests__SIM117_SIM117.py.snap | 336 ++-- ...ke8_simplify__tests__SIM118_SIM118.py.snap | 270 +-- ...ke8_simplify__tests__SIM201_SIM201.py.snap | 84 +- ...ke8_simplify__tests__SIM202_SIM202.py.snap | 84 +- ...ke8_simplify__tests__SIM208_SIM208.py.snap | 56 +- ...ke8_simplify__tests__SIM210_SIM210.py.snap | 110 +- ...ke8_simplify__tests__SIM211_SIM211.py.snap | 84 +- ...ke8_simplify__tests__SIM212_SIM212.py.snap | 56 +- ...ke8_simplify__tests__SIM220_SIM220.py.snap | 84 +- ...ke8_simplify__tests__SIM221_SIM221.py.snap | 84 +- ...ke8_simplify__tests__SIM222_SIM222.py.snap | 122 +- ...ke8_simplify__tests__SIM223_SIM223.py.snap | 90 +- ...ke8_simplify__tests__SIM300_SIM300.py.snap | 420 ++--- ...ke8_simplify__tests__SIM401_SIM401.py.snap | 168 +- ...api__tests__banned_api_true_positives.snap | 312 ++-- ...ative_imports__tests__ban_all_imports.snap | 442 ++--- ...ve_imports__tests__ban_parent_imports.snap | 338 ++-- ...ts__tests__ban_parent_imports_package.snap | 150 +- ...__empty-type-checking-block_TCH005.py.snap | 180 +- ..._type_checking__tests__exempt_modules.snap | 26 +- ...rt-in-type-checking-block_TCH004_1.py.snap | 26 +- ...t-in-type-checking-block_TCH004_10.py.snap | 2 +- ...t-in-type-checking-block_TCH004_11.py.snap | 26 +- ...t-in-type-checking-block_TCH004_12.py.snap | 26 +- ...t-in-type-checking-block_TCH004_13.py.snap | 2 +- ...-in-type-checking-block_TCH004_14.pyi.snap | 2 +- ...rt-in-type-checking-block_TCH004_2.py.snap | 26 +- ...rt-in-type-checking-block_TCH004_3.py.snap | 4 +- ...rt-in-type-checking-block_TCH004_4.py.snap | 26 +- ...rt-in-type-checking-block_TCH004_5.py.snap | 78 +- ...rt-in-type-checking-block_TCH004_6.py.snap | 4 +- ...rt-in-type-checking-block_TCH004_7.py.snap | 4 +- ...rt-in-type-checking-block_TCH004_8.py.snap | 2 +- ...rt-in-type-checking-block_TCH004_9.py.snap | 52 +- ...k_runtime_evaluated_base_classes_1.py.snap | 78 +- ...ock_runtime_evaluated_decorators_1.py.snap | 78 +- ...__flake8_type_checking__tests__strict.snap | 78 +- ...ing-only-first-party-import_TCH001.py.snap | 26 +- ...nly-standard-library-import_TCH003.py.snap | 26 +- ...t_runtime_evaluated_base_classes_3.py.snap | 26 +- ...ort_runtime_evaluated_decorators_3.py.snap | 26 +- ...ing-only-third-party-import_TCH002.py.snap | 208 +-- ...t_runtime_evaluated_base_classes_2.py.snap | 52 +- ...ort_runtime_evaluated_decorators_2.py.snap | 26 +- ...ing-only-third-party-import_strict.py.snap | 26 +- ...nused_arguments__tests__ARG001_ARG.py.snap | 208 +-- ...nused_arguments__tests__ARG002_ARG.py.snap | 104 +- ...nused_arguments__tests__ARG003_ARG.py.snap | 26 +- ...nused_arguments__tests__ARG004_ARG.py.snap | 78 +- ...nused_arguments__tests__ARG005_ARG.py.snap | 26 +- ...uments__tests__enforce_variadic_names.snap | 312 ++-- ...guments__tests__ignore_variadic_names.snap | 208 +-- ...e_pathlib__tests__PTH124_py_path_1.py.snap | 26 +- ...e_pathlib__tests__PTH124_py_path_2.py.snap | 26 +- ...ake8_use_pathlib__tests__full_name.py.snap | 676 ++++---- ...ake8_use_pathlib__tests__import_as.py.snap | 598 +++---- ...e8_use_pathlib__tests__import_from.py.snap | 650 ++++---- ...use_pathlib__tests__import_from_as.py.snap | 598 +++---- ...e8_use_pathlib__tests__use_pathlib.py.snap | 4 +- crates/ruff/src/rules/isort/mod.rs | 27 +- ...tests__add_newline_before_comments.py.snap | 28 +- ..._isort__tests__as_imports_comments.py.snap | 28 +- ...to_furthest_relative_imports_order.py.snap | 28 +- ...__isort__tests__combine_as_imports.py.snap | 28 +- ...bine_as_imports_combine_as_imports.py.snap | 28 +- ..._isort__tests__combine_import_from.py.snap | 28 +- ...ombined_required_imports_docstring.py.snap | 64 +- ...ed_required_imports_docstring_only.py.snap | 4 +- ...s__combined_required_imports_empty.py.snap | 4 +- ...uff__rules__isort__tests__comments.py.snap | 28 +- ..._isort__tests__deduplicate_imports.py.snap | 28 +- ...les__isort__tests__fit_line_length.py.snap | 28 +- ...rt__tests__fit_line_length_comment.py.snap | 28 +- ...orce_single_line_force_single_line.py.snap | 28 +- ..._tests__force_sort_within_sections.py.snap | 28 +- ...ections_force_sort_within_sections.py.snap | 28 +- ..._rules__isort__tests__force_to_top.py.snap | 28 +- ...__tests__force_to_top_force_to_top.py.snap | 28 +- ...__isort__tests__force_wrap_aliases.py.snap | 28 +- ...ce_wrap_aliases_force_wrap_aliases.py.snap | 28 +- ...les__isort__tests__forced_separate.py.snap | 28 +- ...t__tests__import_from_after_import.py.snap | 28 +- ...les__isort__tests__inline_comments.py.snap | 28 +- ...__isort__tests__insert_empty_lines.py.snap | 112 +- ..._isort__tests__insert_empty_lines.pyi.snap | 84 +- ...les__isort__tests__isort_skip_file.py.snap | 2 +- ...lder_separate_local_folder_imports.py.snap | 28 +- ...ules__isort__tests__leading_prefix.py.snap | 104 +- ...ts_lines_after_imports_class_after.py.snap | 28 +- ...rts_lines_after_imports_func_after.py.snap | 28 +- ..._lines_after_imports_nothing_after.py.snap | 28 +- ...s_between_typeslines_between_types.py.snap | 28 +- ...isort__tests__magic_trailing_comma.py.snap | 28 +- ...rules__isort__tests__natural_order.py.snap | 28 +- ...les__isort__tests__no_lines_before.py.snap | 28 +- ...no_lines_before.py_no_lines_before.py.snap | 28 +- ...o_lines_before_with_empty_sections.py.snap | 28 +- ...__tests__no_reorder_within_section.py.snap | 4 +- ..._rules__isort__tests__no_wrap_star.py.snap | 28 +- ...rules__isort__tests__order_by_type.py.snap | 28 +- ..._order_by_type_false_order_by_type.py.snap | 28 +- ..._order_by_type_with_custom_classes.py.snap | 28 +- ..._order_by_type_with_custom_classes.py.snap | 28 +- ...rder_by_type_with_custom_constants.py.snap | 28 +- ...rder_by_type_with_custom_constants.py.snap | 28 +- ...rder_by_type_with_custom_variables.py.snap | 28 +- ...rder_by_type_with_custom_variables.py.snap | 28 +- ...s__order_relative_imports_by_level.py.snap | 28 +- ...ort__tests__preserve_comment_order.py.snap | 28 +- ...isort__tests__preserve_import_star.py.snap | 28 +- ...isort__tests__preserve_indentation.py.snap | 56 +- ...rules__isort__tests__preserve_tabs.py.snap | 4 +- ...les__isort__tests__preserve_tabs_2.py.snap | 4 +- ...ort__tests__relative_imports_order.py.snap | 4 +- ...ort__tests__reorder_within_section.py.snap | 28 +- ...__tests__required_import_docstring.py.snap | 32 +- ...ts__required_import_docstring_only.py.snap | 4 +- ...sort__tests__required_import_empty.py.snap | 4 +- ...equired_import_multiline_docstring.py.snap | 36 +- ..._tests__required_imports_docstring.py.snap | 64 +- ...s__required_imports_docstring_only.py.snap | 4 +- ...ort__tests__required_imports_empty.py.snap | 4 +- ...ules__isort__tests__ruff_skip_file.py.snap | 2 +- ...ests__separate_first_party_imports.py.snap | 28 +- ...rt__tests__separate_future_imports.py.snap | 28 +- ...sts__separate_local_folder_imports.py.snap | 28 +- ...ests__separate_third_party_imports.py.snap | 28 +- .../ruff__rules__isort__tests__skip.py.snap | 56 +- ...isort__tests__sort_similar_imports.py.snap | 28 +- .../ruff__rules__isort__tests__split.py.snap | 4 +- ...railing_comma_magic_trailing_comma.py.snap | 28 +- ...__isort__tests__star_before_others.py.snap | 28 +- ...straight_required_import_docstring.py.snap | 32 +- ...ght_required_import_docstring_only.py.snap | 4 +- ...ts__straight_required_import_empty.py.snap | 4 +- ...les__isort__tests__trailing_suffix.py.snap | 52 +- ...rules__isort__tests__type_comments.py.snap | 4 +- ...ules__mccabe__tests__max_complexity_0.snap | 572 +++---- ...les__mccabe__tests__max_complexity_10.snap | 4 +- ...ules__mccabe__tests__max_complexity_3.snap | 52 +- ...numpy-deprecated-type-alias_NPY001.py.snap | 196 +-- ..._tests__numpy-legacy-random_NPY002.py.snap | 1300 +++++++-------- ...es__pandas_vet__tests__PD002_PD002.py.snap | 136 +- ...les__pep8_naming__tests__N801_N801.py.snap | 130 +- ...les__pep8_naming__tests__N802_N802.py.snap | 130 +- ...les__pep8_naming__tests__N803_N803.py.snap | 52 +- ...les__pep8_naming__tests__N804_N804.py.snap | 78 +- ...les__pep8_naming__tests__N805_N805.py.snap | 130 +- ...les__pep8_naming__tests__N806_N806.py.snap | 52 +- ...les__pep8_naming__tests__N807_N807.py.snap | 52 +- ...les__pep8_naming__tests__N811_N811.py.snap | 78 +- ...les__pep8_naming__tests__N812_N812.py.snap | 78 +- ...les__pep8_naming__tests__N813_N813.py.snap | 78 +- ...les__pep8_naming__tests__N814_N814.py.snap | 78 +- ...les__pep8_naming__tests__N815_N815.py.snap | 78 +- ...les__pep8_naming__tests__N816_N816.py.snap | 78 +- ...les__pep8_naming__tests__N817_N817.py.snap | 52 +- ...les__pep8_naming__tests__N818_N818.py.snap | 52 +- ...999_N999__module__MODULE____init__.py.snap | 26 +- ...s__N999_N999__module__MODULE__file.py.snap | 2 +- ...999_N999__module__flake9____init__.py.snap | 2 +- ..._module__mod with spaces____init__.py.snap | 26 +- ...999__module__mod with spaces__file.py.snap | 2 +- ..._module__mod-with-dashes____init__.py.snap | 26 +- ...999_N999__module__no_module__test.txt.snap | 2 +- ...__module__valid_name__0001_initial.py.snap | 2 +- ...N999__module__valid_name____init__.py.snap | 2 +- ...N999__module__valid_name____main__.py.snap | 2 +- ...999__module__valid_name____setup__.py.snap | 2 +- ...dule__valid_name__file-with-dashes.py.snap | 26 +- ..._module__valid_name__file-with-dashes.snap | 2 +- ...naming__tests__classmethod_decorators.snap | 78 +- ...les__pycodestyle__tests__E101_E101.py.snap | 78 +- ...ules__pycodestyle__tests__E401_E40.py.snap | 26 +- ...ules__pycodestyle__tests__E402_E40.py.snap | 78 +- ...les__pycodestyle__tests__E402_E402.py.snap | 26 +- ...les__pycodestyle__tests__E501_E501.py.snap | 130 +- ...ules__pycodestyle__tests__E701_E70.py.snap | 364 ++--- ...ules__pycodestyle__tests__E702_E70.py.snap | 156 +- ...ules__pycodestyle__tests__E703_E70.py.snap | 84 +- ...les__pycodestyle__tests__E711_E711.py.snap | 302 ++-- ...les__pycodestyle__tests__E712_E712.py.snap | 334 ++-- ...les__pycodestyle__tests__E713_E713.py.snap | 152 +- ...les__pycodestyle__tests__E714_E714.py.snap | 86 +- ...les__pycodestyle__tests__E721_E721.py.snap | 390 ++--- ...les__pycodestyle__tests__E722_E722.py.snap | 78 +- ...les__pycodestyle__tests__E731_E731.py.snap | 192 +-- ...les__pycodestyle__tests__E741_E741.py.snap | 650 ++++---- ...les__pycodestyle__tests__E742_E742.py.snap | 78 +- ...les__pycodestyle__tests__E743_E743.py.snap | 78 +- ...les__pycodestyle__tests__E999_E999.py.snap | 26 +- ...ules__pycodestyle__tests__W191_W19.py.snap | 988 +++++------ ...ules__pycodestyle__tests__W291_W29.py.snap | 84 +- ...s__pycodestyle__tests__W292_W292_0.py.snap | 28 +- ...s__pycodestyle__tests__W292_W292_1.py.snap | 4 +- ...s__pycodestyle__tests__W292_W292_2.py.snap | 4 +- ...s__pycodestyle__tests__W292_W292_3.py.snap | 4 +- ...ules__pycodestyle__tests__W293_W29.py.snap | 28 +- ...s__pycodestyle__tests__W605_W605_0.py.snap | 120 +- ...s__pycodestyle__tests__W605_W605_1.py.snap | 120 +- ...pycodestyle__tests__constant_literals.snap | 280 ++-- ...s__pycodestyle__tests__max_doc_length.snap | 104 +- ...__pycodestyle__tests__task_tags_false.snap | 156 +- ...s__pycodestyle__tests__task_tags_true.snap | 4 +- ...ff__rules__pycodestyle__tests__w292_4.snap | 28 +- ...__rules__pydocstyle__tests__D100_D.py.snap | 26 +- ...__rules__pydocstyle__tests__D101_D.py.snap | 26 +- ...__rules__pydocstyle__tests__D102_D.py.snap | 78 +- ...es__pydocstyle__tests__D102_setter.py.snap | 26 +- ...__rules__pydocstyle__tests__D103_D.py.snap | 26 +- ...__rules__pydocstyle__tests__D104_D.py.snap | 4 +- ...cstyle__tests__D104_D104____init__.py.snap | 26 +- ...__rules__pydocstyle__tests__D105_D.py.snap | 26 +- ...__rules__pydocstyle__tests__D106_D.py.snap | 4 +- ...__rules__pydocstyle__tests__D107_D.py.snap | 52 +- ...__rules__pydocstyle__tests__D200_D.py.snap | 188 +-- ...__rules__pydocstyle__tests__D201_D.py.snap | 140 +- ...__rules__pydocstyle__tests__D202_D.py.snap | 144 +- ...ules__pydocstyle__tests__D202_D202.py.snap | 108 +- ...__rules__pydocstyle__tests__D203_D.py.snap | 98 +- ...__rules__pydocstyle__tests__D204_D.py.snap | 72 +- ...__rules__pydocstyle__tests__D205_D.py.snap | 62 +- ...__rules__pydocstyle__tests__D206_D.py.snap | 4 +- ...__rules__pydocstyle__tests__D207_D.py.snap | 116 +- ...__rules__pydocstyle__tests__D208_D.py.snap | 90 +- ...__rules__pydocstyle__tests__D209_D.py.snap | 68 +- ...__rules__pydocstyle__tests__D210_D.py.snap | 122 +- ...__rules__pydocstyle__tests__D211_D.py.snap | 68 +- ...__rules__pydocstyle__tests__D212_D.py.snap | 98 +- ...__rules__pydocstyle__tests__D213_D.py.snap | 748 ++++----- ...__pydocstyle__tests__D214_sections.py.snap | 36 +- ...__pydocstyle__tests__D215_sections.py.snap | 72 +- ...__rules__pydocstyle__tests__D300_D.py.snap | 130 +- ...__rules__pydocstyle__tests__D301_D.py.snap | 78 +- ...__rules__pydocstyle__tests__D400_D.py.snap | 450 ++--- ...ules__pydocstyle__tests__D400_D400.py.snap | 400 ++--- ...ules__pydocstyle__tests__D401_D401.py.snap | 182 +-- ...__rules__pydocstyle__tests__D402_D.py.snap | 26 +- ...__rules__pydocstyle__tests__D403_D.py.snap | 4 +- ...__rules__pydocstyle__tests__D404_D.py.snap | 52 +- ...__pydocstyle__tests__D405_sections.py.snap | 68 +- ...__pydocstyle__tests__D406_sections.py.snap | 72 +- ...__pydocstyle__tests__D407_sections.py.snap | 576 +++---- ...__pydocstyle__tests__D408_sections.py.snap | 36 +- ...__pydocstyle__tests__D409_sections.py.snap | 72 +- ...__pydocstyle__tests__D410_sections.py.snap | 72 +- ...__pydocstyle__tests__D411_sections.py.snap | 108 +- ...__pydocstyle__tests__D412_sections.py.snap | 36 +- ...__pydocstyle__tests__D413_sections.py.snap | 4 +- ...__pydocstyle__tests__D414_sections.py.snap | 130 +- ...__rules__pydocstyle__tests__D415_D.py.snap | 418 ++--- ...__rules__pydocstyle__tests__D416_D.py.snap | 4 +- ...ts__D417_canonical_google_examples.py.snap | 4 +- ...sts__D417_canonical_numpy_examples.py.snap | 4 +- ...__pydocstyle__tests__D417_sections.py.snap | 286 ++-- ...__rules__pydocstyle__tests__D418_D.py.snap | 78 +- ...__rules__pydocstyle__tests__D419_D.py.snap | 78 +- .../ruff__rules__pydocstyle__tests__bom.snap | 26 +- ...__rules__pydocstyle__tests__d209_d400.snap | 68 +- ...rules__pydocstyle__tests__d417_google.snap | 234 +-- ..._rules__pydocstyle__tests__d417_numpy.snap | 4 +- ...__pydocstyle__tests__d417_unspecified.snap | 234 +-- ...ules__pyflakes__tests__F401_F401_0.py.snap | 336 ++-- ...ules__pyflakes__tests__F401_F401_1.py.snap | 4 +- ...les__pyflakes__tests__F401_F401_10.py.snap | 2 +- ...ules__pyflakes__tests__F401_F401_2.py.snap | 4 +- ...ules__pyflakes__tests__F401_F401_3.py.snap | 4 +- ...ules__pyflakes__tests__F401_F401_4.py.snap | 4 +- ...ules__pyflakes__tests__F401_F401_5.py.snap | 136 +- ...ules__pyflakes__tests__F401_F401_6.py.snap | 136 +- ...ules__pyflakes__tests__F401_F401_7.py.snap | 106 +- ...ules__pyflakes__tests__F401_F401_8.py.snap | 4 +- ...ules__pyflakes__tests__F401_F401_9.py.snap | 30 +- ..._rules__pyflakes__tests__F402_F402.py.snap | 52 +- ..._rules__pyflakes__tests__F403_F403.py.snap | 52 +- ..._rules__pyflakes__tests__F404_F404.py.snap | 52 +- ..._rules__pyflakes__tests__F405_F405.py.snap | 52 +- ..._rules__pyflakes__tests__F406_F406.py.snap | 52 +- ..._rules__pyflakes__tests__F407_F407.py.snap | 26 +- ..._rules__pyflakes__tests__F501_F50x.py.snap | 26 +- ..._rules__pyflakes__tests__F502_F502.py.snap | 182 +-- ..._rules__pyflakes__tests__F502_F50x.py.snap | 26 +- ..._rules__pyflakes__tests__F503_F503.py.snap | 78 +- ..._rules__pyflakes__tests__F503_F50x.py.snap | 26 +- ..._rules__pyflakes__tests__F504_F504.py.snap | 90 +- ..._rules__pyflakes__tests__F504_F50x.py.snap | 30 +- ..._rules__pyflakes__tests__F505_F504.py.snap | 4 +- ..._rules__pyflakes__tests__F505_F50x.py.snap | 26 +- ..._rules__pyflakes__tests__F506_F50x.py.snap | 78 +- ..._rules__pyflakes__tests__F507_F50x.py.snap | 52 +- ..._rules__pyflakes__tests__F508_F50x.py.snap | 26 +- ..._rules__pyflakes__tests__F509_F50x.py.snap | 26 +- ..._rules__pyflakes__tests__F521_F521.py.snap | 182 +-- ..._rules__pyflakes__tests__F522_F522.py.snap | 84 +- ..._rules__pyflakes__tests__F523_F523.py.snap | 182 +-- ..._rules__pyflakes__tests__F524_F524.py.snap | 156 +- ..._rules__pyflakes__tests__F525_F525.py.snap | 52 +- ..._rules__pyflakes__tests__F541_F541.py.snap | 422 ++--- ..._rules__pyflakes__tests__F601_F601.py.snap | 690 ++++---- ..._rules__pyflakes__tests__F602_F602.py.snap | 664 ++++---- ..._rules__pyflakes__tests__F622_F622.py.snap | 26 +- ..._rules__pyflakes__tests__F631_F631.py.snap | 52 +- ..._rules__pyflakes__tests__F632_F632.py.snap | 224 +-- ..._rules__pyflakes__tests__F633_F633.py.snap | 26 +- ..._rules__pyflakes__tests__F634_F634.py.snap | 52 +- ..._rules__pyflakes__tests__F701_F701.py.snap | 104 +- ..._rules__pyflakes__tests__F702_F702.py.snap | 104 +- ..._rules__pyflakes__tests__F704_F704.py.snap | 104 +- ..._rules__pyflakes__tests__F706_F706.py.snap | 52 +- ..._rules__pyflakes__tests__F707_F707.py.snap | 78 +- ..._rules__pyflakes__tests__F722_F722.py.snap | 26 +- ...ules__pyflakes__tests__F811_F811_0.py.snap | 26 +- ...ules__pyflakes__tests__F811_F811_1.py.snap | 26 +- ...les__pyflakes__tests__F811_F811_10.py.snap | 4 +- ...les__pyflakes__tests__F811_F811_11.py.snap | 4 +- ...les__pyflakes__tests__F811_F811_12.py.snap | 26 +- ...les__pyflakes__tests__F811_F811_13.py.snap | 4 +- ...les__pyflakes__tests__F811_F811_14.py.snap | 4 +- ...les__pyflakes__tests__F811_F811_15.py.snap | 26 +- ...les__pyflakes__tests__F811_F811_16.py.snap | 26 +- ...les__pyflakes__tests__F811_F811_17.py.snap | 52 +- ...les__pyflakes__tests__F811_F811_18.py.snap | 4 +- ...les__pyflakes__tests__F811_F811_19.py.snap | 4 +- ...ules__pyflakes__tests__F811_F811_2.py.snap | 26 +- ...les__pyflakes__tests__F811_F811_20.py.snap | 4 +- ...les__pyflakes__tests__F811_F811_21.py.snap | 30 +- ...ules__pyflakes__tests__F811_F811_3.py.snap | 26 +- ...ules__pyflakes__tests__F811_F811_4.py.snap | 26 +- ...ules__pyflakes__tests__F811_F811_5.py.snap | 26 +- ...ules__pyflakes__tests__F811_F811_6.py.snap | 26 +- ...ules__pyflakes__tests__F811_F811_7.py.snap | 4 +- ...ules__pyflakes__tests__F811_F811_8.py.snap | 26 +- ...ules__pyflakes__tests__F811_F811_9.py.snap | 4 +- ...ules__pyflakes__tests__F821_F821_0.py.snap | 338 ++-- ...ules__pyflakes__tests__F821_F821_1.py.snap | 104 +- ...les__pyflakes__tests__F821_F821_10.py.snap | 2 +- ...les__pyflakes__tests__F821_F821_11.py.snap | 52 +- ...les__pyflakes__tests__F821_F821_12.py.snap | 52 +- ...ules__pyflakes__tests__F821_F821_2.py.snap | 26 +- ...ules__pyflakes__tests__F821_F821_3.py.snap | 52 +- ...ules__pyflakes__tests__F821_F821_4.py.snap | 130 +- ...ules__pyflakes__tests__F821_F821_5.py.snap | 26 +- ...ules__pyflakes__tests__F821_F821_6.py.snap | 4 +- ...ules__pyflakes__tests__F821_F821_7.py.snap | 78 +- ...les__pyflakes__tests__F821_F821_8.pyi.snap | 4 +- ...ules__pyflakes__tests__F821_F821_9.py.snap | 26 +- ...ules__pyflakes__tests__F822_F822_0.py.snap | 26 +- ...ules__pyflakes__tests__F822_F822_1.py.snap | 26 +- ...ules__pyflakes__tests__F822_F822_2.py.snap | 2 +- ..._rules__pyflakes__tests__F823_F823.py.snap | 26 +- ...ules__pyflakes__tests__F841_F841_0.py.snap | 588 +++---- ...ules__pyflakes__tests__F841_F841_1.py.snap | 320 ++-- ...ules__pyflakes__tests__F841_F841_2.py.snap | 4 +- ...ules__pyflakes__tests__F841_F841_3.py.snap | 990 +++++------ ..._rules__pyflakes__tests__F842_F842.py.snap | 52 +- ..._rules__pyflakes__tests__F901_F901.py.snap | 56 +- ...es__pyflakes__tests__default_builtins.snap | 26 +- ...flakes__tests__default_typing_modules.snap | 26 +- ...ules__pyflakes__tests__extra_builtins.snap | 4 +- ...pyflakes__tests__extra_typing_modules.snap | 26 +- ...lakes__tests__f841_dummy_variable_rgx.snap | 500 +++--- ...__pyflakes__tests__future_annotations.snap | 88 +- .../ruff__rules__pyflakes__tests__init.snap | 4 +- ...yflakes__tests__multi_statement_lines.snap | 414 ++--- ..._tests__nested_relative_typing_module.snap | 52 +- ...flakes__tests__relative_typing_module.snap | 26 +- ...grep_hooks__tests__PGH001_PGH001_0.py.snap | 52 +- ...grep_hooks__tests__PGH001_PGH001_1.py.snap | 4 +- ...grep_hooks__tests__PGH002_PGH002_0.py.snap | 4 +- ...grep_hooks__tests__PGH002_PGH002_1.py.snap | 52 +- ...grep_hooks__tests__PGH003_PGH003_0.py.snap | 78 +- ...grep_hooks__tests__PGH004_PGH004_0.py.snap | 156 +- ...nt__tests__PLC0414_import_aliasing.py.snap | 224 +-- ...s__PLC1901_compare_to_empty_string.py.snap | 130 +- ...002_unnecessary_direct_lambda_call.py.snap | 78 +- ...lint__tests__PLE0100_yield_in_init.py.snap | 52 +- ...int__tests__PLE0101_return_in_init.py.snap | 52 +- ...tests__PLE0116_continue_in_finally.py.snap | 2 +- ...__PLE0117_nonlocal_without_binding.py.snap | 78 +- ...0118_used_prior_global_declaration.py.snap | 338 ++-- ..._tests__PLE0604_invalid_all_object.py.snap | 52 +- ..._tests__PLE0605_invalid_all_format.py.snap | 208 +-- ...tests__PLE1142_await_outside_async.py.snap | 52 +- ...sts__PLE1205_logging_too_many_args.py.snap | 52 +- ...ests__PLE1206_logging_too_few_args.py.snap | 26 +- ...ts__PLE1307_bad_string_format_type.py.snap | 286 ++-- ..._tests__PLE1310_bad_str_strip_call.py.snap | 416 ++--- ...ests__PLE1507_invalid_envvar_value.py.snap | 104 +- ...sts__PLE2502_bidirectional_unicode.py.snap | 104 +- ...ts__PLR0133_comparison_of_constant.py.snap | 260 +-- ...__PLR0206_property_with_parameters.py.snap | 78 +- ...nt__tests__PLR0402_import_aliasing.py.snap | 86 +- ...PLR0911_too_many_return_statements.py.snap | 26 +- ...__tests__PLR0912_too_many_branches.py.snap | 26 +- ..._tests__PLR0913_too_many_arguments.py.snap | 78 +- ...tests__PLR0915_too_many_statements.py.snap | 26 +- ...LR1701_consider_merging_isinstance.py.snap | 156 +- ..._PLR1722_consider_using_sys_exit_0.py.snap | 104 +- ..._PLR1722_consider_using_sys_exit_1.py.snap | 112 +- ..._PLR1722_consider_using_sys_exit_2.py.snap | 112 +- ..._PLR1722_consider_using_sys_exit_3.py.snap | 56 +- ..._PLR1722_consider_using_sys_exit_4.py.snap | 112 +- ..._PLR1722_consider_using_sys_exit_5.py.snap | 56 +- ..._PLR1722_consider_using_sys_exit_6.py.snap | 52 +- ...ts__PLR2004_magic_value_comparison.py.snap | 130 +- ...tests__PLR5501_collapsible_else_if.py.snap | 52 +- ...ests__PLW0120_useless_else_on_loop.py.snap | 182 +-- ...W0602_global_variable_not_assigned.py.snap | 52 +- ...t__tests__PLW0603_global_statement.py.snap | 208 +-- ...ts__PLW1508_invalid_envvar_default.py.snap | 104 +- ...tests__PLW2901_redefined_loop_name.py.snap | 650 ++++---- ...ylint__tests__allow_magic_value_types.snap | 78 +- ...s__pylint__tests__continue_in_finally.snap | 338 ++-- .../ruff__rules__pylint__tests__max_args.snap | 52 +- ..._tests__max_args_with_dummy_variables.snap | 26 +- ...f__rules__pylint__tests__max_branches.snap | 52 +- ..._pylint__tests__max_return_statements.snap | 26 +- ..._rules__pylint__tests__max_statements.snap | 78 +- ...ff__rules__pyupgrade__tests__UP001.py.snap | 62 +- ...ff__rules__pyupgrade__tests__UP003.py.snap | 140 +- ...ff__rules__pyupgrade__tests__UP004.py.snap | 684 ++++---- ...ff__rules__pyupgrade__tests__UP005.py.snap | 112 +- ...ff__rules__pyupgrade__tests__UP006.py.snap | 138 +- ...ff__rules__pyupgrade__tests__UP007.py.snap | 264 +-- ...ff__rules__pyupgrade__tests__UP008.py.snap | 140 +- ...__rules__pyupgrade__tests__UP009_0.py.snap | 28 +- ...__rules__pyupgrade__tests__UP009_1.py.snap | 28 +- ...__rules__pyupgrade__tests__UP009_2.py.snap | 2 +- ...__rules__pyupgrade__tests__UP009_3.py.snap | 2 +- ...__rules__pyupgrade__tests__UP009_4.py.snap | 2 +- ...ff__rules__pyupgrade__tests__UP010.py.snap | 312 ++-- ...ff__rules__pyupgrade__tests__UP011.py.snap | 120 +- ...ff__rules__pyupgrade__tests__UP012.py.snap | 516 +++--- ...ff__rules__pyupgrade__tests__UP013.py.snap | 336 ++-- ...ff__rules__pyupgrade__tests__UP014.py.snap | 140 +- ...ff__rules__pyupgrade__tests__UP015.py.snap | 1408 ++++++++-------- ...ff__rules__pyupgrade__tests__UP018.py.snap | 168 +- ...ff__rules__pyupgrade__tests__UP019.py.snap | 112 +- ...ff__rules__pyupgrade__tests__UP021.py.snap | 112 +- ...ff__rules__pyupgrade__tests__UP022.py.snap | 240 +-- ...ff__rules__pyupgrade__tests__UP023.py.snap | 280 ++-- ...__rules__pyupgrade__tests__UP024_0.py.snap | 364 ++--- ...__rules__pyupgrade__tests__UP024_1.py.snap | 84 +- ...__rules__pyupgrade__tests__UP024_2.py.snap | 560 +++---- ...__rules__pyupgrade__tests__UP024_3.py.snap | 2 +- ...__rules__pyupgrade__tests__UP024_4.py.snap | 28 +- ...ff__rules__pyupgrade__tests__UP025.py.snap | 360 ++-- ...ff__rules__pyupgrade__tests__UP026.py.snap | 774 ++++----- ...ff__rules__pyupgrade__tests__UP027.py.snap | 140 +- ...__rules__pyupgrade__tests__UP028_0.py.snap | 336 ++-- ...__rules__pyupgrade__tests__UP028_1.py.snap | 2 +- ...ff__rules__pyupgrade__tests__UP029.py.snap | 120 +- ...__rules__pyupgrade__tests__UP030_0.py.snap | 330 ++-- ...__rules__pyupgrade__tests__UP030_1.py.snap | 2 +- ...__rules__pyupgrade__tests__UP030_2.py.snap | 334 ++-- ...__rules__pyupgrade__tests__UP031_0.py.snap | 852 +++++----- ...__rules__pyupgrade__tests__UP031_1.py.snap | 2 +- ...ff__rules__pyupgrade__tests__UP032.py.snap | 616 +++---- ...ff__rules__pyupgrade__tests__UP033.py.snap | 116 +- ...ff__rules__pyupgrade__tests__UP034.py.snap | 400 ++--- ...ff__rules__pyupgrade__tests__UP035.py.snap | 976 +++++------ ...__rules__pyupgrade__tests__UP036_0.py.snap | 802 ++++----- ...__rules__pyupgrade__tests__UP036_1.py.snap | 372 ++--- ...__rules__pyupgrade__tests__UP036_2.py.snap | 344 ++-- ...__rules__pyupgrade__tests__UP036_3.py.snap | 86 +- ...__rules__pyupgrade__tests__UP036_4.py.snap | 256 +-- ...ff__rules__pyupgrade__tests__UP037.py.snap | 784 ++++----- ...ff__rules__pyupgrade__tests__UP038.py.snap | 64 +- ...rade__tests__datetime_utc_alias_py311.snap | 106 +- ...tests__future_annotations_pep_585_p37.snap | 28 +- ...sts__future_annotations_pep_585_py310.snap | 112 +- ...tests__future_annotations_pep_604_p37.snap | 28 +- ...sts__future_annotations_pep_604_py310.snap | 56 +- ..._rules__ruff__tests__RUF005_RUF005.py.snap | 402 ++--- ..._rules__ruff__tests__RUF006_RUF006.py.snap | 52 +- ...ruff__rules__ruff__tests__confusables.snap | 84 +- ...ruff__rules__ruff__tests__flake8_noqa.snap | 4 +- .../ruff__rules__ruff__tests__redirects.snap | 4 +- .../ruff__rules__ruff__tests__ruf100_0.snap | 776 ++++----- .../ruff__rules__ruff__tests__ruf100_1.snap | 250 +-- .../ruff__rules__ruff__tests__ruf100_2.snap | 30 +- .../ruff__rules__ruff__tests__ruf100_3.snap | 300 ++-- .../ruff__rules__ruff__tests__ruff_noqa.snap | 4 +- ...uff__tests__ruff_pairwise_over_zipped.snap | 182 +-- ...ules__ruff__tests__ruff_targeted_noqa.snap | 30 +- ..._error-instead-of-exception_TRY400.py.snap | 208 +-- ...s__tests__prefer-type-error_TRY004.py.snap | 884 +++++----- ...__tests__raise-vanilla-args_TRY003.py.snap | 104 +- ..._tests__raise-vanilla-class_TRY002.py.snap | 52 +- ...ps__tests__raise-within-try_TRY301.py.snap | 156 +- ...ps__tests__reraise-no-cause_TRY200.py.snap | 52 +- ...s__tests__try-consider-else_TRY300.py.snap | 26 +- ..._tests__verbose-log-message_TRY401.py.snap | 260 +-- ...atops__tests__verbose-raise_TRY201.py.snap | 78 +- crates/ruff/src/test.rs | 21 +- 780 files changed, 49686 insertions(+), 49647 deletions(-) diff --git a/crates/ruff/src/rules/eradicate/snapshots/ruff__rules__eradicate__tests__ERA001_ERA001.py.snap b/crates/ruff/src/rules/eradicate/snapshots/ruff__rules__eradicate__tests__ERA001_ERA001.py.snap index 167d1197b8da03..7fe79995fffc96 100644 --- a/crates/ruff/src/rules/eradicate/snapshots/ruff__rules__eradicate__tests__ERA001_ERA001.py.snap +++ b/crates/ruff/src/rules/eradicate/snapshots/ruff__rules__eradicate__tests__ERA001_ERA001.py.snap @@ -2,104 +2,104 @@ source: crates/ruff/src/rules/eradicate/mod.rs expression: diagnostics --- -- kind: - name: CommentedOutCode - body: Found commented-out code - suggestion: Remove commented-out code - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 10 - fix: - content: "" +- - kind: + name: CommentedOutCode + body: Found commented-out code + suggestion: Remove commented-out code + fixable: true location: row: 1 column: 0 end_location: - row: 2 - column: 0 - parent: ~ -- kind: - name: CommentedOutCode - body: Found commented-out code - suggestion: Remove commented-out code - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 22 - fix: - content: "" + row: 1 + column: 10 + fix: + content: "" + location: + row: 1 + column: 0 + end_location: + row: 2 + column: 0 + parent: ~ + - kind: + name: CommentedOutCode + body: Found commented-out code + suggestion: Remove commented-out code + fixable: true location: row: 2 column: 0 end_location: - row: 3 - column: 0 - parent: ~ -- kind: - name: CommentedOutCode - body: Found commented-out code - suggestion: Remove commented-out code - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 6 - fix: - content: "" + row: 2 + column: 22 + fix: + content: "" + location: + row: 2 + column: 0 + end_location: + row: 3 + column: 0 + parent: ~ + - kind: + name: CommentedOutCode + body: Found commented-out code + suggestion: Remove commented-out code + fixable: true location: row: 3 column: 0 end_location: - row: 4 - column: 0 - parent: ~ -- kind: - name: CommentedOutCode - body: Found commented-out code - suggestion: Remove commented-out code - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 13 - fix: - content: "" + row: 3 + column: 6 + fix: + content: "" + location: + row: 3 + column: 0 + end_location: + row: 4 + column: 0 + parent: ~ + - kind: + name: CommentedOutCode + body: Found commented-out code + suggestion: Remove commented-out code + fixable: true location: row: 5 column: 0 end_location: - row: 6 - column: 0 - parent: ~ -- kind: - name: CommentedOutCode - body: Found commented-out code - suggestion: Remove commented-out code - fixable: true - location: - row: 12 - column: 4 - end_location: - row: 12 - column: 16 - fix: - content: "" + row: 5 + column: 13 + fix: + content: "" + location: + row: 5 + column: 0 + end_location: + row: 6 + column: 0 + parent: ~ + - kind: + name: CommentedOutCode + body: Found commented-out code + suggestion: Remove commented-out code + fixable: true location: row: 12 - column: 0 + column: 4 end_location: - row: 13 - column: 0 - parent: ~ + row: 12 + column: 16 + fix: + content: "" + location: + row: 12 + column: 0 + end_location: + row: 13 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT101_YTT101.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT101_YTT101.py.snap index a36bfc124340e3..0fa7c76bfaee0e 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT101_YTT101.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT101_YTT101.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- -- kind: - name: SysVersionSlice3Referenced - body: "`sys.version[:3]` referenced (python3.10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 6 - end_location: - row: 6 - column: 17 - fix: ~ - parent: ~ -- kind: - name: SysVersionSlice3Referenced - body: "`sys.version[:3]` referenced (python3.10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 6 - end_location: - row: 7 - column: 13 - fix: ~ - parent: ~ -- kind: - name: SysVersionSlice3Referenced - body: "`sys.version[:3]` referenced (python3.10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 8 - column: 6 - end_location: - row: 8 - column: 7 - fix: ~ - parent: ~ +- - kind: + name: SysVersionSlice3Referenced + body: "`sys.version[:3]` referenced (python3.10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 6 + end_location: + row: 6 + column: 17 + fix: ~ + parent: ~ + - kind: + name: SysVersionSlice3Referenced + body: "`sys.version[:3]` referenced (python3.10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 6 + end_location: + row: 7 + column: 13 + fix: ~ + parent: ~ + - kind: + name: SysVersionSlice3Referenced + body: "`sys.version[:3]` referenced (python3.10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 8 + column: 6 + end_location: + row: 8 + column: 7 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT102_YTT102.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT102_YTT102.py.snap index 11c4039b429a16..6d7fa5c69d02cf 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT102_YTT102.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT102_YTT102.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- -- kind: - name: SysVersion2Referenced - body: "`sys.version[2]` referenced (python3.10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 11 - end_location: - row: 4 - column: 22 - fix: ~ - parent: ~ -- kind: - name: SysVersion2Referenced - body: "`sys.version[2]` referenced (python3.10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 11 - end_location: - row: 5 - column: 18 - fix: ~ - parent: ~ +- - kind: + name: SysVersion2Referenced + body: "`sys.version[2]` referenced (python3.10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 11 + end_location: + row: 4 + column: 22 + fix: ~ + parent: ~ + - kind: + name: SysVersion2Referenced + body: "`sys.version[2]` referenced (python3.10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 11 + end_location: + row: 5 + column: 18 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT103_YTT103.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT103_YTT103.py.snap index 7bf2c1aca37da3..70c93b723cf2ff 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT103_YTT103.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT103_YTT103.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- -- kind: - name: SysVersionCmpStr3 - body: "`sys.version` compared to string (python3.10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 7 - fix: ~ - parent: ~ -- kind: - name: SysVersionCmpStr3 - body: "`sys.version` compared to string (python3.10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 11 - fix: ~ - parent: ~ -- kind: - name: SysVersionCmpStr3 - body: "`sys.version` compared to string (python3.10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 11 - fix: ~ - parent: ~ -- kind: - name: SysVersionCmpStr3 - body: "`sys.version` compared to string (python3.10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 11 - fix: ~ - parent: ~ -- kind: - name: SysVersionCmpStr3 - body: "`sys.version` compared to string (python3.10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 11 - fix: ~ - parent: ~ +- - kind: + name: SysVersionCmpStr3 + body: "`sys.version` compared to string (python3.10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 7 + fix: ~ + parent: ~ + - kind: + name: SysVersionCmpStr3 + body: "`sys.version` compared to string (python3.10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 11 + fix: ~ + parent: ~ + - kind: + name: SysVersionCmpStr3 + body: "`sys.version` compared to string (python3.10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 11 + fix: ~ + parent: ~ + - kind: + name: SysVersionCmpStr3 + body: "`sys.version` compared to string (python3.10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 11 + fix: ~ + parent: ~ + - kind: + name: SysVersionCmpStr3 + body: "`sys.version` compared to string (python3.10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 11 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT201_YTT201.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT201_YTT201.py.snap index ee9961efc10cc0..ffde3e240c066e 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT201_YTT201.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT201_YTT201.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- -- kind: - name: SysVersionInfo0Eq3Referenced - body: "`sys.version_info[0] == 3` referenced (python4), use `>=`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 6 - end_location: - row: 7 - column: 25 - fix: ~ - parent: ~ -- kind: - name: SysVersionInfo0Eq3Referenced - body: "`sys.version_info[0] == 3` referenced (python4), use `>=`" - suggestion: ~ - fixable: false - location: - row: 8 - column: 6 - end_location: - row: 8 - column: 21 - fix: ~ - parent: ~ -- kind: - name: SysVersionInfo0Eq3Referenced - body: "`sys.version_info[0] == 3` referenced (python4), use `>=`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 6 - end_location: - row: 9 - column: 25 - fix: ~ - parent: ~ -- kind: - name: SysVersionInfo0Eq3Referenced - body: "`sys.version_info[0] == 3` referenced (python4), use `>=`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 6 - end_location: - row: 10 - column: 21 - fix: ~ - parent: ~ +- - kind: + name: SysVersionInfo0Eq3Referenced + body: "`sys.version_info[0] == 3` referenced (python4), use `>=`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 6 + end_location: + row: 7 + column: 25 + fix: ~ + parent: ~ + - kind: + name: SysVersionInfo0Eq3Referenced + body: "`sys.version_info[0] == 3` referenced (python4), use `>=`" + suggestion: ~ + fixable: false + location: + row: 8 + column: 6 + end_location: + row: 8 + column: 21 + fix: ~ + parent: ~ + - kind: + name: SysVersionInfo0Eq3Referenced + body: "`sys.version_info[0] == 3` referenced (python4), use `>=`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 6 + end_location: + row: 9 + column: 25 + fix: ~ + parent: ~ + - kind: + name: SysVersionInfo0Eq3Referenced + body: "`sys.version_info[0] == 3` referenced (python4), use `>=`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 6 + end_location: + row: 10 + column: 21 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT202_YTT202.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT202_YTT202.py.snap index e86c12a99c1ed0..68420b174b4add 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT202_YTT202.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT202_YTT202.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- -- kind: - name: SixPY3Referenced - body: "`six.PY3` referenced (python4), use `not six.PY2`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 3 - end_location: - row: 4 - column: 10 - fix: ~ - parent: ~ -- kind: - name: SixPY3Referenced - body: "`six.PY3` referenced (python4), use `not six.PY2`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 3 - end_location: - row: 6 - column: 6 - fix: ~ - parent: ~ +- - kind: + name: SixPY3Referenced + body: "`six.PY3` referenced (python4), use `not six.PY2`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 3 + end_location: + row: 4 + column: 10 + fix: ~ + parent: ~ + - kind: + name: SixPY3Referenced + body: "`six.PY3` referenced (python4), use `not six.PY2`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 3 + end_location: + row: 6 + column: 6 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT203_YTT203.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT203_YTT203.py.snap index a4e1fc2d36bf6a..d76e7a77eb1b9a 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT203_YTT203.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT203_YTT203.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- -- kind: - name: SysVersionInfo1CmpInt - body: "`sys.version_info[1]` compared to integer (python4), compare `sys.version_info` to tuple" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 19 - fix: ~ - parent: ~ -- kind: - name: SysVersionInfo1CmpInt - body: "`sys.version_info[1]` compared to integer (python4), compare `sys.version_info` to tuple" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 15 - fix: ~ - parent: ~ +- - kind: + name: SysVersionInfo1CmpInt + body: "`sys.version_info[1]` compared to integer (python4), compare `sys.version_info` to tuple" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 19 + fix: ~ + parent: ~ + - kind: + name: SysVersionInfo1CmpInt + body: "`sys.version_info[1]` compared to integer (python4), compare `sys.version_info` to tuple" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 15 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT204_YTT204.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT204_YTT204.py.snap index 9ff038fb68059a..483fc8d1d9be53 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT204_YTT204.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT204_YTT204.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- -- kind: - name: SysVersionInfoMinorCmpInt - body: "`sys.version_info.minor` compared to integer (python4), compare `sys.version_info` to tuple" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 22 - fix: ~ - parent: ~ -- kind: - name: SysVersionInfoMinorCmpInt - body: "`sys.version_info.minor` compared to integer (python4), compare `sys.version_info` to tuple" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 18 - fix: ~ - parent: ~ +- - kind: + name: SysVersionInfoMinorCmpInt + body: "`sys.version_info.minor` compared to integer (python4), compare `sys.version_info` to tuple" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 22 + fix: ~ + parent: ~ + - kind: + name: SysVersionInfoMinorCmpInt + body: "`sys.version_info.minor` compared to integer (python4), compare `sys.version_info` to tuple" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 18 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT301_YTT301.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT301_YTT301.py.snap index 2e154875fa7d3f..307a6fb1d23599 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT301_YTT301.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT301_YTT301.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- -- kind: - name: SysVersion0Referenced - body: "`sys.version[0]` referenced (python10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 11 - end_location: - row: 4 - column: 22 - fix: ~ - parent: ~ -- kind: - name: SysVersion0Referenced - body: "`sys.version[0]` referenced (python10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 11 - end_location: - row: 5 - column: 18 - fix: ~ - parent: ~ +- - kind: + name: SysVersion0Referenced + body: "`sys.version[0]` referenced (python10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 11 + end_location: + row: 4 + column: 22 + fix: ~ + parent: ~ + - kind: + name: SysVersion0Referenced + body: "`sys.version[0]` referenced (python10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 11 + end_location: + row: 5 + column: 18 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT302_YTT302.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT302_YTT302.py.snap index e313659104d93a..846e4b30f06d3c 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT302_YTT302.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT302_YTT302.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- -- kind: - name: SysVersionCmpStr10 - body: "`sys.version` compared to string (python10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 7 - fix: ~ - parent: ~ -- kind: - name: SysVersionCmpStr10 - body: "`sys.version` compared to string (python10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 11 - fix: ~ - parent: ~ -- kind: - name: SysVersionCmpStr10 - body: "`sys.version` compared to string (python10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 11 - fix: ~ - parent: ~ -- kind: - name: SysVersionCmpStr10 - body: "`sys.version` compared to string (python10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 11 - fix: ~ - parent: ~ -- kind: - name: SysVersionCmpStr10 - body: "`sys.version` compared to string (python10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 11 - fix: ~ - parent: ~ +- - kind: + name: SysVersionCmpStr10 + body: "`sys.version` compared to string (python10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 7 + fix: ~ + parent: ~ + - kind: + name: SysVersionCmpStr10 + body: "`sys.version` compared to string (python10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 11 + fix: ~ + parent: ~ + - kind: + name: SysVersionCmpStr10 + body: "`sys.version` compared to string (python10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 11 + fix: ~ + parent: ~ + - kind: + name: SysVersionCmpStr10 + body: "`sys.version` compared to string (python10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 11 + fix: ~ + parent: ~ + - kind: + name: SysVersionCmpStr10 + body: "`sys.version` compared to string (python10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 11 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT303_YTT303.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT303_YTT303.py.snap index 7ea49bfead33df..fffc848519e0b5 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT303_YTT303.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT303_YTT303.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs expression: diagnostics --- -- kind: - name: SysVersionSlice1Referenced - body: "`sys.version[:1]` referenced (python10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 6 - end_location: - row: 4 - column: 17 - fix: ~ - parent: ~ -- kind: - name: SysVersionSlice1Referenced - body: "`sys.version[:1]` referenced (python10), use `sys.version_info`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 6 - end_location: - row: 5 - column: 13 - fix: ~ - parent: ~ +- - kind: + name: SysVersionSlice1Referenced + body: "`sys.version[:1]` referenced (python10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 6 + end_location: + row: 4 + column: 17 + fix: ~ + parent: ~ + - kind: + name: SysVersionSlice1Referenced + body: "`sys.version[:1]` referenced (python10), use `sys.version_info`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 6 + end_location: + row: 5 + column: 13 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_nested_overload.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_nested_overload.snap index 7bffa896b49a8c..69f3e20b271b71 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_nested_overload.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_nested_overload.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_annotations/mod.rs +source: crates/ruff/src/rules/flake8_annotations/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_overload.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_overload.snap index f353af891e9384..f13823695a4c32 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_overload.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_overload.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs expression: diagnostics --- -- kind: - name: MissingReturnTypePublicFunction - body: "Missing return type annotation for public function `bar`" - suggestion: ~ - fixable: false - location: - row: 29 - column: 8 - end_location: - row: 29 - column: 11 - fix: ~ - parent: ~ +- - kind: + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `bar`" + suggestion: ~ + fixable: false + location: + row: 29 + column: 8 + end_location: + row: 29 + column: 11 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_star_arg_any.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_star_arg_any.snap index f6a549b09246df..09f1a321f18aad 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_star_arg_any.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_star_arg_any.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs expression: diagnostics --- -- kind: - name: AnyType - body: "Dynamically typed expressions (typing.Any) are disallowed in `a`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 11 - end_location: - row: 10 - column: 14 - fix: ~ - parent: ~ -- kind: - name: AnyType - body: "Dynamically typed expressions (typing.Any) are disallowed in `foo`" - suggestion: ~ - fixable: false - location: - row: 15 - column: 46 - end_location: - row: 15 - column: 49 - fix: ~ - parent: ~ -- kind: - name: AnyType - body: "Dynamically typed expressions (typing.Any) are disallowed in `a`" - suggestion: ~ - fixable: false - location: - row: 40 - column: 28 - end_location: - row: 40 - column: 31 - fix: ~ - parent: ~ -- kind: - name: AnyType - body: "Dynamically typed expressions (typing.Any) are disallowed in `foo_method`" - suggestion: ~ - fixable: false - location: - row: 44 - column: 66 - end_location: - row: 44 - column: 69 - fix: ~ - parent: ~ +- - kind: + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `a`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 11 + end_location: + row: 10 + column: 14 + fix: ~ + parent: ~ + - kind: + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `foo`" + suggestion: ~ + fixable: false + location: + row: 15 + column: 46 + end_location: + row: 15 + column: 49 + fix: ~ + parent: ~ + - kind: + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `a`" + suggestion: ~ + fixable: false + location: + row: 40 + column: 28 + end_location: + row: 40 + column: 31 + fix: ~ + parent: ~ + - kind: + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `foo_method`" + suggestion: ~ + fixable: false + location: + row: 44 + column: 66 + end_location: + row: 44 + column: 69 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__defaults.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__defaults.snap index fdfde38878a905..800793e086b1ec 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__defaults.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__defaults.snap @@ -2,303 +2,303 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs expression: diagnostics --- -- kind: - name: MissingReturnTypePublicFunction - body: "Missing return type annotation for public function `foo`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MissingTypeFunctionArgument - body: "Missing type annotation for function argument `a`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 8 - end_location: - row: 4 - column: 9 - fix: ~ - parent: ~ -- kind: - name: MissingTypeFunctionArgument - body: "Missing type annotation for function argument `b`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 11 - end_location: - row: 4 - column: 12 - fix: ~ - parent: ~ -- kind: - name: MissingReturnTypePublicFunction - body: "Missing return type annotation for public function `foo`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MissingTypeFunctionArgument - body: "Missing type annotation for function argument `b`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 16 - end_location: - row: 9 - column: 17 - fix: ~ - parent: ~ -- kind: - name: MissingTypeFunctionArgument - body: "Missing type annotation for function argument `b`" - suggestion: ~ - fixable: false - location: - row: 14 - column: 16 - end_location: - row: 14 - column: 17 - fix: ~ - parent: ~ -- kind: - name: MissingReturnTypePublicFunction - body: "Missing return type annotation for public function `foo`" - suggestion: ~ - fixable: false - location: - row: 19 - column: 4 - end_location: - row: 19 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MissingReturnTypePublicFunction - body: "Missing return type annotation for public function `foo`" - suggestion: ~ - fixable: false - location: - row: 24 - column: 4 - end_location: - row: 24 - column: 7 - fix: ~ - parent: ~ -- kind: - name: AnyType - body: "Dynamically typed expressions (typing.Any) are disallowed in `a`" - suggestion: ~ - fixable: false - location: - row: 44 - column: 11 - end_location: - row: 44 - column: 14 - fix: ~ - parent: ~ -- kind: - name: AnyType - body: "Dynamically typed expressions (typing.Any) are disallowed in `foo`" - suggestion: ~ - fixable: false - location: - row: 49 - column: 46 - end_location: - row: 49 - column: 49 - fix: ~ - parent: ~ -- kind: - name: AnyType - body: "Dynamically typed expressions (typing.Any) are disallowed in `*args`" - suggestion: ~ - fixable: false - location: - row: 54 - column: 23 - end_location: - row: 54 - column: 26 - fix: ~ - parent: ~ -- kind: - name: AnyType - body: "Dynamically typed expressions (typing.Any) are disallowed in `**kwargs`" - suggestion: ~ - fixable: false - location: - row: 54 - column: 38 - end_location: - row: 54 - column: 41 - fix: ~ - parent: ~ -- kind: - name: AnyType - body: "Dynamically typed expressions (typing.Any) are disallowed in `*args`" - suggestion: ~ - fixable: false - location: - row: 59 - column: 23 - end_location: - row: 59 - column: 26 - fix: ~ - parent: ~ -- kind: - name: AnyType - body: "Dynamically typed expressions (typing.Any) are disallowed in `**kwargs`" - suggestion: ~ - fixable: false - location: - row: 64 - column: 38 - end_location: - row: 64 - column: 41 - fix: ~ - parent: ~ -- kind: - name: MissingTypeSelf - body: "Missing type annotation for `self` in method" - suggestion: ~ - fixable: false - location: - row: 74 - column: 12 - end_location: - row: 74 - column: 16 - fix: ~ - parent: ~ -- kind: - name: AnyType - body: "Dynamically typed expressions (typing.Any) are disallowed in `a`" - suggestion: ~ - fixable: false - location: - row: 78 - column: 28 - end_location: - row: 78 - column: 31 - fix: ~ - parent: ~ -- kind: - name: AnyType - body: "Dynamically typed expressions (typing.Any) are disallowed in `foo`" - suggestion: ~ - fixable: false - location: - row: 82 - column: 66 - end_location: - row: 82 - column: 69 - fix: ~ - parent: ~ -- kind: - name: AnyType - body: "Dynamically typed expressions (typing.Any) are disallowed in `*params`" - suggestion: ~ - fixable: false - location: - row: 86 - column: 42 - end_location: - row: 86 - column: 45 - fix: ~ - parent: ~ -- kind: - name: AnyType - body: "Dynamically typed expressions (typing.Any) are disallowed in `**options`" - suggestion: ~ - fixable: false - location: - row: 86 - column: 58 - end_location: - row: 86 - column: 61 - fix: ~ - parent: ~ -- kind: - name: AnyType - body: "Dynamically typed expressions (typing.Any) are disallowed in `*params`" - suggestion: ~ - fixable: false - location: - row: 90 - column: 42 - end_location: - row: 90 - column: 45 - fix: ~ - parent: ~ -- kind: - name: AnyType - body: "Dynamically typed expressions (typing.Any) are disallowed in `**options`" - suggestion: ~ - fixable: false - location: - row: 94 - column: 58 - end_location: - row: 94 - column: 61 - fix: ~ - parent: ~ -- kind: - name: MissingTypeCls - body: "Missing type annotation for `cls` in classmethod" - suggestion: ~ - fixable: false - location: - row: 104 - column: 12 - end_location: - row: 104 - column: 15 - fix: ~ - parent: ~ -- kind: - name: MissingTypeSelf - body: "Missing type annotation for `self` in method" - suggestion: ~ - fixable: false - location: - row: 108 - column: 12 - end_location: - row: 108 - column: 16 - fix: ~ - parent: ~ +- - kind: + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `foo`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MissingTypeFunctionArgument + body: "Missing type annotation for function argument `a`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 8 + end_location: + row: 4 + column: 9 + fix: ~ + parent: ~ + - kind: + name: MissingTypeFunctionArgument + body: "Missing type annotation for function argument `b`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 11 + end_location: + row: 4 + column: 12 + fix: ~ + parent: ~ + - kind: + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `foo`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MissingTypeFunctionArgument + body: "Missing type annotation for function argument `b`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 16 + end_location: + row: 9 + column: 17 + fix: ~ + parent: ~ + - kind: + name: MissingTypeFunctionArgument + body: "Missing type annotation for function argument `b`" + suggestion: ~ + fixable: false + location: + row: 14 + column: 16 + end_location: + row: 14 + column: 17 + fix: ~ + parent: ~ + - kind: + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `foo`" + suggestion: ~ + fixable: false + location: + row: 19 + column: 4 + end_location: + row: 19 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `foo`" + suggestion: ~ + fixable: false + location: + row: 24 + column: 4 + end_location: + row: 24 + column: 7 + fix: ~ + parent: ~ + - kind: + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `a`" + suggestion: ~ + fixable: false + location: + row: 44 + column: 11 + end_location: + row: 44 + column: 14 + fix: ~ + parent: ~ + - kind: + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `foo`" + suggestion: ~ + fixable: false + location: + row: 49 + column: 46 + end_location: + row: 49 + column: 49 + fix: ~ + parent: ~ + - kind: + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `*args`" + suggestion: ~ + fixable: false + location: + row: 54 + column: 23 + end_location: + row: 54 + column: 26 + fix: ~ + parent: ~ + - kind: + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `**kwargs`" + suggestion: ~ + fixable: false + location: + row: 54 + column: 38 + end_location: + row: 54 + column: 41 + fix: ~ + parent: ~ + - kind: + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `*args`" + suggestion: ~ + fixable: false + location: + row: 59 + column: 23 + end_location: + row: 59 + column: 26 + fix: ~ + parent: ~ + - kind: + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `**kwargs`" + suggestion: ~ + fixable: false + location: + row: 64 + column: 38 + end_location: + row: 64 + column: 41 + fix: ~ + parent: ~ + - kind: + name: MissingTypeSelf + body: "Missing type annotation for `self` in method" + suggestion: ~ + fixable: false + location: + row: 74 + column: 12 + end_location: + row: 74 + column: 16 + fix: ~ + parent: ~ + - kind: + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `a`" + suggestion: ~ + fixable: false + location: + row: 78 + column: 28 + end_location: + row: 78 + column: 31 + fix: ~ + parent: ~ + - kind: + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `foo`" + suggestion: ~ + fixable: false + location: + row: 82 + column: 66 + end_location: + row: 82 + column: 69 + fix: ~ + parent: ~ + - kind: + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `*params`" + suggestion: ~ + fixable: false + location: + row: 86 + column: 42 + end_location: + row: 86 + column: 45 + fix: ~ + parent: ~ + - kind: + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `**options`" + suggestion: ~ + fixable: false + location: + row: 86 + column: 58 + end_location: + row: 86 + column: 61 + fix: ~ + parent: ~ + - kind: + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `*params`" + suggestion: ~ + fixable: false + location: + row: 90 + column: 42 + end_location: + row: 90 + column: 45 + fix: ~ + parent: ~ + - kind: + name: AnyType + body: "Dynamically typed expressions (typing.Any) are disallowed in `**options`" + suggestion: ~ + fixable: false + location: + row: 94 + column: 58 + end_location: + row: 94 + column: 61 + fix: ~ + parent: ~ + - kind: + name: MissingTypeCls + body: "Missing type annotation for `cls` in classmethod" + suggestion: ~ + fixable: false + location: + row: 104 + column: 12 + end_location: + row: 104 + column: 15 + fix: ~ + parent: ~ + - kind: + name: MissingTypeSelf + body: "Missing type annotation for `self` in method" + suggestion: ~ + fixable: false + location: + row: 108 + column: 12 + end_location: + row: 108 + column: 16 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__ignore_fully_untyped.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__ignore_fully_untyped.snap index e6d963bfb17c09..b6828d638ab3a5 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__ignore_fully_untyped.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__ignore_fully_untyped.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs expression: diagnostics --- -- kind: - name: MissingReturnTypePublicFunction - body: "Missing return type annotation for public function `error_partially_typed_1`" - suggestion: ~ - fixable: false - location: - row: 24 - column: 4 - end_location: - row: 24 - column: 27 - fix: ~ - parent: ~ -- kind: - name: MissingTypeFunctionArgument - body: "Missing type annotation for function argument `b`" - suggestion: ~ - fixable: false - location: - row: 24 - column: 36 - end_location: - row: 24 - column: 37 - fix: ~ - parent: ~ -- kind: - name: MissingTypeFunctionArgument - body: "Missing type annotation for function argument `b`" - suggestion: ~ - fixable: false - location: - row: 28 - column: 36 - end_location: - row: 28 - column: 37 - fix: ~ - parent: ~ -- kind: - name: MissingReturnTypePublicFunction - body: "Missing return type annotation for public function `error_partially_typed_3`" - suggestion: ~ - fixable: false - location: - row: 32 - column: 4 - end_location: - row: 32 - column: 27 - fix: ~ - parent: ~ -- kind: - name: MissingReturnTypePublicFunction - body: "Missing return type annotation for public function `error_typed_self`" - suggestion: ~ - fixable: false - location: - row: 43 - column: 8 - end_location: - row: 43 - column: 24 - fix: ~ - parent: ~ +- - kind: + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `error_partially_typed_1`" + suggestion: ~ + fixable: false + location: + row: 24 + column: 4 + end_location: + row: 24 + column: 27 + fix: ~ + parent: ~ + - kind: + name: MissingTypeFunctionArgument + body: "Missing type annotation for function argument `b`" + suggestion: ~ + fixable: false + location: + row: 24 + column: 36 + end_location: + row: 24 + column: 37 + fix: ~ + parent: ~ + - kind: + name: MissingTypeFunctionArgument + body: "Missing type annotation for function argument `b`" + suggestion: ~ + fixable: false + location: + row: 28 + column: 36 + end_location: + row: 28 + column: 37 + fix: ~ + parent: ~ + - kind: + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `error_partially_typed_3`" + suggestion: ~ + fixable: false + location: + row: 32 + column: 4 + end_location: + row: 32 + column: 27 + fix: ~ + parent: ~ + - kind: + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `error_typed_self`" + suggestion: ~ + fixable: false + location: + row: 43 + column: 8 + end_location: + row: 43 + column: 24 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__mypy_init_return.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__mypy_init_return.snap index 88175c55a0bd1c..6f812458f9472c 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__mypy_init_return.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__mypy_init_return.snap @@ -2,77 +2,77 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs expression: diagnostics --- -- kind: - name: MissingReturnTypeSpecialMethod - body: "Missing return type annotation for special method `__init__`" - suggestion: "Add `None` return type" - fixable: true - location: - row: 5 - column: 8 - end_location: - row: 5 - column: 16 - fix: - content: " -> None" +- - kind: + name: MissingReturnTypeSpecialMethod + body: "Missing return type annotation for special method `__init__`" + suggestion: "Add `None` return type" + fixable: true location: row: 5 - column: 22 + column: 8 end_location: row: 5 - column: 22 - parent: ~ -- kind: - name: MissingReturnTypeSpecialMethod - body: "Missing return type annotation for special method `__init__`" - suggestion: "Add `None` return type" - fixable: true - location: - row: 11 - column: 8 - end_location: - row: 11 - column: 16 - fix: - content: " -> None" + column: 16 + fix: + content: " -> None" + location: + row: 5 + column: 22 + end_location: + row: 5 + column: 22 + parent: ~ + - kind: + name: MissingReturnTypeSpecialMethod + body: "Missing return type annotation for special method `__init__`" + suggestion: "Add `None` return type" + fixable: true location: row: 11 - column: 27 + column: 8 end_location: row: 11 - column: 27 - parent: ~ -- kind: - name: MissingReturnTypePrivateFunction - body: "Missing return type annotation for private function `__init__`" - suggestion: ~ - fixable: false - location: - row: 40 - column: 4 - end_location: - row: 40 - column: 12 - fix: ~ - parent: ~ -- kind: - name: MissingReturnTypeSpecialMethod - body: "Missing return type annotation for special method `__init__`" - suggestion: "Add `None` return type" - fixable: true - location: - row: 47 - column: 8 - end_location: - row: 47 - column: 16 - fix: - content: " -> None" + column: 16 + fix: + content: " -> None" + location: + row: 11 + column: 27 + end_location: + row: 11 + column: 27 + parent: ~ + - kind: + name: MissingReturnTypePrivateFunction + body: "Missing return type annotation for private function `__init__`" + suggestion: ~ + fixable: false + location: + row: 40 + column: 4 + end_location: + row: 40 + column: 12 + fix: ~ + parent: ~ + - kind: + name: MissingReturnTypeSpecialMethod + body: "Missing return type annotation for special method `__init__`" + suggestion: "Add `None` return type" + fixable: true location: row: 47 - column: 28 + column: 8 end_location: row: 47 - column: 28 - parent: ~ + column: 16 + fix: + content: " -> None" + location: + row: 47 + column: 28 + end_location: + row: 47 + column: 28 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__suppress_dummy_args.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__suppress_dummy_args.snap index 7bffa896b49a8c..69f3e20b271b71 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__suppress_dummy_args.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__suppress_dummy_args.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_annotations/mod.rs +source: crates/ruff/src/rules/flake8_annotations/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__suppress_none_returning.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__suppress_none_returning.snap index 12988972565e28..b882fc4cc21700 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__suppress_none_returning.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__suppress_none_returning.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs expression: diagnostics --- -- kind: - name: MissingReturnTypePublicFunction - body: "Missing return type annotation for public function `foo`" - suggestion: ~ - fixable: false - location: - row: 45 - column: 4 - end_location: - row: 45 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MissingReturnTypePublicFunction - body: "Missing return type annotation for public function `foo`" - suggestion: ~ - fixable: false - location: - row: 50 - column: 4 - end_location: - row: 50 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MissingTypeFunctionArgument - body: "Missing type annotation for function argument `a`" - suggestion: ~ - fixable: false - location: - row: 59 - column: 8 - end_location: - row: 59 - column: 9 - fix: ~ - parent: ~ +- - kind: + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `foo`" + suggestion: ~ + fixable: false + location: + row: 45 + column: 4 + end_location: + row: 45 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MissingReturnTypePublicFunction + body: "Missing return type annotation for public function `foo`" + suggestion: ~ + fixable: false + location: + row: 50 + column: 4 + end_location: + row: 50 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MissingTypeFunctionArgument + body: "Missing type annotation for function argument `a`" + suggestion: ~ + fixable: false + location: + row: 59 + column: 8 + end_location: + row: 59 + column: 9 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S101_S101.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S101_S101.py.snap index 186be68d9611f6..47a112fcdb9ad9 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S101_S101.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S101_S101.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: Assert - body: "Use of `assert` detected" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 6 - fix: ~ - parent: ~ -- kind: - name: Assert - body: "Use of `assert` detected" - suggestion: ~ - fixable: false - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 10 - fix: ~ - parent: ~ -- kind: - name: Assert - body: "Use of `assert` detected" - suggestion: ~ - fixable: false - location: - row: 11 - column: 4 - end_location: - row: 11 - column: 10 - fix: ~ - parent: ~ +- - kind: + name: Assert + body: "Use of `assert` detected" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 6 + fix: ~ + parent: ~ + - kind: + name: Assert + body: "Use of `assert` detected" + suggestion: ~ + fixable: false + location: + row: 8 + column: 4 + end_location: + row: 8 + column: 10 + fix: ~ + parent: ~ + - kind: + name: Assert + body: "Use of `assert` detected" + suggestion: ~ + fixable: false + location: + row: 11 + column: 4 + end_location: + row: 11 + column: 10 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S102_S102.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S102_S102.py.snap index 121192f1dbf45a..0448f961a9a20e 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S102_S102.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S102_S102.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: ExecBuiltin - body: "Use of `exec` detected" - suggestion: ~ - fixable: false - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 17 - fix: ~ - parent: ~ -- kind: - name: ExecBuiltin - body: "Use of `exec` detected" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 13 - fix: ~ - parent: ~ +- - kind: + name: ExecBuiltin + body: "Use of `exec` detected" + suggestion: ~ + fixable: false + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 17 + fix: ~ + parent: ~ + - kind: + name: ExecBuiltin + body: "Use of `exec` detected" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 13 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S103_S103.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S103_S103.py.snap index 2c33efc8183254..6c061f2505ecf4 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S103_S103.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S103_S103.py.snap @@ -2,173 +2,173 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: BadFilePermissions - body: "`os.chmod` setting a permissive mask `0o227` on file or directory" - suggestion: ~ - fixable: false - location: - row: 6 - column: 24 - end_location: - row: 6 - column: 29 - fix: ~ - parent: ~ -- kind: - name: BadFilePermissions - body: "`os.chmod` setting a permissive mask `0o7` on file or directory" - suggestion: ~ - fixable: false - location: - row: 7 - column: 24 - end_location: - row: 7 - column: 27 - fix: ~ - parent: ~ -- kind: - name: BadFilePermissions - body: "`os.chmod` setting a permissive mask `0o777` on file or directory" - suggestion: ~ - fixable: false - location: - row: 9 - column: 24 - end_location: - row: 9 - column: 29 - fix: ~ - parent: ~ -- kind: - name: BadFilePermissions - body: "`os.chmod` setting a permissive mask `0o770` on file or directory" - suggestion: ~ - fixable: false - location: - row: 10 - column: 24 - end_location: - row: 10 - column: 29 - fix: ~ - parent: ~ -- kind: - name: BadFilePermissions - body: "`os.chmod` setting a permissive mask `0o776` on file or directory" - suggestion: ~ - fixable: false - location: - row: 11 - column: 24 - end_location: - row: 11 - column: 29 - fix: ~ - parent: ~ -- kind: - name: BadFilePermissions - body: "`os.chmod` setting a permissive mask `0o777` on file or directory" - suggestion: ~ - fixable: false - location: - row: 13 - column: 22 - end_location: - row: 13 - column: 25 - fix: ~ - parent: ~ -- kind: - name: BadFilePermissions - body: "`os.chmod` setting a permissive mask `0o777` on file or directory" - suggestion: ~ - fixable: false - location: - row: 14 - column: 23 - end_location: - row: 14 - column: 28 - fix: ~ - parent: ~ -- kind: - name: BadFilePermissions - body: "`os.chmod` setting a permissive mask `0o777` on file or directory" - suggestion: ~ - fixable: false - location: - row: 15 - column: 24 - end_location: - row: 15 - column: 29 - fix: ~ - parent: ~ -- kind: - name: BadFilePermissions - body: "`os.chmod` setting a permissive mask `0o777` on file or directory" - suggestion: ~ - fixable: false - location: - row: 17 - column: 18 - end_location: - row: 17 - column: 23 - fix: ~ - parent: ~ -- kind: - name: BadFilePermissions - body: "`os.chmod` setting a permissive mask `0o777` on file or directory" - suggestion: ~ - fixable: false - location: - row: 18 - column: 18 - end_location: - row: 18 - column: 36 - fix: ~ - parent: ~ -- kind: - name: BadFilePermissions - body: "`os.chmod` setting a permissive mask `0o777` on file or directory" - suggestion: ~ - fixable: false - location: - row: 19 - column: 18 - end_location: - row: 19 - column: 60 - fix: ~ - parent: ~ -- kind: - name: BadFilePermissions - body: "`os.chmod` setting a permissive mask `0o10` on file or directory" - suggestion: ~ - fixable: false - location: - row: 20 - column: 26 - end_location: - row: 20 - column: 38 - fix: ~ - parent: ~ -- kind: - name: BadFilePermissions - body: "`os.chmod` setting a permissive mask `0o2` on file or directory" - suggestion: ~ - fixable: false - location: - row: 22 - column: 24 - end_location: - row: 22 - column: 36 - fix: ~ - parent: ~ +- - kind: + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o227` on file or directory" + suggestion: ~ + fixable: false + location: + row: 6 + column: 24 + end_location: + row: 6 + column: 29 + fix: ~ + parent: ~ + - kind: + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o7` on file or directory" + suggestion: ~ + fixable: false + location: + row: 7 + column: 24 + end_location: + row: 7 + column: 27 + fix: ~ + parent: ~ + - kind: + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o777` on file or directory" + suggestion: ~ + fixable: false + location: + row: 9 + column: 24 + end_location: + row: 9 + column: 29 + fix: ~ + parent: ~ + - kind: + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o770` on file or directory" + suggestion: ~ + fixable: false + location: + row: 10 + column: 24 + end_location: + row: 10 + column: 29 + fix: ~ + parent: ~ + - kind: + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o776` on file or directory" + suggestion: ~ + fixable: false + location: + row: 11 + column: 24 + end_location: + row: 11 + column: 29 + fix: ~ + parent: ~ + - kind: + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o777` on file or directory" + suggestion: ~ + fixable: false + location: + row: 13 + column: 22 + end_location: + row: 13 + column: 25 + fix: ~ + parent: ~ + - kind: + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o777` on file or directory" + suggestion: ~ + fixable: false + location: + row: 14 + column: 23 + end_location: + row: 14 + column: 28 + fix: ~ + parent: ~ + - kind: + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o777` on file or directory" + suggestion: ~ + fixable: false + location: + row: 15 + column: 24 + end_location: + row: 15 + column: 29 + fix: ~ + parent: ~ + - kind: + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o777` on file or directory" + suggestion: ~ + fixable: false + location: + row: 17 + column: 18 + end_location: + row: 17 + column: 23 + fix: ~ + parent: ~ + - kind: + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o777` on file or directory" + suggestion: ~ + fixable: false + location: + row: 18 + column: 18 + end_location: + row: 18 + column: 36 + fix: ~ + parent: ~ + - kind: + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o777` on file or directory" + suggestion: ~ + fixable: false + location: + row: 19 + column: 18 + end_location: + row: 19 + column: 60 + fix: ~ + parent: ~ + - kind: + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o10` on file or directory" + suggestion: ~ + fixable: false + location: + row: 20 + column: 26 + end_location: + row: 20 + column: 38 + fix: ~ + parent: ~ + - kind: + name: BadFilePermissions + body: "`os.chmod` setting a permissive mask `0o2` on file or directory" + suggestion: ~ + fixable: false + location: + row: 22 + column: 24 + end_location: + row: 22 + column: 36 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S104_S104.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S104_S104.py.snap index 16b2d9f11769ef..c47b0743f68921 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S104_S104.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S104_S104.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: HardcodedBindAllInterfaces - body: Possible binding to all interfaces - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 9 - fix: ~ - parent: ~ -- kind: - name: HardcodedBindAllInterfaces - body: Possible binding to all interfaces - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 9 - fix: ~ - parent: ~ -- kind: - name: HardcodedBindAllInterfaces - body: Possible binding to all interfaces - suggestion: ~ - fixable: false - location: - row: 14 - column: 5 - end_location: - row: 14 - column: 14 - fix: ~ - parent: ~ -- kind: - name: HardcodedBindAllInterfaces - body: Possible binding to all interfaces - suggestion: ~ - fixable: false - location: - row: 18 - column: 8 - end_location: - row: 18 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: HardcodedBindAllInterfaces + body: Possible binding to all interfaces + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 9 + fix: ~ + parent: ~ + - kind: + name: HardcodedBindAllInterfaces + body: Possible binding to all interfaces + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 9 + fix: ~ + parent: ~ + - kind: + name: HardcodedBindAllInterfaces + body: Possible binding to all interfaces + suggestion: ~ + fixable: false + location: + row: 14 + column: 5 + end_location: + row: 14 + column: 14 + fix: ~ + parent: ~ + - kind: + name: HardcodedBindAllInterfaces + body: Possible binding to all interfaces + suggestion: ~ + fixable: false + location: + row: 18 + column: 8 + end_location: + row: 18 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S105_S105.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S105_S105.py.snap index 79e85ae1239749..819452c8b06d1e 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S105_S105.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S105_S105.py.snap @@ -2,511 +2,511 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 13 - column: 11 - end_location: - row: 13 - column: 19 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 14 - column: 8 - end_location: - row: 14 - column: 16 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 15 - column: 9 - end_location: - row: 15 - column: 17 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 16 - column: 6 - end_location: - row: 16 - column: 14 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 17 - column: 9 - end_location: - row: 17 - column: 17 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 18 - column: 8 - end_location: - row: 18 - column: 16 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 19 - column: 10 - end_location: - row: 19 - column: 18 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 20 - column: 18 - end_location: - row: 20 - column: 26 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 21 - column: 18 - end_location: - row: 21 - column: 26 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 22 - column: 11 - end_location: - row: 22 - column: 19 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 23 - column: 11 - end_location: - row: 23 - column: 19 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 25 - column: 16 - end_location: - row: 25 - column: 24 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 26 - column: 12 - end_location: - row: 26 - column: 20 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 27 - column: 14 - end_location: - row: 27 - column: 22 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 28 - column: 11 - end_location: - row: 28 - column: 19 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 29 - column: 14 - end_location: - row: 29 - column: 22 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 30 - column: 13 - end_location: - row: 30 - column: 21 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 31 - column: 15 - end_location: - row: 31 - column: 23 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 32 - column: 23 - end_location: - row: 32 - column: 31 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 33 - column: 23 - end_location: - row: 33 - column: 31 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 37 - column: 15 - end_location: - row: 37 - column: 23 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 41 - column: 19 - end_location: - row: 41 - column: 27 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 42 - column: 16 - end_location: - row: 42 - column: 24 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 43 - column: 17 - end_location: - row: 43 - column: 25 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 44 - column: 14 - end_location: - row: 44 - column: 22 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 45 - column: 17 - end_location: - row: 45 - column: 25 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 46 - column: 16 - end_location: - row: 46 - column: 24 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 47 - column: 18 - end_location: - row: 47 - column: 26 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 49 - column: 12 - end_location: - row: 49 - column: 20 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 50 - column: 9 - end_location: - row: 50 - column: 17 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 51 - column: 10 - end_location: - row: 51 - column: 18 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 52 - column: 7 - end_location: - row: 52 - column: 15 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 53 - column: 10 - end_location: - row: 53 - column: 18 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 54 - column: 9 - end_location: - row: 54 - column: 17 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 55 - column: 11 - end_location: - row: 55 - column: 19 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 56 - column: 20 - end_location: - row: 56 - column: 28 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"1\\n2\"" - suggestion: ~ - fixable: false - location: - row: 58 - column: 12 - end_location: - row: 58 - column: 18 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"3\\t4\"" - suggestion: ~ - fixable: false - location: - row: 61 - column: 12 - end_location: - row: 61 - column: 18 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordString - body: "Possible hardcoded password: \"5\\r6\"" - suggestion: ~ - fixable: false - location: - row: 64 - column: 12 - end_location: - row: 64 - column: 18 - fix: ~ - parent: ~ +- - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 13 + column: 11 + end_location: + row: 13 + column: 19 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 14 + column: 8 + end_location: + row: 14 + column: 16 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 15 + column: 9 + end_location: + row: 15 + column: 17 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 16 + column: 6 + end_location: + row: 16 + column: 14 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 17 + column: 9 + end_location: + row: 17 + column: 17 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 18 + column: 8 + end_location: + row: 18 + column: 16 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 19 + column: 10 + end_location: + row: 19 + column: 18 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 20 + column: 18 + end_location: + row: 20 + column: 26 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 21 + column: 18 + end_location: + row: 21 + column: 26 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 22 + column: 11 + end_location: + row: 22 + column: 19 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 23 + column: 11 + end_location: + row: 23 + column: 19 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 25 + column: 16 + end_location: + row: 25 + column: 24 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 26 + column: 12 + end_location: + row: 26 + column: 20 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 27 + column: 14 + end_location: + row: 27 + column: 22 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 28 + column: 11 + end_location: + row: 28 + column: 19 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 29 + column: 14 + end_location: + row: 29 + column: 22 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 30 + column: 13 + end_location: + row: 30 + column: 21 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 31 + column: 15 + end_location: + row: 31 + column: 23 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 32 + column: 23 + end_location: + row: 32 + column: 31 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 33 + column: 23 + end_location: + row: 33 + column: 31 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 37 + column: 15 + end_location: + row: 37 + column: 23 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 41 + column: 19 + end_location: + row: 41 + column: 27 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 42 + column: 16 + end_location: + row: 42 + column: 24 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 43 + column: 17 + end_location: + row: 43 + column: 25 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 44 + column: 14 + end_location: + row: 44 + column: 22 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 45 + column: 17 + end_location: + row: 45 + column: 25 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 46 + column: 16 + end_location: + row: 46 + column: 24 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 47 + column: 18 + end_location: + row: 47 + column: 26 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 49 + column: 12 + end_location: + row: 49 + column: 20 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 50 + column: 9 + end_location: + row: 50 + column: 17 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 51 + column: 10 + end_location: + row: 51 + column: 18 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 52 + column: 7 + end_location: + row: 52 + column: 15 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 53 + column: 10 + end_location: + row: 53 + column: 18 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 54 + column: 9 + end_location: + row: 54 + column: 17 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 55 + column: 11 + end_location: + row: 55 + column: 19 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 56 + column: 20 + end_location: + row: 56 + column: 28 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"1\\n2\"" + suggestion: ~ + fixable: false + location: + row: 58 + column: 12 + end_location: + row: 58 + column: 18 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"3\\t4\"" + suggestion: ~ + fixable: false + location: + row: 61 + column: 12 + end_location: + row: 61 + column: 18 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordString + body: "Possible hardcoded password: \"5\\r6\"" + suggestion: ~ + fixable: false + location: + row: 64 + column: 12 + end_location: + row: 64 + column: 18 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S106_S106.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S106_S106.py.snap index 7d4ea849fecf4f..a0f1b4e233f0ac 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S106_S106.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S106_S106.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: HardcodedPasswordFuncArg - body: "Possible hardcoded password: \"s3cr3t\"" - suggestion: ~ - fixable: false - location: - row: 14 - column: 8 - end_location: - row: 14 - column: 25 - fix: ~ - parent: ~ +- - kind: + name: HardcodedPasswordFuncArg + body: "Possible hardcoded password: \"s3cr3t\"" + suggestion: ~ + fixable: false + location: + row: 14 + column: 8 + end_location: + row: 14 + column: 25 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S107_S107.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S107_S107.py.snap index 06d9ccb6993903..cd34e99bd15d55 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S107_S107.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S107_S107.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: HardcodedPasswordDefault - body: "Possible hardcoded password: \"default\"" - suggestion: ~ - fixable: false - location: - row: 5 - column: 28 - end_location: - row: 5 - column: 37 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordDefault - body: "Possible hardcoded password: \"posonly\"" - suggestion: ~ - fixable: false - location: - row: 13 - column: 44 - end_location: - row: 13 - column: 53 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordDefault - body: "Possible hardcoded password: \"kwonly\"" - suggestion: ~ - fixable: false - location: - row: 21 - column: 38 - end_location: - row: 21 - column: 46 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordDefault - body: "Possible hardcoded password: \"posonly\"" - suggestion: ~ - fixable: false - location: - row: 29 - column: 38 - end_location: - row: 29 - column: 47 - fix: ~ - parent: ~ -- kind: - name: HardcodedPasswordDefault - body: "Possible hardcoded password: \"kwonly\"" - suggestion: ~ - fixable: false - location: - row: 29 - column: 61 - end_location: - row: 29 - column: 69 - fix: ~ - parent: ~ +- - kind: + name: HardcodedPasswordDefault + body: "Possible hardcoded password: \"default\"" + suggestion: ~ + fixable: false + location: + row: 5 + column: 28 + end_location: + row: 5 + column: 37 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordDefault + body: "Possible hardcoded password: \"posonly\"" + suggestion: ~ + fixable: false + location: + row: 13 + column: 44 + end_location: + row: 13 + column: 53 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordDefault + body: "Possible hardcoded password: \"kwonly\"" + suggestion: ~ + fixable: false + location: + row: 21 + column: 38 + end_location: + row: 21 + column: 46 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordDefault + body: "Possible hardcoded password: \"posonly\"" + suggestion: ~ + fixable: false + location: + row: 29 + column: 38 + end_location: + row: 29 + column: 47 + fix: ~ + parent: ~ + - kind: + name: HardcodedPasswordDefault + body: "Possible hardcoded password: \"kwonly\"" + suggestion: ~ + fixable: false + location: + row: 29 + column: 61 + end_location: + row: 29 + column: 69 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_S108.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_S108.py.snap index 8bda552a389c26..33d015f9af8124 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_S108.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_S108.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: HardcodedTempFile - body: "Probable insecure usage of temporary file or directory: \"/tmp/abc\"" - suggestion: ~ - fixable: false - location: - row: 5 - column: 10 - end_location: - row: 5 - column: 20 - fix: ~ - parent: ~ -- kind: - name: HardcodedTempFile - body: "Probable insecure usage of temporary file or directory: \"/var/tmp/123\"" - suggestion: ~ - fixable: false - location: - row: 8 - column: 10 - end_location: - row: 8 - column: 24 - fix: ~ - parent: ~ -- kind: - name: HardcodedTempFile - body: "Probable insecure usage of temporary file or directory: \"/dev/shm/unit/test\"" - suggestion: ~ - fixable: false - location: - row: 11 - column: 10 - end_location: - row: 11 - column: 30 - fix: ~ - parent: ~ +- - kind: + name: HardcodedTempFile + body: "Probable insecure usage of temporary file or directory: \"/tmp/abc\"" + suggestion: ~ + fixable: false + location: + row: 5 + column: 10 + end_location: + row: 5 + column: 20 + fix: ~ + parent: ~ + - kind: + name: HardcodedTempFile + body: "Probable insecure usage of temporary file or directory: \"/var/tmp/123\"" + suggestion: ~ + fixable: false + location: + row: 8 + column: 10 + end_location: + row: 8 + column: 24 + fix: ~ + parent: ~ + - kind: + name: HardcodedTempFile + body: "Probable insecure usage of temporary file or directory: \"/dev/shm/unit/test\"" + suggestion: ~ + fixable: false + location: + row: 11 + column: 10 + end_location: + row: 11 + column: 30 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_extend.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_extend.snap index 1774737ca22246..4add97b6354236 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_extend.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_extend.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: HardcodedTempFile - body: "Probable insecure usage of temporary file or directory: \"/tmp/abc\"" - suggestion: ~ - fixable: false - location: - row: 5 - column: 10 - end_location: - row: 5 - column: 20 - fix: ~ - parent: ~ -- kind: - name: HardcodedTempFile - body: "Probable insecure usage of temporary file or directory: \"/var/tmp/123\"" - suggestion: ~ - fixable: false - location: - row: 8 - column: 10 - end_location: - row: 8 - column: 24 - fix: ~ - parent: ~ -- kind: - name: HardcodedTempFile - body: "Probable insecure usage of temporary file or directory: \"/dev/shm/unit/test\"" - suggestion: ~ - fixable: false - location: - row: 11 - column: 10 - end_location: - row: 11 - column: 30 - fix: ~ - parent: ~ -- kind: - name: HardcodedTempFile - body: "Probable insecure usage of temporary file or directory: \"/foo/bar\"" - suggestion: ~ - fixable: false - location: - row: 15 - column: 10 - end_location: - row: 15 - column: 20 - fix: ~ - parent: ~ +- - kind: + name: HardcodedTempFile + body: "Probable insecure usage of temporary file or directory: \"/tmp/abc\"" + suggestion: ~ + fixable: false + location: + row: 5 + column: 10 + end_location: + row: 5 + column: 20 + fix: ~ + parent: ~ + - kind: + name: HardcodedTempFile + body: "Probable insecure usage of temporary file or directory: \"/var/tmp/123\"" + suggestion: ~ + fixable: false + location: + row: 8 + column: 10 + end_location: + row: 8 + column: 24 + fix: ~ + parent: ~ + - kind: + name: HardcodedTempFile + body: "Probable insecure usage of temporary file or directory: \"/dev/shm/unit/test\"" + suggestion: ~ + fixable: false + location: + row: 11 + column: 10 + end_location: + row: 11 + column: 30 + fix: ~ + parent: ~ + - kind: + name: HardcodedTempFile + body: "Probable insecure usage of temporary file or directory: \"/foo/bar\"" + suggestion: ~ + fixable: false + location: + row: 15 + column: 10 + end_location: + row: 15 + column: 20 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_S110.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_S110.py.snap index aa0ee08f3b48bd..2c1111c0b77043 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_S110.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_S110.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: TryExceptPass - body: "`try`-`except`-`pass` detected, consider logging the exception" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 4 - column: 8 - fix: ~ - parent: ~ -- kind: - name: TryExceptPass - body: "`try`-`except`-`pass` detected, consider logging the exception" - suggestion: ~ - fixable: false - location: - row: 8 - column: 0 - end_location: - row: 9 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: TryExceptPass + body: "`try`-`except`-`pass` detected, consider logging the exception" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 4 + column: 8 + fix: ~ + parent: ~ + - kind: + name: TryExceptPass + body: "`try`-`except`-`pass` detected, consider logging the exception" + suggestion: ~ + fixable: false + location: + row: 8 + column: 0 + end_location: + row: 9 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_typed.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_typed.snap index 09147b2a6774c5..c9800e9ce66aa0 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_typed.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_typed.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: TryExceptPass - body: "`try`-`except`-`pass` detected, consider logging the exception" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 4 - column: 8 - fix: ~ - parent: ~ -- kind: - name: TryExceptPass - body: "`try`-`except`-`pass` detected, consider logging the exception" - suggestion: ~ - fixable: false - location: - row: 8 - column: 0 - end_location: - row: 9 - column: 8 - fix: ~ - parent: ~ -- kind: - name: TryExceptPass - body: "`try`-`except`-`pass` detected, consider logging the exception" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 14 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: TryExceptPass + body: "`try`-`except`-`pass` detected, consider logging the exception" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 4 + column: 8 + fix: ~ + parent: ~ + - kind: + name: TryExceptPass + body: "`try`-`except`-`pass` detected, consider logging the exception" + suggestion: ~ + fixable: false + location: + row: 8 + column: 0 + end_location: + row: 9 + column: 8 + fix: ~ + parent: ~ + - kind: + name: TryExceptPass + body: "`try`-`except`-`pass` detected, consider logging the exception" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 14 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S112_S112.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S112_S112.py.snap index afff3d8817387f..ee2f18038c79bf 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S112_S112.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S112_S112.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: TryExceptContinue - body: "`try`-`except`-`continue` detected, consider logging the exception" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 4 - column: 12 - fix: ~ - parent: ~ -- kind: - name: TryExceptContinue - body: "`try`-`except`-`continue` detected, consider logging the exception" - suggestion: ~ - fixable: false - location: - row: 8 - column: 0 - end_location: - row: 9 - column: 12 - fix: ~ - parent: ~ -- kind: - name: TryExceptContinue - body: "`try`-`except`-`continue` detected, consider logging the exception" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 14 - column: 12 - fix: ~ - parent: ~ -- kind: - name: TryExceptContinue - body: "`try`-`except`-`continue` detected, consider logging the exception" - suggestion: ~ - fixable: false - location: - row: 18 - column: 0 - end_location: - row: 19 - column: 12 - fix: ~ - parent: ~ +- - kind: + name: TryExceptContinue + body: "`try`-`except`-`continue` detected, consider logging the exception" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 4 + column: 12 + fix: ~ + parent: ~ + - kind: + name: TryExceptContinue + body: "`try`-`except`-`continue` detected, consider logging the exception" + suggestion: ~ + fixable: false + location: + row: 8 + column: 0 + end_location: + row: 9 + column: 12 + fix: ~ + parent: ~ + - kind: + name: TryExceptContinue + body: "`try`-`except`-`continue` detected, consider logging the exception" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 14 + column: 12 + fix: ~ + parent: ~ + - kind: + name: TryExceptContinue + body: "`try`-`except`-`continue` detected, consider logging the exception" + suggestion: ~ + fixable: false + location: + row: 18 + column: 0 + end_location: + row: 19 + column: 12 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S113_S113.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S113_S113.py.snap index 85cbf0de963afa..018cfdb0f17d6c 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S113_S113.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S113_S113.py.snap @@ -2,186 +2,186 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: RequestWithoutTimeout - body: Probable use of requests call without timeout - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 12 - fix: ~ - parent: ~ -- kind: - name: RequestWithoutTimeout - body: "Probable use of requests call with timeout set to `None`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 42 - end_location: - row: 4 - column: 46 - fix: ~ - parent: ~ -- kind: - name: RequestWithoutTimeout - body: Probable use of requests call without timeout - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 13 - fix: ~ - parent: ~ -- kind: - name: RequestWithoutTimeout - body: "Probable use of requests call with timeout set to `None`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 43 - end_location: - row: 7 - column: 47 - fix: ~ - parent: ~ -- kind: - name: RequestWithoutTimeout - body: Probable use of requests call without timeout - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 12 - fix: ~ - parent: ~ -- kind: - name: RequestWithoutTimeout - body: "Probable use of requests call with timeout set to `None`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 42 - end_location: - row: 10 - column: 46 - fix: ~ - parent: ~ -- kind: - name: RequestWithoutTimeout - body: Probable use of requests call without timeout - suggestion: ~ - fixable: false - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 15 - fix: ~ - parent: ~ -- kind: - name: RequestWithoutTimeout - body: "Probable use of requests call with timeout set to `None`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 45 - end_location: - row: 13 - column: 49 - fix: ~ - parent: ~ -- kind: - name: RequestWithoutTimeout - body: Probable use of requests call without timeout - suggestion: ~ - fixable: false - location: - row: 15 - column: 0 - end_location: - row: 15 - column: 14 - fix: ~ - parent: ~ -- kind: - name: RequestWithoutTimeout - body: "Probable use of requests call with timeout set to `None`" - suggestion: ~ - fixable: false - location: - row: 16 - column: 44 - end_location: - row: 16 - column: 48 - fix: ~ - parent: ~ -- kind: - name: RequestWithoutTimeout - body: Probable use of requests call without timeout - suggestion: ~ - fixable: false - location: - row: 18 - column: 0 - end_location: - row: 18 - column: 16 - fix: ~ - parent: ~ -- kind: - name: RequestWithoutTimeout - body: "Probable use of requests call with timeout set to `None`" - suggestion: ~ - fixable: false - location: - row: 19 - column: 46 - end_location: - row: 19 - column: 50 - fix: ~ - parent: ~ -- kind: - name: RequestWithoutTimeout - body: Probable use of requests call without timeout - suggestion: ~ - fixable: false - location: - row: 21 - column: 0 - end_location: - row: 21 - column: 13 - fix: ~ - parent: ~ -- kind: - name: RequestWithoutTimeout - body: "Probable use of requests call with timeout set to `None`" - suggestion: ~ - fixable: false - location: - row: 22 - column: 43 - end_location: - row: 22 - column: 47 - fix: ~ - parent: ~ +- - kind: + name: RequestWithoutTimeout + body: Probable use of requests call without timeout + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 12 + fix: ~ + parent: ~ + - kind: + name: RequestWithoutTimeout + body: "Probable use of requests call with timeout set to `None`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 42 + end_location: + row: 4 + column: 46 + fix: ~ + parent: ~ + - kind: + name: RequestWithoutTimeout + body: Probable use of requests call without timeout + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 13 + fix: ~ + parent: ~ + - kind: + name: RequestWithoutTimeout + body: "Probable use of requests call with timeout set to `None`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 43 + end_location: + row: 7 + column: 47 + fix: ~ + parent: ~ + - kind: + name: RequestWithoutTimeout + body: Probable use of requests call without timeout + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 12 + fix: ~ + parent: ~ + - kind: + name: RequestWithoutTimeout + body: "Probable use of requests call with timeout set to `None`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 42 + end_location: + row: 10 + column: 46 + fix: ~ + parent: ~ + - kind: + name: RequestWithoutTimeout + body: Probable use of requests call without timeout + suggestion: ~ + fixable: false + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 15 + fix: ~ + parent: ~ + - kind: + name: RequestWithoutTimeout + body: "Probable use of requests call with timeout set to `None`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 45 + end_location: + row: 13 + column: 49 + fix: ~ + parent: ~ + - kind: + name: RequestWithoutTimeout + body: Probable use of requests call without timeout + suggestion: ~ + fixable: false + location: + row: 15 + column: 0 + end_location: + row: 15 + column: 14 + fix: ~ + parent: ~ + - kind: + name: RequestWithoutTimeout + body: "Probable use of requests call with timeout set to `None`" + suggestion: ~ + fixable: false + location: + row: 16 + column: 44 + end_location: + row: 16 + column: 48 + fix: ~ + parent: ~ + - kind: + name: RequestWithoutTimeout + body: Probable use of requests call without timeout + suggestion: ~ + fixable: false + location: + row: 18 + column: 0 + end_location: + row: 18 + column: 16 + fix: ~ + parent: ~ + - kind: + name: RequestWithoutTimeout + body: "Probable use of requests call with timeout set to `None`" + suggestion: ~ + fixable: false + location: + row: 19 + column: 46 + end_location: + row: 19 + column: 50 + fix: ~ + parent: ~ + - kind: + name: RequestWithoutTimeout + body: Probable use of requests call without timeout + suggestion: ~ + fixable: false + location: + row: 21 + column: 0 + end_location: + row: 21 + column: 13 + fix: ~ + parent: ~ + - kind: + name: RequestWithoutTimeout + body: "Probable use of requests call with timeout set to `None`" + suggestion: ~ + fixable: false + location: + row: 22 + column: 43 + end_location: + row: 22 + column: 47 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S324_S324.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S324_S324.py.snap index 0c2b18b3217d0c..5325a7ee094984 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S324_S324.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S324_S324.py.snap @@ -2,173 +2,173 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: HashlibInsecureHashFunction - body: "Probable use of insecure hash functions in `hashlib`: `md5`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 12 - end_location: - row: 7 - column: 17 - fix: ~ - parent: ~ -- kind: - name: HashlibInsecureHashFunction - body: "Probable use of insecure hash functions in `hashlib`: `md4`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 12 - end_location: - row: 9 - column: 17 - fix: ~ - parent: ~ -- kind: - name: HashlibInsecureHashFunction - body: "Probable use of insecure hash functions in `hashlib`: `md5`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 17 - end_location: - row: 11 - column: 22 - fix: ~ - parent: ~ -- kind: - name: HashlibInsecureHashFunction - body: "Probable use of insecure hash functions in `hashlib`: `MD4`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 12 - end_location: - row: 13 - column: 17 - fix: ~ - parent: ~ -- kind: - name: HashlibInsecureHashFunction - body: "Probable use of insecure hash functions in `hashlib`: `sha1`" - suggestion: ~ - fixable: false - location: - row: 15 - column: 12 - end_location: - row: 15 - column: 18 - fix: ~ - parent: ~ -- kind: - name: HashlibInsecureHashFunction - body: "Probable use of insecure hash functions in `hashlib`: `sha1`" - suggestion: ~ - fixable: false - location: - row: 17 - column: 12 - end_location: - row: 17 - column: 18 - fix: ~ - parent: ~ -- kind: - name: HashlibInsecureHashFunction - body: "Probable use of insecure hash functions in `hashlib`: `sha`" - suggestion: ~ - fixable: false - location: - row: 19 - column: 12 - end_location: - row: 19 - column: 17 - fix: ~ - parent: ~ -- kind: - name: HashlibInsecureHashFunction - body: "Probable use of insecure hash functions in `hashlib`: `SHA`" - suggestion: ~ - fixable: false - location: - row: 21 - column: 17 - end_location: - row: 21 - column: 22 - fix: ~ - parent: ~ -- kind: - name: HashlibInsecureHashFunction - body: "Probable use of insecure hash functions in `hashlib`: `sha`" - suggestion: ~ - fixable: false - location: - row: 23 - column: 0 - end_location: - row: 23 - column: 11 - fix: ~ - parent: ~ -- kind: - name: HashlibInsecureHashFunction - body: "Probable use of insecure hash functions in `hashlib`: `md5`" - suggestion: ~ - fixable: false - location: - row: 25 - column: 0 - end_location: - row: 25 - column: 11 - fix: ~ - parent: ~ -- kind: - name: HashlibInsecureHashFunction - body: "Probable use of insecure hash functions in `hashlib`: `sha1`" - suggestion: ~ - fixable: false - location: - row: 27 - column: 12 - end_location: - row: 27 - column: 18 - fix: ~ - parent: ~ -- kind: - name: HashlibInsecureHashFunction - body: "Probable use of insecure hash functions in `hashlib`: `sha1`" - suggestion: ~ - fixable: false - location: - row: 29 - column: 0 - end_location: - row: 29 - column: 12 - fix: ~ - parent: ~ -- kind: - name: HashlibInsecureHashFunction - body: "Probable use of insecure hash functions in `hashlib`: `sha1`" - suggestion: ~ - fixable: false - location: - row: 32 - column: 12 - end_location: - row: 32 - column: 18 - fix: ~ - parent: ~ +- - kind: + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `md5`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 12 + end_location: + row: 7 + column: 17 + fix: ~ + parent: ~ + - kind: + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `md4`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 12 + end_location: + row: 9 + column: 17 + fix: ~ + parent: ~ + - kind: + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `md5`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 17 + end_location: + row: 11 + column: 22 + fix: ~ + parent: ~ + - kind: + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `MD4`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 12 + end_location: + row: 13 + column: 17 + fix: ~ + parent: ~ + - kind: + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `sha1`" + suggestion: ~ + fixable: false + location: + row: 15 + column: 12 + end_location: + row: 15 + column: 18 + fix: ~ + parent: ~ + - kind: + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `sha1`" + suggestion: ~ + fixable: false + location: + row: 17 + column: 12 + end_location: + row: 17 + column: 18 + fix: ~ + parent: ~ + - kind: + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `sha`" + suggestion: ~ + fixable: false + location: + row: 19 + column: 12 + end_location: + row: 19 + column: 17 + fix: ~ + parent: ~ + - kind: + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `SHA`" + suggestion: ~ + fixable: false + location: + row: 21 + column: 17 + end_location: + row: 21 + column: 22 + fix: ~ + parent: ~ + - kind: + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `sha`" + suggestion: ~ + fixable: false + location: + row: 23 + column: 0 + end_location: + row: 23 + column: 11 + fix: ~ + parent: ~ + - kind: + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `md5`" + suggestion: ~ + fixable: false + location: + row: 25 + column: 0 + end_location: + row: 25 + column: 11 + fix: ~ + parent: ~ + - kind: + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `sha1`" + suggestion: ~ + fixable: false + location: + row: 27 + column: 12 + end_location: + row: 27 + column: 18 + fix: ~ + parent: ~ + - kind: + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `sha1`" + suggestion: ~ + fixable: false + location: + row: 29 + column: 0 + end_location: + row: 29 + column: 12 + fix: ~ + parent: ~ + - kind: + name: HashlibInsecureHashFunction + body: "Probable use of insecure hash functions in `hashlib`: `sha1`" + suggestion: ~ + fixable: false + location: + row: 32 + column: 12 + end_location: + row: 32 + column: 18 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S501_S501.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S501_S501.py.snap index 8bd0d423f226c4..c673807f7b0f28 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S501_S501.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S501_S501.py.snap @@ -2,238 +2,238 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 5 - column: 53 - end_location: - row: 5 - column: 58 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 7 - column: 54 - end_location: - row: 7 - column: 59 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 9 - column: 53 - end_location: - row: 9 - column: 58 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 11 - column: 56 - end_location: - row: 11 - column: 61 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 13 - column: 55 - end_location: - row: 13 - column: 60 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 15 - column: 57 - end_location: - row: 15 - column: 62 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 17 - column: 54 - end_location: - row: 17 - column: 59 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 20 - column: 49 - end_location: - row: 20 - column: 54 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 22 - column: 38 - end_location: - row: 22 - column: 43 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 24 - column: 42 - end_location: - row: 24 - column: 47 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 26 - column: 39 - end_location: - row: 26 - column: 44 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 28 - column: 39 - end_location: - row: 28 - column: 44 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 30 - column: 38 - end_location: - row: 30 - column: 43 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 32 - column: 40 - end_location: - row: 32 - column: 45 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 34 - column: 41 - end_location: - row: 34 - column: 46 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 36 - column: 41 - end_location: - row: 36 - column: 46 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 38 - column: 20 - end_location: - row: 38 - column: 25 - fix: ~ - parent: ~ -- kind: - name: RequestWithNoCertValidation - body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" - suggestion: ~ - fixable: false - location: - row: 40 - column: 25 - end_location: - row: 40 - column: 30 - fix: ~ - parent: ~ +- - kind: + name: RequestWithNoCertValidation + body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 5 + column: 53 + end_location: + row: 5 + column: 58 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 7 + column: 54 + end_location: + row: 7 + column: 59 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 9 + column: 53 + end_location: + row: 9 + column: 58 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 11 + column: 56 + end_location: + row: 11 + column: 61 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 13 + column: 55 + end_location: + row: 13 + column: 60 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 15 + column: 57 + end_location: + row: 15 + column: 62 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `requests` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 17 + column: 54 + end_location: + row: 17 + column: 59 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 20 + column: 49 + end_location: + row: 20 + column: 54 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 22 + column: 38 + end_location: + row: 22 + column: 43 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 24 + column: 42 + end_location: + row: 24 + column: 47 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 26 + column: 39 + end_location: + row: 26 + column: 44 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 28 + column: 39 + end_location: + row: 28 + column: 44 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 30 + column: 38 + end_location: + row: 30 + column: 43 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 32 + column: 40 + end_location: + row: 32 + column: 45 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 34 + column: 41 + end_location: + row: 34 + column: 46 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 36 + column: 41 + end_location: + row: 36 + column: 46 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 38 + column: 20 + end_location: + row: 38 + column: 25 + fix: ~ + parent: ~ + - kind: + name: RequestWithNoCertValidation + body: "Probable use of `httpx` call with `verify=False` disabling SSL certificate checks" + suggestion: ~ + fixable: false + location: + row: 40 + column: 25 + end_location: + row: 40 + column: 30 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S506_S506.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S506_S506.py.snap index 487c7be4ed5b21..d4dbc1c9152792 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S506_S506.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S506_S506.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: UnsafeYAMLLoad - body: "Probable use of unsafe `yaml.load`. Allows instantiation of arbitrary objects. Consider `yaml.safe_load`." - suggestion: ~ - fixable: false - location: - row: 10 - column: 8 - end_location: - row: 10 - column: 17 - fix: ~ - parent: ~ -- kind: - name: UnsafeYAMLLoad - body: "Probable use of unsafe loader `Loader` with `yaml.load`. Allows instantiation of arbitrary objects. Consider `yaml.safe_load`." - suggestion: ~ - fixable: false - location: - row: 24 - column: 23 - end_location: - row: 24 - column: 34 - fix: ~ - parent: ~ +- - kind: + name: UnsafeYAMLLoad + body: "Probable use of unsafe `yaml.load`. Allows instantiation of arbitrary objects. Consider `yaml.safe_load`." + suggestion: ~ + fixable: false + location: + row: 10 + column: 8 + end_location: + row: 10 + column: 17 + fix: ~ + parent: ~ + - kind: + name: UnsafeYAMLLoad + body: "Probable use of unsafe loader `Loader` with `yaml.load`. Allows instantiation of arbitrary objects. Consider `yaml.safe_load`." + suggestion: ~ + fixable: false + location: + row: 24 + column: 23 + end_location: + row: 24 + column: 34 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S508_S508.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S508_S508.py.snap index b7ca595297ce06..fb7452893452fc 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S508_S508.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S508_S508.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: SnmpInsecureVersion - body: The use of SNMPv1 and SNMPv2 is insecure. Use SNMPv3 if able. - suggestion: ~ - fixable: false - location: - row: 3 - column: 32 - end_location: - row: 3 - column: 33 - fix: ~ - parent: ~ -- kind: - name: SnmpInsecureVersion - body: The use of SNMPv1 and SNMPv2 is insecure. Use SNMPv3 if able. - suggestion: ~ - fixable: false - location: - row: 4 - column: 32 - end_location: - row: 4 - column: 33 - fix: ~ - parent: ~ +- - kind: + name: SnmpInsecureVersion + body: The use of SNMPv1 and SNMPv2 is insecure. Use SNMPv3 if able. + suggestion: ~ + fixable: false + location: + row: 3 + column: 32 + end_location: + row: 3 + column: 33 + fix: ~ + parent: ~ + - kind: + name: SnmpInsecureVersion + body: The use of SNMPv1 and SNMPv2 is insecure. Use SNMPv3 if able. + suggestion: ~ + fixable: false + location: + row: 4 + column: 32 + end_location: + row: 4 + column: 33 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S509_S509.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S509_S509.py.snap index 1bf0ffc498a039..a7dc05259d437d 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S509_S509.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S509_S509.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: SnmpWeakCryptography - body: "You should not use SNMPv3 without encryption. `noAuthNoPriv` & `authNoPriv` is insecure." - suggestion: ~ - fixable: false - location: - row: 4 - column: 11 - end_location: - row: 4 - column: 22 - fix: ~ - parent: ~ -- kind: - name: SnmpWeakCryptography - body: "You should not use SNMPv3 without encryption. `noAuthNoPriv` & `authNoPriv` is insecure." - suggestion: ~ - fixable: false - location: - row: 5 - column: 15 - end_location: - row: 5 - column: 26 - fix: ~ - parent: ~ +- - kind: + name: SnmpWeakCryptography + body: "You should not use SNMPv3 without encryption. `noAuthNoPriv` & `authNoPriv` is insecure." + suggestion: ~ + fixable: false + location: + row: 4 + column: 11 + end_location: + row: 4 + column: 22 + fix: ~ + parent: ~ + - kind: + name: SnmpWeakCryptography + body: "You should not use SNMPv3 without encryption. `noAuthNoPriv` & `authNoPriv` is insecure." + suggestion: ~ + fixable: false + location: + row: 5 + column: 15 + end_location: + row: 5 + column: 26 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S608_S608.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S608_S608.py.snap index b2d2ca8a7c28f6..3307c5f3c75d7e 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S608_S608.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S608_S608.py.snap @@ -2,589 +2,589 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 2 - column: 9 - end_location: - row: 2 - column: 40 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 3 - column: 9 - end_location: - row: 3 - column: 35 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 4 - column: 9 - end_location: - row: 4 - column: 43 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 5 - column: 9 - end_location: - row: 5 - column: 44 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 6 - column: 9 - end_location: - row: 6 - column: 49 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 8 - column: 9 - end_location: - row: 8 - column: 52 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 9 - column: 9 - end_location: - row: 9 - column: 47 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 10 - column: 9 - end_location: - row: 10 - column: 54 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 11 - column: 9 - end_location: - row: 11 - column: 55 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 12 - column: 10 - end_location: - row: 12 - column: 48 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 14 - column: 10 - end_location: - row: 14 - column: 50 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 15 - column: 10 - end_location: - row: 15 - column: 50 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 16 - column: 10 - end_location: - row: 16 - column: 57 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 17 - column: 10 - end_location: - row: 17 - column: 51 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 19 - column: 10 - end_location: - row: 19 - column: 49 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 20 - column: 10 - end_location: - row: 20 - column: 49 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 21 - column: 10 - end_location: - row: 21 - column: 53 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 22 - column: 10 - end_location: - row: 22 - column: 43 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 24 - column: 10 - end_location: - row: 24 - column: 41 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 25 - column: 10 - end_location: - row: 25 - column: 36 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 26 - column: 10 - end_location: - row: 26 - column: 44 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 27 - column: 10 - end_location: - row: 27 - column: 45 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 28 - column: 10 - end_location: - row: 28 - column: 50 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 30 - column: 10 - end_location: - row: 30 - column: 53 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 31 - column: 10 - end_location: - row: 31 - column: 48 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 32 - column: 10 - end_location: - row: 32 - column: 55 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 33 - column: 10 - end_location: - row: 33 - column: 56 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 34 - column: 10 - end_location: - row: 34 - column: 48 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 36 - column: 10 - end_location: - row: 36 - column: 50 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 37 - column: 10 - end_location: - row: 37 - column: 50 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 38 - column: 10 - end_location: - row: 38 - column: 57 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 39 - column: 10 - end_location: - row: 39 - column: 51 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 41 - column: 10 - end_location: - row: 41 - column: 49 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 42 - column: 10 - end_location: - row: 42 - column: 49 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 43 - column: 10 - end_location: - row: 43 - column: 53 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 44 - column: 10 - end_location: - row: 44 - column: 43 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 48 - column: 11 - end_location: - row: 52 - column: 13 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 55 - column: 11 - end_location: - row: 59 - column: 13 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 62 - column: 11 - end_location: - row: 66 - column: 19 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 69 - column: 11 - end_location: - row: 73 - column: 7 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 77 - column: 8 - end_location: - row: 79 - column: 28 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 83 - column: 25 - end_location: - row: 83 - column: 67 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 84 - column: 25 - end_location: - row: 84 - column: 65 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 85 - column: 25 - end_location: - row: 85 - column: 73 - fix: ~ - parent: ~ -- kind: - name: HardcodedSQLExpression - body: Possible SQL injection vector through string-based query construction - suggestion: ~ - fixable: false - location: - row: 86 - column: 29 - end_location: - row: 86 - column: 71 - fix: ~ - parent: ~ +- - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 2 + column: 9 + end_location: + row: 2 + column: 40 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 3 + column: 9 + end_location: + row: 3 + column: 35 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 4 + column: 9 + end_location: + row: 4 + column: 43 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 5 + column: 9 + end_location: + row: 5 + column: 44 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 6 + column: 9 + end_location: + row: 6 + column: 49 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 8 + column: 9 + end_location: + row: 8 + column: 52 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 9 + column: 9 + end_location: + row: 9 + column: 47 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 10 + column: 9 + end_location: + row: 10 + column: 54 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 11 + column: 9 + end_location: + row: 11 + column: 55 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 12 + column: 10 + end_location: + row: 12 + column: 48 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 14 + column: 10 + end_location: + row: 14 + column: 50 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 15 + column: 10 + end_location: + row: 15 + column: 50 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 16 + column: 10 + end_location: + row: 16 + column: 57 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 17 + column: 10 + end_location: + row: 17 + column: 51 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 19 + column: 10 + end_location: + row: 19 + column: 49 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 20 + column: 10 + end_location: + row: 20 + column: 49 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 21 + column: 10 + end_location: + row: 21 + column: 53 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 22 + column: 10 + end_location: + row: 22 + column: 43 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 24 + column: 10 + end_location: + row: 24 + column: 41 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 25 + column: 10 + end_location: + row: 25 + column: 36 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 26 + column: 10 + end_location: + row: 26 + column: 44 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 27 + column: 10 + end_location: + row: 27 + column: 45 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 28 + column: 10 + end_location: + row: 28 + column: 50 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 30 + column: 10 + end_location: + row: 30 + column: 53 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 31 + column: 10 + end_location: + row: 31 + column: 48 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 32 + column: 10 + end_location: + row: 32 + column: 55 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 33 + column: 10 + end_location: + row: 33 + column: 56 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 34 + column: 10 + end_location: + row: 34 + column: 48 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 36 + column: 10 + end_location: + row: 36 + column: 50 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 37 + column: 10 + end_location: + row: 37 + column: 50 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 38 + column: 10 + end_location: + row: 38 + column: 57 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 39 + column: 10 + end_location: + row: 39 + column: 51 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 41 + column: 10 + end_location: + row: 41 + column: 49 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 42 + column: 10 + end_location: + row: 42 + column: 49 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 43 + column: 10 + end_location: + row: 43 + column: 53 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 44 + column: 10 + end_location: + row: 44 + column: 43 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 48 + column: 11 + end_location: + row: 52 + column: 13 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 55 + column: 11 + end_location: + row: 59 + column: 13 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 62 + column: 11 + end_location: + row: 66 + column: 19 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 69 + column: 11 + end_location: + row: 73 + column: 7 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 77 + column: 8 + end_location: + row: 79 + column: 28 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 83 + column: 25 + end_location: + row: 83 + column: 67 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 84 + column: 25 + end_location: + row: 84 + column: 65 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 85 + column: 25 + end_location: + row: 85 + column: 73 + fix: ~ + parent: ~ + - kind: + name: HardcodedSQLExpression + body: Possible SQL injection vector through string-based query construction + suggestion: ~ + fixable: false + location: + row: 86 + column: 29 + end_location: + row: 86 + column: 71 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S612_S612.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S612_S612.py.snap index ac143ca11f1f1c..ff79a11119c241 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S612_S612.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S612_S612.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: LoggingConfigInsecureListen - body: "Use of insecure `logging.config.listen` detected" - suggestion: ~ - fixable: false - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 25 - fix: ~ - parent: ~ +- - kind: + name: LoggingConfigInsecureListen + body: "Use of insecure `logging.config.listen` detected" + suggestion: ~ + fixable: false + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 25 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S701_S701.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S701_S701.py.snap index 0e7fa8a033708b..801668b81453fb 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S701_S701.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S701_S701.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs expression: diagnostics --- -- kind: - name: Jinja2AutoescapeFalse - body: "Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function." - suggestion: ~ - fixable: false - location: - row: 9 - column: 67 - end_location: - row: 9 - column: 76 - fix: ~ - parent: ~ -- kind: - name: Jinja2AutoescapeFalse - body: "Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function." - suggestion: ~ - fixable: false - location: - row: 10 - column: 44 - end_location: - row: 10 - column: 49 - fix: ~ - parent: ~ -- kind: - name: Jinja2AutoescapeFalse - body: "Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function." - suggestion: ~ - fixable: false - location: - row: 13 - column: 23 - end_location: - row: 13 - column: 28 - fix: ~ - parent: ~ -- kind: - name: Jinja2AutoescapeFalse - body: "By default, jinja2 sets `autoescape` to `False`. Consider using `autoescape=True` or the `select_autoescape` function to mitigate XSS vulnerabilities." - suggestion: ~ - fixable: false - location: - row: 15 - column: 0 - end_location: - row: 15 - column: 11 - fix: ~ - parent: ~ -- kind: - name: Jinja2AutoescapeFalse - body: "Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function." - suggestion: ~ - fixable: false - location: - row: 29 - column: 46 - end_location: - row: 29 - column: 57 - fix: ~ - parent: ~ +- - kind: + name: Jinja2AutoescapeFalse + body: "Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function." + suggestion: ~ + fixable: false + location: + row: 9 + column: 67 + end_location: + row: 9 + column: 76 + fix: ~ + parent: ~ + - kind: + name: Jinja2AutoescapeFalse + body: "Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function." + suggestion: ~ + fixable: false + location: + row: 10 + column: 44 + end_location: + row: 10 + column: 49 + fix: ~ + parent: ~ + - kind: + name: Jinja2AutoescapeFalse + body: "Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function." + suggestion: ~ + fixable: false + location: + row: 13 + column: 23 + end_location: + row: 13 + column: 28 + fix: ~ + parent: ~ + - kind: + name: Jinja2AutoescapeFalse + body: "By default, jinja2 sets `autoescape` to `False`. Consider using `autoescape=True` or the `select_autoescape` function to mitigate XSS vulnerabilities." + suggestion: ~ + fixable: false + location: + row: 15 + column: 0 + end_location: + row: 15 + column: 11 + fix: ~ + parent: ~ + - kind: + name: Jinja2AutoescapeFalse + body: "Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function." + suggestion: ~ + fixable: false + location: + row: 29 + column: 46 + end_location: + row: 29 + column: 57 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_blind_except/snapshots/ruff__rules__flake8_blind_except__tests__BLE001_BLE.py.snap b/crates/ruff/src/rules/flake8_blind_except/snapshots/ruff__rules__flake8_blind_except__tests__BLE001_BLE.py.snap index cd9d595361c725..4b62503ca616b4 100644 --- a/crates/ruff/src/rules/flake8_blind_except/snapshots/ruff__rules__flake8_blind_except__tests__BLE001_BLE.py.snap +++ b/crates/ruff/src/rules/flake8_blind_except/snapshots/ruff__rules__flake8_blind_except__tests__BLE001_BLE.py.snap @@ -2,134 +2,134 @@ source: crates/ruff/src/rules/flake8_blind_except/mod.rs expression: diagnostics --- -- kind: - name: BlindExcept - body: "Do not catch blind exception: `BaseException`" - suggestion: ~ - fixable: false - location: - row: 25 - column: 7 - end_location: - row: 25 - column: 20 - fix: ~ - parent: ~ -- kind: - name: BlindExcept - body: "Do not catch blind exception: `Exception`" - suggestion: ~ - fixable: false - location: - row: 31 - column: 7 - end_location: - row: 31 - column: 16 - fix: ~ - parent: ~ -- kind: - name: BlindExcept - body: "Do not catch blind exception: `Exception`" - suggestion: ~ - fixable: false - location: - row: 42 - column: 7 - end_location: - row: 42 - column: 16 - fix: ~ - parent: ~ -- kind: - name: BlindExcept - body: "Do not catch blind exception: `BaseException`" - suggestion: ~ - fixable: false - location: - row: 45 - column: 11 - end_location: - row: 45 - column: 24 - fix: ~ - parent: ~ -- kind: - name: BlindExcept - body: "Do not catch blind exception: `Exception`" - suggestion: ~ - fixable: false - location: - row: 54 - column: 7 - end_location: - row: 54 - column: 16 - fix: ~ - parent: ~ -- kind: - name: BlindExcept - body: "Do not catch blind exception: `Exception`" - suggestion: ~ - fixable: false - location: - row: 60 - column: 7 - end_location: - row: 60 - column: 16 - fix: ~ - parent: ~ -- kind: - name: BlindExcept - body: "Do not catch blind exception: `BaseException`" - suggestion: ~ - fixable: false - location: - row: 62 - column: 7 - end_location: - row: 62 - column: 20 - fix: ~ - parent: ~ -- kind: - name: BlindExcept - body: "Do not catch blind exception: `Exception`" - suggestion: ~ - fixable: false - location: - row: 69 - column: 7 - end_location: - row: 69 - column: 16 - fix: ~ - parent: ~ -- kind: - name: BlindExcept - body: "Do not catch blind exception: `Exception`" - suggestion: ~ - fixable: false - location: - row: 75 - column: 7 - end_location: - row: 75 - column: 16 - fix: ~ - parent: ~ -- kind: - name: BlindExcept - body: "Do not catch blind exception: `Exception`" - suggestion: ~ - fixable: false - location: - row: 81 - column: 7 - end_location: - row: 81 - column: 16 - fix: ~ - parent: ~ +- - kind: + name: BlindExcept + body: "Do not catch blind exception: `BaseException`" + suggestion: ~ + fixable: false + location: + row: 25 + column: 7 + end_location: + row: 25 + column: 20 + fix: ~ + parent: ~ + - kind: + name: BlindExcept + body: "Do not catch blind exception: `Exception`" + suggestion: ~ + fixable: false + location: + row: 31 + column: 7 + end_location: + row: 31 + column: 16 + fix: ~ + parent: ~ + - kind: + name: BlindExcept + body: "Do not catch blind exception: `Exception`" + suggestion: ~ + fixable: false + location: + row: 42 + column: 7 + end_location: + row: 42 + column: 16 + fix: ~ + parent: ~ + - kind: + name: BlindExcept + body: "Do not catch blind exception: `BaseException`" + suggestion: ~ + fixable: false + location: + row: 45 + column: 11 + end_location: + row: 45 + column: 24 + fix: ~ + parent: ~ + - kind: + name: BlindExcept + body: "Do not catch blind exception: `Exception`" + suggestion: ~ + fixable: false + location: + row: 54 + column: 7 + end_location: + row: 54 + column: 16 + fix: ~ + parent: ~ + - kind: + name: BlindExcept + body: "Do not catch blind exception: `Exception`" + suggestion: ~ + fixable: false + location: + row: 60 + column: 7 + end_location: + row: 60 + column: 16 + fix: ~ + parent: ~ + - kind: + name: BlindExcept + body: "Do not catch blind exception: `BaseException`" + suggestion: ~ + fixable: false + location: + row: 62 + column: 7 + end_location: + row: 62 + column: 20 + fix: ~ + parent: ~ + - kind: + name: BlindExcept + body: "Do not catch blind exception: `Exception`" + suggestion: ~ + fixable: false + location: + row: 69 + column: 7 + end_location: + row: 69 + column: 16 + fix: ~ + parent: ~ + - kind: + name: BlindExcept + body: "Do not catch blind exception: `Exception`" + suggestion: ~ + fixable: false + location: + row: 75 + column: 7 + end_location: + row: 75 + column: 16 + fix: ~ + parent: ~ + - kind: + name: BlindExcept + body: "Do not catch blind exception: `Exception`" + suggestion: ~ + fixable: false + location: + row: 81 + column: 7 + end_location: + row: 81 + column: 16 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT001_FBT.py.snap b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT001_FBT.py.snap index cb37ddd2160f87..327fe3c265ac2d 100644 --- a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT001_FBT.py.snap +++ b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT001_FBT.py.snap @@ -2,121 +2,121 @@ source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs expression: diagnostics --- -- kind: - name: BooleanPositionalArgInFunctionDefinition - body: Boolean positional arg in function definition - suggestion: ~ - fixable: false - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 26 - fix: ~ - parent: ~ -- kind: - name: BooleanPositionalArgInFunctionDefinition - body: Boolean positional arg in function definition - suggestion: ~ - fixable: false - location: - row: 5 - column: 4 - end_location: - row: 5 - column: 31 - fix: ~ - parent: ~ -- kind: - name: BooleanPositionalArgInFunctionDefinition - body: Boolean positional arg in function definition - suggestion: ~ - fixable: false - location: - row: 10 - column: 4 - end_location: - row: 10 - column: 36 - fix: ~ - parent: ~ -- kind: - name: BooleanPositionalArgInFunctionDefinition - body: Boolean positional arg in function definition - suggestion: ~ - fixable: false - location: - row: 11 - column: 4 - end_location: - row: 11 - column: 41 - fix: ~ - parent: ~ -- kind: - name: BooleanPositionalArgInFunctionDefinition - body: Boolean positional arg in function definition - suggestion: ~ - fixable: false - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 37 - fix: ~ - parent: ~ -- kind: - name: BooleanPositionalArgInFunctionDefinition - body: Boolean positional arg in function definition - suggestion: ~ - fixable: false - location: - row: 15 - column: 4 - end_location: - row: 15 - column: 42 - fix: ~ - parent: ~ -- kind: - name: BooleanPositionalArgInFunctionDefinition - body: Boolean positional arg in function definition - suggestion: ~ - fixable: false - location: - row: 18 - column: 4 - end_location: - row: 18 - column: 40 - fix: ~ - parent: ~ -- kind: - name: BooleanPositionalArgInFunctionDefinition - body: Boolean positional arg in function definition - suggestion: ~ - fixable: false - location: - row: 19 - column: 4 - end_location: - row: 19 - column: 45 - fix: ~ - parent: ~ -- kind: - name: BooleanPositionalArgInFunctionDefinition - body: Boolean positional arg in function definition - suggestion: ~ - fixable: false - location: - row: 81 - column: 18 - end_location: - row: 81 - column: 29 - fix: ~ - parent: ~ +- - kind: + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + suggestion: ~ + fixable: false + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 26 + fix: ~ + parent: ~ + - kind: + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + suggestion: ~ + fixable: false + location: + row: 5 + column: 4 + end_location: + row: 5 + column: 31 + fix: ~ + parent: ~ + - kind: + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + suggestion: ~ + fixable: false + location: + row: 10 + column: 4 + end_location: + row: 10 + column: 36 + fix: ~ + parent: ~ + - kind: + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + suggestion: ~ + fixable: false + location: + row: 11 + column: 4 + end_location: + row: 11 + column: 41 + fix: ~ + parent: ~ + - kind: + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + suggestion: ~ + fixable: false + location: + row: 14 + column: 4 + end_location: + row: 14 + column: 37 + fix: ~ + parent: ~ + - kind: + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + suggestion: ~ + fixable: false + location: + row: 15 + column: 4 + end_location: + row: 15 + column: 42 + fix: ~ + parent: ~ + - kind: + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + suggestion: ~ + fixable: false + location: + row: 18 + column: 4 + end_location: + row: 18 + column: 40 + fix: ~ + parent: ~ + - kind: + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + suggestion: ~ + fixable: false + location: + row: 19 + column: 4 + end_location: + row: 19 + column: 45 + fix: ~ + parent: ~ + - kind: + name: BooleanPositionalArgInFunctionDefinition + body: Boolean positional arg in function definition + suggestion: ~ + fixable: false + location: + row: 81 + column: 18 + end_location: + row: 81 + column: 29 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT002_FBT.py.snap b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT002_FBT.py.snap index 44649eb1c55de0..fc3c95110f8a88 100644 --- a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT002_FBT.py.snap +++ b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT002_FBT.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs expression: diagnostics --- -- kind: - name: BooleanDefaultValueInFunctionDefinition - body: Boolean default value in function definition - suggestion: ~ - fixable: false - location: - row: 12 - column: 30 - end_location: - row: 12 - column: 34 - fix: ~ - parent: ~ -- kind: - name: BooleanDefaultValueInFunctionDefinition - body: Boolean default value in function definition - suggestion: ~ - fixable: false - location: - row: 13 - column: 42 - end_location: - row: 13 - column: 46 - fix: ~ - parent: ~ -- kind: - name: BooleanDefaultValueInFunctionDefinition - body: Boolean default value in function definition - suggestion: ~ - fixable: false - location: - row: 14 - column: 40 - end_location: - row: 14 - column: 44 - fix: ~ - parent: ~ -- kind: - name: BooleanDefaultValueInFunctionDefinition - body: Boolean default value in function definition - suggestion: ~ - fixable: false - location: - row: 15 - column: 45 - end_location: - row: 15 - column: 49 - fix: ~ - parent: ~ +- - kind: + name: BooleanDefaultValueInFunctionDefinition + body: Boolean default value in function definition + suggestion: ~ + fixable: false + location: + row: 12 + column: 30 + end_location: + row: 12 + column: 34 + fix: ~ + parent: ~ + - kind: + name: BooleanDefaultValueInFunctionDefinition + body: Boolean default value in function definition + suggestion: ~ + fixable: false + location: + row: 13 + column: 42 + end_location: + row: 13 + column: 46 + fix: ~ + parent: ~ + - kind: + name: BooleanDefaultValueInFunctionDefinition + body: Boolean default value in function definition + suggestion: ~ + fixable: false + location: + row: 14 + column: 40 + end_location: + row: 14 + column: 44 + fix: ~ + parent: ~ + - kind: + name: BooleanDefaultValueInFunctionDefinition + body: Boolean default value in function definition + suggestion: ~ + fixable: false + location: + row: 15 + column: 45 + end_location: + row: 15 + column: 49 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT003_FBT.py.snap b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT003_FBT.py.snap index d2b89cf62137db..c33f348ca873bb 100644 --- a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT003_FBT.py.snap +++ b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT003_FBT.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs expression: diagnostics --- -- kind: - name: BooleanPositionalValueInFunctionCall - body: Boolean positional value in function call - suggestion: ~ - fixable: false - location: - row: 42 - column: 10 - end_location: - row: 42 - column: 14 - fix: ~ - parent: ~ -- kind: - name: BooleanPositionalValueInFunctionCall - body: Boolean positional value in function call - suggestion: ~ - fixable: false - location: - row: 57 - column: 10 - end_location: - row: 57 - column: 14 - fix: ~ - parent: ~ -- kind: - name: BooleanPositionalValueInFunctionCall - body: Boolean positional value in function call - suggestion: ~ - fixable: false - location: - row: 57 - column: 16 - end_location: - row: 57 - column: 21 - fix: ~ - parent: ~ +- - kind: + name: BooleanPositionalValueInFunctionCall + body: Boolean positional value in function call + suggestion: ~ + fixable: false + location: + row: 42 + column: 10 + end_location: + row: 42 + column: 14 + fix: ~ + parent: ~ + - kind: + name: BooleanPositionalValueInFunctionCall + body: Boolean positional value in function call + suggestion: ~ + fixable: false + location: + row: 57 + column: 10 + end_location: + row: 57 + column: 14 + fix: ~ + parent: ~ + - kind: + name: BooleanPositionalValueInFunctionCall + body: Boolean positional value in function call + suggestion: ~ + fixable: false + location: + row: 57 + column: 16 + end_location: + row: 57 + column: 21 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B002_B002.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B002_B002.py.snap index dfaa9a7433cf60..c4fef047a0e67d 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B002_B002.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B002_B002.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: UnaryPrefixIncrement - body: Python does not support the unary prefix increment - suggestion: ~ - fixable: false - location: - row: 15 - column: 8 - end_location: - row: 15 - column: 11 - fix: ~ - parent: ~ -- kind: - name: UnaryPrefixIncrement - body: Python does not support the unary prefix increment - suggestion: ~ - fixable: false - location: - row: 20 - column: 11 - end_location: - row: 20 - column: 14 - fix: ~ - parent: ~ +- - kind: + name: UnaryPrefixIncrement + body: Python does not support the unary prefix increment + suggestion: ~ + fixable: false + location: + row: 15 + column: 8 + end_location: + row: 15 + column: 11 + fix: ~ + parent: ~ + - kind: + name: UnaryPrefixIncrement + body: Python does not support the unary prefix increment + suggestion: ~ + fixable: false + location: + row: 20 + column: 11 + end_location: + row: 20 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B003_B003.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B003_B003.py.snap index 2adce9ce78a847..98761ecbb86a6b 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B003_B003.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B003_B003.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: AssignmentToOsEnviron - body: "Assigning to `os.environ` doesn't clear the environment" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 10 - fix: ~ - parent: ~ +- - kind: + name: AssignmentToOsEnviron + body: "Assigning to `os.environ` doesn't clear the environment" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 10 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B004_B004.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B004_B004.py.snap index eed4c9dd273958..d798ed98b94e27 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B004_B004.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B004_B004.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: UnreliableCallableCheck - body: "Using `hasattr(x, '__call__')` to test if x is callable is unreliable. Use `callable(x)` for consistent results." - suggestion: ~ - fixable: false - location: - row: 3 - column: 7 - end_location: - row: 3 - column: 29 - fix: ~ - parent: ~ -- kind: - name: UnreliableCallableCheck - body: "Using `hasattr(x, '__call__')` to test if x is callable is unreliable. Use `callable(x)` for consistent results." - suggestion: ~ - fixable: false - location: - row: 5 - column: 7 - end_location: - row: 5 - column: 36 - fix: ~ - parent: ~ +- - kind: + name: UnreliableCallableCheck + body: "Using `hasattr(x, '__call__')` to test if x is callable is unreliable. Use `callable(x)` for consistent results." + suggestion: ~ + fixable: false + location: + row: 3 + column: 7 + end_location: + row: 3 + column: 29 + fix: ~ + parent: ~ + - kind: + name: UnreliableCallableCheck + body: "Using `hasattr(x, '__call__')` to test if x is callable is unreliable. Use `callable(x)` for consistent results." + suggestion: ~ + fixable: false + location: + row: 5 + column: 7 + end_location: + row: 5 + column: 36 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B005_B005.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B005_B005.py.snap index b7718c3bf0ce1b..c17512e5abb13c 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B005_B005.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B005_B005.py.snap @@ -2,108 +2,108 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: StripWithMultiCharacters - body: "Using `.strip()` with multi-character strings is misleading the reader" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 24 - fix: ~ - parent: ~ -- kind: - name: StripWithMultiCharacters - body: "Using `.strip()` with multi-character strings is misleading the reader" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 17 - fix: ~ - parent: ~ -- kind: - name: StripWithMultiCharacters - body: "Using `.strip()` with multi-character strings is misleading the reader" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 25 - fix: ~ - parent: ~ -- kind: - name: StripWithMultiCharacters - body: "Using `.strip()` with multi-character strings is misleading the reader" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 18 - fix: ~ - parent: ~ -- kind: - name: StripWithMultiCharacters - body: "Using `.strip()` with multi-character strings is misleading the reader" - suggestion: ~ - fixable: false - location: - row: 16 - column: 0 - end_location: - row: 16 - column: 25 - fix: ~ - parent: ~ -- kind: - name: StripWithMultiCharacters - body: "Using `.strip()` with multi-character strings is misleading the reader" - suggestion: ~ - fixable: false - location: - row: 19 - column: 0 - end_location: - row: 19 - column: 18 - fix: ~ - parent: ~ -- kind: - name: StripWithMultiCharacters - body: "Using `.strip()` with multi-character strings is misleading the reader" - suggestion: ~ - fixable: false - location: - row: 22 - column: 0 - end_location: - row: 22 - column: 13 - fix: ~ - parent: ~ -- kind: - name: StripWithMultiCharacters - body: "Using `.strip()` with multi-character strings is misleading the reader" - suggestion: ~ - fixable: false - location: - row: 24 - column: 0 - end_location: - row: 24 - column: 35 - fix: ~ - parent: ~ +- - kind: + name: StripWithMultiCharacters + body: "Using `.strip()` with multi-character strings is misleading the reader" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 24 + fix: ~ + parent: ~ + - kind: + name: StripWithMultiCharacters + body: "Using `.strip()` with multi-character strings is misleading the reader" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 17 + fix: ~ + parent: ~ + - kind: + name: StripWithMultiCharacters + body: "Using `.strip()` with multi-character strings is misleading the reader" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 25 + fix: ~ + parent: ~ + - kind: + name: StripWithMultiCharacters + body: "Using `.strip()` with multi-character strings is misleading the reader" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 18 + fix: ~ + parent: ~ + - kind: + name: StripWithMultiCharacters + body: "Using `.strip()` with multi-character strings is misleading the reader" + suggestion: ~ + fixable: false + location: + row: 16 + column: 0 + end_location: + row: 16 + column: 25 + fix: ~ + parent: ~ + - kind: + name: StripWithMultiCharacters + body: "Using `.strip()` with multi-character strings is misleading the reader" + suggestion: ~ + fixable: false + location: + row: 19 + column: 0 + end_location: + row: 19 + column: 18 + fix: ~ + parent: ~ + - kind: + name: StripWithMultiCharacters + body: "Using `.strip()` with multi-character strings is misleading the reader" + suggestion: ~ + fixable: false + location: + row: 22 + column: 0 + end_location: + row: 22 + column: 13 + fix: ~ + parent: ~ + - kind: + name: StripWithMultiCharacters + body: "Using `.strip()` with multi-character strings is misleading the reader" + suggestion: ~ + fixable: false + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 35 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B006_B006_B008.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B006_B006_B008.py.snap index f7195ef02d292d..fb1be930f30242 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B006_B006_B008.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B006_B006_B008.py.snap @@ -2,186 +2,186 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: MutableArgumentDefault - body: Do not use mutable data structures for argument defaults - suggestion: ~ - fixable: false - location: - row: 60 - column: 24 - end_location: - row: 60 - column: 33 - fix: ~ - parent: ~ -- kind: - name: MutableArgumentDefault - body: Do not use mutable data structures for argument defaults - suggestion: ~ - fixable: false - location: - row: 64 - column: 29 - end_location: - row: 64 - column: 31 - fix: ~ - parent: ~ -- kind: - name: MutableArgumentDefault - body: Do not use mutable data structures for argument defaults - suggestion: ~ - fixable: false - location: - row: 68 - column: 19 - end_location: - row: 68 - column: 24 - fix: ~ - parent: ~ -- kind: - name: MutableArgumentDefault - body: Do not use mutable data structures for argument defaults - suggestion: ~ - fixable: false - location: - row: 72 - column: 19 - end_location: - row: 72 - column: 44 - fix: ~ - parent: ~ -- kind: - name: MutableArgumentDefault - body: Do not use mutable data structures for argument defaults - suggestion: ~ - fixable: false - location: - row: 76 - column: 31 - end_location: - row: 76 - column: 56 - fix: ~ - parent: ~ -- kind: - name: MutableArgumentDefault - body: Do not use mutable data structures for argument defaults - suggestion: ~ - fixable: false - location: - row: 80 - column: 25 - end_location: - row: 80 - column: 44 - fix: ~ - parent: ~ -- kind: - name: MutableArgumentDefault - body: Do not use mutable data structures for argument defaults - suggestion: ~ - fixable: false - location: - row: 85 - column: 45 - end_location: - row: 85 - column: 69 - fix: ~ - parent: ~ -- kind: - name: MutableArgumentDefault - body: Do not use mutable data structures for argument defaults - suggestion: ~ - fixable: false - location: - row: 89 - column: 45 - end_location: - row: 89 - column: 72 - fix: ~ - parent: ~ -- kind: - name: MutableArgumentDefault - body: Do not use mutable data structures for argument defaults - suggestion: ~ - fixable: false - location: - row: 93 - column: 44 - end_location: - row: 93 - column: 68 - fix: ~ - parent: ~ -- kind: - name: MutableArgumentDefault - body: Do not use mutable data structures for argument defaults - suggestion: ~ - fixable: false - location: - row: 97 - column: 32 - end_location: - row: 97 - column: 34 - fix: ~ - parent: ~ -- kind: - name: MutableArgumentDefault - body: Do not use mutable data structures for argument defaults - suggestion: ~ - fixable: false - location: - row: 170 - column: 19 - end_location: - row: 170 - column: 48 - fix: ~ - parent: ~ -- kind: - name: MutableArgumentDefault - body: Do not use mutable data structures for argument defaults - suggestion: ~ - fixable: false - location: - row: 203 - column: 26 - end_location: - row: 203 - column: 28 - fix: ~ - parent: ~ -- kind: - name: MutableArgumentDefault - body: Do not use mutable data structures for argument defaults - suggestion: ~ - fixable: false - location: - row: 204 - column: 34 - end_location: - row: 204 - column: 36 - fix: ~ - parent: ~ -- kind: - name: MutableArgumentDefault - body: Do not use mutable data structures for argument defaults - suggestion: ~ - fixable: false - location: - row: 205 - column: 61 - end_location: - row: 205 - column: 66 - fix: ~ - parent: ~ +- - kind: + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + suggestion: ~ + fixable: false + location: + row: 60 + column: 24 + end_location: + row: 60 + column: 33 + fix: ~ + parent: ~ + - kind: + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + suggestion: ~ + fixable: false + location: + row: 64 + column: 29 + end_location: + row: 64 + column: 31 + fix: ~ + parent: ~ + - kind: + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + suggestion: ~ + fixable: false + location: + row: 68 + column: 19 + end_location: + row: 68 + column: 24 + fix: ~ + parent: ~ + - kind: + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + suggestion: ~ + fixable: false + location: + row: 72 + column: 19 + end_location: + row: 72 + column: 44 + fix: ~ + parent: ~ + - kind: + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + suggestion: ~ + fixable: false + location: + row: 76 + column: 31 + end_location: + row: 76 + column: 56 + fix: ~ + parent: ~ + - kind: + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + suggestion: ~ + fixable: false + location: + row: 80 + column: 25 + end_location: + row: 80 + column: 44 + fix: ~ + parent: ~ + - kind: + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + suggestion: ~ + fixable: false + location: + row: 85 + column: 45 + end_location: + row: 85 + column: 69 + fix: ~ + parent: ~ + - kind: + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + suggestion: ~ + fixable: false + location: + row: 89 + column: 45 + end_location: + row: 89 + column: 72 + fix: ~ + parent: ~ + - kind: + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + suggestion: ~ + fixable: false + location: + row: 93 + column: 44 + end_location: + row: 93 + column: 68 + fix: ~ + parent: ~ + - kind: + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + suggestion: ~ + fixable: false + location: + row: 97 + column: 32 + end_location: + row: 97 + column: 34 + fix: ~ + parent: ~ + - kind: + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + suggestion: ~ + fixable: false + location: + row: 170 + column: 19 + end_location: + row: 170 + column: 48 + fix: ~ + parent: ~ + - kind: + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + suggestion: ~ + fixable: false + location: + row: 203 + column: 26 + end_location: + row: 203 + column: 28 + fix: ~ + parent: ~ + - kind: + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + suggestion: ~ + fixable: false + location: + row: 204 + column: 34 + end_location: + row: 204 + column: 36 + fix: ~ + parent: ~ + - kind: + name: MutableArgumentDefault + body: Do not use mutable data structures for argument defaults + suggestion: ~ + fixable: false + location: + row: 205 + column: 61 + end_location: + row: 205 + column: 66 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B007_B007.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B007_B007.py.snap index 073bb80ebb84c1..980982499f0c1f 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B007_B007.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B007_B007.py.snap @@ -2,208 +2,208 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: UnusedLoopControlVariable - body: "Loop control variable `i` not used within loop body" - suggestion: "Rename unused `i` to `_i`" - fixable: true - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UnusedLoopControlVariable - body: "Loop control variable `k` not used within loop body" - suggestion: "Rename unused `k` to `_k`" - fixable: true - location: - row: 18 - column: 12 - end_location: - row: 18 - column: 13 - fix: - content: _k +- - kind: + name: UnusedLoopControlVariable + body: "Loop control variable `i` not used within loop body" + suggestion: "Rename unused `i` to `_i`" + fixable: true + location: + row: 6 + column: 4 + end_location: + row: 6 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UnusedLoopControlVariable + body: "Loop control variable `k` not used within loop body" + suggestion: "Rename unused `k` to `_k`" + fixable: true location: row: 18 column: 12 end_location: row: 18 column: 13 - parent: ~ -- kind: - name: UnusedLoopControlVariable - body: "Loop control variable `i` not used within loop body" - suggestion: "Rename unused `i` to `_i`" - fixable: true - location: - row: 30 - column: 4 - end_location: - row: 30 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UnusedLoopControlVariable - body: "Loop control variable `k` not used within loop body" - suggestion: "Rename unused `k` to `_k`" - fixable: true - location: - row: 30 - column: 12 - end_location: - row: 30 - column: 13 - fix: - content: _k + fix: + content: _k + location: + row: 18 + column: 12 + end_location: + row: 18 + column: 13 + parent: ~ + - kind: + name: UnusedLoopControlVariable + body: "Loop control variable `i` not used within loop body" + suggestion: "Rename unused `i` to `_i`" + fixable: true + location: + row: 30 + column: 4 + end_location: + row: 30 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UnusedLoopControlVariable + body: "Loop control variable `k` not used within loop body" + suggestion: "Rename unused `k` to `_k`" + fixable: true location: row: 30 column: 12 end_location: row: 30 column: 13 - parent: ~ -- kind: - name: UnusedLoopControlVariable - body: "Loop control variable `bar` may not be used within loop body" - suggestion: ~ - fixable: false - location: - row: 34 - column: 9 - end_location: - row: 34 - column: 12 - fix: ~ - parent: ~ -- kind: - name: UnusedLoopControlVariable - body: "Loop control variable `bar` may not be used within loop body" - suggestion: ~ - fixable: false - location: - row: 38 - column: 9 - end_location: - row: 38 - column: 12 - fix: ~ - parent: ~ -- kind: - name: UnusedLoopControlVariable - body: "Loop control variable `bar` may not be used within loop body" - suggestion: ~ - fixable: false - location: - row: 42 - column: 9 - end_location: - row: 42 - column: 12 - fix: ~ - parent: ~ -- kind: - name: UnusedLoopControlVariable - body: "Loop control variable `bar` may not be used within loop body" - suggestion: ~ - fixable: false - location: - row: 46 - column: 9 - end_location: - row: 46 - column: 12 - fix: ~ - parent: ~ -- kind: - name: UnusedLoopControlVariable - body: "Loop control variable `bar` not used within loop body" - suggestion: "Rename unused `bar` to `_bar`" - fixable: true - location: - row: 52 - column: 13 - end_location: - row: 52 - column: 16 - fix: - content: _bar + fix: + content: _k + location: + row: 30 + column: 12 + end_location: + row: 30 + column: 13 + parent: ~ + - kind: + name: UnusedLoopControlVariable + body: "Loop control variable `bar` may not be used within loop body" + suggestion: ~ + fixable: false + location: + row: 34 + column: 9 + end_location: + row: 34 + column: 12 + fix: ~ + parent: ~ + - kind: + name: UnusedLoopControlVariable + body: "Loop control variable `bar` may not be used within loop body" + suggestion: ~ + fixable: false + location: + row: 38 + column: 9 + end_location: + row: 38 + column: 12 + fix: ~ + parent: ~ + - kind: + name: UnusedLoopControlVariable + body: "Loop control variable `bar` may not be used within loop body" + suggestion: ~ + fixable: false + location: + row: 42 + column: 9 + end_location: + row: 42 + column: 12 + fix: ~ + parent: ~ + - kind: + name: UnusedLoopControlVariable + body: "Loop control variable `bar` may not be used within loop body" + suggestion: ~ + fixable: false + location: + row: 46 + column: 9 + end_location: + row: 46 + column: 12 + fix: ~ + parent: ~ + - kind: + name: UnusedLoopControlVariable + body: "Loop control variable `bar` not used within loop body" + suggestion: "Rename unused `bar` to `_bar`" + fixable: true location: row: 52 column: 13 end_location: row: 52 column: 16 - parent: ~ -- kind: - name: UnusedLoopControlVariable - body: "Loop control variable `bar` not used within loop body" - suggestion: "Rename unused `bar` to `_bar`" - fixable: true - location: - row: 59 - column: 13 - end_location: - row: 59 - column: 16 - fix: ~ - parent: ~ -- kind: - name: UnusedLoopControlVariable - body: "Loop control variable `bar` not used within loop body" - suggestion: "Rename unused `bar` to `_bar`" - fixable: true - location: - row: 68 - column: 13 - end_location: - row: 68 - column: 16 - fix: - content: _bar + fix: + content: _bar + location: + row: 52 + column: 13 + end_location: + row: 52 + column: 16 + parent: ~ + - kind: + name: UnusedLoopControlVariable + body: "Loop control variable `bar` not used within loop body" + suggestion: "Rename unused `bar` to `_bar`" + fixable: true + location: + row: 59 + column: 13 + end_location: + row: 59 + column: 16 + fix: ~ + parent: ~ + - kind: + name: UnusedLoopControlVariable + body: "Loop control variable `bar` not used within loop body" + suggestion: "Rename unused `bar` to `_bar`" + fixable: true location: row: 68 column: 13 end_location: row: 68 column: 16 - parent: ~ -- kind: - name: UnusedLoopControlVariable - body: "Loop control variable `bar` not used within loop body" - suggestion: "Rename unused `bar` to `_bar`" - fixable: true - location: - row: 77 - column: 13 - end_location: - row: 77 - column: 16 - fix: - content: _bar + fix: + content: _bar + location: + row: 68 + column: 13 + end_location: + row: 68 + column: 16 + parent: ~ + - kind: + name: UnusedLoopControlVariable + body: "Loop control variable `bar` not used within loop body" + suggestion: "Rename unused `bar` to `_bar`" + fixable: true location: row: 77 column: 13 end_location: row: 77 column: 16 - parent: ~ -- kind: - name: UnusedLoopControlVariable - body: "Loop control variable `line_` not used within loop body" - suggestion: ~ - fixable: false - location: - row: 87 - column: 4 - end_location: - row: 87 - column: 9 - fix: ~ - parent: ~ + fix: + content: _bar + location: + row: 77 + column: 13 + end_location: + row: 77 + column: 16 + parent: ~ + - kind: + name: UnusedLoopControlVariable + body: "Loop control variable `line_` not used within loop body" + suggestion: ~ + fixable: false + location: + row: 87 + column: 4 + end_location: + row: 87 + column: 9 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B008_B006_B008.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B008_B006_B008.py.snap index 386b09cf513b30..94618686ddcdf7 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B008_B006_B008.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B008_B006_B008.py.snap @@ -2,199 +2,199 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: FunctionCallArgumentDefault - body: "Do not perform function call `range` in argument defaults" - suggestion: ~ - fixable: false - location: - row: 85 - column: 60 - end_location: - row: 85 - column: 68 - fix: ~ - parent: ~ -- kind: - name: FunctionCallArgumentDefault - body: "Do not perform function call `range` in argument defaults" - suggestion: ~ - fixable: false - location: - row: 89 - column: 63 - end_location: - row: 89 - column: 71 - fix: ~ - parent: ~ -- kind: - name: FunctionCallArgumentDefault - body: "Do not perform function call `range` in argument defaults" - suggestion: ~ - fixable: false - location: - row: 93 - column: 59 - end_location: - row: 93 - column: 67 - fix: ~ - parent: ~ -- kind: - name: FunctionCallArgumentDefault - body: "Do not perform function call `time.time` in argument defaults" - suggestion: ~ - fixable: false - location: - row: 109 - column: 38 - end_location: - row: 109 - column: 49 - fix: ~ - parent: ~ -- kind: - name: FunctionCallArgumentDefault - body: "Do not perform function call `dt.datetime.now` in argument defaults" - suggestion: ~ - fixable: false - location: - row: 113 - column: 11 - end_location: - row: 113 - column: 28 - fix: ~ - parent: ~ -- kind: - name: FunctionCallArgumentDefault - body: "Do not perform function call `dt.timedelta` in argument defaults" - suggestion: ~ - fixable: false - location: - row: 113 - column: 31 - end_location: - row: 113 - column: 51 - fix: ~ - parent: ~ -- kind: - name: FunctionCallArgumentDefault - body: Do not perform function call in argument defaults - suggestion: ~ - fixable: false - location: - row: 117 - column: 29 - end_location: - row: 117 - column: 44 - fix: ~ - parent: ~ -- kind: - name: FunctionCallArgumentDefault - body: "Do not perform function call `float` in argument defaults" - suggestion: ~ - fixable: false - location: - row: 155 - column: 33 - end_location: - row: 155 - column: 47 - fix: ~ - parent: ~ -- kind: - name: FunctionCallArgumentDefault - body: "Do not perform function call `float` in argument defaults" - suggestion: ~ - fixable: false - location: - row: 160 - column: 29 - end_location: - row: 160 - column: 37 - fix: ~ - parent: ~ -- kind: - name: FunctionCallArgumentDefault - body: "Do not perform function call `float` in argument defaults" - suggestion: ~ - fixable: false - location: - row: 164 - column: 44 - end_location: - row: 164 - column: 57 - fix: ~ - parent: ~ -- kind: - name: FunctionCallArgumentDefault - body: "Do not perform function call `float` in argument defaults" - suggestion: ~ - fixable: false - location: - row: 170 - column: 20 - end_location: - row: 170 - column: 28 - fix: ~ - parent: ~ -- kind: - name: FunctionCallArgumentDefault - body: "Do not perform function call `dt.datetime.now` in argument defaults" - suggestion: ~ - fixable: false - location: - row: 170 - column: 30 - end_location: - row: 170 - column: 47 - fix: ~ - parent: ~ -- kind: - name: FunctionCallArgumentDefault - body: "Do not perform function call `map` in argument defaults" - suggestion: ~ - fixable: false - location: - row: 176 - column: 21 - end_location: - row: 176 - column: 62 - fix: ~ - parent: ~ -- kind: - name: FunctionCallArgumentDefault - body: "Do not perform function call `random.randint` in argument defaults" - suggestion: ~ - fixable: false - location: - row: 181 - column: 18 - end_location: - row: 181 - column: 59 - fix: ~ - parent: ~ -- kind: - name: FunctionCallArgumentDefault - body: "Do not perform function call `dt.datetime.now` in argument defaults" - suggestion: ~ - fixable: false - location: - row: 181 - column: 36 - end_location: - row: 181 - column: 53 - fix: ~ - parent: ~ +- - kind: + name: FunctionCallArgumentDefault + body: "Do not perform function call `range` in argument defaults" + suggestion: ~ + fixable: false + location: + row: 85 + column: 60 + end_location: + row: 85 + column: 68 + fix: ~ + parent: ~ + - kind: + name: FunctionCallArgumentDefault + body: "Do not perform function call `range` in argument defaults" + suggestion: ~ + fixable: false + location: + row: 89 + column: 63 + end_location: + row: 89 + column: 71 + fix: ~ + parent: ~ + - kind: + name: FunctionCallArgumentDefault + body: "Do not perform function call `range` in argument defaults" + suggestion: ~ + fixable: false + location: + row: 93 + column: 59 + end_location: + row: 93 + column: 67 + fix: ~ + parent: ~ + - kind: + name: FunctionCallArgumentDefault + body: "Do not perform function call `time.time` in argument defaults" + suggestion: ~ + fixable: false + location: + row: 109 + column: 38 + end_location: + row: 109 + column: 49 + fix: ~ + parent: ~ + - kind: + name: FunctionCallArgumentDefault + body: "Do not perform function call `dt.datetime.now` in argument defaults" + suggestion: ~ + fixable: false + location: + row: 113 + column: 11 + end_location: + row: 113 + column: 28 + fix: ~ + parent: ~ + - kind: + name: FunctionCallArgumentDefault + body: "Do not perform function call `dt.timedelta` in argument defaults" + suggestion: ~ + fixable: false + location: + row: 113 + column: 31 + end_location: + row: 113 + column: 51 + fix: ~ + parent: ~ + - kind: + name: FunctionCallArgumentDefault + body: Do not perform function call in argument defaults + suggestion: ~ + fixable: false + location: + row: 117 + column: 29 + end_location: + row: 117 + column: 44 + fix: ~ + parent: ~ + - kind: + name: FunctionCallArgumentDefault + body: "Do not perform function call `float` in argument defaults" + suggestion: ~ + fixable: false + location: + row: 155 + column: 33 + end_location: + row: 155 + column: 47 + fix: ~ + parent: ~ + - kind: + name: FunctionCallArgumentDefault + body: "Do not perform function call `float` in argument defaults" + suggestion: ~ + fixable: false + location: + row: 160 + column: 29 + end_location: + row: 160 + column: 37 + fix: ~ + parent: ~ + - kind: + name: FunctionCallArgumentDefault + body: "Do not perform function call `float` in argument defaults" + suggestion: ~ + fixable: false + location: + row: 164 + column: 44 + end_location: + row: 164 + column: 57 + fix: ~ + parent: ~ + - kind: + name: FunctionCallArgumentDefault + body: "Do not perform function call `float` in argument defaults" + suggestion: ~ + fixable: false + location: + row: 170 + column: 20 + end_location: + row: 170 + column: 28 + fix: ~ + parent: ~ + - kind: + name: FunctionCallArgumentDefault + body: "Do not perform function call `dt.datetime.now` in argument defaults" + suggestion: ~ + fixable: false + location: + row: 170 + column: 30 + end_location: + row: 170 + column: 47 + fix: ~ + parent: ~ + - kind: + name: FunctionCallArgumentDefault + body: "Do not perform function call `map` in argument defaults" + suggestion: ~ + fixable: false + location: + row: 176 + column: 21 + end_location: + row: 176 + column: 62 + fix: ~ + parent: ~ + - kind: + name: FunctionCallArgumentDefault + body: "Do not perform function call `random.randint` in argument defaults" + suggestion: ~ + fixable: false + location: + row: 181 + column: 18 + end_location: + row: 181 + column: 59 + fix: ~ + parent: ~ + - kind: + name: FunctionCallArgumentDefault + body: "Do not perform function call `dt.datetime.now` in argument defaults" + suggestion: ~ + fixable: false + location: + row: 181 + column: 36 + end_location: + row: 181 + column: 53 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B009_B009_B010.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B009_B009_B010.py.snap index 7c5050b5b6f098..d5e19583571f5c 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B009_B009_B010.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B009_B009_B010.py.snap @@ -2,144 +2,144 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: GetAttrWithConstant - body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." - suggestion: "Replace `getattr` with attribute access" - fixable: true - location: - row: 19 - column: 0 - end_location: - row: 19 - column: 19 - fix: - content: foo.bar +- - kind: + name: GetAttrWithConstant + body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." + suggestion: "Replace `getattr` with attribute access" + fixable: true location: row: 19 column: 0 end_location: row: 19 column: 19 - parent: ~ -- kind: - name: GetAttrWithConstant - body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." - suggestion: "Replace `getattr` with attribute access" - fixable: true - location: - row: 20 - column: 0 - end_location: - row: 20 - column: 23 - fix: - content: foo._123abc + fix: + content: foo.bar + location: + row: 19 + column: 0 + end_location: + row: 19 + column: 19 + parent: ~ + - kind: + name: GetAttrWithConstant + body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." + suggestion: "Replace `getattr` with attribute access" + fixable: true location: row: 20 column: 0 end_location: row: 20 column: 23 - parent: ~ -- kind: - name: GetAttrWithConstant - body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." - suggestion: "Replace `getattr` with attribute access" - fixable: true - location: - row: 21 - column: 0 - end_location: - row: 21 - column: 26 - fix: - content: foo.__123abc__ + fix: + content: foo._123abc + location: + row: 20 + column: 0 + end_location: + row: 20 + column: 23 + parent: ~ + - kind: + name: GetAttrWithConstant + body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." + suggestion: "Replace `getattr` with attribute access" + fixable: true location: row: 21 column: 0 end_location: row: 21 column: 26 - parent: ~ -- kind: - name: GetAttrWithConstant - body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." - suggestion: "Replace `getattr` with attribute access" - fixable: true - location: - row: 22 - column: 0 - end_location: - row: 22 - column: 22 - fix: - content: foo.abc123 + fix: + content: foo.__123abc__ + location: + row: 21 + column: 0 + end_location: + row: 21 + column: 26 + parent: ~ + - kind: + name: GetAttrWithConstant + body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." + suggestion: "Replace `getattr` with attribute access" + fixable: true location: row: 22 column: 0 end_location: row: 22 column: 22 - parent: ~ -- kind: - name: GetAttrWithConstant - body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." - suggestion: "Replace `getattr` with attribute access" - fixable: true - location: - row: 23 - column: 0 - end_location: - row: 23 - column: 23 - fix: - content: foo.abc123 + fix: + content: foo.abc123 + location: + row: 22 + column: 0 + end_location: + row: 22 + column: 22 + parent: ~ + - kind: + name: GetAttrWithConstant + body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." + suggestion: "Replace `getattr` with attribute access" + fixable: true location: row: 23 column: 0 end_location: row: 23 column: 23 - parent: ~ -- kind: - name: GetAttrWithConstant - body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." - suggestion: "Replace `getattr` with attribute access" - fixable: true - location: - row: 24 - column: 14 - end_location: - row: 24 - column: 31 - fix: - content: x.bar + fix: + content: foo.abc123 + location: + row: 23 + column: 0 + end_location: + row: 23 + column: 23 + parent: ~ + - kind: + name: GetAttrWithConstant + body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." + suggestion: "Replace `getattr` with attribute access" + fixable: true location: row: 24 column: 14 end_location: row: 24 column: 31 - parent: ~ -- kind: - name: GetAttrWithConstant - body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." - suggestion: "Replace `getattr` with attribute access" - fixable: true - location: - row: 25 - column: 3 - end_location: - row: 25 - column: 20 - fix: - content: x.bar + fix: + content: x.bar + location: + row: 24 + column: 14 + end_location: + row: 24 + column: 31 + parent: ~ + - kind: + name: GetAttrWithConstant + body: "Do not call `getattr` with a constant attribute value. It is not any safer than normal property access." + suggestion: "Replace `getattr` with attribute access" + fixable: true location: row: 25 column: 3 end_location: row: 25 column: 20 - parent: ~ + fix: + content: x.bar + location: + row: 25 + column: 3 + end_location: + row: 25 + column: 20 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B010_B009_B010.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B010_B009_B010.py.snap index ed2f64cb1e8e4e..74161652280cd4 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B010_B009_B010.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B010_B009_B010.py.snap @@ -2,124 +2,124 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: SetAttrWithConstant - body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." - suggestion: "Replace `setattr` with assignment" - fixable: true - location: - row: 40 - column: 0 - end_location: - row: 40 - column: 25 - fix: - content: foo.bar = None +- - kind: + name: SetAttrWithConstant + body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." + suggestion: "Replace `setattr` with assignment" + fixable: true location: row: 40 column: 0 end_location: row: 40 column: 25 - parent: ~ -- kind: - name: SetAttrWithConstant - body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." - suggestion: "Replace `setattr` with assignment" - fixable: true - location: - row: 41 - column: 0 - end_location: - row: 41 - column: 29 - fix: - content: foo._123abc = None + fix: + content: foo.bar = None + location: + row: 40 + column: 0 + end_location: + row: 40 + column: 25 + parent: ~ + - kind: + name: SetAttrWithConstant + body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." + suggestion: "Replace `setattr` with assignment" + fixable: true location: row: 41 column: 0 end_location: row: 41 column: 29 - parent: ~ -- kind: - name: SetAttrWithConstant - body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." - suggestion: "Replace `setattr` with assignment" - fixable: true - location: - row: 42 - column: 0 - end_location: - row: 42 - column: 32 - fix: - content: foo.__123abc__ = None + fix: + content: foo._123abc = None + location: + row: 41 + column: 0 + end_location: + row: 41 + column: 29 + parent: ~ + - kind: + name: SetAttrWithConstant + body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." + suggestion: "Replace `setattr` with assignment" + fixable: true location: row: 42 column: 0 end_location: row: 42 column: 32 - parent: ~ -- kind: - name: SetAttrWithConstant - body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." - suggestion: "Replace `setattr` with assignment" - fixable: true - location: - row: 43 - column: 0 - end_location: - row: 43 - column: 28 - fix: - content: foo.abc123 = None + fix: + content: foo.__123abc__ = None + location: + row: 42 + column: 0 + end_location: + row: 42 + column: 32 + parent: ~ + - kind: + name: SetAttrWithConstant + body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." + suggestion: "Replace `setattr` with assignment" + fixable: true location: row: 43 column: 0 end_location: row: 43 column: 28 - parent: ~ -- kind: - name: SetAttrWithConstant - body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." - suggestion: "Replace `setattr` with assignment" - fixable: true - location: - row: 44 - column: 0 - end_location: - row: 44 - column: 29 - fix: - content: foo.abc123 = None + fix: + content: foo.abc123 = None + location: + row: 43 + column: 0 + end_location: + row: 43 + column: 28 + parent: ~ + - kind: + name: SetAttrWithConstant + body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." + suggestion: "Replace `setattr` with assignment" + fixable: true location: row: 44 column: 0 end_location: row: 44 column: 29 - parent: ~ -- kind: - name: SetAttrWithConstant - body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." - suggestion: "Replace `setattr` with assignment" - fixable: true - location: - row: 45 - column: 0 - end_location: - row: 45 - column: 30 - fix: - content: foo.bar.baz = None + fix: + content: foo.abc123 = None + location: + row: 44 + column: 0 + end_location: + row: 44 + column: 29 + parent: ~ + - kind: + name: SetAttrWithConstant + body: "Do not call `setattr` with a constant attribute value. It is not any safer than normal property access." + suggestion: "Replace `setattr` with assignment" + fixable: true location: row: 45 column: 0 end_location: row: 45 column: 30 - parent: ~ + fix: + content: foo.bar.baz = None + location: + row: 45 + column: 0 + end_location: + row: 45 + column: 30 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B011_B011.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B011_B011.py.snap index 348e8c87ced732..32dc284da02dcf 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B011_B011.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B011_B011.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: AssertFalse - body: "Do not `assert False` (`python -O` removes these calls), raise `AssertionError()`" - suggestion: "Replace `assert False`" - fixable: true - location: - row: 8 - column: 7 - end_location: - row: 8 - column: 12 - fix: - content: raise AssertionError() +- - kind: + name: AssertFalse + body: "Do not `assert False` (`python -O` removes these calls), raise `AssertionError()`" + suggestion: "Replace `assert False`" + fixable: true location: row: 8 - column: 0 + column: 7 end_location: row: 8 column: 12 - parent: ~ -- kind: - name: AssertFalse - body: "Do not `assert False` (`python -O` removes these calls), raise `AssertionError()`" - suggestion: "Replace `assert False`" - fixable: true - location: - row: 10 - column: 7 - end_location: - row: 10 - column: 12 - fix: - content: "raise AssertionError(\"message\")" + fix: + content: raise AssertionError() + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 12 + parent: ~ + - kind: + name: AssertFalse + body: "Do not `assert False` (`python -O` removes these calls), raise `AssertionError()`" + suggestion: "Replace `assert False`" + fixable: true location: row: 10 - column: 0 + column: 7 end_location: row: 10 - column: 23 - parent: ~ + column: 12 + fix: + content: "raise AssertionError(\"message\")" + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 23 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B012_B012.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B012_B012.py.snap index aabded9d782979..87df858420c928 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B012_B012.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B012_B012.py.snap @@ -2,147 +2,147 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: JumpStatementInFinally - body: "`return` inside `finally` blocks cause exceptions to be silenced" - suggestion: ~ - fixable: false - location: - row: 5 - column: 8 - end_location: - row: 5 - column: 14 - fix: ~ - parent: ~ -- kind: - name: JumpStatementInFinally - body: "`return` inside `finally` blocks cause exceptions to be silenced" - suggestion: ~ - fixable: false - location: - row: 13 - column: 12 - end_location: - row: 13 - column: 18 - fix: ~ - parent: ~ -- kind: - name: JumpStatementInFinally - body: "`return` inside `finally` blocks cause exceptions to be silenced" - suggestion: ~ - fixable: false - location: - row: 21 - column: 12 - end_location: - row: 21 - column: 18 - fix: ~ - parent: ~ -- kind: - name: JumpStatementInFinally - body: "`return` inside `finally` blocks cause exceptions to be silenced" - suggestion: ~ - fixable: false - location: - row: 31 - column: 12 - end_location: - row: 31 - column: 18 - fix: ~ - parent: ~ -- kind: - name: JumpStatementInFinally - body: "`return` inside `finally` blocks cause exceptions to be silenced" - suggestion: ~ - fixable: false - location: - row: 44 - column: 20 - end_location: - row: 44 - column: 26 - fix: ~ - parent: ~ -- kind: - name: JumpStatementInFinally - body: "`break` inside `finally` blocks cause exceptions to be silenced" - suggestion: ~ - fixable: false - location: - row: 66 - column: 12 - end_location: - row: 66 - column: 17 - fix: ~ - parent: ~ -- kind: - name: JumpStatementInFinally - body: "`continue` inside `finally` blocks cause exceptions to be silenced" - suggestion: ~ - fixable: false - location: - row: 78 - column: 12 - end_location: - row: 78 - column: 20 - fix: ~ - parent: ~ -- kind: - name: JumpStatementInFinally - body: "`return` inside `finally` blocks cause exceptions to be silenced" - suggestion: ~ - fixable: false - location: - row: 94 - column: 12 - end_location: - row: 94 - column: 18 - fix: ~ - parent: ~ -- kind: - name: JumpStatementInFinally - body: "`continue` inside `finally` blocks cause exceptions to be silenced" - suggestion: ~ - fixable: false - location: - row: 101 - column: 8 - end_location: - row: 101 - column: 16 - fix: ~ - parent: ~ -- kind: - name: JumpStatementInFinally - body: "`break` inside `finally` blocks cause exceptions to be silenced" - suggestion: ~ - fixable: false - location: - row: 107 - column: 8 - end_location: - row: 107 - column: 13 - fix: ~ - parent: ~ -- kind: - name: JumpStatementInFinally - body: "`break` inside `finally` blocks cause exceptions to be silenced" - suggestion: ~ - fixable: false - location: - row: 118 - column: 16 - end_location: - row: 118 - column: 21 - fix: ~ - parent: ~ +- - kind: + name: JumpStatementInFinally + body: "`return` inside `finally` blocks cause exceptions to be silenced" + suggestion: ~ + fixable: false + location: + row: 5 + column: 8 + end_location: + row: 5 + column: 14 + fix: ~ + parent: ~ + - kind: + name: JumpStatementInFinally + body: "`return` inside `finally` blocks cause exceptions to be silenced" + suggestion: ~ + fixable: false + location: + row: 13 + column: 12 + end_location: + row: 13 + column: 18 + fix: ~ + parent: ~ + - kind: + name: JumpStatementInFinally + body: "`return` inside `finally` blocks cause exceptions to be silenced" + suggestion: ~ + fixable: false + location: + row: 21 + column: 12 + end_location: + row: 21 + column: 18 + fix: ~ + parent: ~ + - kind: + name: JumpStatementInFinally + body: "`return` inside `finally` blocks cause exceptions to be silenced" + suggestion: ~ + fixable: false + location: + row: 31 + column: 12 + end_location: + row: 31 + column: 18 + fix: ~ + parent: ~ + - kind: + name: JumpStatementInFinally + body: "`return` inside `finally` blocks cause exceptions to be silenced" + suggestion: ~ + fixable: false + location: + row: 44 + column: 20 + end_location: + row: 44 + column: 26 + fix: ~ + parent: ~ + - kind: + name: JumpStatementInFinally + body: "`break` inside `finally` blocks cause exceptions to be silenced" + suggestion: ~ + fixable: false + location: + row: 66 + column: 12 + end_location: + row: 66 + column: 17 + fix: ~ + parent: ~ + - kind: + name: JumpStatementInFinally + body: "`continue` inside `finally` blocks cause exceptions to be silenced" + suggestion: ~ + fixable: false + location: + row: 78 + column: 12 + end_location: + row: 78 + column: 20 + fix: ~ + parent: ~ + - kind: + name: JumpStatementInFinally + body: "`return` inside `finally` blocks cause exceptions to be silenced" + suggestion: ~ + fixable: false + location: + row: 94 + column: 12 + end_location: + row: 94 + column: 18 + fix: ~ + parent: ~ + - kind: + name: JumpStatementInFinally + body: "`continue` inside `finally` blocks cause exceptions to be silenced" + suggestion: ~ + fixable: false + location: + row: 101 + column: 8 + end_location: + row: 101 + column: 16 + fix: ~ + parent: ~ + - kind: + name: JumpStatementInFinally + body: "`break` inside `finally` blocks cause exceptions to be silenced" + suggestion: ~ + fixable: false + location: + row: 107 + column: 8 + end_location: + row: 107 + column: 13 + fix: ~ + parent: ~ + - kind: + name: JumpStatementInFinally + body: "`break` inside `finally` blocks cause exceptions to be silenced" + suggestion: ~ + fixable: false + location: + row: 118 + column: 16 + end_location: + row: 118 + column: 21 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B013_B013.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B013_B013.py.snap index d95a9ced7cdb54..9ae234b6174fd7 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B013_B013.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B013_B013.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: RedundantTupleInExceptionHandler - body: "A length-one tuple literal is redundant. Write `except ValueError` instead of `except (ValueError,)`." - suggestion: "Replace with `except ValueError`" - fixable: true - location: - row: 3 - column: 7 - end_location: - row: 3 - column: 20 - fix: - content: ValueError +- - kind: + name: RedundantTupleInExceptionHandler + body: "A length-one tuple literal is redundant. Write `except ValueError` instead of `except (ValueError,)`." + suggestion: "Replace with `except ValueError`" + fixable: true location: row: 3 column: 7 end_location: row: 3 column: 20 - parent: ~ + fix: + content: ValueError + location: + row: 3 + column: 7 + end_location: + row: 3 + column: 20 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B014_B014.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B014_B014.py.snap index aac00b0bef8b88..093848f3c1959f 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B014_B014.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B014_B014.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: DuplicateHandlerException - body: "Exception handler with duplicate exception: `OSError`" - suggestion: De-duplicate exceptions - fixable: true - location: - row: 17 - column: 7 - end_location: - row: 17 - column: 25 - fix: - content: OSError +- - kind: + name: DuplicateHandlerException + body: "Exception handler with duplicate exception: `OSError`" + suggestion: De-duplicate exceptions + fixable: true location: row: 17 column: 7 end_location: row: 17 column: 25 - parent: ~ -- kind: - name: DuplicateHandlerException - body: "Exception handler with duplicate exception: `MyError`" - suggestion: De-duplicate exceptions - fixable: true - location: - row: 28 - column: 7 - end_location: - row: 28 - column: 25 - fix: - content: MyError + fix: + content: OSError + location: + row: 17 + column: 7 + end_location: + row: 17 + column: 25 + parent: ~ + - kind: + name: DuplicateHandlerException + body: "Exception handler with duplicate exception: `MyError`" + suggestion: De-duplicate exceptions + fixable: true location: row: 28 column: 7 end_location: row: 28 column: 25 - parent: ~ -- kind: - name: DuplicateHandlerException - body: "Exception handler with duplicate exception: `re.error`" - suggestion: De-duplicate exceptions - fixable: true - location: - row: 49 - column: 7 - end_location: - row: 49 - column: 27 - fix: - content: re.error + fix: + content: MyError + location: + row: 28 + column: 7 + end_location: + row: 28 + column: 25 + parent: ~ + - kind: + name: DuplicateHandlerException + body: "Exception handler with duplicate exception: `re.error`" + suggestion: De-duplicate exceptions + fixable: true location: row: 49 column: 7 end_location: row: 49 column: 27 - parent: ~ + fix: + content: re.error + location: + row: 49 + column: 7 + end_location: + row: 49 + column: 27 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B015_B015.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B015_B015.py.snap index 391615c4ded5a7..6ebb79fff1bff7 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B015_B015.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B015_B015.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: UselessComparison - body: "Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it." - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 6 - fix: ~ - parent: ~ -- kind: - name: UselessComparison - body: "Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it." - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 11 - fix: ~ - parent: ~ -- kind: - name: UselessComparison - body: "Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it." - suggestion: ~ - fixable: false - location: - row: 17 - column: 4 - end_location: - row: 17 - column: 15 - fix: ~ - parent: ~ -- kind: - name: UselessComparison - body: "Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it." - suggestion: ~ - fixable: false - location: - row: 24 - column: 4 - end_location: - row: 24 - column: 10 - fix: ~ - parent: ~ +- - kind: + name: UselessComparison + body: "Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it." + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 6 + fix: ~ + parent: ~ + - kind: + name: UselessComparison + body: "Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it." + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 11 + fix: ~ + parent: ~ + - kind: + name: UselessComparison + body: "Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it." + suggestion: ~ + fixable: false + location: + row: 17 + column: 4 + end_location: + row: 17 + column: 15 + fix: ~ + parent: ~ + - kind: + name: UselessComparison + body: "Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it." + suggestion: ~ + fixable: false + location: + row: 24 + column: 4 + end_location: + row: 24 + column: 10 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B016_B016.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B016_B016.py.snap index 9666b4dd3c1627..1c526d36c4a01c 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B016_B016.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B016_B016.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: CannotRaiseLiteral - body: Cannot raise a literal. Did you intend to return it or raise an Exception? - suggestion: ~ - fixable: false - location: - row: 6 - column: 6 - end_location: - row: 6 - column: 11 - fix: ~ - parent: ~ -- kind: - name: CannotRaiseLiteral - body: Cannot raise a literal. Did you intend to return it or raise an Exception? - suggestion: ~ - fixable: false - location: - row: 7 - column: 6 - end_location: - row: 7 - column: 7 - fix: ~ - parent: ~ -- kind: - name: CannotRaiseLiteral - body: Cannot raise a literal. Did you intend to return it or raise an Exception? - suggestion: ~ - fixable: false - location: - row: 8 - column: 6 - end_location: - row: 8 - column: 14 - fix: ~ - parent: ~ +- - kind: + name: CannotRaiseLiteral + body: Cannot raise a literal. Did you intend to return it or raise an Exception? + suggestion: ~ + fixable: false + location: + row: 6 + column: 6 + end_location: + row: 6 + column: 11 + fix: ~ + parent: ~ + - kind: + name: CannotRaiseLiteral + body: Cannot raise a literal. Did you intend to return it or raise an Exception? + suggestion: ~ + fixable: false + location: + row: 7 + column: 6 + end_location: + row: 7 + column: 7 + fix: ~ + parent: ~ + - kind: + name: CannotRaiseLiteral + body: Cannot raise a literal. Did you intend to return it or raise an Exception? + suggestion: ~ + fixable: false + location: + row: 8 + column: 6 + end_location: + row: 8 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B017_B017.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B017_B017.py.snap index 617fdb93803b57..df0acd6f856fd0 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B017_B017.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B017_B017.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: AssertRaisesException - body: "`assertRaises(Exception)` should be considered evil" - suggestion: ~ - fixable: false - location: - row: 22 - column: 8 - end_location: - row: 23 - column: 42 - fix: ~ - parent: ~ +- - kind: + name: AssertRaisesException + body: "`assertRaises(Exception)` should be considered evil" + suggestion: ~ + fixable: false + location: + row: 22 + column: 8 + end_location: + row: 23 + column: 42 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B018_B018.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B018_B018.py.snap index 76681653cc43cf..cae6c84d621e17 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B018_B018.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B018_B018.py.snap @@ -2,316 +2,316 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 11 - column: 4 - end_location: - row: 11 - column: 6 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 12 - column: 4 - end_location: - row: 12 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 13 - column: 4 - end_location: - row: 13 - column: 7 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 10 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 15 - column: 4 - end_location: - row: 15 - column: 8 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 17 - column: 4 - end_location: - row: 17 - column: 8 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 18 - column: 4 - end_location: - row: 18 - column: 10 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 19 - column: 4 - end_location: - row: 19 - column: 10 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 20 - column: 4 - end_location: - row: 20 - column: 18 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 24 - column: 4 - end_location: - row: 24 - column: 7 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 27 - column: 4 - end_location: - row: 27 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 39 - column: 4 - end_location: - row: 39 - column: 6 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 40 - column: 4 - end_location: - row: 40 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 41 - column: 4 - end_location: - row: 41 - column: 7 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 42 - column: 4 - end_location: - row: 42 - column: 10 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 43 - column: 4 - end_location: - row: 43 - column: 8 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 44 - column: 4 - end_location: - row: 44 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 45 - column: 4 - end_location: - row: 45 - column: 8 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 46 - column: 4 - end_location: - row: 46 - column: 10 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 47 - column: 4 - end_location: - row: 47 - column: 10 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 48 - column: 4 - end_location: - row: 48 - column: 18 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 52 - column: 4 - end_location: - row: 52 - column: 7 - fix: ~ - parent: ~ -- kind: - name: UselessExpression - body: Found useless expression. Either assign it to a variable or remove it. - suggestion: ~ - fixable: false - location: - row: 55 - column: 4 - end_location: - row: 55 - column: 5 - fix: ~ - parent: ~ +- - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 11 + column: 4 + end_location: + row: 11 + column: 6 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 12 + column: 4 + end_location: + row: 12 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 13 + column: 4 + end_location: + row: 13 + column: 7 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 14 + column: 4 + end_location: + row: 14 + column: 10 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 15 + column: 4 + end_location: + row: 15 + column: 8 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 16 + column: 4 + end_location: + row: 16 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 17 + column: 4 + end_location: + row: 17 + column: 8 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 18 + column: 4 + end_location: + row: 18 + column: 10 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 19 + column: 4 + end_location: + row: 19 + column: 10 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 20 + column: 4 + end_location: + row: 20 + column: 18 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 24 + column: 4 + end_location: + row: 24 + column: 7 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 27 + column: 4 + end_location: + row: 27 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 39 + column: 4 + end_location: + row: 39 + column: 6 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 40 + column: 4 + end_location: + row: 40 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 41 + column: 4 + end_location: + row: 41 + column: 7 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 42 + column: 4 + end_location: + row: 42 + column: 10 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 43 + column: 4 + end_location: + row: 43 + column: 8 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 44 + column: 4 + end_location: + row: 44 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 45 + column: 4 + end_location: + row: 45 + column: 8 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 46 + column: 4 + end_location: + row: 46 + column: 10 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 47 + column: 4 + end_location: + row: 47 + column: 10 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 48 + column: 4 + end_location: + row: 48 + column: 18 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 52 + column: 4 + end_location: + row: 52 + column: 7 + fix: ~ + parent: ~ + - kind: + name: UselessExpression + body: Found useless expression. Either assign it to a variable or remove it. + suggestion: ~ + fixable: false + location: + row: 55 + column: 4 + end_location: + row: 55 + column: 5 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B019_B019.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B019_B019.py.snap index 26da311a775132..18616e9a3538ae 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B019_B019.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B019_B019.py.snap @@ -2,108 +2,108 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: CachedInstanceMethod - body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" - suggestion: ~ - fixable: false - location: - row: 78 - column: 5 - end_location: - row: 78 - column: 20 - fix: ~ - parent: ~ -- kind: - name: CachedInstanceMethod - body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" - suggestion: ~ - fixable: false - location: - row: 82 - column: 5 - end_location: - row: 82 - column: 10 - fix: ~ - parent: ~ -- kind: - name: CachedInstanceMethod - body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" - suggestion: ~ - fixable: false - location: - row: 86 - column: 5 - end_location: - row: 86 - column: 22 - fix: ~ - parent: ~ -- kind: - name: CachedInstanceMethod - body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" - suggestion: ~ - fixable: false - location: - row: 90 - column: 5 - end_location: - row: 90 - column: 12 - fix: ~ - parent: ~ -- kind: - name: CachedInstanceMethod - body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" - suggestion: ~ - fixable: false - location: - row: 94 - column: 5 - end_location: - row: 94 - column: 24 - fix: ~ - parent: ~ -- kind: - name: CachedInstanceMethod - body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" - suggestion: ~ - fixable: false - location: - row: 98 - column: 5 - end_location: - row: 98 - column: 14 - fix: ~ - parent: ~ -- kind: - name: CachedInstanceMethod - body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" - suggestion: ~ - fixable: false - location: - row: 102 - column: 5 - end_location: - row: 102 - column: 26 - fix: ~ - parent: ~ -- kind: - name: CachedInstanceMethod - body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" - suggestion: ~ - fixable: false - location: - row: 106 - column: 5 - end_location: - row: 106 - column: 16 - fix: ~ - parent: ~ +- - kind: + name: CachedInstanceMethod + body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" + suggestion: ~ + fixable: false + location: + row: 78 + column: 5 + end_location: + row: 78 + column: 20 + fix: ~ + parent: ~ + - kind: + name: CachedInstanceMethod + body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" + suggestion: ~ + fixable: false + location: + row: 82 + column: 5 + end_location: + row: 82 + column: 10 + fix: ~ + parent: ~ + - kind: + name: CachedInstanceMethod + body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" + suggestion: ~ + fixable: false + location: + row: 86 + column: 5 + end_location: + row: 86 + column: 22 + fix: ~ + parent: ~ + - kind: + name: CachedInstanceMethod + body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" + suggestion: ~ + fixable: false + location: + row: 90 + column: 5 + end_location: + row: 90 + column: 12 + fix: ~ + parent: ~ + - kind: + name: CachedInstanceMethod + body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" + suggestion: ~ + fixable: false + location: + row: 94 + column: 5 + end_location: + row: 94 + column: 24 + fix: ~ + parent: ~ + - kind: + name: CachedInstanceMethod + body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" + suggestion: ~ + fixable: false + location: + row: 98 + column: 5 + end_location: + row: 98 + column: 14 + fix: ~ + parent: ~ + - kind: + name: CachedInstanceMethod + body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" + suggestion: ~ + fixable: false + location: + row: 102 + column: 5 + end_location: + row: 102 + column: 26 + fix: ~ + parent: ~ + - kind: + name: CachedInstanceMethod + body: "Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks" + suggestion: ~ + fixable: false + location: + row: 106 + column: 5 + end_location: + row: 106 + column: 16 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B020_B020.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B020_B020.py.snap index 52633aacadd53c..d759fcdfa91cb6 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B020_B020.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B020_B020.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: LoopVariableOverridesIterator - body: "Loop control variable `items` overrides iterable it iterates" - suggestion: ~ - fixable: false - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 9 - fix: ~ - parent: ~ -- kind: - name: LoopVariableOverridesIterator - body: "Loop control variable `values` overrides iterable it iterates" - suggestion: ~ - fixable: false - location: - row: 21 - column: 9 - end_location: - row: 21 - column: 15 - fix: ~ - parent: ~ -- kind: - name: LoopVariableOverridesIterator - body: "Loop control variable `vars` overrides iterable it iterates" - suggestion: ~ - fixable: false - location: - row: 36 - column: 4 - end_location: - row: 36 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: LoopVariableOverridesIterator + body: "Loop control variable `items` overrides iterable it iterates" + suggestion: ~ + fixable: false + location: + row: 8 + column: 4 + end_location: + row: 8 + column: 9 + fix: ~ + parent: ~ + - kind: + name: LoopVariableOverridesIterator + body: "Loop control variable `values` overrides iterable it iterates" + suggestion: ~ + fixable: false + location: + row: 21 + column: 9 + end_location: + row: 21 + column: 15 + fix: ~ + parent: ~ + - kind: + name: LoopVariableOverridesIterator + body: "Loop control variable `vars` overrides iterable it iterates" + suggestion: ~ + fixable: false + location: + row: 36 + column: 4 + end_location: + row: 36 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B021_B021.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B021_B021.py.snap index ca66eb17d0f7f3..72b13ac251a62a 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B021_B021.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B021_B021.py.snap @@ -2,134 +2,134 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: FStringDocstring - body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 4 - column: 3 - fix: ~ - parent: ~ -- kind: - name: FStringDocstring - body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. - suggestion: ~ - fixable: false - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 28 - fix: ~ - parent: ~ -- kind: - name: FStringDocstring - body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. - suggestion: ~ - fixable: false - location: - row: 22 - column: 4 - end_location: - row: 22 - column: 28 - fix: ~ - parent: ~ -- kind: - name: FStringDocstring - body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. - suggestion: ~ - fixable: false - location: - row: 30 - column: 4 - end_location: - row: 30 - column: 28 - fix: ~ - parent: ~ -- kind: - name: FStringDocstring - body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. - suggestion: ~ - fixable: false - location: - row: 38 - column: 4 - end_location: - row: 38 - column: 28 - fix: ~ - parent: ~ -- kind: - name: FStringDocstring - body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. - suggestion: ~ - fixable: false - location: - row: 46 - column: 4 - end_location: - row: 46 - column: 24 - fix: ~ - parent: ~ -- kind: - name: FStringDocstring - body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. - suggestion: ~ - fixable: false - location: - row: 54 - column: 4 - end_location: - row: 54 - column: 24 - fix: ~ - parent: ~ -- kind: - name: FStringDocstring - body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. - suggestion: ~ - fixable: false - location: - row: 62 - column: 4 - end_location: - row: 62 - column: 24 - fix: ~ - parent: ~ -- kind: - name: FStringDocstring - body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. - suggestion: ~ - fixable: false - location: - row: 70 - column: 4 - end_location: - row: 70 - column: 24 - fix: ~ - parent: ~ -- kind: - name: FStringDocstring - body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. - suggestion: ~ - fixable: false - location: - row: 74 - column: 4 - end_location: - row: 74 - column: 48 - fix: ~ - parent: ~ +- - kind: + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 4 + column: 3 + fix: ~ + parent: ~ + - kind: + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + suggestion: ~ + fixable: false + location: + row: 14 + column: 4 + end_location: + row: 14 + column: 28 + fix: ~ + parent: ~ + - kind: + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + suggestion: ~ + fixable: false + location: + row: 22 + column: 4 + end_location: + row: 22 + column: 28 + fix: ~ + parent: ~ + - kind: + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + suggestion: ~ + fixable: false + location: + row: 30 + column: 4 + end_location: + row: 30 + column: 28 + fix: ~ + parent: ~ + - kind: + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + suggestion: ~ + fixable: false + location: + row: 38 + column: 4 + end_location: + row: 38 + column: 28 + fix: ~ + parent: ~ + - kind: + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + suggestion: ~ + fixable: false + location: + row: 46 + column: 4 + end_location: + row: 46 + column: 24 + fix: ~ + parent: ~ + - kind: + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + suggestion: ~ + fixable: false + location: + row: 54 + column: 4 + end_location: + row: 54 + column: 24 + fix: ~ + parent: ~ + - kind: + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + suggestion: ~ + fixable: false + location: + row: 62 + column: 4 + end_location: + row: 62 + column: 24 + fix: ~ + parent: ~ + - kind: + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + suggestion: ~ + fixable: false + location: + row: 70 + column: 4 + end_location: + row: 70 + column: 24 + fix: ~ + parent: ~ + - kind: + name: FStringDocstring + body: f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. + suggestion: ~ + fixable: false + location: + row: 74 + column: 4 + end_location: + row: 74 + column: 48 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B022_B022.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B022_B022.py.snap index 6674168f69a1ba..f2f368ff952bde 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B022_B022.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B022_B022.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: UselessContextlibSuppress - body: "No arguments passed to `contextlib.suppress`. No exceptions will be suppressed and therefore this context manager is redundant" - suggestion: ~ - fixable: false - location: - row: 9 - column: 5 - end_location: - row: 9 - column: 26 - fix: ~ - parent: ~ -- kind: - name: UselessContextlibSuppress - body: "No arguments passed to `contextlib.suppress`. No exceptions will be suppressed and therefore this context manager is redundant" - suggestion: ~ - fixable: false - location: - row: 12 - column: 5 - end_location: - row: 12 - column: 15 - fix: ~ - parent: ~ +- - kind: + name: UselessContextlibSuppress + body: "No arguments passed to `contextlib.suppress`. No exceptions will be suppressed and therefore this context manager is redundant" + suggestion: ~ + fixable: false + location: + row: 9 + column: 5 + end_location: + row: 9 + column: 26 + fix: ~ + parent: ~ + - kind: + name: UselessContextlibSuppress + body: "No arguments passed to `contextlib.suppress`. No exceptions will be suppressed and therefore this context manager is redundant" + suggestion: ~ + fixable: false + location: + row: 12 + column: 5 + end_location: + row: 12 + column: 15 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B023_B023.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B023_B023.py.snap index 6650cec55f8f29..7267b81e8ebffb 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B023_B023.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B023_B023.py.snap @@ -2,316 +2,316 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `x`" - suggestion: ~ - fixable: false - location: - row: 12 - column: 29 - end_location: - row: 12 - column: 30 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `y`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 29 - end_location: - row: 13 - column: 30 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `x`" - suggestion: ~ - fixable: false - location: - row: 16 - column: 15 - end_location: - row: 16 - column: 16 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `x`" - suggestion: ~ - fixable: false - location: - row: 28 - column: 18 - end_location: - row: 28 - column: 19 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `x`" - suggestion: ~ - fixable: false - location: - row: 29 - column: 18 - end_location: - row: 29 - column: 19 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `x`" - suggestion: ~ - fixable: false - location: - row: 30 - column: 18 - end_location: - row: 30 - column: 19 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `x`" - suggestion: ~ - fixable: false - location: - row: 31 - column: 21 - end_location: - row: 31 - column: 22 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `x`" - suggestion: ~ - fixable: false - location: - row: 40 - column: 33 - end_location: - row: 40 - column: 34 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `x`" - suggestion: ~ - fixable: false - location: - row: 42 - column: 13 - end_location: - row: 42 - column: 14 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `a`" - suggestion: ~ - fixable: false - location: - row: 50 - column: 29 - end_location: - row: 50 - column: 30 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `a_`" - suggestion: ~ - fixable: false - location: - row: 51 - column: 29 - end_location: - row: 51 - column: 31 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `b`" - suggestion: ~ - fixable: false - location: - row: 52 - column: 29 - end_location: - row: 52 - column: 30 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `c`" - suggestion: ~ - fixable: false - location: - row: 53 - column: 29 - end_location: - row: 53 - column: 30 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `j`" - suggestion: ~ - fixable: false - location: - row: 61 - column: 16 - end_location: - row: 61 - column: 17 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `k`" - suggestion: ~ - fixable: false - location: - row: 61 - column: 20 - end_location: - row: 61 - column: 21 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `l`" - suggestion: ~ - fixable: false - location: - row: 68 - column: 9 - end_location: - row: 68 - column: 10 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `i`" - suggestion: ~ - fixable: false - location: - row: 82 - column: 15 - end_location: - row: 82 - column: 16 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `x`" - suggestion: ~ - fixable: false - location: - row: 117 - column: 23 - end_location: - row: 117 - column: 24 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `x`" - suggestion: ~ - fixable: false - location: - row: 118 - column: 26 - end_location: - row: 118 - column: 27 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `x`" - suggestion: ~ - fixable: false - location: - row: 119 - column: 36 - end_location: - row: 119 - column: 37 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `x`" - suggestion: ~ - fixable: false - location: - row: 120 - column: 37 - end_location: - row: 120 - column: 38 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `x`" - suggestion: ~ - fixable: false - location: - row: 121 - column: 36 - end_location: - row: 121 - column: 37 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `name`" - suggestion: ~ - fixable: false - location: - row: 171 - column: 28 - end_location: - row: 171 - column: 32 - fix: ~ - parent: ~ -- kind: - name: FunctionUsesLoopVariable - body: "Function definition does not bind loop variable `i`" - suggestion: ~ - fixable: false - location: - row: 174 - column: 28 - end_location: - row: 174 - column: 29 - fix: ~ - parent: ~ +- - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + suggestion: ~ + fixable: false + location: + row: 12 + column: 29 + end_location: + row: 12 + column: 30 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `y`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 29 + end_location: + row: 13 + column: 30 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + suggestion: ~ + fixable: false + location: + row: 16 + column: 15 + end_location: + row: 16 + column: 16 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + suggestion: ~ + fixable: false + location: + row: 28 + column: 18 + end_location: + row: 28 + column: 19 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + suggestion: ~ + fixable: false + location: + row: 29 + column: 18 + end_location: + row: 29 + column: 19 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + suggestion: ~ + fixable: false + location: + row: 30 + column: 18 + end_location: + row: 30 + column: 19 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + suggestion: ~ + fixable: false + location: + row: 31 + column: 21 + end_location: + row: 31 + column: 22 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + suggestion: ~ + fixable: false + location: + row: 40 + column: 33 + end_location: + row: 40 + column: 34 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + suggestion: ~ + fixable: false + location: + row: 42 + column: 13 + end_location: + row: 42 + column: 14 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `a`" + suggestion: ~ + fixable: false + location: + row: 50 + column: 29 + end_location: + row: 50 + column: 30 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `a_`" + suggestion: ~ + fixable: false + location: + row: 51 + column: 29 + end_location: + row: 51 + column: 31 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `b`" + suggestion: ~ + fixable: false + location: + row: 52 + column: 29 + end_location: + row: 52 + column: 30 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `c`" + suggestion: ~ + fixable: false + location: + row: 53 + column: 29 + end_location: + row: 53 + column: 30 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `j`" + suggestion: ~ + fixable: false + location: + row: 61 + column: 16 + end_location: + row: 61 + column: 17 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `k`" + suggestion: ~ + fixable: false + location: + row: 61 + column: 20 + end_location: + row: 61 + column: 21 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `l`" + suggestion: ~ + fixable: false + location: + row: 68 + column: 9 + end_location: + row: 68 + column: 10 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `i`" + suggestion: ~ + fixable: false + location: + row: 82 + column: 15 + end_location: + row: 82 + column: 16 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + suggestion: ~ + fixable: false + location: + row: 117 + column: 23 + end_location: + row: 117 + column: 24 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + suggestion: ~ + fixable: false + location: + row: 118 + column: 26 + end_location: + row: 118 + column: 27 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + suggestion: ~ + fixable: false + location: + row: 119 + column: 36 + end_location: + row: 119 + column: 37 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + suggestion: ~ + fixable: false + location: + row: 120 + column: 37 + end_location: + row: 120 + column: 38 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `x`" + suggestion: ~ + fixable: false + location: + row: 121 + column: 36 + end_location: + row: 121 + column: 37 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `name`" + suggestion: ~ + fixable: false + location: + row: 171 + column: 28 + end_location: + row: 171 + column: 32 + fix: ~ + parent: ~ + - kind: + name: FunctionUsesLoopVariable + body: "Function definition does not bind loop variable `i`" + suggestion: ~ + fixable: false + location: + row: 174 + column: 28 + end_location: + row: 174 + column: 29 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B024_B024.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B024_B024.py.snap index e8dcfa070ca1c2..028967b9e4a202 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B024_B024.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B024_B024.py.snap @@ -2,82 +2,82 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: AbstractBaseClassWithoutAbstractMethod - body: "`Base_1` is an abstract base class, but it has no abstract methods" - suggestion: ~ - fixable: false - location: - row: 18 - column: 0 - end_location: - row: 20 - column: 13 - fix: ~ - parent: ~ -- kind: - name: AbstractBaseClassWithoutAbstractMethod - body: "`MetaBase_1` is an abstract base class, but it has no abstract methods" - suggestion: ~ - fixable: false - location: - row: 71 - column: 0 - end_location: - row: 73 - column: 13 - fix: ~ - parent: ~ -- kind: - name: AbstractBaseClassWithoutAbstractMethod - body: "`abc_Base_1` is an abstract base class, but it has no abstract methods" - suggestion: ~ - fixable: false - location: - row: 82 - column: 0 - end_location: - row: 84 - column: 13 - fix: ~ - parent: ~ -- kind: - name: AbstractBaseClassWithoutAbstractMethod - body: "`abc_Base_2` is an abstract base class, but it has no abstract methods" - suggestion: ~ - fixable: false - location: - row: 87 - column: 0 - end_location: - row: 89 - column: 13 - fix: ~ - parent: ~ -- kind: - name: AbstractBaseClassWithoutAbstractMethod - body: "`notabc_Base_1` is an abstract base class, but it has no abstract methods" - suggestion: ~ - fixable: false - location: - row: 92 - column: 0 - end_location: - row: 94 - column: 13 - fix: ~ - parent: ~ -- kind: - name: AbstractBaseClassWithoutAbstractMethod - body: "`abc_set_class_variable_4` is an abstract base class, but it has no abstract methods" - suggestion: ~ - fixable: false - location: - row: 141 - column: 0 - end_location: - row: 142 - column: 7 - fix: ~ - parent: ~ +- - kind: + name: AbstractBaseClassWithoutAbstractMethod + body: "`Base_1` is an abstract base class, but it has no abstract methods" + suggestion: ~ + fixable: false + location: + row: 18 + column: 0 + end_location: + row: 20 + column: 13 + fix: ~ + parent: ~ + - kind: + name: AbstractBaseClassWithoutAbstractMethod + body: "`MetaBase_1` is an abstract base class, but it has no abstract methods" + suggestion: ~ + fixable: false + location: + row: 71 + column: 0 + end_location: + row: 73 + column: 13 + fix: ~ + parent: ~ + - kind: + name: AbstractBaseClassWithoutAbstractMethod + body: "`abc_Base_1` is an abstract base class, but it has no abstract methods" + suggestion: ~ + fixable: false + location: + row: 82 + column: 0 + end_location: + row: 84 + column: 13 + fix: ~ + parent: ~ + - kind: + name: AbstractBaseClassWithoutAbstractMethod + body: "`abc_Base_2` is an abstract base class, but it has no abstract methods" + suggestion: ~ + fixable: false + location: + row: 87 + column: 0 + end_location: + row: 89 + column: 13 + fix: ~ + parent: ~ + - kind: + name: AbstractBaseClassWithoutAbstractMethod + body: "`notabc_Base_1` is an abstract base class, but it has no abstract methods" + suggestion: ~ + fixable: false + location: + row: 92 + column: 0 + end_location: + row: 94 + column: 13 + fix: ~ + parent: ~ + - kind: + name: AbstractBaseClassWithoutAbstractMethod + body: "`abc_set_class_variable_4` is an abstract base class, but it has no abstract methods" + suggestion: ~ + fixable: false + location: + row: 141 + column: 0 + end_location: + row: 142 + column: 7 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B025_B025.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B025_B025.py.snap index fe24098b5352c6..9e1ce21aae8bf2 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B025_B025.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B025_B025.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: DuplicateTryBlockException - body: "try-except block with duplicate exception `ValueError`" - suggestion: ~ - fixable: false - location: - row: 19 - column: 7 - end_location: - row: 19 - column: 17 - fix: ~ - parent: ~ -- kind: - name: DuplicateTryBlockException - body: "try-except block with duplicate exception `pickle.PickleError`" - suggestion: ~ - fixable: false - location: - row: 28 - column: 7 - end_location: - row: 28 - column: 25 - fix: ~ - parent: ~ -- kind: - name: DuplicateTryBlockException - body: "try-except block with duplicate exception `ValueError`" - suggestion: ~ - fixable: false - location: - row: 35 - column: 7 - end_location: - row: 35 - column: 17 - fix: ~ - parent: ~ -- kind: - name: DuplicateTryBlockException - body: "try-except block with duplicate exception `TypeError`" - suggestion: ~ - fixable: false - location: - row: 37 - column: 17 - end_location: - row: 37 - column: 26 - fix: ~ - parent: ~ +- - kind: + name: DuplicateTryBlockException + body: "try-except block with duplicate exception `ValueError`" + suggestion: ~ + fixable: false + location: + row: 19 + column: 7 + end_location: + row: 19 + column: 17 + fix: ~ + parent: ~ + - kind: + name: DuplicateTryBlockException + body: "try-except block with duplicate exception `pickle.PickleError`" + suggestion: ~ + fixable: false + location: + row: 28 + column: 7 + end_location: + row: 28 + column: 25 + fix: ~ + parent: ~ + - kind: + name: DuplicateTryBlockException + body: "try-except block with duplicate exception `ValueError`" + suggestion: ~ + fixable: false + location: + row: 35 + column: 7 + end_location: + row: 35 + column: 17 + fix: ~ + parent: ~ + - kind: + name: DuplicateTryBlockException + body: "try-except block with duplicate exception `TypeError`" + suggestion: ~ + fixable: false + location: + row: 37 + column: 17 + end_location: + row: 37 + column: 26 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B026_B026.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B026_B026.py.snap index 52155fbcd043ad..195e25ebb65e1c 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B026_B026.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B026_B026.py.snap @@ -2,95 +2,95 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: StarArgUnpackingAfterKeywordArg - body: Star-arg unpacking after a keyword argument is strongly discouraged - suggestion: ~ - fixable: false - location: - row: 16 - column: 15 - end_location: - row: 16 - column: 30 - fix: ~ - parent: ~ -- kind: - name: StarArgUnpackingAfterKeywordArg - body: Star-arg unpacking after a keyword argument is strongly discouraged - suggestion: ~ - fixable: false - location: - row: 17 - column: 15 - end_location: - row: 17 - column: 23 - fix: ~ - parent: ~ -- kind: - name: StarArgUnpackingAfterKeywordArg - body: Star-arg unpacking after a keyword argument is strongly discouraged - suggestion: ~ - fixable: false - location: - row: 18 - column: 26 - end_location: - row: 18 - column: 34 - fix: ~ - parent: ~ -- kind: - name: StarArgUnpackingAfterKeywordArg - body: Star-arg unpacking after a keyword argument is strongly discouraged - suggestion: ~ - fixable: false - location: - row: 19 - column: 37 - end_location: - row: 19 - column: 40 - fix: ~ - parent: ~ -- kind: - name: StarArgUnpackingAfterKeywordArg - body: Star-arg unpacking after a keyword argument is strongly discouraged - suggestion: ~ - fixable: false - location: - row: 20 - column: 15 - end_location: - row: 20 - column: 23 - fix: ~ - parent: ~ -- kind: - name: StarArgUnpackingAfterKeywordArg - body: Star-arg unpacking after a keyword argument is strongly discouraged - suggestion: ~ - fixable: false - location: - row: 20 - column: 25 - end_location: - row: 20 - column: 33 - fix: ~ - parent: ~ -- kind: - name: StarArgUnpackingAfterKeywordArg - body: Star-arg unpacking after a keyword argument is strongly discouraged - suggestion: ~ - fixable: false - location: - row: 21 - column: 25 - end_location: - row: 21 - column: 33 - fix: ~ - parent: ~ +- - kind: + name: StarArgUnpackingAfterKeywordArg + body: Star-arg unpacking after a keyword argument is strongly discouraged + suggestion: ~ + fixable: false + location: + row: 16 + column: 15 + end_location: + row: 16 + column: 30 + fix: ~ + parent: ~ + - kind: + name: StarArgUnpackingAfterKeywordArg + body: Star-arg unpacking after a keyword argument is strongly discouraged + suggestion: ~ + fixable: false + location: + row: 17 + column: 15 + end_location: + row: 17 + column: 23 + fix: ~ + parent: ~ + - kind: + name: StarArgUnpackingAfterKeywordArg + body: Star-arg unpacking after a keyword argument is strongly discouraged + suggestion: ~ + fixable: false + location: + row: 18 + column: 26 + end_location: + row: 18 + column: 34 + fix: ~ + parent: ~ + - kind: + name: StarArgUnpackingAfterKeywordArg + body: Star-arg unpacking after a keyword argument is strongly discouraged + suggestion: ~ + fixable: false + location: + row: 19 + column: 37 + end_location: + row: 19 + column: 40 + fix: ~ + parent: ~ + - kind: + name: StarArgUnpackingAfterKeywordArg + body: Star-arg unpacking after a keyword argument is strongly discouraged + suggestion: ~ + fixable: false + location: + row: 20 + column: 15 + end_location: + row: 20 + column: 23 + fix: ~ + parent: ~ + - kind: + name: StarArgUnpackingAfterKeywordArg + body: Star-arg unpacking after a keyword argument is strongly discouraged + suggestion: ~ + fixable: false + location: + row: 20 + column: 25 + end_location: + row: 20 + column: 33 + fix: ~ + parent: ~ + - kind: + name: StarArgUnpackingAfterKeywordArg + body: Star-arg unpacking after a keyword argument is strongly discouraged + suggestion: ~ + fixable: false + location: + row: 21 + column: 25 + end_location: + row: 21 + column: 33 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B027_B027.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B027_B027.py.snap index 7c3bb97a55649c..6bb4854c0ab2bb 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B027_B027.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B027_B027.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: EmptyMethodWithoutAbstractDecorator - body: "`AbstractClass.empty_1` is an empty method in an abstract base class, but has no abstract decorator" - suggestion: ~ - fixable: false - location: - row: 13 - column: 4 - end_location: - row: 14 - column: 11 - fix: ~ - parent: ~ -- kind: - name: EmptyMethodWithoutAbstractDecorator - body: "`AbstractClass.empty_2` is an empty method in an abstract base class, but has no abstract decorator" - suggestion: ~ - fixable: false - location: - row: 16 - column: 4 - end_location: - row: 17 - column: 12 - fix: ~ - parent: ~ -- kind: - name: EmptyMethodWithoutAbstractDecorator - body: "`AbstractClass.empty_3` is an empty method in an abstract base class, but has no abstract decorator" - suggestion: ~ - fixable: false - location: - row: 19 - column: 4 - end_location: - row: 21 - column: 11 - fix: ~ - parent: ~ -- kind: - name: EmptyMethodWithoutAbstractDecorator - body: "`AbstractClass.empty_4` is an empty method in an abstract base class, but has no abstract decorator" - suggestion: ~ - fixable: false - location: - row: 23 - column: 4 - end_location: - row: 28 - column: 12 - fix: ~ - parent: ~ +- - kind: + name: EmptyMethodWithoutAbstractDecorator + body: "`AbstractClass.empty_1` is an empty method in an abstract base class, but has no abstract decorator" + suggestion: ~ + fixable: false + location: + row: 13 + column: 4 + end_location: + row: 14 + column: 11 + fix: ~ + parent: ~ + - kind: + name: EmptyMethodWithoutAbstractDecorator + body: "`AbstractClass.empty_2` is an empty method in an abstract base class, but has no abstract decorator" + suggestion: ~ + fixable: false + location: + row: 16 + column: 4 + end_location: + row: 17 + column: 12 + fix: ~ + parent: ~ + - kind: + name: EmptyMethodWithoutAbstractDecorator + body: "`AbstractClass.empty_3` is an empty method in an abstract base class, but has no abstract decorator" + suggestion: ~ + fixable: false + location: + row: 19 + column: 4 + end_location: + row: 21 + column: 11 + fix: ~ + parent: ~ + - kind: + name: EmptyMethodWithoutAbstractDecorator + body: "`AbstractClass.empty_4` is an empty method in an abstract base class, but has no abstract decorator" + suggestion: ~ + fixable: false + location: + row: 23 + column: 4 + end_location: + row: 28 + column: 12 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B027_B027.pyi.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B027_B027.pyi.snap index 28b468d5d892aa..ba4bb33c5449fe 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B027_B027.pyi.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B027_B027.pyi.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B029_B029.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B029_B029.py.snap index ba094d325c145e..1d6e87d1f373ce 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B029_B029.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B029_B029.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: ExceptWithEmptyTuple - body: "Using except (): with an empty tuple does not handle/catch anything. Add exceptions to handle." - suggestion: ~ - fixable: false - location: - row: 8 - column: 0 - end_location: - row: 9 - column: 8 - fix: ~ - parent: ~ -- kind: - name: ExceptWithEmptyTuple - body: "Using except (): with an empty tuple does not handle/catch anything. Add exceptions to handle." - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 14 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: ExceptWithEmptyTuple + body: "Using except (): with an empty tuple does not handle/catch anything. Add exceptions to handle." + suggestion: ~ + fixable: false + location: + row: 8 + column: 0 + end_location: + row: 9 + column: 8 + fix: ~ + parent: ~ + - kind: + name: ExceptWithEmptyTuple + body: "Using except (): with an empty tuple does not handle/catch anything. Add exceptions to handle." + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 14 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B030_B030.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B030_B030.py.snap index 23491995231af5..3333c152804d66 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B030_B030.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B030_B030.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: ExceptWithNonExceptionClasses - body: "`except` handlers should only be exception classes or tuples of exception classes" - suggestion: ~ - fixable: false - location: - row: 12 - column: 7 - end_location: - row: 12 - column: 8 - fix: ~ - parent: ~ -- kind: - name: ExceptWithNonExceptionClasses - body: "`except` handlers should only be exception classes or tuples of exception classes" - suggestion: ~ - fixable: false - location: - row: 17 - column: 8 - end_location: - row: 17 - column: 9 - fix: ~ - parent: ~ -- kind: - name: ExceptWithNonExceptionClasses - body: "`except` handlers should only be exception classes or tuples of exception classes" - suggestion: ~ - fixable: false - location: - row: 22 - column: 20 - end_location: - row: 22 - column: 57 - fix: ~ - parent: ~ -- kind: - name: ExceptWithNonExceptionClasses - body: "`except` handlers should only be exception classes or tuples of exception classes" - suggestion: ~ - fixable: false - location: - row: 27 - column: 36 - end_location: - row: 27 - column: 57 - fix: ~ - parent: ~ +- - kind: + name: ExceptWithNonExceptionClasses + body: "`except` handlers should only be exception classes or tuples of exception classes" + suggestion: ~ + fixable: false + location: + row: 12 + column: 7 + end_location: + row: 12 + column: 8 + fix: ~ + parent: ~ + - kind: + name: ExceptWithNonExceptionClasses + body: "`except` handlers should only be exception classes or tuples of exception classes" + suggestion: ~ + fixable: false + location: + row: 17 + column: 8 + end_location: + row: 17 + column: 9 + fix: ~ + parent: ~ + - kind: + name: ExceptWithNonExceptionClasses + body: "`except` handlers should only be exception classes or tuples of exception classes" + suggestion: ~ + fixable: false + location: + row: 22 + column: 20 + end_location: + row: 22 + column: 57 + fix: ~ + parent: ~ + - kind: + name: ExceptWithNonExceptionClasses + body: "`except` handlers should only be exception classes or tuples of exception classes" + suggestion: ~ + fixable: false + location: + row: 27 + column: 36 + end_location: + row: 27 + column: 57 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B032_B032.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B032_B032.py.snap index e0a74a5b84637a..0e634901279e93 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B032_B032.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B032_B032.py.snap @@ -2,108 +2,108 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: UnintentionalTypeAnnotation - body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 11 - fix: ~ - parent: ~ -- kind: - name: UnintentionalTypeAnnotation - body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 8 - fix: ~ - parent: ~ -- kind: - name: UnintentionalTypeAnnotation - body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" - suggestion: ~ - fixable: false - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 16 - fix: ~ - parent: ~ -- kind: - name: UnintentionalTypeAnnotation - body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 13 - fix: ~ - parent: ~ -- kind: - name: UnintentionalTypeAnnotation - body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" - suggestion: ~ - fixable: false - location: - row: 16 - column: 0 - end_location: - row: 16 - column: 14 - fix: ~ - parent: ~ -- kind: - name: UnintentionalTypeAnnotation - body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" - suggestion: ~ - fixable: false - location: - row: 17 - column: 0 - end_location: - row: 17 - column: 22 - fix: ~ - parent: ~ -- kind: - name: UnintentionalTypeAnnotation - body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" - suggestion: ~ - fixable: false - location: - row: 18 - column: 0 - end_location: - row: 18 - column: 11 - fix: ~ - parent: ~ -- kind: - name: UnintentionalTypeAnnotation - body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" - suggestion: ~ - fixable: false - location: - row: 19 - column: 0 - end_location: - row: 19 - column: 19 - fix: ~ - parent: ~ +- - kind: + name: UnintentionalTypeAnnotation + body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 11 + fix: ~ + parent: ~ + - kind: + name: UnintentionalTypeAnnotation + body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 8 + fix: ~ + parent: ~ + - kind: + name: UnintentionalTypeAnnotation + body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" + suggestion: ~ + fixable: false + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 16 + fix: ~ + parent: ~ + - kind: + name: UnintentionalTypeAnnotation + body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 13 + fix: ~ + parent: ~ + - kind: + name: UnintentionalTypeAnnotation + body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" + suggestion: ~ + fixable: false + location: + row: 16 + column: 0 + end_location: + row: 16 + column: 14 + fix: ~ + parent: ~ + - kind: + name: UnintentionalTypeAnnotation + body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" + suggestion: ~ + fixable: false + location: + row: 17 + column: 0 + end_location: + row: 17 + column: 22 + fix: ~ + parent: ~ + - kind: + name: UnintentionalTypeAnnotation + body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" + suggestion: ~ + fixable: false + location: + row: 18 + column: 0 + end_location: + row: 18 + column: 11 + fix: ~ + parent: ~ + - kind: + name: UnintentionalTypeAnnotation + body: "Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)?" + suggestion: ~ + fixable: false + location: + row: 19 + column: 0 + end_location: + row: 19 + column: 19 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B904_B904.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B904_B904.py.snap index ebadbcb251f637..2f31ce6bc4e02c 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B904_B904.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B904_B904.py.snap @@ -2,82 +2,82 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: RaiseWithoutFromInsideExcept - body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" - suggestion: ~ - fixable: false - location: - row: 10 - column: 8 - end_location: - row: 10 - column: 23 - fix: ~ - parent: ~ -- kind: - name: RaiseWithoutFromInsideExcept - body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" - suggestion: ~ - fixable: false - location: - row: 11 - column: 4 - end_location: - row: 11 - column: 21 - fix: ~ - parent: ~ -- kind: - name: RaiseWithoutFromInsideExcept - body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" - suggestion: ~ - fixable: false - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 39 - fix: ~ - parent: ~ -- kind: - name: RaiseWithoutFromInsideExcept - body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" - suggestion: ~ - fixable: false - location: - row: 62 - column: 8 - end_location: - row: 62 - column: 35 - fix: ~ - parent: ~ -- kind: - name: RaiseWithoutFromInsideExcept - body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" - suggestion: ~ - fixable: false - location: - row: 64 - column: 8 - end_location: - row: 64 - column: 35 - fix: ~ - parent: ~ -- kind: - name: RaiseWithoutFromInsideExcept - body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" - suggestion: ~ - fixable: false - location: - row: 72 - column: 12 - end_location: - row: 72 - column: 39 - fix: ~ - parent: ~ +- - kind: + name: RaiseWithoutFromInsideExcept + body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" + suggestion: ~ + fixable: false + location: + row: 10 + column: 8 + end_location: + row: 10 + column: 23 + fix: ~ + parent: ~ + - kind: + name: RaiseWithoutFromInsideExcept + body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" + suggestion: ~ + fixable: false + location: + row: 11 + column: 4 + end_location: + row: 11 + column: 21 + fix: ~ + parent: ~ + - kind: + name: RaiseWithoutFromInsideExcept + body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" + suggestion: ~ + fixable: false + location: + row: 16 + column: 4 + end_location: + row: 16 + column: 39 + fix: ~ + parent: ~ + - kind: + name: RaiseWithoutFromInsideExcept + body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" + suggestion: ~ + fixable: false + location: + row: 62 + column: 8 + end_location: + row: 62 + column: 35 + fix: ~ + parent: ~ + - kind: + name: RaiseWithoutFromInsideExcept + body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" + suggestion: ~ + fixable: false + location: + row: 64 + column: 8 + end_location: + row: 64 + column: 35 + fix: ~ + parent: ~ + - kind: + name: RaiseWithoutFromInsideExcept + body: "Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling" + suggestion: ~ + fixable: false + location: + row: 72 + column: 12 + end_location: + row: 72 + column: 39 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B905_B905.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B905_B905.py.snap index 46975425f22c34..d2a40d09508302 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B905_B905.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B905_B905.py.snap @@ -2,95 +2,95 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: ZipWithoutExplicitStrict - body: "`zip()` without an explicit `strict=` parameter" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 5 - fix: ~ - parent: ~ -- kind: - name: ZipWithoutExplicitStrict - body: "`zip()` without an explicit `strict=` parameter" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 13 - fix: ~ - parent: ~ -- kind: - name: ZipWithoutExplicitStrict - body: "`zip()` without an explicit `strict=` parameter" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 13 - fix: ~ - parent: ~ -- kind: - name: ZipWithoutExplicitStrict - body: "`zip()` without an explicit `strict=` parameter" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 24 - fix: ~ - parent: ~ -- kind: - name: ZipWithoutExplicitStrict - body: "`zip()` without an explicit `strict=` parameter" - suggestion: ~ - fixable: false - location: - row: 4 - column: 15 - end_location: - row: 4 - column: 23 - fix: ~ - parent: ~ -- kind: - name: ZipWithoutExplicitStrict - body: "`zip()` without an explicit `strict=` parameter" - suggestion: ~ - fixable: false - location: - row: 5 - column: 4 - end_location: - row: 5 - column: 12 - fix: ~ - parent: ~ -- kind: - name: ZipWithoutExplicitStrict - body: "`zip()` without an explicit `strict=` parameter" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 26 - fix: ~ - parent: ~ +- - kind: + name: ZipWithoutExplicitStrict + body: "`zip()` without an explicit `strict=` parameter" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 5 + fix: ~ + parent: ~ + - kind: + name: ZipWithoutExplicitStrict + body: "`zip()` without an explicit `strict=` parameter" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 13 + fix: ~ + parent: ~ + - kind: + name: ZipWithoutExplicitStrict + body: "`zip()` without an explicit `strict=` parameter" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 13 + fix: ~ + parent: ~ + - kind: + name: ZipWithoutExplicitStrict + body: "`zip()` without an explicit `strict=` parameter" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 24 + fix: ~ + parent: ~ + - kind: + name: ZipWithoutExplicitStrict + body: "`zip()` without an explicit `strict=` parameter" + suggestion: ~ + fixable: false + location: + row: 4 + column: 15 + end_location: + row: 4 + column: 23 + fix: ~ + parent: ~ + - kind: + name: ZipWithoutExplicitStrict + body: "`zip()` without an explicit `strict=` parameter" + suggestion: ~ + fixable: false + location: + row: 5 + column: 4 + end_location: + row: 5 + column: 12 + fix: ~ + parent: ~ + - kind: + name: ZipWithoutExplicitStrict + body: "`zip()` without an explicit `strict=` parameter" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 26 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__extend_immutable_calls.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__extend_immutable_calls.snap index 0812483b429a4a..fba82ad43ddcb7 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__extend_immutable_calls.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__extend_immutable_calls.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs expression: diagnostics --- -- kind: - name: FunctionCallArgumentDefault - body: "Do not perform function call `Depends` in argument defaults" - suggestion: ~ - fixable: false - location: - row: 19 - column: 50 - end_location: - row: 19 - column: 63 - fix: ~ - parent: ~ +- - kind: + name: FunctionCallArgumentDefault + body: "Do not perform function call `Depends` in argument defaults" + suggestion: ~ + fixable: false + location: + row: 19 + column: 50 + end_location: + row: 19 + column: 63 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py.snap index cb3108f14f117b..681848450794b1 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py.snap @@ -2,264 +2,264 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs expression: diagnostics --- -- kind: - name: BuiltinVariableShadowing - body: "Variable `sum` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 18 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `int` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 29 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `dir` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 32 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `print` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 5 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `copyright` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 9 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `complex` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 7 - column: 1 - end_location: - row: 7 - column: 8 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `float` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 5 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `object` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 8 - column: 8 - end_location: - row: 8 - column: 14 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `min` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 3 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `max` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 9 - column: 5 - end_location: - row: 9 - column: 8 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `id` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 2 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `bytes` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 14 - column: 8 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `slice` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 16 - column: 0 - end_location: - row: 17 - column: 8 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `ValueError` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 21 - column: 0 - end_location: - row: 22 - column: 7 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `memoryview` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 24 - column: 4 - end_location: - row: 24 - column: 14 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `bytearray` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 24 - column: 17 - end_location: - row: 24 - column: 26 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `str` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 27 - column: 21 - end_location: - row: 27 - column: 24 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `all` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 27 - column: 44 - end_location: - row: 27 - column: 47 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `any` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 27 - column: 49 - end_location: - row: 27 - column: 52 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `sum` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 30 - column: 7 - end_location: - row: 30 - column: 10 - fix: ~ - parent: ~ +- - kind: + name: BuiltinVariableShadowing + body: "Variable `sum` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 18 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `int` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 29 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `dir` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 32 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `print` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 5 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `copyright` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 9 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `complex` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 7 + column: 1 + end_location: + row: 7 + column: 8 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `float` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 5 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `object` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 8 + column: 8 + end_location: + row: 8 + column: 14 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `min` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 3 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `max` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 9 + column: 5 + end_location: + row: 9 + column: 8 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `id` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 2 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `bytes` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 14 + column: 8 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `slice` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 16 + column: 0 + end_location: + row: 17 + column: 8 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `ValueError` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 21 + column: 0 + end_location: + row: 22 + column: 7 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `memoryview` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 24 + column: 4 + end_location: + row: 24 + column: 14 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `bytearray` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 24 + column: 17 + end_location: + row: 24 + column: 26 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `str` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 27 + column: 21 + end_location: + row: 27 + column: 24 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `all` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 27 + column: 44 + end_location: + row: 27 + column: 47 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `any` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 27 + column: 49 + end_location: + row: 27 + column: 52 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `sum` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 30 + column: 7 + end_location: + row: 30 + column: 10 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py_builtins_ignorelist.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py_builtins_ignorelist.snap index a747afe215b112..2cbcaa1ea3badd 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py_builtins_ignorelist.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py_builtins_ignorelist.snap @@ -2,238 +2,238 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs expression: diagnostics --- -- kind: - name: BuiltinVariableShadowing - body: "Variable `sum` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 18 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `int` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 29 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `print` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 5 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `copyright` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 9 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `complex` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 7 - column: 1 - end_location: - row: 7 - column: 8 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `float` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 5 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `object` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 8 - column: 8 - end_location: - row: 8 - column: 14 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `min` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 3 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `max` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 9 - column: 5 - end_location: - row: 9 - column: 8 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `bytes` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 14 - column: 8 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `slice` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 16 - column: 0 - end_location: - row: 17 - column: 8 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `ValueError` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 21 - column: 0 - end_location: - row: 22 - column: 7 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `memoryview` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 24 - column: 4 - end_location: - row: 24 - column: 14 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `bytearray` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 24 - column: 17 - end_location: - row: 24 - column: 26 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `str` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 27 - column: 21 - end_location: - row: 27 - column: 24 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `all` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 27 - column: 44 - end_location: - row: 27 - column: 47 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `any` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 27 - column: 49 - end_location: - row: 27 - column: 52 - fix: ~ - parent: ~ -- kind: - name: BuiltinVariableShadowing - body: "Variable `sum` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 30 - column: 7 - end_location: - row: 30 - column: 10 - fix: ~ - parent: ~ +- - kind: + name: BuiltinVariableShadowing + body: "Variable `sum` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 18 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `int` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 29 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `print` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 5 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `copyright` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 9 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `complex` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 7 + column: 1 + end_location: + row: 7 + column: 8 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `float` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 5 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `object` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 8 + column: 8 + end_location: + row: 8 + column: 14 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `min` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 3 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `max` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 9 + column: 5 + end_location: + row: 9 + column: 8 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `bytes` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 14 + column: 8 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `slice` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 16 + column: 0 + end_location: + row: 17 + column: 8 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `ValueError` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 21 + column: 0 + end_location: + row: 22 + column: 7 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `memoryview` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 24 + column: 4 + end_location: + row: 24 + column: 14 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `bytearray` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 24 + column: 17 + end_location: + row: 24 + column: 26 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `str` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 27 + column: 21 + end_location: + row: 27 + column: 24 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `all` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 27 + column: 44 + end_location: + row: 27 + column: 47 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `any` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 27 + column: 49 + end_location: + row: 27 + column: 52 + fix: ~ + parent: ~ + - kind: + name: BuiltinVariableShadowing + body: "Variable `sum` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 30 + column: 7 + end_location: + row: 30 + column: 10 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py.snap index 4a89c5e360d979..c1bed9aa7f2971 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py.snap @@ -2,121 +2,121 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs expression: diagnostics --- -- kind: - name: BuiltinArgumentShadowing - body: "Argument `str` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 1 - column: 10 - end_location: - row: 1 - column: 13 - fix: ~ - parent: ~ -- kind: - name: BuiltinArgumentShadowing - body: "Argument `type` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 1 - column: 18 - end_location: - row: 1 - column: 22 - fix: ~ - parent: ~ -- kind: - name: BuiltinArgumentShadowing - body: "Argument `complex` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 1 - column: 25 - end_location: - row: 1 - column: 32 - fix: ~ - parent: ~ -- kind: - name: BuiltinArgumentShadowing - body: "Argument `Exception` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 1 - column: 34 - end_location: - row: 1 - column: 43 - fix: ~ - parent: ~ -- kind: - name: BuiltinArgumentShadowing - body: "Argument `getattr` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 1 - column: 47 - end_location: - row: 1 - column: 54 - fix: ~ - parent: ~ -- kind: - name: BuiltinArgumentShadowing - body: "Argument `bytes` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 5 - column: 16 - end_location: - row: 5 - column: 21 - fix: ~ - parent: ~ -- kind: - name: BuiltinArgumentShadowing - body: "Argument `id` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 8 - column: 16 - end_location: - row: 8 - column: 18 - fix: ~ - parent: ~ -- kind: - name: BuiltinArgumentShadowing - body: "Argument `dir` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 8 - column: 20 - end_location: - row: 8 - column: 23 - fix: ~ - parent: ~ -- kind: - name: BuiltinArgumentShadowing - body: "Argument `float` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 11 - column: 15 - end_location: - row: 11 - column: 20 - fix: ~ - parent: ~ +- - kind: + name: BuiltinArgumentShadowing + body: "Argument `str` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 1 + column: 10 + end_location: + row: 1 + column: 13 + fix: ~ + parent: ~ + - kind: + name: BuiltinArgumentShadowing + body: "Argument `type` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 1 + column: 18 + end_location: + row: 1 + column: 22 + fix: ~ + parent: ~ + - kind: + name: BuiltinArgumentShadowing + body: "Argument `complex` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 1 + column: 25 + end_location: + row: 1 + column: 32 + fix: ~ + parent: ~ + - kind: + name: BuiltinArgumentShadowing + body: "Argument `Exception` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 1 + column: 34 + end_location: + row: 1 + column: 43 + fix: ~ + parent: ~ + - kind: + name: BuiltinArgumentShadowing + body: "Argument `getattr` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 1 + column: 47 + end_location: + row: 1 + column: 54 + fix: ~ + parent: ~ + - kind: + name: BuiltinArgumentShadowing + body: "Argument `bytes` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 5 + column: 16 + end_location: + row: 5 + column: 21 + fix: ~ + parent: ~ + - kind: + name: BuiltinArgumentShadowing + body: "Argument `id` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 8 + column: 16 + end_location: + row: 8 + column: 18 + fix: ~ + parent: ~ + - kind: + name: BuiltinArgumentShadowing + body: "Argument `dir` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 8 + column: 20 + end_location: + row: 8 + column: 23 + fix: ~ + parent: ~ + - kind: + name: BuiltinArgumentShadowing + body: "Argument `float` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 11 + column: 15 + end_location: + row: 11 + column: 20 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py_builtins_ignorelist.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py_builtins_ignorelist.snap index 55015f60e20d00..a19bb999465864 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py_builtins_ignorelist.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py_builtins_ignorelist.snap @@ -2,95 +2,95 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs expression: diagnostics --- -- kind: - name: BuiltinArgumentShadowing - body: "Argument `str` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 1 - column: 10 - end_location: - row: 1 - column: 13 - fix: ~ - parent: ~ -- kind: - name: BuiltinArgumentShadowing - body: "Argument `type` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 1 - column: 18 - end_location: - row: 1 - column: 22 - fix: ~ - parent: ~ -- kind: - name: BuiltinArgumentShadowing - body: "Argument `complex` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 1 - column: 25 - end_location: - row: 1 - column: 32 - fix: ~ - parent: ~ -- kind: - name: BuiltinArgumentShadowing - body: "Argument `Exception` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 1 - column: 34 - end_location: - row: 1 - column: 43 - fix: ~ - parent: ~ -- kind: - name: BuiltinArgumentShadowing - body: "Argument `getattr` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 1 - column: 47 - end_location: - row: 1 - column: 54 - fix: ~ - parent: ~ -- kind: - name: BuiltinArgumentShadowing - body: "Argument `bytes` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 5 - column: 16 - end_location: - row: 5 - column: 21 - fix: ~ - parent: ~ -- kind: - name: BuiltinArgumentShadowing - body: "Argument `float` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 11 - column: 15 - end_location: - row: 11 - column: 20 - fix: ~ - parent: ~ +- - kind: + name: BuiltinArgumentShadowing + body: "Argument `str` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 1 + column: 10 + end_location: + row: 1 + column: 13 + fix: ~ + parent: ~ + - kind: + name: BuiltinArgumentShadowing + body: "Argument `type` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 1 + column: 18 + end_location: + row: 1 + column: 22 + fix: ~ + parent: ~ + - kind: + name: BuiltinArgumentShadowing + body: "Argument `complex` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 1 + column: 25 + end_location: + row: 1 + column: 32 + fix: ~ + parent: ~ + - kind: + name: BuiltinArgumentShadowing + body: "Argument `Exception` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 1 + column: 34 + end_location: + row: 1 + column: 43 + fix: ~ + parent: ~ + - kind: + name: BuiltinArgumentShadowing + body: "Argument `getattr` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 1 + column: 47 + end_location: + row: 1 + column: 54 + fix: ~ + parent: ~ + - kind: + name: BuiltinArgumentShadowing + body: "Argument `bytes` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 5 + column: 16 + end_location: + row: 5 + column: 21 + fix: ~ + parent: ~ + - kind: + name: BuiltinArgumentShadowing + body: "Argument `float` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 11 + column: 15 + end_location: + row: 11 + column: 20 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py.snap index c6a519258bedef..0417661304c8b8 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs expression: diagnostics --- -- kind: - name: BuiltinAttributeShadowing - body: "Class attribute `ImportError` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 15 - fix: ~ - parent: ~ -- kind: - name: BuiltinAttributeShadowing - body: "Class attribute `id` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 6 - fix: ~ - parent: ~ -- kind: - name: BuiltinAttributeShadowing - body: "Class attribute `dir` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 7 - fix: ~ - parent: ~ -- kind: - name: BuiltinAttributeShadowing - body: "Class attribute `str` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 11 - column: 4 - end_location: - row: 12 - column: 12 - fix: ~ - parent: ~ +- - kind: + name: BuiltinAttributeShadowing + body: "Class attribute `ImportError` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 15 + fix: ~ + parent: ~ + - kind: + name: BuiltinAttributeShadowing + body: "Class attribute `id` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 6 + fix: ~ + parent: ~ + - kind: + name: BuiltinAttributeShadowing + body: "Class attribute `dir` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 7 + fix: ~ + parent: ~ + - kind: + name: BuiltinAttributeShadowing + body: "Class attribute `str` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 11 + column: 4 + end_location: + row: 12 + column: 12 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py_builtins_ignorelist.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py_builtins_ignorelist.snap index 9e104005e9a05f..6412e9e9a12b4f 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py_builtins_ignorelist.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py_builtins_ignorelist.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs expression: diagnostics --- -- kind: - name: BuiltinAttributeShadowing - body: "Class attribute `ImportError` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 15 - fix: ~ - parent: ~ -- kind: - name: BuiltinAttributeShadowing - body: "Class attribute `str` is shadowing a python builtin" - suggestion: ~ - fixable: false - location: - row: 11 - column: 4 - end_location: - row: 12 - column: 12 - fix: ~ - parent: ~ +- - kind: + name: BuiltinAttributeShadowing + body: "Class attribute `ImportError` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 15 + fix: ~ + parent: ~ + - kind: + name: BuiltinAttributeShadowing + body: "Class attribute `str` is shadowing a python builtin" + suggestion: ~ + fixable: false + location: + row: 11 + column: 4 + end_location: + row: 12 + column: 12 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_commas/snapshots/ruff__rules__flake8_commas__tests__COM81.py.snap b/crates/ruff/src/rules/flake8_commas/snapshots/ruff__rules__flake8_commas__tests__COM81.py.snap index 13fac3667eb6c6..f7861cd67a1734 100644 --- a/crates/ruff/src/rules/flake8_commas/snapshots/ruff__rules__flake8_commas__tests__COM81.py.snap +++ b/crates/ruff/src/rules/flake8_commas/snapshots/ruff__rules__flake8_commas__tests__COM81.py.snap @@ -2,955 +2,955 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs expression: diagnostics --- -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 4 - column: 17 - end_location: - row: 4 - column: 17 - fix: - content: "'test'," +- - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 4 - column: 11 + column: 17 end_location: row: 4 column: 17 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 10 - column: 5 - end_location: - row: 10 - column: 5 - fix: - content: "3," + fix: + content: "'test'," + location: + row: 4 + column: 11 + end_location: + row: 4 + column: 17 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 10 - column: 4 + column: 5 end_location: row: 10 column: 5 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 16 - column: 5 - end_location: - row: 16 - column: 5 - fix: - content: "3," + fix: + content: "3," + location: + row: 10 + column: 4 + end_location: + row: 10 + column: 5 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 16 - column: 4 + column: 5 end_location: row: 16 column: 5 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 23 - column: 5 - end_location: - row: 23 - column: 5 - fix: - content: "3," + fix: + content: "3," + location: + row: 16 + column: 4 + end_location: + row: 16 + column: 5 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 23 - column: 4 + column: 5 end_location: row: 23 column: 5 - parent: ~ -- kind: - name: TrailingCommaOnBareTupleProhibited - body: Trailing comma on bare tuple prohibited - suggestion: ~ - fixable: false - location: - row: 36 - column: 7 - end_location: - row: 36 - column: 8 - fix: ~ - parent: ~ -- kind: - name: TrailingCommaOnBareTupleProhibited - body: Trailing comma on bare tuple prohibited - suggestion: ~ - fixable: false - location: - row: 38 - column: 18 - end_location: - row: 38 - column: 19 - fix: ~ - parent: ~ -- kind: - name: TrailingCommaOnBareTupleProhibited - body: Trailing comma on bare tuple prohibited - suggestion: ~ - fixable: false - location: - row: 45 - column: 7 - end_location: - row: 45 - column: 8 - fix: ~ - parent: ~ -- kind: - name: TrailingCommaOnBareTupleProhibited - body: Trailing comma on bare tuple prohibited - suggestion: ~ - fixable: false - location: - row: 49 - column: 9 - end_location: - row: 49 - column: 10 - fix: ~ - parent: ~ -- kind: - name: TrailingCommaOnBareTupleProhibited - body: Trailing comma on bare tuple prohibited - suggestion: ~ - fixable: false - location: - row: 56 - column: 31 - end_location: - row: 56 - column: 32 - fix: ~ - parent: ~ -- kind: - name: TrailingCommaOnBareTupleProhibited - body: Trailing comma on bare tuple prohibited - suggestion: ~ - fixable: false - location: - row: 58 - column: 25 - end_location: - row: 58 - column: 26 - fix: ~ - parent: ~ -- kind: - name: TrailingCommaOnBareTupleProhibited - body: Trailing comma on bare tuple prohibited - suggestion: ~ - fixable: false - location: - row: 61 - column: 16 - end_location: - row: 61 - column: 17 - fix: ~ - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 70 - column: 7 - end_location: - row: 70 - column: 7 - fix: - content: "bar," + fix: + content: "3," + location: + row: 23 + column: 4 + end_location: + row: 23 + column: 5 + parent: ~ + - kind: + name: TrailingCommaOnBareTupleProhibited + body: Trailing comma on bare tuple prohibited + suggestion: ~ + fixable: false + location: + row: 36 + column: 7 + end_location: + row: 36 + column: 8 + fix: ~ + parent: ~ + - kind: + name: TrailingCommaOnBareTupleProhibited + body: Trailing comma on bare tuple prohibited + suggestion: ~ + fixable: false + location: + row: 38 + column: 18 + end_location: + row: 38 + column: 19 + fix: ~ + parent: ~ + - kind: + name: TrailingCommaOnBareTupleProhibited + body: Trailing comma on bare tuple prohibited + suggestion: ~ + fixable: false + location: + row: 45 + column: 7 + end_location: + row: 45 + column: 8 + fix: ~ + parent: ~ + - kind: + name: TrailingCommaOnBareTupleProhibited + body: Trailing comma on bare tuple prohibited + suggestion: ~ + fixable: false + location: + row: 49 + column: 9 + end_location: + row: 49 + column: 10 + fix: ~ + parent: ~ + - kind: + name: TrailingCommaOnBareTupleProhibited + body: Trailing comma on bare tuple prohibited + suggestion: ~ + fixable: false + location: + row: 56 + column: 31 + end_location: + row: 56 + column: 32 + fix: ~ + parent: ~ + - kind: + name: TrailingCommaOnBareTupleProhibited + body: Trailing comma on bare tuple prohibited + suggestion: ~ + fixable: false + location: + row: 58 + column: 25 + end_location: + row: 58 + column: 26 + fix: ~ + parent: ~ + - kind: + name: TrailingCommaOnBareTupleProhibited + body: Trailing comma on bare tuple prohibited + suggestion: ~ + fixable: false + location: + row: 61 + column: 16 + end_location: + row: 61 + column: 17 + fix: ~ + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 70 - column: 4 + column: 7 end_location: row: 70 column: 7 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 78 - column: 7 - end_location: - row: 78 - column: 7 - fix: - content: "bar," + fix: + content: "bar," + location: + row: 70 + column: 4 + end_location: + row: 70 + column: 7 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 78 - column: 4 + column: 7 end_location: row: 78 column: 7 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 86 - column: 7 - end_location: - row: 86 - column: 7 - fix: - content: "bar," + fix: + content: "bar," + location: + row: 78 + column: 4 + end_location: + row: 78 + column: 7 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 86 - column: 4 + column: 7 end_location: row: 86 column: 7 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 152 - column: 5 - end_location: - row: 152 - column: 5 - fix: - content: "y," + fix: + content: "bar," + location: + row: 86 + column: 4 + end_location: + row: 86 + column: 7 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 152 - column: 4 + column: 5 end_location: row: 152 column: 5 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 158 - column: 10 - end_location: - row: 158 - column: 10 - fix: - content: "Anyway," + fix: + content: "y," + location: + row: 152 + column: 4 + end_location: + row: 152 + column: 5 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 158 - column: 4 + column: 10 end_location: row: 158 column: 10 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 293 - column: 14 - end_location: - row: 293 - column: 14 - fix: - content: "123," + fix: + content: "Anyway," + location: + row: 158 + column: 4 + end_location: + row: 158 + column: 10 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 293 - column: 11 + column: 14 end_location: row: 293 column: 14 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 304 - column: 13 - end_location: - row: 304 - column: 13 - fix: - content: "2," + fix: + content: "123," + location: + row: 293 + column: 11 + end_location: + row: 293 + column: 14 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 304 - column: 12 + column: 13 end_location: row: 304 column: 13 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 310 - column: 13 - end_location: - row: 310 - column: 13 - fix: - content: "3," + fix: + content: "2," + location: + row: 304 + column: 12 + end_location: + row: 304 + column: 13 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 310 - column: 12 + column: 13 end_location: row: 310 column: 13 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 316 - column: 9 - end_location: - row: 316 - column: 9 - fix: - content: "3," + fix: + content: "3," + location: + row: 310 + column: 12 + end_location: + row: 310 + column: 13 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 316 - column: 8 + column: 9 end_location: row: 316 column: 9 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 322 - column: 14 - end_location: - row: 322 - column: 14 - fix: - content: "123," + fix: + content: "3," + location: + row: 316 + column: 8 + end_location: + row: 316 + column: 9 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 322 - column: 11 + column: 14 end_location: row: 322 column: 14 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 368 - column: 14 - end_location: - row: 368 - column: 14 - fix: - content: "\"not good\"," + fix: + content: "123," + location: + row: 322 + column: 11 + end_location: + row: 322 + column: 14 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 368 - column: 4 + column: 14 end_location: row: 368 column: 14 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 375 - column: 14 - end_location: - row: 375 - column: 14 - fix: - content: "\"not good\"," + fix: + content: "\"not good\"," + location: + row: 368 + column: 4 + end_location: + row: 368 + column: 14 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 375 - column: 4 + column: 14 end_location: row: 375 column: 14 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 404 - column: 14 - end_location: - row: 404 - column: 14 - fix: - content: "\"not fine\"," + fix: + content: "\"not good\"," + location: + row: 375 + column: 4 + end_location: + row: 375 + column: 14 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 404 - column: 4 + column: 14 end_location: row: 404 column: 14 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 432 - column: 14 - end_location: - row: 432 - column: 14 - fix: - content: "\"not fine\"," + fix: + content: "\"not fine\"," + location: + row: 404 + column: 4 + end_location: + row: 404 + column: 14 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 432 - column: 4 + column: 14 end_location: row: 432 column: 14 - parent: ~ -- kind: - name: TrailingCommaProhibited - body: Trailing comma prohibited - suggestion: Remove trailing comma - fixable: true - location: - row: 485 - column: 20 - end_location: - row: 485 - column: 21 - fix: - content: "" + fix: + content: "\"not fine\"," + location: + row: 432 + column: 4 + end_location: + row: 432 + column: 14 + parent: ~ + - kind: + name: TrailingCommaProhibited + body: Trailing comma prohibited + suggestion: Remove trailing comma + fixable: true location: row: 485 column: 20 end_location: row: 485 column: 21 - parent: ~ -- kind: - name: TrailingCommaProhibited - body: Trailing comma prohibited - suggestion: Remove trailing comma - fixable: true - location: - row: 487 - column: 12 - end_location: - row: 487 - column: 13 - fix: - content: "" + fix: + content: "" + location: + row: 485 + column: 20 + end_location: + row: 485 + column: 21 + parent: ~ + - kind: + name: TrailingCommaProhibited + body: Trailing comma prohibited + suggestion: Remove trailing comma + fixable: true location: row: 487 column: 12 end_location: row: 487 column: 13 - parent: ~ -- kind: - name: TrailingCommaProhibited - body: Trailing comma prohibited - suggestion: Remove trailing comma - fixable: true - location: - row: 489 - column: 17 - end_location: - row: 489 - column: 18 - fix: - content: "" + fix: + content: "" + location: + row: 487 + column: 12 + end_location: + row: 487 + column: 13 + parent: ~ + - kind: + name: TrailingCommaProhibited + body: Trailing comma prohibited + suggestion: Remove trailing comma + fixable: true location: row: 489 column: 17 end_location: row: 489 column: 18 - parent: ~ -- kind: - name: TrailingCommaProhibited - body: Trailing comma prohibited - suggestion: Remove trailing comma - fixable: true - location: - row: 494 - column: 5 - end_location: - row: 494 - column: 6 - fix: - content: "" + fix: + content: "" + location: + row: 489 + column: 17 + end_location: + row: 489 + column: 18 + parent: ~ + - kind: + name: TrailingCommaProhibited + body: Trailing comma prohibited + suggestion: Remove trailing comma + fixable: true location: row: 494 column: 5 end_location: row: 494 column: 6 - parent: ~ -- kind: - name: TrailingCommaProhibited - body: Trailing comma prohibited - suggestion: Remove trailing comma - fixable: true - location: - row: 496 - column: 20 - end_location: - row: 496 - column: 21 - fix: - content: "" + fix: + content: "" + location: + row: 494 + column: 5 + end_location: + row: 494 + column: 6 + parent: ~ + - kind: + name: TrailingCommaProhibited + body: Trailing comma prohibited + suggestion: Remove trailing comma + fixable: true location: row: 496 column: 20 end_location: row: 496 column: 21 - parent: ~ -- kind: - name: TrailingCommaProhibited - body: Trailing comma prohibited - suggestion: Remove trailing comma - fixable: true - location: - row: 498 - column: 12 - end_location: - row: 498 - column: 13 - fix: - content: "" + fix: + content: "" + location: + row: 496 + column: 20 + end_location: + row: 496 + column: 21 + parent: ~ + - kind: + name: TrailingCommaProhibited + body: Trailing comma prohibited + suggestion: Remove trailing comma + fixable: true location: row: 498 column: 12 end_location: row: 498 column: 13 - parent: ~ -- kind: - name: TrailingCommaProhibited - body: Trailing comma prohibited - suggestion: Remove trailing comma - fixable: true - location: - row: 500 - column: 17 - end_location: - row: 500 - column: 18 - fix: - content: "" + fix: + content: "" + location: + row: 498 + column: 12 + end_location: + row: 498 + column: 13 + parent: ~ + - kind: + name: TrailingCommaProhibited + body: Trailing comma prohibited + suggestion: Remove trailing comma + fixable: true location: row: 500 column: 17 end_location: row: 500 column: 18 - parent: ~ -- kind: - name: TrailingCommaProhibited - body: Trailing comma prohibited - suggestion: Remove trailing comma - fixable: true - location: - row: 505 - column: 5 - end_location: - row: 505 - column: 6 - fix: - content: "" + fix: + content: "" + location: + row: 500 + column: 17 + end_location: + row: 500 + column: 18 + parent: ~ + - kind: + name: TrailingCommaProhibited + body: Trailing comma prohibited + suggestion: Remove trailing comma + fixable: true location: row: 505 column: 5 end_location: row: 505 column: 6 - parent: ~ -- kind: - name: TrailingCommaProhibited - body: Trailing comma prohibited - suggestion: Remove trailing comma - fixable: true - location: - row: 511 - column: 9 - end_location: - row: 511 - column: 10 - fix: - content: "" + fix: + content: "" + location: + row: 505 + column: 5 + end_location: + row: 505 + column: 6 + parent: ~ + - kind: + name: TrailingCommaProhibited + body: Trailing comma prohibited + suggestion: Remove trailing comma + fixable: true location: row: 511 column: 9 end_location: row: 511 column: 10 - parent: ~ -- kind: - name: TrailingCommaProhibited - body: Trailing comma prohibited - suggestion: Remove trailing comma - fixable: true - location: - row: 513 - column: 8 - end_location: - row: 513 - column: 9 - fix: - content: "" + fix: + content: "" + location: + row: 511 + column: 9 + end_location: + row: 511 + column: 10 + parent: ~ + - kind: + name: TrailingCommaProhibited + body: Trailing comma prohibited + suggestion: Remove trailing comma + fixable: true location: row: 513 column: 8 end_location: row: 513 column: 9 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 519 - column: 12 - end_location: - row: 519 - column: 12 - fix: - content: "kwargs," + fix: + content: "" + location: + row: 513 + column: 8 + end_location: + row: 513 + column: 9 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 519 - column: 6 + column: 12 end_location: row: 519 column: 12 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 526 - column: 9 - end_location: - row: 526 - column: 9 - fix: - content: "args," + fix: + content: "kwargs," + location: + row: 519 + column: 6 + end_location: + row: 519 + column: 12 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 526 - column: 5 + column: 9 end_location: row: 526 column: 9 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 534 - column: 15 - end_location: - row: 534 - column: 15 - fix: - content: "extra_kwarg," + fix: + content: "args," + location: + row: 526 + column: 5 + end_location: + row: 526 + column: 9 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 534 - column: 4 + column: 15 end_location: row: 534 column: 15 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 541 - column: 12 - end_location: - row: 541 - column: 12 - fix: - content: "kwargs," + fix: + content: "extra_kwarg," + location: + row: 534 + column: 4 + end_location: + row: 534 + column: 15 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 541 - column: 6 + column: 12 end_location: row: 541 column: 12 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 547 - column: 23 - end_location: - row: 547 - column: 23 - fix: - content: "not_called_kwargs," + fix: + content: "kwargs," + location: + row: 541 + column: 6 + end_location: + row: 541 + column: 12 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 547 - column: 6 + column: 23 end_location: row: 547 column: 23 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 554 - column: 14 - end_location: - row: 554 - column: 14 - fix: - content: "kwarg_only," + fix: + content: "not_called_kwargs," + location: + row: 547 + column: 6 + end_location: + row: 547 + column: 23 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 554 - column: 4 + column: 14 end_location: row: 554 column: 14 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 561 - column: 12 - end_location: - row: 561 - column: 12 - fix: - content: "kwargs," + fix: + content: "kwarg_only," + location: + row: 554 + column: 4 + end_location: + row: 554 + column: 14 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 561 - column: 6 + column: 12 end_location: row: 561 column: 12 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 565 - column: 12 - end_location: - row: 565 - column: 12 - fix: - content: "kwargs," + fix: + content: "kwargs," + location: + row: 561 + column: 6 + end_location: + row: 561 + column: 12 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 565 - column: 6 + column: 12 end_location: row: 565 column: 12 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 573 - column: 9 - end_location: - row: 573 - column: 9 - fix: - content: "args," + fix: + content: "kwargs," + location: + row: 565 + column: 6 + end_location: + row: 565 + column: 12 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 573 - column: 5 + column: 9 end_location: row: 573 column: 9 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 577 - column: 9 - end_location: - row: 577 - column: 9 - fix: - content: "args," + fix: + content: "args," + location: + row: 573 + column: 5 + end_location: + row: 573 + column: 9 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 577 - column: 5 + column: 9 end_location: row: 577 column: 9 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 583 - column: 9 - end_location: - row: 583 - column: 9 - fix: - content: "args," + fix: + content: "args," + location: + row: 577 + column: 5 + end_location: + row: 577 + column: 9 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 583 - column: 5 + column: 9 end_location: row: 583 column: 9 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 590 - column: 12 - end_location: - row: 590 - column: 12 - fix: - content: "kwargs," + fix: + content: "args," + location: + row: 583 + column: 5 + end_location: + row: 583 + column: 9 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 590 - column: 6 + column: 12 end_location: row: 590 column: 12 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 598 - column: 14 - end_location: - row: 598 - column: 14 - fix: - content: "kwarg_only," + fix: + content: "kwargs," + location: + row: 590 + column: 6 + end_location: + row: 590 + column: 12 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 598 - column: 4 + column: 14 end_location: row: 598 column: 14 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 627 - column: 19 - end_location: - row: 627 - column: 19 - fix: - content: "}," + fix: + content: "kwarg_only," + location: + row: 598 + column: 4 + end_location: + row: 598 + column: 14 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 627 - column: 18 + column: 19 end_location: row: 627 column: 19 - parent: ~ -- kind: - name: TrailingCommaMissing - body: Trailing comma missing - suggestion: Add trailing comma - fixable: true - location: - row: 632 - column: 41 - end_location: - row: 632 - column: 41 - fix: - content: ")," + fix: + content: "}," + location: + row: 627 + column: 18 + end_location: + row: 627 + column: 19 + parent: ~ + - kind: + name: TrailingCommaMissing + body: Trailing comma missing + suggestion: Add trailing comma + fixable: true location: row: 632 - column: 40 + column: 41 end_location: row: 632 column: 41 - parent: ~ + fix: + content: ")," + location: + row: 632 + column: 40 + end_location: + row: 632 + column: 41 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C400_C400.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C400_C400.py.snap index cf32bd5e13e677..5d3fd99fe45ae8 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C400_C400.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C400_C400.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryGeneratorList - body: "Unnecessary generator (rewrite as a `list` comprehension)" - suggestion: "Rewrite as a `list` comprehension" - fixable: true - location: - row: 1 - column: 4 - end_location: - row: 1 - column: 29 - fix: - content: "[x for x in range(3)]" +- - kind: + name: UnnecessaryGeneratorList + body: "Unnecessary generator (rewrite as a `list` comprehension)" + suggestion: "Rewrite as a `list` comprehension" + fixable: true location: row: 1 column: 4 end_location: row: 1 column: 29 - parent: ~ -- kind: - name: UnnecessaryGeneratorList - body: "Unnecessary generator (rewrite as a `list` comprehension)" - suggestion: "Rewrite as a `list` comprehension" - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 4 - column: 1 - fix: - content: "[\n x for x in range(3)\n]" + fix: + content: "[x for x in range(3)]" + location: + row: 1 + column: 4 + end_location: + row: 1 + column: 29 + parent: ~ + - kind: + name: UnnecessaryGeneratorList + body: "Unnecessary generator (rewrite as a `list` comprehension)" + suggestion: "Rewrite as a `list` comprehension" + fixable: true location: row: 2 column: 4 end_location: row: 4 column: 1 - parent: ~ + fix: + content: "[\n x for x in range(3)\n]" + location: + row: 2 + column: 4 + end_location: + row: 4 + column: 1 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C401_C401.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C401_C401.py.snap index b7db1be95efaac..520c15b10ca51d 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C401_C401.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C401_C401.py.snap @@ -2,104 +2,104 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryGeneratorSet - body: "Unnecessary generator (rewrite as a `set` comprehension)" - suggestion: "Rewrite as a `set` comprehension" - fixable: true - location: - row: 1 - column: 4 - end_location: - row: 1 - column: 28 - fix: - content: "{x for x in range(3)}" +- - kind: + name: UnnecessaryGeneratorSet + body: "Unnecessary generator (rewrite as a `set` comprehension)" + suggestion: "Rewrite as a `set` comprehension" + fixable: true location: row: 1 column: 4 end_location: row: 1 column: 28 - parent: ~ -- kind: - name: UnnecessaryGeneratorSet - body: "Unnecessary generator (rewrite as a `set` comprehension)" - suggestion: "Rewrite as a `set` comprehension" - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 4 - column: 1 - fix: - content: "{\n x for x in range(3)\n}" + fix: + content: "{x for x in range(3)}" + location: + row: 1 + column: 4 + end_location: + row: 1 + column: 28 + parent: ~ + - kind: + name: UnnecessaryGeneratorSet + body: "Unnecessary generator (rewrite as a `set` comprehension)" + suggestion: "Rewrite as a `set` comprehension" + fixable: true location: row: 2 column: 4 end_location: row: 4 column: 1 - parent: ~ -- kind: - name: UnnecessaryGeneratorSet - body: "Unnecessary generator (rewrite as a `set` comprehension)" - suggestion: "Rewrite as a `set` comprehension" - fixable: true - location: - row: 5 - column: 7 - end_location: - row: 5 - column: 48 - fix: - content: " {a if a < 6 else 0 for a in range(3)} " + fix: + content: "{\n x for x in range(3)\n}" + location: + row: 2 + column: 4 + end_location: + row: 4 + column: 1 + parent: ~ + - kind: + name: UnnecessaryGeneratorSet + body: "Unnecessary generator (rewrite as a `set` comprehension)" + suggestion: "Rewrite as a `set` comprehension" + fixable: true location: row: 5 column: 7 end_location: row: 5 column: 48 - parent: ~ -- kind: - name: UnnecessaryGeneratorSet - body: "Unnecessary generator (rewrite as a `set` comprehension)" - suggestion: "Rewrite as a `set` comprehension" - fixable: true - location: - row: 6 - column: 16 - end_location: - row: 6 - column: 57 - fix: - content: "{a if a < 6 else 0 for a in range(3)}" + fix: + content: " {a if a < 6 else 0 for a in range(3)} " + location: + row: 5 + column: 7 + end_location: + row: 5 + column: 48 + parent: ~ + - kind: + name: UnnecessaryGeneratorSet + body: "Unnecessary generator (rewrite as a `set` comprehension)" + suggestion: "Rewrite as a `set` comprehension" + fixable: true location: row: 6 column: 16 end_location: row: 6 column: 57 - parent: ~ -- kind: - name: UnnecessaryGeneratorSet - body: "Unnecessary generator (rewrite as a `set` comprehension)" - suggestion: "Rewrite as a `set` comprehension" - fixable: true - location: - row: 7 - column: 15 - end_location: - row: 7 - column: 39 - fix: - content: " {a for a in range(3)} " + fix: + content: "{a if a < 6 else 0 for a in range(3)}" + location: + row: 6 + column: 16 + end_location: + row: 6 + column: 57 + parent: ~ + - kind: + name: UnnecessaryGeneratorSet + body: "Unnecessary generator (rewrite as a `set` comprehension)" + suggestion: "Rewrite as a `set` comprehension" + fixable: true location: row: 7 column: 15 end_location: row: 7 column: 39 - parent: ~ + fix: + content: " {a for a in range(3)} " + location: + row: 7 + column: 15 + end_location: + row: 7 + column: 39 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C402_C402.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C402_C402.py.snap index 84c336712bc760..03e09c5901aa78 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C402_C402.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C402_C402.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryGeneratorDict - body: "Unnecessary generator (rewrite as a `dict` comprehension)" - suggestion: "Rewrite as a `dict` comprehension" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 30 - fix: - content: "{x: x for x in range(3)}" +- - kind: + name: UnnecessaryGeneratorDict + body: "Unnecessary generator (rewrite as a `dict` comprehension)" + suggestion: "Rewrite as a `dict` comprehension" + fixable: true location: row: 1 column: 0 end_location: row: 1 column: 30 - parent: ~ -- kind: - name: UnnecessaryGeneratorDict - body: "Unnecessary generator (rewrite as a `dict` comprehension)" - suggestion: "Rewrite as a `dict` comprehension" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 4 - column: 1 - fix: - content: "{\n x: x for x in range(3)\n}" + fix: + content: "{x: x for x in range(3)}" + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 30 + parent: ~ + - kind: + name: UnnecessaryGeneratorDict + body: "Unnecessary generator (rewrite as a `dict` comprehension)" + suggestion: "Rewrite as a `dict` comprehension" + fixable: true location: row: 2 column: 0 end_location: row: 4 column: 1 - parent: ~ -- kind: - name: UnnecessaryGeneratorDict - body: "Unnecessary generator (rewrite as a `dict` comprehension)" - suggestion: "Rewrite as a `dict` comprehension" - fixable: true - location: - row: 6 - column: 7 - end_location: - row: 6 - column: 37 - fix: - content: " {x: x for x in range(3)} " + fix: + content: "{\n x: x for x in range(3)\n}" + location: + row: 2 + column: 0 + end_location: + row: 4 + column: 1 + parent: ~ + - kind: + name: UnnecessaryGeneratorDict + body: "Unnecessary generator (rewrite as a `dict` comprehension)" + suggestion: "Rewrite as a `dict` comprehension" + fixable: true location: row: 6 column: 7 end_location: row: 6 column: 37 - parent: ~ -- kind: - name: UnnecessaryGeneratorDict - body: "Unnecessary generator (rewrite as a `dict` comprehension)" - suggestion: "Rewrite as a `dict` comprehension" - fixable: true - location: - row: 7 - column: 15 - end_location: - row: 7 - column: 45 - fix: - content: " {x: x for x in range(3)} " + fix: + content: " {x: x for x in range(3)} " + location: + row: 6 + column: 7 + end_location: + row: 6 + column: 37 + parent: ~ + - kind: + name: UnnecessaryGeneratorDict + body: "Unnecessary generator (rewrite as a `dict` comprehension)" + suggestion: "Rewrite as a `dict` comprehension" + fixable: true location: row: 7 column: 15 end_location: row: 7 column: 45 - parent: ~ + fix: + content: " {x: x for x in range(3)} " + location: + row: 7 + column: 15 + end_location: + row: 7 + column: 45 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C403_C403.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C403_C403.py.snap index a39ed25045ef07..4e8ceb41c9c57a 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C403_C403.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C403_C403.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryListComprehensionSet - body: "Unnecessary `list` comprehension (rewrite as a `set` comprehension)" - suggestion: "Rewrite as a `set` comprehension" - fixable: true - location: - row: 1 - column: 4 - end_location: - row: 1 - column: 30 - fix: - content: "{x for x in range(3)}" +- - kind: + name: UnnecessaryListComprehensionSet + body: "Unnecessary `list` comprehension (rewrite as a `set` comprehension)" + suggestion: "Rewrite as a `set` comprehension" + fixable: true location: row: 1 column: 4 end_location: row: 1 column: 30 - parent: ~ -- kind: - name: UnnecessaryListComprehensionSet - body: "Unnecessary `list` comprehension (rewrite as a `set` comprehension)" - suggestion: "Rewrite as a `set` comprehension" - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 4 - column: 1 - fix: - content: "{\n x for x in range(3)\n}" + fix: + content: "{x for x in range(3)}" + location: + row: 1 + column: 4 + end_location: + row: 1 + column: 30 + parent: ~ + - kind: + name: UnnecessaryListComprehensionSet + body: "Unnecessary `list` comprehension (rewrite as a `set` comprehension)" + suggestion: "Rewrite as a `set` comprehension" + fixable: true location: row: 2 column: 4 end_location: row: 4 column: 1 - parent: ~ + fix: + content: "{\n x for x in range(3)\n}" + location: + row: 2 + column: 4 + end_location: + row: 4 + column: 1 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C404_C404.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C404_C404.py.snap index 536493cb5dc7df..c5c4501a7047cc 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C404_C404.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C404_C404.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryListComprehensionDict - body: "Unnecessary `list` comprehension (rewrite as a `dict` comprehension)" - suggestion: "Rewrite as a `dict` comprehension" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 32 - fix: - content: "{i: i for i in range(3)}" +- - kind: + name: UnnecessaryListComprehensionDict + body: "Unnecessary `list` comprehension (rewrite as a `dict` comprehension)" + suggestion: "Rewrite as a `dict` comprehension" + fixable: true location: row: 1 column: 0 end_location: row: 1 column: 32 - parent: ~ + fix: + content: "{i: i for i in range(3)}" + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 32 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C405_C405.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C405_C405.py.snap index f4ce11b013846b..88c3807993e071 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C405_C405.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C405_C405.py.snap @@ -2,184 +2,184 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryLiteralSet - body: "Unnecessary `list` literal (rewrite as a `set` literal)" - suggestion: "Rewrite as a `set` literal" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 11 - fix: - content: "{1, 2}" +- - kind: + name: UnnecessaryLiteralSet + body: "Unnecessary `list` literal (rewrite as a `set` literal)" + suggestion: "Rewrite as a `set` literal" + fixable: true location: row: 1 column: 0 end_location: row: 1 column: 11 - parent: ~ -- kind: - name: UnnecessaryLiteralSet - body: "Unnecessary `tuple` literal (rewrite as a `set` literal)" - suggestion: "Rewrite as a `set` literal" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 11 - fix: - content: "{1, 2}" + fix: + content: "{1, 2}" + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 11 + parent: ~ + - kind: + name: UnnecessaryLiteralSet + body: "Unnecessary `tuple` literal (rewrite as a `set` literal)" + suggestion: "Rewrite as a `set` literal" + fixable: true location: row: 2 column: 0 end_location: row: 2 column: 11 - parent: ~ -- kind: - name: UnnecessaryLiteralSet - body: "Unnecessary `list` literal (rewrite as a `set` literal)" - suggestion: "Rewrite as a `set` literal" - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 7 - fix: - content: set() + fix: + content: "{1, 2}" + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 11 + parent: ~ + - kind: + name: UnnecessaryLiteralSet + body: "Unnecessary `list` literal (rewrite as a `set` literal)" + suggestion: "Rewrite as a `set` literal" + fixable: true location: row: 3 column: 0 end_location: row: 3 column: 7 - parent: ~ -- kind: - name: UnnecessaryLiteralSet - body: "Unnecessary `tuple` literal (rewrite as a `set` literal)" - suggestion: "Rewrite as a `set` literal" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 7 - fix: - content: set() + fix: + content: set() + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 7 + parent: ~ + - kind: + name: UnnecessaryLiteralSet + body: "Unnecessary `tuple` literal (rewrite as a `set` literal)" + suggestion: "Rewrite as a `set` literal" + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 7 - parent: ~ -- kind: - name: UnnecessaryLiteralSet - body: "Unnecessary `tuple` literal (rewrite as a `set` literal)" - suggestion: "Rewrite as a `set` literal" - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 9 - fix: - content: "{1}" + fix: + content: set() + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 7 + parent: ~ + - kind: + name: UnnecessaryLiteralSet + body: "Unnecessary `tuple` literal (rewrite as a `set` literal)" + suggestion: "Rewrite as a `set` literal" + fixable: true location: row: 6 column: 0 end_location: row: 6 column: 9 - parent: ~ -- kind: - name: UnnecessaryLiteralSet - body: "Unnecessary `tuple` literal (rewrite as a `set` literal)" - suggestion: "Rewrite as a `set` literal" - fixable: true - location: - row: 7 - column: 0 - end_location: - row: 9 - column: 2 - fix: - content: "{\n 1,\n}" + fix: + content: "{1}" + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 9 + parent: ~ + - kind: + name: UnnecessaryLiteralSet + body: "Unnecessary `tuple` literal (rewrite as a `set` literal)" + suggestion: "Rewrite as a `set` literal" + fixable: true location: row: 7 column: 0 end_location: row: 9 column: 2 - parent: ~ -- kind: - name: UnnecessaryLiteralSet - body: "Unnecessary `list` literal (rewrite as a `set` literal)" - suggestion: "Rewrite as a `set` literal" - fixable: true - location: - row: 10 - column: 0 - end_location: - row: 12 - column: 2 - fix: - content: "{\n 1,\n}" + fix: + content: "{\n 1,\n}" + location: + row: 7 + column: 0 + end_location: + row: 9 + column: 2 + parent: ~ + - kind: + name: UnnecessaryLiteralSet + body: "Unnecessary `list` literal (rewrite as a `set` literal)" + suggestion: "Rewrite as a `set` literal" + fixable: true location: row: 10 column: 0 end_location: row: 12 column: 2 - parent: ~ -- kind: - name: UnnecessaryLiteralSet - body: "Unnecessary `tuple` literal (rewrite as a `set` literal)" - suggestion: "Rewrite as a `set` literal" - fixable: true - location: - row: 13 - column: 0 - end_location: - row: 15 - column: 1 - fix: - content: "{1}" + fix: + content: "{\n 1,\n}" + location: + row: 10 + column: 0 + end_location: + row: 12 + column: 2 + parent: ~ + - kind: + name: UnnecessaryLiteralSet + body: "Unnecessary `tuple` literal (rewrite as a `set` literal)" + suggestion: "Rewrite as a `set` literal" + fixable: true location: row: 13 column: 0 end_location: row: 15 column: 1 - parent: ~ -- kind: - name: UnnecessaryLiteralSet - body: "Unnecessary `list` literal (rewrite as a `set` literal)" - suggestion: "Rewrite as a `set` literal" - fixable: true - location: - row: 16 - column: 0 - end_location: - row: 18 - column: 1 - fix: - content: "{1,}" + fix: + content: "{1}" + location: + row: 13 + column: 0 + end_location: + row: 15 + column: 1 + parent: ~ + - kind: + name: UnnecessaryLiteralSet + body: "Unnecessary `list` literal (rewrite as a `set` literal)" + suggestion: "Rewrite as a `set` literal" + fixable: true location: row: 16 column: 0 end_location: row: 18 column: 1 - parent: ~ + fix: + content: "{1,}" + location: + row: 16 + column: 0 + end_location: + row: 18 + column: 1 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C406_C406.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C406_C406.py.snap index 01d7fb247708fe..5ecb5122c8a95a 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C406_C406.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C406_C406.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryLiteralDict - body: "Unnecessary `list` literal (rewrite as a `dict` literal)" - suggestion: "Rewrite as a `dict` literal" - fixable: true - location: - row: 1 - column: 5 - end_location: - row: 1 - column: 19 - fix: - content: "{1: 2}" +- - kind: + name: UnnecessaryLiteralDict + body: "Unnecessary `list` literal (rewrite as a `dict` literal)" + suggestion: "Rewrite as a `dict` literal" + fixable: true location: row: 1 column: 5 end_location: row: 1 column: 19 - parent: ~ -- kind: - name: UnnecessaryLiteralDict - body: "Unnecessary `tuple` literal (rewrite as a `dict` literal)" - suggestion: "Rewrite as a `dict` literal" - fixable: true - location: - row: 2 - column: 5 - end_location: - row: 2 - column: 20 - fix: - content: "{1: 2,}" + fix: + content: "{1: 2}" + location: + row: 1 + column: 5 + end_location: + row: 1 + column: 19 + parent: ~ + - kind: + name: UnnecessaryLiteralDict + body: "Unnecessary `tuple` literal (rewrite as a `dict` literal)" + suggestion: "Rewrite as a `dict` literal" + fixable: true location: row: 2 column: 5 end_location: row: 2 column: 20 - parent: ~ -- kind: - name: UnnecessaryLiteralDict - body: "Unnecessary `list` literal (rewrite as a `dict` literal)" - suggestion: "Rewrite as a `dict` literal" - fixable: true - location: - row: 3 - column: 5 - end_location: - row: 3 - column: 13 - fix: - content: "{}" + fix: + content: "{1: 2,}" + location: + row: 2 + column: 5 + end_location: + row: 2 + column: 20 + parent: ~ + - kind: + name: UnnecessaryLiteralDict + body: "Unnecessary `list` literal (rewrite as a `dict` literal)" + suggestion: "Rewrite as a `dict` literal" + fixable: true location: row: 3 column: 5 end_location: row: 3 column: 13 - parent: ~ -- kind: - name: UnnecessaryLiteralDict - body: "Unnecessary `tuple` literal (rewrite as a `dict` literal)" - suggestion: "Rewrite as a `dict` literal" - fixable: true - location: - row: 4 - column: 5 - end_location: - row: 4 - column: 13 - fix: - content: "{}" + fix: + content: "{}" + location: + row: 3 + column: 5 + end_location: + row: 3 + column: 13 + parent: ~ + - kind: + name: UnnecessaryLiteralDict + body: "Unnecessary `tuple` literal (rewrite as a `dict` literal)" + suggestion: "Rewrite as a `dict` literal" + fixable: true location: row: 4 column: 5 end_location: row: 4 column: 13 - parent: ~ + fix: + content: "{}" + location: + row: 4 + column: 5 + end_location: + row: 4 + column: 13 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py.snap index 19e087d78b8a1a..81491d23d1ff19 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryCollectionCall - body: "Unnecessary `tuple` call (rewrite as a literal)" - suggestion: Rewrite as a literal - fixable: true - location: - row: 1 - column: 4 - end_location: - row: 1 - column: 11 - fix: - content: () +- - kind: + name: UnnecessaryCollectionCall + body: "Unnecessary `tuple` call (rewrite as a literal)" + suggestion: Rewrite as a literal + fixable: true location: row: 1 column: 4 end_location: row: 1 column: 11 - parent: ~ -- kind: - name: UnnecessaryCollectionCall - body: "Unnecessary `list` call (rewrite as a literal)" - suggestion: Rewrite as a literal - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 10 - fix: - content: "[]" + fix: + content: () + location: + row: 1 + column: 4 + end_location: + row: 1 + column: 11 + parent: ~ + - kind: + name: UnnecessaryCollectionCall + body: "Unnecessary `list` call (rewrite as a literal)" + suggestion: Rewrite as a literal + fixable: true location: row: 2 column: 4 end_location: row: 2 column: 10 - parent: ~ -- kind: - name: UnnecessaryCollectionCall - body: "Unnecessary `dict` call (rewrite as a literal)" - suggestion: Rewrite as a literal - fixable: true - location: - row: 3 - column: 5 - end_location: - row: 3 - column: 11 - fix: - content: "{}" + fix: + content: "[]" + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 10 + parent: ~ + - kind: + name: UnnecessaryCollectionCall + body: "Unnecessary `dict` call (rewrite as a literal)" + suggestion: Rewrite as a literal + fixable: true location: row: 3 column: 5 end_location: row: 3 column: 11 - parent: ~ -- kind: - name: UnnecessaryCollectionCall - body: "Unnecessary `dict` call (rewrite as a literal)" - suggestion: Rewrite as a literal - fixable: true - location: - row: 4 - column: 5 - end_location: - row: 4 - column: 14 - fix: - content: "{\"a\": 1}" + fix: + content: "{}" + location: + row: 3 + column: 5 + end_location: + row: 3 + column: 11 + parent: ~ + - kind: + name: UnnecessaryCollectionCall + body: "Unnecessary `dict` call (rewrite as a literal)" + suggestion: Rewrite as a literal + fixable: true location: row: 4 column: 5 end_location: row: 4 column: 14 - parent: ~ + fix: + content: "{\"a\": 1}" + location: + row: 4 + column: 5 + end_location: + row: 4 + column: 14 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py_allow_dict_calls_with_keyword_arguments.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py_allow_dict_calls_with_keyword_arguments.snap index 9970b164e33f60..d7191066a447d4 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py_allow_dict_calls_with_keyword_arguments.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py_allow_dict_calls_with_keyword_arguments.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryCollectionCall - body: "Unnecessary `tuple` call (rewrite as a literal)" - suggestion: Rewrite as a literal - fixable: true - location: - row: 1 - column: 4 - end_location: - row: 1 - column: 11 - fix: - content: () +- - kind: + name: UnnecessaryCollectionCall + body: "Unnecessary `tuple` call (rewrite as a literal)" + suggestion: Rewrite as a literal + fixable: true location: row: 1 column: 4 end_location: row: 1 column: 11 - parent: ~ -- kind: - name: UnnecessaryCollectionCall - body: "Unnecessary `list` call (rewrite as a literal)" - suggestion: Rewrite as a literal - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 10 - fix: - content: "[]" + fix: + content: () + location: + row: 1 + column: 4 + end_location: + row: 1 + column: 11 + parent: ~ + - kind: + name: UnnecessaryCollectionCall + body: "Unnecessary `list` call (rewrite as a literal)" + suggestion: Rewrite as a literal + fixable: true location: row: 2 column: 4 end_location: row: 2 column: 10 - parent: ~ -- kind: - name: UnnecessaryCollectionCall - body: "Unnecessary `dict` call (rewrite as a literal)" - suggestion: Rewrite as a literal - fixable: true - location: - row: 3 - column: 5 - end_location: - row: 3 - column: 11 - fix: - content: "{}" + fix: + content: "[]" + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 10 + parent: ~ + - kind: + name: UnnecessaryCollectionCall + body: "Unnecessary `dict` call (rewrite as a literal)" + suggestion: Rewrite as a literal + fixable: true location: row: 3 column: 5 end_location: row: 3 column: 11 - parent: ~ + fix: + content: "{}" + location: + row: 3 + column: 5 + end_location: + row: 3 + column: 11 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C409_C409.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C409_C409.py.snap index 7b6219eac6c585..f50dc7fc392824 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C409_C409.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C409_C409.py.snap @@ -2,104 +2,104 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryLiteralWithinTupleCall - body: "Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal)" - suggestion: "Rewrite as a `tuple` literal" - fixable: true - location: - row: 1 - column: 5 - end_location: - row: 1 - column: 14 - fix: - content: () +- - kind: + name: UnnecessaryLiteralWithinTupleCall + body: "Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal)" + suggestion: "Rewrite as a `tuple` literal" + fixable: true location: row: 1 column: 5 end_location: row: 1 column: 14 - parent: ~ -- kind: - name: UnnecessaryLiteralWithinTupleCall - body: "Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal)" - suggestion: "Rewrite as a `tuple` literal" - fixable: true - location: - row: 2 - column: 5 - end_location: - row: 2 - column: 18 - fix: - content: "(1, 2)" + fix: + content: () + location: + row: 1 + column: 5 + end_location: + row: 1 + column: 14 + parent: ~ + - kind: + name: UnnecessaryLiteralWithinTupleCall + body: "Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal)" + suggestion: "Rewrite as a `tuple` literal" + fixable: true location: row: 2 column: 5 end_location: row: 2 column: 18 - parent: ~ -- kind: - name: UnnecessaryLiteralWithinTupleCall - body: "Unnecessary `tuple` literal passed to `tuple()` (remove the outer call to `tuple()`)" - suggestion: "Remove outer `tuple` call" - fixable: true - location: - row: 3 - column: 5 - end_location: - row: 3 - column: 18 - fix: - content: "(1, 2)" + fix: + content: "(1, 2)" + location: + row: 2 + column: 5 + end_location: + row: 2 + column: 18 + parent: ~ + - kind: + name: UnnecessaryLiteralWithinTupleCall + body: "Unnecessary `tuple` literal passed to `tuple()` (remove the outer call to `tuple()`)" + suggestion: "Remove outer `tuple` call" + fixable: true location: row: 3 column: 5 end_location: row: 3 column: 18 - parent: ~ -- kind: - name: UnnecessaryLiteralWithinTupleCall - body: "Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal)" - suggestion: "Rewrite as a `tuple` literal" - fixable: true - location: - row: 4 - column: 5 - end_location: - row: 7 - column: 2 - fix: - content: "(\n 1,\n 2\n)" + fix: + content: "(1, 2)" + location: + row: 3 + column: 5 + end_location: + row: 3 + column: 18 + parent: ~ + - kind: + name: UnnecessaryLiteralWithinTupleCall + body: "Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal)" + suggestion: "Rewrite as a `tuple` literal" + fixable: true location: row: 4 column: 5 end_location: row: 7 column: 2 - parent: ~ -- kind: - name: UnnecessaryLiteralWithinTupleCall - body: "Unnecessary `tuple` literal passed to `tuple()` (remove the outer call to `tuple()`)" - suggestion: "Remove outer `tuple` call" - fixable: true - location: - row: 8 - column: 5 - end_location: - row: 10 - column: 1 - fix: - content: "(1, 2)" + fix: + content: "(\n 1,\n 2\n)" + location: + row: 4 + column: 5 + end_location: + row: 7 + column: 2 + parent: ~ + - kind: + name: UnnecessaryLiteralWithinTupleCall + body: "Unnecessary `tuple` literal passed to `tuple()` (remove the outer call to `tuple()`)" + suggestion: "Remove outer `tuple` call" + fixable: true location: row: 8 column: 5 end_location: row: 10 column: 1 - parent: ~ + fix: + content: "(1, 2)" + location: + row: 8 + column: 5 + end_location: + row: 10 + column: 1 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C410_C410.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C410_C410.py.snap index d880407494325a..ec663b97ebb7e4 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C410_C410.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C410_C410.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryLiteralWithinListCall - body: "Unnecessary `list` literal passed to `list()` (remove the outer call to `list()`)" - suggestion: "Remove outer `list` call" - fixable: true - location: - row: 1 - column: 5 - end_location: - row: 1 - column: 17 - fix: - content: "[1, 2]" +- - kind: + name: UnnecessaryLiteralWithinListCall + body: "Unnecessary `list` literal passed to `list()` (remove the outer call to `list()`)" + suggestion: "Remove outer `list` call" + fixable: true location: row: 1 column: 5 end_location: row: 1 column: 17 - parent: ~ -- kind: - name: UnnecessaryLiteralWithinListCall - body: "Unnecessary `tuple` literal passed to `list()` (rewrite as a `list` literal)" - suggestion: "Rewrite as a `list` literal" - fixable: true - location: - row: 2 - column: 5 - end_location: - row: 2 - column: 17 - fix: - content: "[1, 2]" + fix: + content: "[1, 2]" + location: + row: 1 + column: 5 + end_location: + row: 1 + column: 17 + parent: ~ + - kind: + name: UnnecessaryLiteralWithinListCall + body: "Unnecessary `tuple` literal passed to `list()` (rewrite as a `list` literal)" + suggestion: "Rewrite as a `list` literal" + fixable: true location: row: 2 column: 5 end_location: row: 2 column: 17 - parent: ~ -- kind: - name: UnnecessaryLiteralWithinListCall - body: "Unnecessary `list` literal passed to `list()` (remove the outer call to `list()`)" - suggestion: "Remove outer `list` call" - fixable: true - location: - row: 3 - column: 5 - end_location: - row: 3 - column: 13 - fix: - content: "[]" + fix: + content: "[1, 2]" + location: + row: 2 + column: 5 + end_location: + row: 2 + column: 17 + parent: ~ + - kind: + name: UnnecessaryLiteralWithinListCall + body: "Unnecessary `list` literal passed to `list()` (remove the outer call to `list()`)" + suggestion: "Remove outer `list` call" + fixable: true location: row: 3 column: 5 end_location: row: 3 column: 13 - parent: ~ -- kind: - name: UnnecessaryLiteralWithinListCall - body: "Unnecessary `tuple` literal passed to `list()` (rewrite as a `list` literal)" - suggestion: "Rewrite as a `list` literal" - fixable: true - location: - row: 4 - column: 5 - end_location: - row: 4 - column: 13 - fix: - content: "[]" + fix: + content: "[]" + location: + row: 3 + column: 5 + end_location: + row: 3 + column: 13 + parent: ~ + - kind: + name: UnnecessaryLiteralWithinListCall + body: "Unnecessary `tuple` literal passed to `list()` (rewrite as a `list` literal)" + suggestion: "Rewrite as a `list` literal" + fixable: true location: row: 4 column: 5 end_location: row: 4 column: 13 - parent: ~ + fix: + content: "[]" + location: + row: 4 + column: 5 + end_location: + row: 4 + column: 13 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C411_C411.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C411_C411.py.snap index 699c9e5bdd755d..112edd6bcb15b5 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C411_C411.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C411_C411.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryListCall - body: "Unnecessary `list` call (remove the outer call to `list()`)" - suggestion: "Remove outer `list` call" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 20 - fix: - content: "[i for i in x]" +- - kind: + name: UnnecessaryListCall + body: "Unnecessary `list` call (remove the outer call to `list()`)" + suggestion: "Remove outer `list` call" + fixable: true location: row: 2 column: 0 end_location: row: 2 column: 20 - parent: ~ + fix: + content: "[i for i in x]" + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 20 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C413_C413.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C413_C413.py.snap index 10654bda4eb319..1f746bea6b1528 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C413_C413.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C413_C413.py.snap @@ -2,144 +2,144 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryCallAroundSorted - body: "Unnecessary `list` call around `sorted()`" - suggestion: "Remove unnecessary `list` call" - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 15 - fix: - content: sorted(x) +- - kind: + name: UnnecessaryCallAroundSorted + body: "Unnecessary `list` call around `sorted()`" + suggestion: "Remove unnecessary `list` call" + fixable: true location: row: 3 column: 0 end_location: row: 3 column: 15 - parent: ~ -- kind: - name: UnnecessaryCallAroundSorted - body: "Unnecessary `reversed` call around `sorted()`" - suggestion: "Remove unnecessary `reversed` call" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 19 - fix: - content: "sorted(x, reverse=True)" + fix: + content: sorted(x) + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 15 + parent: ~ + - kind: + name: UnnecessaryCallAroundSorted + body: "Unnecessary `reversed` call around `sorted()`" + suggestion: "Remove unnecessary `reversed` call" + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 19 - parent: ~ -- kind: - name: UnnecessaryCallAroundSorted - body: "Unnecessary `reversed` call around `sorted()`" - suggestion: "Remove unnecessary `reversed` call" - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 36 - fix: - content: "sorted(x, key=lambda e: e, reverse=True)" + fix: + content: "sorted(x, reverse=True)" + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 19 + parent: ~ + - kind: + name: UnnecessaryCallAroundSorted + body: "Unnecessary `reversed` call around `sorted()`" + suggestion: "Remove unnecessary `reversed` call" + fixable: true location: row: 5 column: 0 end_location: row: 5 column: 36 - parent: ~ -- kind: - name: UnnecessaryCallAroundSorted - body: "Unnecessary `reversed` call around `sorted()`" - suggestion: "Remove unnecessary `reversed` call" - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 33 - fix: - content: "sorted(x, reverse=False)" + fix: + content: "sorted(x, key=lambda e: e, reverse=True)" + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 36 + parent: ~ + - kind: + name: UnnecessaryCallAroundSorted + body: "Unnecessary `reversed` call around `sorted()`" + suggestion: "Remove unnecessary `reversed` call" + fixable: true location: row: 6 column: 0 end_location: row: 6 column: 33 - parent: ~ -- kind: - name: UnnecessaryCallAroundSorted - body: "Unnecessary `reversed` call around `sorted()`" - suggestion: "Remove unnecessary `reversed` call" - fixable: true - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 50 - fix: - content: "sorted(x, key=lambda e: e, reverse=False)" + fix: + content: "sorted(x, reverse=False)" + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 33 + parent: ~ + - kind: + name: UnnecessaryCallAroundSorted + body: "Unnecessary `reversed` call around `sorted()`" + suggestion: "Remove unnecessary `reversed` call" + fixable: true location: row: 7 column: 0 end_location: row: 7 column: 50 - parent: ~ -- kind: - name: UnnecessaryCallAroundSorted - body: "Unnecessary `reversed` call around `sorted()`" - suggestion: "Remove unnecessary `reversed` call" - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 50 - fix: - content: "sorted(x, reverse=False, key=lambda e: e)" + fix: + content: "sorted(x, key=lambda e: e, reverse=False)" + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 50 + parent: ~ + - kind: + name: UnnecessaryCallAroundSorted + body: "Unnecessary `reversed` call around `sorted()`" + suggestion: "Remove unnecessary `reversed` call" + fixable: true location: row: 8 column: 0 end_location: row: 8 column: 50 - parent: ~ -- kind: - name: UnnecessaryCallAroundSorted - body: "Unnecessary `reversed` call around `sorted()`" - suggestion: "Remove unnecessary `reversed` call" - fixable: true - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 34 - fix: - content: "sorted(x, reverse=True)" + fix: + content: "sorted(x, reverse=False, key=lambda e: e)" + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 50 + parent: ~ + - kind: + name: UnnecessaryCallAroundSorted + body: "Unnecessary `reversed` call around `sorted()`" + suggestion: "Remove unnecessary `reversed` call" + fixable: true location: row: 9 column: 0 end_location: row: 9 column: 34 - parent: ~ + fix: + content: "sorted(x, reverse=True)" + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 34 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C414_C414.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C414_C414.py.snap index df977690d032ca..feb81ae96f9c28 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C414_C414.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C414_C414.py.snap @@ -2,284 +2,284 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryDoubleCastOrProcess - body: "Unnecessary `list` call within `list()`" - suggestion: "Remove the inner `list` call" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 13 - fix: - content: list(x) +- - kind: + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `list` call within `list()`" + suggestion: "Remove the inner `list` call" + fixable: true location: row: 2 column: 0 end_location: row: 2 column: 13 - parent: ~ -- kind: - name: UnnecessaryDoubleCastOrProcess - body: "Unnecessary `tuple` call within `list()`" - suggestion: "Remove the inner `tuple` call" - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 14 - fix: - content: list(x) + fix: + content: list(x) + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 13 + parent: ~ + - kind: + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `tuple` call within `list()`" + suggestion: "Remove the inner `tuple` call" + fixable: true location: row: 3 column: 0 end_location: row: 3 column: 14 - parent: ~ -- kind: - name: UnnecessaryDoubleCastOrProcess - body: "Unnecessary `list` call within `tuple()`" - suggestion: "Remove the inner `list` call" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 14 - fix: - content: tuple(x) + fix: + content: list(x) + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 14 + parent: ~ + - kind: + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `list` call within `tuple()`" + suggestion: "Remove the inner `list` call" + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 14 - parent: ~ -- kind: - name: UnnecessaryDoubleCastOrProcess - body: "Unnecessary `tuple` call within `tuple()`" - suggestion: "Remove the inner `tuple` call" - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 15 - fix: - content: tuple(x) + fix: + content: tuple(x) + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 14 + parent: ~ + - kind: + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `tuple` call within `tuple()`" + suggestion: "Remove the inner `tuple` call" + fixable: true location: row: 5 column: 0 end_location: row: 5 column: 15 - parent: ~ -- kind: - name: UnnecessaryDoubleCastOrProcess - body: "Unnecessary `set` call within `set()`" - suggestion: "Remove the inner `set` call" - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 11 - fix: - content: set(x) + fix: + content: tuple(x) + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 15 + parent: ~ + - kind: + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `set` call within `set()`" + suggestion: "Remove the inner `set` call" + fixable: true location: row: 6 column: 0 end_location: row: 6 column: 11 - parent: ~ -- kind: - name: UnnecessaryDoubleCastOrProcess - body: "Unnecessary `list` call within `set()`" - suggestion: "Remove the inner `list` call" - fixable: true - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 12 - fix: - content: set(x) + fix: + content: set(x) + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 11 + parent: ~ + - kind: + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `list` call within `set()`" + suggestion: "Remove the inner `list` call" + fixable: true location: row: 7 column: 0 end_location: row: 7 column: 12 - parent: ~ -- kind: - name: UnnecessaryDoubleCastOrProcess - body: "Unnecessary `tuple` call within `set()`" - suggestion: "Remove the inner `tuple` call" - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 13 - fix: - content: set(x) + fix: + content: set(x) + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 12 + parent: ~ + - kind: + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `tuple` call within `set()`" + suggestion: "Remove the inner `tuple` call" + fixable: true location: row: 8 column: 0 end_location: row: 8 column: 13 - parent: ~ -- kind: - name: UnnecessaryDoubleCastOrProcess - body: "Unnecessary `sorted` call within `set()`" - suggestion: "Remove the inner `sorted` call" - fixable: true - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 14 - fix: - content: set(x) + fix: + content: set(x) + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 13 + parent: ~ + - kind: + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `sorted` call within `set()`" + suggestion: "Remove the inner `sorted` call" + fixable: true location: row: 9 column: 0 end_location: row: 9 column: 14 - parent: ~ -- kind: - name: UnnecessaryDoubleCastOrProcess - body: "Unnecessary `reversed` call within `set()`" - suggestion: "Remove the inner `reversed` call" - fixable: true - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 16 - fix: - content: set(x) + fix: + content: set(x) + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 14 + parent: ~ + - kind: + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `reversed` call within `set()`" + suggestion: "Remove the inner `reversed` call" + fixable: true location: row: 10 column: 0 end_location: row: 10 column: 16 - parent: ~ -- kind: - name: UnnecessaryDoubleCastOrProcess - body: "Unnecessary `list` call within `sorted()`" - suggestion: "Remove the inner `list` call" - fixable: true - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 15 - fix: - content: sorted(x) + fix: + content: set(x) + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 16 + parent: ~ + - kind: + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `list` call within `sorted()`" + suggestion: "Remove the inner `list` call" + fixable: true location: row: 11 column: 0 end_location: row: 11 column: 15 - parent: ~ -- kind: - name: UnnecessaryDoubleCastOrProcess - body: "Unnecessary `tuple` call within `sorted()`" - suggestion: "Remove the inner `tuple` call" - fixable: true - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 16 - fix: - content: sorted(x) + fix: + content: sorted(x) + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 15 + parent: ~ + - kind: + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `tuple` call within `sorted()`" + suggestion: "Remove the inner `tuple` call" + fixable: true location: row: 12 column: 0 end_location: row: 12 column: 16 - parent: ~ -- kind: - name: UnnecessaryDoubleCastOrProcess - body: "Unnecessary `sorted` call within `sorted()`" - suggestion: "Remove the inner `sorted` call" - fixable: true - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 17 - fix: - content: sorted(x) + fix: + content: sorted(x) + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 16 + parent: ~ + - kind: + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `sorted` call within `sorted()`" + suggestion: "Remove the inner `sorted` call" + fixable: true location: row: 13 column: 0 end_location: row: 13 column: 17 - parent: ~ -- kind: - name: UnnecessaryDoubleCastOrProcess - body: "Unnecessary `reversed` call within `sorted()`" - suggestion: "Remove the inner `reversed` call" - fixable: true - location: - row: 14 - column: 0 - end_location: - row: 14 - column: 19 - fix: - content: sorted(x) + fix: + content: sorted(x) + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 17 + parent: ~ + - kind: + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `reversed` call within `sorted()`" + suggestion: "Remove the inner `reversed` call" + fixable: true location: row: 14 column: 0 end_location: row: 14 column: 19 - parent: ~ -- kind: - name: UnnecessaryDoubleCastOrProcess - body: "Unnecessary `list` call within `tuple()`" - suggestion: "Remove the inner `list` call" - fixable: true - location: - row: 15 - column: 0 - end_location: - row: 20 - column: 1 - fix: - content: "tuple(\n [x, 3, \"hell\"\\\n \"o\"]\n )" + fix: + content: sorted(x) + location: + row: 14 + column: 0 + end_location: + row: 14 + column: 19 + parent: ~ + - kind: + name: UnnecessaryDoubleCastOrProcess + body: "Unnecessary `list` call within `tuple()`" + suggestion: "Remove the inner `list` call" + fixable: true location: row: 15 column: 0 end_location: row: 20 column: 1 - parent: ~ + fix: + content: "tuple(\n [x, 3, \"hell\"\\\n \"o\"]\n )" + location: + row: 15 + column: 0 + end_location: + row: 20 + column: 1 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C415_C415.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C415_C415.py.snap index d919696982166e..e62e03584c8243 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C415_C415.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C415_C415.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessarySubscriptReversal - body: "Unnecessary subscript reversal of iterable within `set()`" - suggestion: ~ - fixable: false - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 18 - fix: ~ - parent: ~ -- kind: - name: UnnecessarySubscriptReversal - body: "Unnecessary subscript reversal of iterable within `reversed()`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 23 - fix: ~ - parent: ~ -- kind: - name: UnnecessarySubscriptReversal - body: "Unnecessary subscript reversal of iterable within `sorted()`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 21 - fix: ~ - parent: ~ -- kind: - name: UnnecessarySubscriptReversal - body: "Unnecessary subscript reversal of iterable within `sorted()`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 4 - end_location: - row: 5 - column: 35 - fix: ~ - parent: ~ +- - kind: + name: UnnecessarySubscriptReversal + body: "Unnecessary subscript reversal of iterable within `set()`" + suggestion: ~ + fixable: false + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 18 + fix: ~ + parent: ~ + - kind: + name: UnnecessarySubscriptReversal + body: "Unnecessary subscript reversal of iterable within `reversed()`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 23 + fix: ~ + parent: ~ + - kind: + name: UnnecessarySubscriptReversal + body: "Unnecessary subscript reversal of iterable within `sorted()`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 21 + fix: ~ + parent: ~ + - kind: + name: UnnecessarySubscriptReversal + body: "Unnecessary subscript reversal of iterable within `sorted()`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 4 + end_location: + row: 5 + column: 35 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C416_C416.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C416_C416.py.snap index 5daa988b852835..3b8b213a7ea0e6 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C416_C416.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C416_C416.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryComprehension - body: "Unnecessary `list` comprehension (rewrite using `list()`)" - suggestion: "Rewrite using `list()`" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 14 - fix: - content: list(x) +- - kind: + name: UnnecessaryComprehension + body: "Unnecessary `list` comprehension (rewrite using `list()`)" + suggestion: "Rewrite using `list()`" + fixable: true location: row: 2 column: 0 end_location: row: 2 column: 14 - parent: ~ -- kind: - name: UnnecessaryComprehension - body: "Unnecessary `set` comprehension (rewrite using `set()`)" - suggestion: "Rewrite using `set()`" - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 14 - fix: - content: set(x) + fix: + content: list(x) + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 14 + parent: ~ + - kind: + name: UnnecessaryComprehension + body: "Unnecessary `set` comprehension (rewrite using `set()`)" + suggestion: "Rewrite using `set()`" + fixable: true location: row: 3 column: 0 end_location: row: 3 column: 14 - parent: ~ + fix: + content: set(x) + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 14 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C417_C417.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C417_C417.py.snap index efa0e02d8ee2a1..f495ab1bc791b5 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C417_C417.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C417_C417.py.snap @@ -2,257 +2,257 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryMap - body: "Unnecessary `map` usage (rewrite using a generator expression)" - suggestion: "Replace `map` using a generator expression" - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 26 - fix: - content: (x + 1 for x in nums) +- - kind: + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a generator expression)" + suggestion: "Replace `map` using a generator expression" + fixable: true location: row: 3 column: 0 end_location: row: 3 column: 26 - parent: ~ -- kind: - name: UnnecessaryMap - body: "Unnecessary `map` usage (rewrite using a generator expression)" - suggestion: "Replace `map` using a generator expression" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 27 - fix: - content: (str(x) for x in nums) + fix: + content: (x + 1 for x in nums) + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 26 + parent: ~ + - kind: + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a generator expression)" + suggestion: "Replace `map` using a generator expression" + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 27 - parent: ~ -- kind: - name: UnnecessaryMap - body: "Unnecessary `map` usage (rewrite using a `list` comprehension)" - suggestion: "Replace `map` using a `list` comprehension" - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 32 - fix: - content: "[x * 2 for x in nums]" + fix: + content: (str(x) for x in nums) + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 27 + parent: ~ + - kind: + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a `list` comprehension)" + suggestion: "Replace `map` using a `list` comprehension" + fixable: true location: row: 5 column: 0 end_location: row: 5 column: 32 - parent: ~ -- kind: - name: UnnecessaryMap - body: "Unnecessary `map` usage (rewrite using a `set` comprehension)" - suggestion: "Replace `map` using a `set` comprehension" - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 36 - fix: - content: "{x % 2 == 0 for x in nums}" + fix: + content: "[x * 2 for x in nums]" + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 32 + parent: ~ + - kind: + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a `set` comprehension)" + suggestion: "Replace `map` using a `set` comprehension" + fixable: true location: row: 6 column: 0 end_location: row: 6 column: 36 - parent: ~ -- kind: - name: UnnecessaryMap - body: "Unnecessary `map` usage (rewrite using a `dict` comprehension)" - suggestion: "Replace `map` using a `dict` comprehension" - fixable: true - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 36 - fix: - content: "{v: v**2 for v in nums}" + fix: + content: "{x % 2 == 0 for x in nums}" + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 36 + parent: ~ + - kind: + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a `dict` comprehension)" + suggestion: "Replace `map` using a `dict` comprehension" + fixable: true location: row: 7 column: 0 end_location: row: 7 column: 36 - parent: ~ -- kind: - name: UnnecessaryMap - body: "Unnecessary `map` usage (rewrite using a generator expression)" - suggestion: "Replace `map` using a generator expression" - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 26 - fix: - content: "(\"const\" for _ in nums)" + fix: + content: "{v: v**2 for v in nums}" + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 36 + parent: ~ + - kind: + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a generator expression)" + suggestion: "Replace `map` using a generator expression" + fixable: true location: row: 8 column: 0 end_location: row: 8 column: 26 - parent: ~ -- kind: - name: UnnecessaryMap - body: "Unnecessary `map` usage (rewrite using a generator expression)" - suggestion: "Replace `map` using a generator expression" - fixable: true - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 24 - fix: - content: (3.0 for _ in nums) + fix: + content: "(\"const\" for _ in nums)" + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 26 + parent: ~ + - kind: + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a generator expression)" + suggestion: "Replace `map` using a generator expression" + fixable: true location: row: 9 column: 0 end_location: row: 9 column: 24 - parent: ~ -- kind: - name: UnnecessaryMap - body: "Unnecessary `map` usage (rewrite using a generator expression)" - suggestion: "Replace `map` using a generator expression" - fixable: true - location: - row: 10 - column: 12 - end_location: - row: 10 - column: 63 - fix: - content: "(x in nums and \"1\" or \"0\" for x in range(123))" + fix: + content: (3.0 for _ in nums) + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 24 + parent: ~ + - kind: + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a generator expression)" + suggestion: "Replace `map` using a generator expression" + fixable: true location: row: 10 column: 12 end_location: row: 10 column: 63 - parent: ~ -- kind: - name: UnnecessaryMap - body: "Unnecessary `map` usage (rewrite using a generator expression)" - suggestion: "Replace `map` using a generator expression" - fixable: true - location: - row: 11 - column: 4 - end_location: - row: 11 - column: 44 - fix: - content: "(isinstance(v, dict) for v in nums)" + fix: + content: "(x in nums and \"1\" or \"0\" for x in range(123))" + location: + row: 10 + column: 12 + end_location: + row: 10 + column: 63 + parent: ~ + - kind: + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a generator expression)" + suggestion: "Replace `map` using a generator expression" + fixable: true location: row: 11 column: 4 end_location: row: 11 column: 44 - parent: ~ -- kind: - name: UnnecessaryMap - body: "Unnecessary `map` usage (rewrite using a generator expression)" - suggestion: "Replace `map` using a generator expression" - fixable: true - location: - row: 12 - column: 13 - end_location: - row: 12 - column: 35 - fix: - content: (v for v in nums) + fix: + content: "(isinstance(v, dict) for v in nums)" + location: + row: 11 + column: 4 + end_location: + row: 11 + column: 44 + parent: ~ + - kind: + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a generator expression)" + suggestion: "Replace `map` using a generator expression" + fixable: true location: row: 12 column: 13 end_location: row: 12 column: 35 - parent: ~ -- kind: - name: UnnecessaryMap - body: "Unnecessary `map` usage (rewrite using a `set` comprehension)" - suggestion: "Replace `map` using a `set` comprehension" - fixable: true - location: - row: 15 - column: 7 - end_location: - row: 15 - column: 43 - fix: - content: " {x % 2 == 0 for x in nums} " + fix: + content: (v for v in nums) + location: + row: 12 + column: 13 + end_location: + row: 12 + column: 35 + parent: ~ + - kind: + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a `set` comprehension)" + suggestion: "Replace `map` using a `set` comprehension" + fixable: true location: row: 15 column: 7 end_location: row: 15 column: 43 - parent: ~ -- kind: - name: UnnecessaryMap - body: "Unnecessary `map` usage (rewrite using a `dict` comprehension)" - suggestion: "Replace `map` using a `dict` comprehension" - fixable: true - location: - row: 16 - column: 7 - end_location: - row: 16 - column: 43 - fix: - content: " {v: v**2 for v in nums} " + fix: + content: " {x % 2 == 0 for x in nums} " + location: + row: 15 + column: 7 + end_location: + row: 15 + column: 43 + parent: ~ + - kind: + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a `dict` comprehension)" + suggestion: "Replace `map` using a `dict` comprehension" + fixable: true location: row: 16 column: 7 end_location: row: 16 column: 43 - parent: ~ -- kind: - name: UnnecessaryMap - body: "Unnecessary `map` usage (rewrite using a generator expression)" - suggestion: "Replace `map` using a generator expression" - fixable: true - location: - row: 21 - column: 0 - end_location: - row: 21 - column: 24 - fix: ~ - parent: ~ + fix: + content: " {v: v**2 for v in nums} " + location: + row: 16 + column: 7 + end_location: + row: 16 + column: 43 + parent: ~ + - kind: + name: UnnecessaryMap + body: "Unnecessary `map` usage (rewrite using a generator expression)" + suggestion: "Replace `map` using a generator expression" + fixable: true + location: + row: 21 + column: 0 + end_location: + row: 21 + column: 24 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ001_DTZ001.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ001_DTZ001.py.snap index 5aa766e1583a27..1c272e72bc12aa 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ001_DTZ001.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ001_DTZ001.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- -- kind: - name: CallDatetimeWithoutTzinfo - body: "The use of `datetime.datetime()` without `tzinfo` argument is not allowed" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 38 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeWithoutTzinfo - body: "The use of `datetime.datetime()` without `tzinfo` argument is not allowed" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 47 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeWithoutTzinfo - body: "The use of `datetime.datetime()` without `tzinfo` argument is not allowed" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 37 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeWithoutTzinfo - body: "The use of `datetime.datetime()` without `tzinfo` argument is not allowed" - suggestion: ~ - fixable: false - location: - row: 16 - column: 0 - end_location: - row: 16 - column: 42 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeWithoutTzinfo - body: "The use of `datetime.datetime()` without `tzinfo` argument is not allowed" - suggestion: ~ - fixable: false - location: - row: 21 - column: 0 - end_location: - row: 21 - column: 29 - fix: ~ - parent: ~ +- - kind: + name: CallDatetimeWithoutTzinfo + body: "The use of `datetime.datetime()` without `tzinfo` argument is not allowed" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 38 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeWithoutTzinfo + body: "The use of `datetime.datetime()` without `tzinfo` argument is not allowed" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 47 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeWithoutTzinfo + body: "The use of `datetime.datetime()` without `tzinfo` argument is not allowed" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 37 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeWithoutTzinfo + body: "The use of `datetime.datetime()` without `tzinfo` argument is not allowed" + suggestion: ~ + fixable: false + location: + row: 16 + column: 0 + end_location: + row: 16 + column: 42 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeWithoutTzinfo + body: "The use of `datetime.datetime()` without `tzinfo` argument is not allowed" + suggestion: ~ + fixable: false + location: + row: 21 + column: 0 + end_location: + row: 21 + column: 29 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ002_DTZ002.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ002_DTZ002.py.snap index a6c95716ba6d32..04b7d23cae1a68 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ002_DTZ002.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ002_DTZ002.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- -- kind: - name: CallDatetimeToday - body: "The use of `datetime.datetime.today()` is not allowed, use `datetime.datetime.now(tz=)` instead" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 25 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeToday - body: "The use of `datetime.datetime.today()` is not allowed, use `datetime.datetime.now(tz=)` instead" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 16 - fix: ~ - parent: ~ +- - kind: + name: CallDatetimeToday + body: "The use of `datetime.datetime.today()` is not allowed, use `datetime.datetime.now(tz=)` instead" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 25 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeToday + body: "The use of `datetime.datetime.today()` is not allowed, use `datetime.datetime.now(tz=)` instead" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 16 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ003_DTZ003.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ003_DTZ003.py.snap index 3876b15c6f5fd6..0a5fd0ba906629 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ003_DTZ003.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ003_DTZ003.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- -- kind: - name: CallDatetimeUtcnow - body: "The use of `datetime.datetime.utcnow()` is not allowed, use `datetime.datetime.now(tz=)` instead" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 26 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeUtcnow - body: "The use of `datetime.datetime.utcnow()` is not allowed, use `datetime.datetime.now(tz=)` instead" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: CallDatetimeUtcnow + body: "The use of `datetime.datetime.utcnow()` is not allowed, use `datetime.datetime.now(tz=)` instead" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 26 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeUtcnow + body: "The use of `datetime.datetime.utcnow()` is not allowed, use `datetime.datetime.now(tz=)` instead" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ004_DTZ004.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ004_DTZ004.py.snap index 86d06b24928910..5d38793e52b586 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ004_DTZ004.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ004_DTZ004.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- -- kind: - name: CallDatetimeUtcfromtimestamp - body: "The use of `datetime.datetime.utcfromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=)` instead" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 40 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeUtcfromtimestamp - body: "The use of `datetime.datetime.utcfromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=)` instead" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 31 - fix: ~ - parent: ~ +- - kind: + name: CallDatetimeUtcfromtimestamp + body: "The use of `datetime.datetime.utcfromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=)` instead" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 40 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeUtcfromtimestamp + body: "The use of `datetime.datetime.utcfromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=)` instead" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 31 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ005_DTZ005.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ005_DTZ005.py.snap index e074b603f106ce..01c7e0dedc68a2 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ005_DTZ005.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ005_DTZ005.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- -- kind: - name: CallDatetimeNowWithoutTzinfo - body: "The use of `datetime.datetime.now()` without `tz` argument is not allowed" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 23 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeNowWithoutTzinfo - body: "The use of `datetime.datetime.now()` without `tz` argument is not allowed" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 48 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeNowWithoutTzinfo - body: "The use of `datetime.datetime.now()` without `tz` argument is not allowed" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 27 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeNowWithoutTzinfo - body: "The use of `datetime.datetime.now()` without `tz` argument is not allowed" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 30 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeNowWithoutTzinfo - body: "The use of `datetime.datetime.now()` without `tz` argument is not allowed" - suggestion: ~ - fixable: false - location: - row: 18 - column: 0 - end_location: - row: 18 - column: 14 - fix: ~ - parent: ~ +- - kind: + name: CallDatetimeNowWithoutTzinfo + body: "The use of `datetime.datetime.now()` without `tz` argument is not allowed" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 23 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeNowWithoutTzinfo + body: "The use of `datetime.datetime.now()` without `tz` argument is not allowed" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 48 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeNowWithoutTzinfo + body: "The use of `datetime.datetime.now()` without `tz` argument is not allowed" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 27 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeNowWithoutTzinfo + body: "The use of `datetime.datetime.now()` without `tz` argument is not allowed" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 30 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeNowWithoutTzinfo + body: "The use of `datetime.datetime.now()` without `tz` argument is not allowed" + suggestion: ~ + fixable: false + location: + row: 18 + column: 0 + end_location: + row: 18 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ006_DTZ006.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ006_DTZ006.py.snap index a7ba9c66fb5c0b..1cfbe2b5664655 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ006_DTZ006.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ006_DTZ006.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- -- kind: - name: CallDatetimeFromtimestamp - body: "The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 37 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeFromtimestamp - body: "The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 64 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeFromtimestamp - body: "The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 43 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeFromtimestamp - body: "The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 46 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeFromtimestamp - body: "The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed" - suggestion: ~ - fixable: false - location: - row: 18 - column: 0 - end_location: - row: 18 - column: 28 - fix: ~ - parent: ~ +- - kind: + name: CallDatetimeFromtimestamp + body: "The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 37 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeFromtimestamp + body: "The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 64 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeFromtimestamp + body: "The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 43 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeFromtimestamp + body: "The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 46 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeFromtimestamp + body: "The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed" + suggestion: ~ + fixable: false + location: + row: 18 + column: 0 + end_location: + row: 18 + column: 28 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ007_DTZ007.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ007_DTZ007.py.snap index 3325a865e23a62..037fa9b945ff58 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ007_DTZ007.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ007_DTZ007.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- -- kind: - name: CallDatetimeStrptimeWithoutZone - body: "The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 53 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeStrptimeWithoutZone - body: "The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 52 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeStrptimeWithoutZone - body: "The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 52 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeStrptimeWithoutZone - body: "The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 52 - fix: ~ - parent: ~ -- kind: - name: CallDatetimeStrptimeWithoutZone - body: "The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()`" - suggestion: ~ - fixable: false - location: - row: 35 - column: 0 - end_location: - row: 35 - column: 43 - fix: ~ - parent: ~ +- - kind: + name: CallDatetimeStrptimeWithoutZone + body: "The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 53 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeStrptimeWithoutZone + body: "The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 52 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeStrptimeWithoutZone + body: "The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 52 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeStrptimeWithoutZone + body: "The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 52 + fix: ~ + parent: ~ + - kind: + name: CallDatetimeStrptimeWithoutZone + body: "The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()`" + suggestion: ~ + fixable: false + location: + row: 35 + column: 0 + end_location: + row: 35 + column: 43 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ011_DTZ011.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ011_DTZ011.py.snap index bb6ef5d79cc51b..4e6aaf1ac8cd87 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ011_DTZ011.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ011_DTZ011.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- -- kind: - name: CallDateToday - body: "The use of `datetime.date.today()` is not allowed, use `datetime.datetime.now(tz=).date()` instead" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 21 - fix: ~ - parent: ~ -- kind: - name: CallDateToday - body: "The use of `datetime.date.today()` is not allowed, use `datetime.datetime.now(tz=).date()` instead" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 12 - fix: ~ - parent: ~ +- - kind: + name: CallDateToday + body: "The use of `datetime.date.today()` is not allowed, use `datetime.datetime.now(tz=).date()` instead" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 21 + fix: ~ + parent: ~ + - kind: + name: CallDateToday + body: "The use of `datetime.date.today()` is not allowed, use `datetime.datetime.now(tz=).date()` instead" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 12 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ012_DTZ012.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ012_DTZ012.py.snap index 8de285a1bec83f..1e37b4f232bf8e 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ012_DTZ012.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ012_DTZ012.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs expression: diagnostics --- -- kind: - name: CallDateFromtimestamp - body: "The use of `datetime.date.fromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=).date()` instead" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 33 - fix: ~ - parent: ~ -- kind: - name: CallDateFromtimestamp - body: "The use of `datetime.date.fromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=).date()` instead" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 24 - fix: ~ - parent: ~ +- - kind: + name: CallDateFromtimestamp + body: "The use of `datetime.date.fromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=).date()` instead" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 33 + fix: ~ + parent: ~ + - kind: + name: CallDateFromtimestamp + body: "The use of `datetime.date.fromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=).date()` instead" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 24 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_debugger/snapshots/ruff__rules__flake8_debugger__tests__T100_T100.py.snap b/crates/ruff/src/rules/flake8_debugger/snapshots/ruff__rules__flake8_debugger__tests__T100_T100.py.snap index 7b9b19bebfb9d6..f23c5303670d9e 100644 --- a/crates/ruff/src/rules/flake8_debugger/snapshots/ruff__rules__flake8_debugger__tests__T100_T100.py.snap +++ b/crates/ruff/src/rules/flake8_debugger/snapshots/ruff__rules__flake8_debugger__tests__T100_T100.py.snap @@ -2,121 +2,121 @@ source: crates/ruff/src/rules/flake8_debugger/mod.rs expression: diagnostics --- -- kind: - name: Debugger - body: "Trace found: `breakpoint` used" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 12 - fix: ~ - parent: ~ -- kind: - name: Debugger - body: "Import for `pdb` found" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 10 - fix: ~ - parent: ~ -- kind: - name: Debugger - body: "Import for `builtins.breakpoint` found" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 31 - fix: ~ - parent: ~ -- kind: - name: Debugger - body: "Import for `pdb.set_trace` found" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 31 - fix: ~ - parent: ~ -- kind: - name: Debugger - body: "Import for `celery.contrib.rdb.set_trace` found" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 40 - fix: ~ - parent: ~ -- kind: - name: Debugger - body: "Import for `celery.contrib.rdb` found" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 25 - fix: ~ - parent: ~ -- kind: - name: Debugger - body: "Trace found: `builtins.breakpoint` used" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 12 - fix: ~ - parent: ~ -- kind: - name: Debugger - body: "Trace found: `pdb.set_trace` used" - suggestion: ~ - fixable: false - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 4 - fix: ~ - parent: ~ -- kind: - name: Debugger - body: "Trace found: `celery.contrib.rdb.set_trace` used" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 11 - fix: ~ - parent: ~ +- - kind: + name: Debugger + body: "Trace found: `breakpoint` used" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 12 + fix: ~ + parent: ~ + - kind: + name: Debugger + body: "Import for `pdb` found" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 10 + fix: ~ + parent: ~ + - kind: + name: Debugger + body: "Import for `builtins.breakpoint` found" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 31 + fix: ~ + parent: ~ + - kind: + name: Debugger + body: "Import for `pdb.set_trace` found" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 31 + fix: ~ + parent: ~ + - kind: + name: Debugger + body: "Import for `celery.contrib.rdb.set_trace` found" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 40 + fix: ~ + parent: ~ + - kind: + name: Debugger + body: "Import for `celery.contrib.rdb` found" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 25 + fix: ~ + parent: ~ + - kind: + name: Debugger + body: "Trace found: `builtins.breakpoint` used" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 12 + fix: ~ + parent: ~ + - kind: + name: Debugger + body: "Trace found: `pdb.set_trace` used" + suggestion: ~ + fixable: false + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 4 + fix: ~ + parent: ~ + - kind: + name: Debugger + body: "Trace found: `celery.contrib.rdb.set_trace` used" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 11 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ001_DJ001.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ001_DJ001.py.snap index ec413391ded12c..4330cf54ec0fd4 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ001_DJ001.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ001_DJ001.py.snap @@ -2,238 +2,238 @@ source: crates/ruff/src/rules/flake8_django/mod.rs expression: diagnostics --- -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as CharField" - suggestion: ~ - fixable: false - location: - row: 7 - column: 16 - end_location: - row: 7 - column: 59 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as TextField" - suggestion: ~ - fixable: false - location: - row: 8 - column: 16 - end_location: - row: 8 - column: 59 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as SlugField" - suggestion: ~ - fixable: false - location: - row: 9 - column: 16 - end_location: - row: 9 - column: 59 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as EmailField" - suggestion: ~ - fixable: false - location: - row: 10 - column: 17 - end_location: - row: 10 - column: 61 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as FilePathField" - suggestion: ~ - fixable: false - location: - row: 11 - column: 20 - end_location: - row: 11 - column: 67 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as URLField" - suggestion: ~ - fixable: false - location: - row: 12 - column: 15 - end_location: - row: 12 - column: 57 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as CharField" - suggestion: ~ - fixable: false - location: - row: 16 - column: 16 - end_location: - row: 16 - column: 64 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as CharField" - suggestion: ~ - fixable: false - location: - row: 17 - column: 16 - end_location: - row: 17 - column: 56 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as SlugField" - suggestion: ~ - fixable: false - location: - row: 18 - column: 16 - end_location: - row: 18 - column: 59 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as EmailField" - suggestion: ~ - fixable: false - location: - row: 19 - column: 17 - end_location: - row: 19 - column: 61 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as FilePathField" - suggestion: ~ - fixable: false - location: - row: 20 - column: 20 - end_location: - row: 20 - column: 67 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as URLField" - suggestion: ~ - fixable: false - location: - row: 21 - column: 15 - end_location: - row: 21 - column: 57 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as CharField" - suggestion: ~ - fixable: false - location: - row: 25 - column: 16 - end_location: - row: 25 - column: 64 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as CharField" - suggestion: ~ - fixable: false - location: - row: 26 - column: 16 - end_location: - row: 26 - column: 56 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as SlugField" - suggestion: ~ - fixable: false - location: - row: 27 - column: 16 - end_location: - row: 27 - column: 59 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as EmailField" - suggestion: ~ - fixable: false - location: - row: 28 - column: 17 - end_location: - row: 28 - column: 61 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as FilePathField" - suggestion: ~ - fixable: false - location: - row: 29 - column: 20 - end_location: - row: 29 - column: 67 - fix: ~ - parent: ~ -- kind: - name: NullableModelStringField - body: "Avoid using `null=True` on string-based fields such as URLField" - suggestion: ~ - fixable: false - location: - row: 30 - column: 15 - end_location: - row: 30 - column: 57 - fix: ~ - parent: ~ +- - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as CharField" + suggestion: ~ + fixable: false + location: + row: 7 + column: 16 + end_location: + row: 7 + column: 59 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as TextField" + suggestion: ~ + fixable: false + location: + row: 8 + column: 16 + end_location: + row: 8 + column: 59 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as SlugField" + suggestion: ~ + fixable: false + location: + row: 9 + column: 16 + end_location: + row: 9 + column: 59 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as EmailField" + suggestion: ~ + fixable: false + location: + row: 10 + column: 17 + end_location: + row: 10 + column: 61 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as FilePathField" + suggestion: ~ + fixable: false + location: + row: 11 + column: 20 + end_location: + row: 11 + column: 67 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as URLField" + suggestion: ~ + fixable: false + location: + row: 12 + column: 15 + end_location: + row: 12 + column: 57 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as CharField" + suggestion: ~ + fixable: false + location: + row: 16 + column: 16 + end_location: + row: 16 + column: 64 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as CharField" + suggestion: ~ + fixable: false + location: + row: 17 + column: 16 + end_location: + row: 17 + column: 56 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as SlugField" + suggestion: ~ + fixable: false + location: + row: 18 + column: 16 + end_location: + row: 18 + column: 59 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as EmailField" + suggestion: ~ + fixable: false + location: + row: 19 + column: 17 + end_location: + row: 19 + column: 61 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as FilePathField" + suggestion: ~ + fixable: false + location: + row: 20 + column: 20 + end_location: + row: 20 + column: 67 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as URLField" + suggestion: ~ + fixable: false + location: + row: 21 + column: 15 + end_location: + row: 21 + column: 57 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as CharField" + suggestion: ~ + fixable: false + location: + row: 25 + column: 16 + end_location: + row: 25 + column: 64 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as CharField" + suggestion: ~ + fixable: false + location: + row: 26 + column: 16 + end_location: + row: 26 + column: 56 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as SlugField" + suggestion: ~ + fixable: false + location: + row: 27 + column: 16 + end_location: + row: 27 + column: 59 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as EmailField" + suggestion: ~ + fixable: false + location: + row: 28 + column: 17 + end_location: + row: 28 + column: 61 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as FilePathField" + suggestion: ~ + fixable: false + location: + row: 29 + column: 20 + end_location: + row: 29 + column: 67 + fix: ~ + parent: ~ + - kind: + name: NullableModelStringField + body: "Avoid using `null=True` on string-based fields such as URLField" + suggestion: ~ + fixable: false + location: + row: 30 + column: 15 + end_location: + row: 30 + column: 57 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ003_DJ003.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ003_DJ003.py.snap index 790a1d5ae3b8b4..b0b86381e58582 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ003_DJ003.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ003_DJ003.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_django/mod.rs expression: diagnostics --- -- kind: - name: LocalsInRenderFunction - body: "Avoid passing `locals()` as context to a `render` function" - suggestion: ~ - fixable: false - location: - row: 5 - column: 41 - end_location: - row: 5 - column: 49 - fix: ~ - parent: ~ -- kind: - name: LocalsInRenderFunction - body: "Avoid passing `locals()` as context to a `render` function" - suggestion: ~ - fixable: false - location: - row: 9 - column: 49 - end_location: - row: 9 - column: 57 - fix: ~ - parent: ~ +- - kind: + name: LocalsInRenderFunction + body: "Avoid passing `locals()` as context to a `render` function" + suggestion: ~ + fixable: false + location: + row: 5 + column: 41 + end_location: + row: 5 + column: 49 + fix: ~ + parent: ~ + - kind: + name: LocalsInRenderFunction + body: "Avoid passing `locals()` as context to a `render` function" + suggestion: ~ + fixable: false + location: + row: 9 + column: 49 + end_location: + row: 9 + column: 57 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ006_DJ006.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ006_DJ006.py.snap index f49e9b0353dd19..f7c89edb6072ec 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ006_DJ006.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ006_DJ006.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_django/mod.rs expression: diagnostics --- -- kind: - name: ExcludeWithModelForm - body: "Do not use `exclude` with `ModelForm`, use `fields` instead" - suggestion: ~ - fixable: false - location: - row: 6 - column: 8 - end_location: - row: 6 - column: 15 - fix: ~ - parent: ~ +- - kind: + name: ExcludeWithModelForm + body: "Do not use `exclude` with `ModelForm`, use `fields` instead" + suggestion: ~ + fixable: false + location: + row: 6 + column: 8 + end_location: + row: 6 + column: 15 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ007_DJ007.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ007_DJ007.py.snap index 026d0ae882d964..8b721c36549b3f 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ007_DJ007.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ007_DJ007.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_django/mod.rs expression: diagnostics --- -- kind: - name: AllWithModelForm - body: "Do not use `__all__` with `ModelForm`, use `fields` instead" - suggestion: ~ - fixable: false - location: - row: 6 - column: 8 - end_location: - row: 6 - column: 26 - fix: ~ - parent: ~ -- kind: - name: AllWithModelForm - body: "Do not use `__all__` with `ModelForm`, use `fields` instead" - suggestion: ~ - fixable: false - location: - row: 11 - column: 8 - end_location: - row: 11 - column: 27 - fix: ~ - parent: ~ +- - kind: + name: AllWithModelForm + body: "Do not use `__all__` with `ModelForm`, use `fields` instead" + suggestion: ~ + fixable: false + location: + row: 6 + column: 8 + end_location: + row: 6 + column: 26 + fix: ~ + parent: ~ + - kind: + name: AllWithModelForm + body: "Do not use `__all__` with `ModelForm`, use `fields` instead" + suggestion: ~ + fixable: false + location: + row: 11 + column: 8 + end_location: + row: 11 + column: 27 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ008_DJ008.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ008_DJ008.py.snap index c8cb34f4a1e66b..6f4268356b8e71 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ008_DJ008.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ008_DJ008.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_django/mod.rs expression: diagnostics --- -- kind: - name: ModelWithoutDunderStr - body: "Model does not define `__str__` method" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 18 - column: 16 - fix: ~ - parent: ~ -- kind: - name: ModelWithoutDunderStr - body: "Model does not define `__str__` method" - suggestion: ~ - fixable: false - location: - row: 21 - column: 0 - end_location: - row: 33 - column: 16 - fix: ~ - parent: ~ -- kind: - name: ModelWithoutDunderStr - body: "Model does not define `__str__` method" - suggestion: ~ - fixable: false - location: - row: 36 - column: 0 - end_location: - row: 47 - column: 16 - fix: ~ - parent: ~ +- - kind: + name: ModelWithoutDunderStr + body: "Model does not define `__str__` method" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 18 + column: 16 + fix: ~ + parent: ~ + - kind: + name: ModelWithoutDunderStr + body: "Model does not define `__str__` method" + suggestion: ~ + fixable: false + location: + row: 21 + column: 0 + end_location: + row: 33 + column: 16 + fix: ~ + parent: ~ + - kind: + name: ModelWithoutDunderStr + body: "Model does not define `__str__` method" + suggestion: ~ + fixable: false + location: + row: 36 + column: 0 + end_location: + row: 47 + column: 16 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ013_DJ013.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ013_DJ013.py.snap index 60a35293fce27e..75c20ef635c346 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ013_DJ013.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ013_DJ013.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_django/mod.rs expression: diagnostics --- -- kind: - name: NonLeadingReceiverDecorator - body: "`@receiver` decorator must be on top of all the other decorators" - suggestion: ~ - fixable: false - location: - row: 15 - column: 1 - end_location: - row: 15 - column: 35 - fix: ~ - parent: ~ -- kind: - name: NonLeadingReceiverDecorator - body: "`@receiver` decorator must be on top of all the other decorators" - suggestion: ~ - fixable: false - location: - row: 35 - column: 1 - end_location: - row: 35 - column: 35 - fix: ~ - parent: ~ +- - kind: + name: NonLeadingReceiverDecorator + body: "`@receiver` decorator must be on top of all the other decorators" + suggestion: ~ + fixable: false + location: + row: 15 + column: 1 + end_location: + row: 15 + column: 35 + fix: ~ + parent: ~ + - kind: + name: NonLeadingReceiverDecorator + body: "`@receiver` decorator must be on top of all the other decorators" + suggestion: ~ + fixable: false + location: + row: 35 + column: 1 + end_location: + row: 35 + column: 35 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__custom.snap b/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__custom.snap index 11953d88fab00f..dc39b02f606dc4 100644 --- a/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__custom.snap +++ b/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__custom.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_errmsg/mod.rs expression: diagnostics --- -- kind: - name: RawStringInException - body: "Exception must not use a string literal, assign to variable first" - suggestion: ~ - fixable: false - location: - row: 5 - column: 23 - end_location: - row: 5 - column: 53 - fix: ~ - parent: ~ -- kind: - name: FStringInException - body: "Exception must not use an f-string literal, assign to variable first" - suggestion: ~ - fixable: false - location: - row: 14 - column: 23 - end_location: - row: 14 - column: 56 - fix: ~ - parent: ~ -- kind: - name: DotFormatInException - body: "Exception must not use a `.format()` string directly, assign to variable first" - suggestion: ~ - fixable: false - location: - row: 18 - column: 23 - end_location: - row: 18 - column: 81 - fix: ~ - parent: ~ +- - kind: + name: RawStringInException + body: "Exception must not use a string literal, assign to variable first" + suggestion: ~ + fixable: false + location: + row: 5 + column: 23 + end_location: + row: 5 + column: 53 + fix: ~ + parent: ~ + - kind: + name: FStringInException + body: "Exception must not use an f-string literal, assign to variable first" + suggestion: ~ + fixable: false + location: + row: 14 + column: 23 + end_location: + row: 14 + column: 56 + fix: ~ + parent: ~ + - kind: + name: DotFormatInException + body: "Exception must not use a `.format()` string directly, assign to variable first" + suggestion: ~ + fixable: false + location: + row: 18 + column: 23 + end_location: + row: 18 + column: 81 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__defaults.snap b/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__defaults.snap index 65c53e83ed2e74..7ce12f37fa54c5 100644 --- a/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__defaults.snap +++ b/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__defaults.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_errmsg/mod.rs expression: diagnostics --- -- kind: - name: RawStringInException - body: "Exception must not use a string literal, assign to variable first" - suggestion: ~ - fixable: false - location: - row: 5 - column: 23 - end_location: - row: 5 - column: 53 - fix: ~ - parent: ~ -- kind: - name: RawStringInException - body: "Exception must not use a string literal, assign to variable first" - suggestion: ~ - fixable: false - location: - row: 9 - column: 23 - end_location: - row: 9 - column: 30 - fix: ~ - parent: ~ -- kind: - name: FStringInException - body: "Exception must not use an f-string literal, assign to variable first" - suggestion: ~ - fixable: false - location: - row: 14 - column: 23 - end_location: - row: 14 - column: 56 - fix: ~ - parent: ~ -- kind: - name: DotFormatInException - body: "Exception must not use a `.format()` string directly, assign to variable first" - suggestion: ~ - fixable: false - location: - row: 18 - column: 23 - end_location: - row: 18 - column: 81 - fix: ~ - parent: ~ +- - kind: + name: RawStringInException + body: "Exception must not use a string literal, assign to variable first" + suggestion: ~ + fixable: false + location: + row: 5 + column: 23 + end_location: + row: 5 + column: 53 + fix: ~ + parent: ~ + - kind: + name: RawStringInException + body: "Exception must not use a string literal, assign to variable first" + suggestion: ~ + fixable: false + location: + row: 9 + column: 23 + end_location: + row: 9 + column: 30 + fix: ~ + parent: ~ + - kind: + name: FStringInException + body: "Exception must not use an f-string literal, assign to variable first" + suggestion: ~ + fixable: false + location: + row: 14 + column: 23 + end_location: + row: 14 + column: 56 + fix: ~ + parent: ~ + - kind: + name: DotFormatInException + body: "Exception must not use a `.format()` string directly, assign to variable first" + suggestion: ~ + fixable: false + location: + row: 18 + column: 23 + end_location: + row: 18 + column: 81 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_1.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_1.py.snap index b3f3f24af7419f..843011ab31cc7a 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_1.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_1.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- -- kind: - name: ShebangNotExecutable - body: Shebang is present but file is not executable - suggestion: ~ - fixable: false - location: - row: 1 - column: 2 - end_location: - row: 1 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: ShebangNotExecutable + body: Shebang is present but file is not executable + suggestion: ~ + fixable: false + location: + row: 1 + column: 2 + end_location: + row: 1 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_2.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_2.py.snap index c738409c4f8e5f..d7eaa733d177e6 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_2.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_2.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_executable/mod.rs +source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_3.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_3.py.snap index c738409c4f8e5f..d7eaa733d177e6 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_3.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_3.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_executable/mod.rs +source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_1.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_1.py.snap index 0385da5a1cf116..d6738424c3f7e0 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_1.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_1.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- -- kind: - name: ShebangMissingExecutableFile - body: The file is executable but no shebang is present - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: ~ - parent: ~ +- - kind: + name: ShebangMissingExecutableFile + body: The file is executable but no shebang is present + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 0 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_2.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_2.py.snap index c738409c4f8e5f..d7eaa733d177e6 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_2.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_2.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_executable/mod.rs +source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_3.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_3.py.snap index c738409c4f8e5f..d7eaa733d177e6 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_3.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_3.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_executable/mod.rs +source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE003.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE003.py.snap index 8d9a6c2dc84f43..238c909b7a8d02 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE003.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE003.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- -- kind: - name: ShebangPython - body: "Shebang should contain `python`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 15 - fix: ~ - parent: ~ +- - kind: + name: ShebangPython + body: "Shebang should contain `python`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 15 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_1.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_1.py.snap index 2b620ef8f24285..6fbe3aa628e1b4 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_1.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_1.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- -- kind: - name: ShebangWhitespace - body: Avoid whitespace before shebang - suggestion: Remove whitespace before shebang - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 4 - fix: - content: "" +- - kind: + name: ShebangWhitespace + body: Avoid whitespace before shebang + suggestion: Remove whitespace before shebang + fixable: true location: row: 1 column: 0 end_location: row: 1 column: 4 - parent: ~ + fix: + content: "" + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 4 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_2.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_2.py.snap index c738409c4f8e5f..d7eaa733d177e6 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_2.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_2.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_executable/mod.rs +source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_3.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_3.py.snap index 0385da5a1cf116..d6738424c3f7e0 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_3.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_3.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- -- kind: - name: ShebangMissingExecutableFile - body: The file is executable but no shebang is present - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: ~ - parent: ~ +- - kind: + name: ShebangMissingExecutableFile + body: The file is executable but no shebang is present + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 0 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_1.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_1.py.snap index 8fbfcb1d55270d..74f59741ea4dec 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_1.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_1.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- -- kind: - name: ShebangNewline - body: Shebang should be at the beginning of the file - suggestion: ~ - fixable: false - location: - row: 3 - column: 2 - end_location: - row: 3 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: ShebangNewline + body: Shebang should be at the beginning of the file + suggestion: ~ + fixable: false + location: + row: 3 + column: 2 + end_location: + row: 3 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_2.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_2.py.snap index d061b2485e4e5e..84237179de0363 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_2.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_2.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- -- kind: - name: ShebangNewline - body: Shebang should be at the beginning of the file - suggestion: ~ - fixable: false - location: - row: 4 - column: 2 - end_location: - row: 4 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: ShebangNewline + body: Shebang should be at the beginning of the file + suggestion: ~ + fixable: false + location: + row: 4 + column: 2 + end_location: + row: 4 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_3.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_3.py.snap index cfe1e981893a3e..0383b9cbf6a560 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_3.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_3.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_executable/mod.rs expression: diagnostics --- -- kind: - name: ShebangNewline - body: Shebang should be at the beginning of the file - suggestion: ~ - fixable: false - location: - row: 6 - column: 2 - end_location: - row: 6 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: ShebangNewline + body: Shebang should be at the beginning of the file + suggestion: ~ + fixable: false + location: + row: 6 + column: 2 + end_location: + row: 6 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC001_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC001_ISC.py.snap index 45749af82942bb..83ecba12072e23 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC001_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC001_ISC.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs expression: diagnostics --- -- kind: - name: SingleLineImplicitStringConcatenation - body: Implicitly concatenated string literals on one line - suggestion: ~ - fixable: false - location: - row: 1 - column: 4 - end_location: - row: 1 - column: 11 - fix: ~ - parent: ~ -- kind: - name: SingleLineImplicitStringConcatenation - body: Implicitly concatenated string literals on one line - suggestion: ~ - fixable: false - location: - row: 1 - column: 8 - end_location: - row: 1 - column: 15 - fix: ~ - parent: ~ +- - kind: + name: SingleLineImplicitStringConcatenation + body: Implicitly concatenated string literals on one line + suggestion: ~ + fixable: false + location: + row: 1 + column: 4 + end_location: + row: 1 + column: 11 + fix: ~ + parent: ~ + - kind: + name: SingleLineImplicitStringConcatenation + body: Implicitly concatenated string literals on one line + suggestion: ~ + fixable: false + location: + row: 1 + column: 8 + end_location: + row: 1 + column: 15 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC002_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC002_ISC.py.snap index 39275dd7c04b97..ee0d0dd19fc9e5 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC002_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC002_ISC.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs expression: diagnostics --- -- kind: - name: MultiLineImplicitStringConcatenation - body: Implicitly concatenated string literals over multiple lines - suggestion: ~ - fixable: false - location: - row: 5 - column: 4 - end_location: - row: 6 - column: 9 - fix: ~ - parent: ~ +- - kind: + name: MultiLineImplicitStringConcatenation + body: Implicitly concatenated string literals over multiple lines + suggestion: ~ + fixable: false + location: + row: 5 + column: 4 + end_location: + row: 6 + column: 9 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC003_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC003_ISC.py.snap index c456628a15b379..9146cd9458d854 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC003_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC003_ISC.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs expression: diagnostics --- -- kind: - name: ExplicitStringConcatenation - body: Explicitly concatenated string should be implicitly concatenated - suggestion: ~ - fixable: false - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 17 - fix: ~ - parent: ~ -- kind: - name: ExplicitStringConcatenation - body: Explicitly concatenated string should be implicitly concatenated - suggestion: ~ - fixable: false - location: - row: 9 - column: 2 - end_location: - row: 10 - column: 7 - fix: ~ - parent: ~ -- kind: - name: ExplicitStringConcatenation - body: Explicitly concatenated string should be implicitly concatenated - suggestion: ~ - fixable: false - location: - row: 14 - column: 2 - end_location: - row: 15 - column: 7 - fix: ~ - parent: ~ -- kind: - name: ExplicitStringConcatenation - body: Explicitly concatenated string should be implicitly concatenated - suggestion: ~ - fixable: false - location: - row: 19 - column: 2 - end_location: - row: 20 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: ExplicitStringConcatenation + body: Explicitly concatenated string should be implicitly concatenated + suggestion: ~ + fixable: false + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 17 + fix: ~ + parent: ~ + - kind: + name: ExplicitStringConcatenation + body: Explicitly concatenated string should be implicitly concatenated + suggestion: ~ + fixable: false + location: + row: 9 + column: 2 + end_location: + row: 10 + column: 7 + fix: ~ + parent: ~ + - kind: + name: ExplicitStringConcatenation + body: Explicitly concatenated string should be implicitly concatenated + suggestion: ~ + fixable: false + location: + row: 14 + column: 2 + end_location: + row: 15 + column: 7 + fix: ~ + parent: ~ + - kind: + name: ExplicitStringConcatenation + body: Explicitly concatenated string should be implicitly concatenated + suggestion: ~ + fixable: false + location: + row: 19 + column: 2 + end_location: + row: 20 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC001_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC001_ISC.py.snap index 45749af82942bb..83ecba12072e23 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC001_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC001_ISC.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs expression: diagnostics --- -- kind: - name: SingleLineImplicitStringConcatenation - body: Implicitly concatenated string literals on one line - suggestion: ~ - fixable: false - location: - row: 1 - column: 4 - end_location: - row: 1 - column: 11 - fix: ~ - parent: ~ -- kind: - name: SingleLineImplicitStringConcatenation - body: Implicitly concatenated string literals on one line - suggestion: ~ - fixable: false - location: - row: 1 - column: 8 - end_location: - row: 1 - column: 15 - fix: ~ - parent: ~ +- - kind: + name: SingleLineImplicitStringConcatenation + body: Implicitly concatenated string literals on one line + suggestion: ~ + fixable: false + location: + row: 1 + column: 4 + end_location: + row: 1 + column: 11 + fix: ~ + parent: ~ + - kind: + name: SingleLineImplicitStringConcatenation + body: Implicitly concatenated string literals on one line + suggestion: ~ + fixable: false + location: + row: 1 + column: 8 + end_location: + row: 1 + column: 15 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC002_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC002_ISC.py.snap index 1564ce7da40d92..d69946bb3ec030 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC002_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC002_ISC.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs expression: diagnostics --- -- kind: - name: MultiLineImplicitStringConcatenation - body: Implicitly concatenated string literals over multiple lines - suggestion: ~ - fixable: false - location: - row: 5 - column: 4 - end_location: - row: 6 - column: 9 - fix: ~ - parent: ~ -- kind: - name: MultiLineImplicitStringConcatenation - body: Implicitly concatenated string literals over multiple lines - suggestion: ~ - fixable: false - location: - row: 24 - column: 2 - end_location: - row: 25 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiLineImplicitStringConcatenation - body: Implicitly concatenated string literals over multiple lines - suggestion: ~ - fixable: false - location: - row: 29 - column: 2 - end_location: - row: 30 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiLineImplicitStringConcatenation - body: Implicitly concatenated string literals over multiple lines - suggestion: ~ - fixable: false - location: - row: 34 - column: 2 - end_location: - row: 35 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: MultiLineImplicitStringConcatenation + body: Implicitly concatenated string literals over multiple lines + suggestion: ~ + fixable: false + location: + row: 5 + column: 4 + end_location: + row: 6 + column: 9 + fix: ~ + parent: ~ + - kind: + name: MultiLineImplicitStringConcatenation + body: Implicitly concatenated string literals over multiple lines + suggestion: ~ + fixable: false + location: + row: 24 + column: 2 + end_location: + row: 25 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiLineImplicitStringConcatenation + body: Implicitly concatenated string literals over multiple lines + suggestion: ~ + fixable: false + location: + row: 29 + column: 2 + end_location: + row: 30 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiLineImplicitStringConcatenation + body: Implicitly concatenated string literals over multiple lines + suggestion: ~ + fixable: false + location: + row: 34 + column: 2 + end_location: + row: 35 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC003_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC003_ISC.py.snap index c456628a15b379..9146cd9458d854 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC003_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC003_ISC.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs expression: diagnostics --- -- kind: - name: ExplicitStringConcatenation - body: Explicitly concatenated string should be implicitly concatenated - suggestion: ~ - fixable: false - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 17 - fix: ~ - parent: ~ -- kind: - name: ExplicitStringConcatenation - body: Explicitly concatenated string should be implicitly concatenated - suggestion: ~ - fixable: false - location: - row: 9 - column: 2 - end_location: - row: 10 - column: 7 - fix: ~ - parent: ~ -- kind: - name: ExplicitStringConcatenation - body: Explicitly concatenated string should be implicitly concatenated - suggestion: ~ - fixable: false - location: - row: 14 - column: 2 - end_location: - row: 15 - column: 7 - fix: ~ - parent: ~ -- kind: - name: ExplicitStringConcatenation - body: Explicitly concatenated string should be implicitly concatenated - suggestion: ~ - fixable: false - location: - row: 19 - column: 2 - end_location: - row: 20 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: ExplicitStringConcatenation + body: Explicitly concatenated string should be implicitly concatenated + suggestion: ~ + fixable: false + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 17 + fix: ~ + parent: ~ + - kind: + name: ExplicitStringConcatenation + body: Explicitly concatenated string should be implicitly concatenated + suggestion: ~ + fixable: false + location: + row: 9 + column: 2 + end_location: + row: 10 + column: 7 + fix: ~ + parent: ~ + - kind: + name: ExplicitStringConcatenation + body: Explicitly concatenated string should be implicitly concatenated + suggestion: ~ + fixable: false + location: + row: 14 + column: 2 + end_location: + row: 15 + column: 7 + fix: ~ + parent: ~ + - kind: + name: ExplicitStringConcatenation + body: Explicitly concatenated string should be implicitly concatenated + suggestion: ~ + fixable: false + location: + row: 19 + column: 2 + end_location: + row: 20 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__custom.snap b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__custom.snap index dc82abb0e77989..0de02f21ef9ef2 100644 --- a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__custom.snap +++ b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__custom.snap @@ -2,368 +2,368 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs expression: diagnostics --- -- kind: - name: UnconventionalImportAlias - body: "`altair` should be imported as `alt`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 13 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`dask.array` should be imported as `da`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 17 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`dask.dataframe` should be imported as `dd`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 21 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`matplotlib.pyplot` should be imported as `plt`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 24 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`numpy` should be imported as `np`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 12 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`pandas` should be imported as `pd`" - suggestion: ~ - fixable: false - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 13 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`seaborn` should be imported as `sns`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 14 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`tensorflow` should be imported as `tf`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 17 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`holoviews` should be imported as `hv`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 16 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`panel` should be imported as `pn`" - suggestion: ~ - fixable: false - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 12 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`plotly.express` should be imported as `px`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 21 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`matplotlib` should be imported as `mpl`" - suggestion: ~ - fixable: false - location: - row: 14 - column: 0 - end_location: - row: 14 - column: 17 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`polars` should be imported as `pl`" - suggestion: ~ - fixable: false - location: - row: 15 - column: 0 - end_location: - row: 15 - column: 13 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`pyarrow` should be imported as `pa`" - suggestion: ~ - fixable: false - location: - row: 16 - column: 0 - end_location: - row: 16 - column: 14 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`altair` should be imported as `alt`" - suggestion: ~ - fixable: false - location: - row: 18 - column: 0 - end_location: - row: 18 - column: 21 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`matplotlib.pyplot` should be imported as `plt`" - suggestion: ~ - fixable: false - location: - row: 19 - column: 0 - end_location: - row: 19 - column: 32 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`dask.array` should be imported as `da`" - suggestion: ~ - fixable: false - location: - row: 20 - column: 0 - end_location: - row: 20 - column: 27 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`dask.dataframe` should be imported as `dd`" - suggestion: ~ - fixable: false - location: - row: 21 - column: 0 - end_location: - row: 21 - column: 28 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`numpy` should be imported as `np`" - suggestion: ~ - fixable: false - location: - row: 22 - column: 0 - end_location: - row: 22 - column: 19 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`pandas` should be imported as `pd`" - suggestion: ~ - fixable: false - location: - row: 23 - column: 0 - end_location: - row: 23 - column: 21 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`seaborn` should be imported as `sns`" - suggestion: ~ - fixable: false - location: - row: 24 - column: 0 - end_location: - row: 24 - column: 22 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`tensorflow` should be imported as `tf`" - suggestion: ~ - fixable: false - location: - row: 25 - column: 0 - end_location: - row: 25 - column: 24 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`holoviews` should be imported as `hv`" - suggestion: ~ - fixable: false - location: - row: 26 - column: 0 - end_location: - row: 26 - column: 23 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`panel` should be imported as `pn`" - suggestion: ~ - fixable: false - location: - row: 27 - column: 0 - end_location: - row: 27 - column: 19 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`plotly.express` should be imported as `px`" - suggestion: ~ - fixable: false - location: - row: 28 - column: 0 - end_location: - row: 28 - column: 29 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`matplotlib` should be imported as `mpl`" - suggestion: ~ - fixable: false - location: - row: 29 - column: 0 - end_location: - row: 29 - column: 23 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`polars` should be imported as `pl`" - suggestion: ~ - fixable: false - location: - row: 30 - column: 0 - end_location: - row: 30 - column: 19 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`pyarrow` should be imported as `pa`" - suggestion: ~ - fixable: false - location: - row: 31 - column: 0 - end_location: - row: 31 - column: 21 - fix: ~ - parent: ~ +- - kind: + name: UnconventionalImportAlias + body: "`altair` should be imported as `alt`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 13 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`dask.array` should be imported as `da`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 17 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`dask.dataframe` should be imported as `dd`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 21 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`matplotlib.pyplot` should be imported as `plt`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 24 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`numpy` should be imported as `np`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 12 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`pandas` should be imported as `pd`" + suggestion: ~ + fixable: false + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 13 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`seaborn` should be imported as `sns`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 14 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`tensorflow` should be imported as `tf`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 17 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`holoviews` should be imported as `hv`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 16 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`panel` should be imported as `pn`" + suggestion: ~ + fixable: false + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 12 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`plotly.express` should be imported as `px`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 21 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`matplotlib` should be imported as `mpl`" + suggestion: ~ + fixable: false + location: + row: 14 + column: 0 + end_location: + row: 14 + column: 17 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`polars` should be imported as `pl`" + suggestion: ~ + fixable: false + location: + row: 15 + column: 0 + end_location: + row: 15 + column: 13 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`pyarrow` should be imported as `pa`" + suggestion: ~ + fixable: false + location: + row: 16 + column: 0 + end_location: + row: 16 + column: 14 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`altair` should be imported as `alt`" + suggestion: ~ + fixable: false + location: + row: 18 + column: 0 + end_location: + row: 18 + column: 21 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`matplotlib.pyplot` should be imported as `plt`" + suggestion: ~ + fixable: false + location: + row: 19 + column: 0 + end_location: + row: 19 + column: 32 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`dask.array` should be imported as `da`" + suggestion: ~ + fixable: false + location: + row: 20 + column: 0 + end_location: + row: 20 + column: 27 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`dask.dataframe` should be imported as `dd`" + suggestion: ~ + fixable: false + location: + row: 21 + column: 0 + end_location: + row: 21 + column: 28 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`numpy` should be imported as `np`" + suggestion: ~ + fixable: false + location: + row: 22 + column: 0 + end_location: + row: 22 + column: 19 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`pandas` should be imported as `pd`" + suggestion: ~ + fixable: false + location: + row: 23 + column: 0 + end_location: + row: 23 + column: 21 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`seaborn` should be imported as `sns`" + suggestion: ~ + fixable: false + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 22 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`tensorflow` should be imported as `tf`" + suggestion: ~ + fixable: false + location: + row: 25 + column: 0 + end_location: + row: 25 + column: 24 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`holoviews` should be imported as `hv`" + suggestion: ~ + fixable: false + location: + row: 26 + column: 0 + end_location: + row: 26 + column: 23 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`panel` should be imported as `pn`" + suggestion: ~ + fixable: false + location: + row: 27 + column: 0 + end_location: + row: 27 + column: 19 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`plotly.express` should be imported as `px`" + suggestion: ~ + fixable: false + location: + row: 28 + column: 0 + end_location: + row: 28 + column: 29 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`matplotlib` should be imported as `mpl`" + suggestion: ~ + fixable: false + location: + row: 29 + column: 0 + end_location: + row: 29 + column: 23 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`polars` should be imported as `pl`" + suggestion: ~ + fixable: false + location: + row: 30 + column: 0 + end_location: + row: 30 + column: 19 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`pyarrow` should be imported as `pa`" + suggestion: ~ + fixable: false + location: + row: 31 + column: 0 + end_location: + row: 31 + column: 21 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__defaults.snap b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__defaults.snap index 4099963bfbb856..e81c27d2ed1528 100644 --- a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__defaults.snap +++ b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__defaults.snap @@ -2,134 +2,134 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs expression: diagnostics --- -- kind: - name: UnconventionalImportAlias - body: "`altair` should be imported as `alt`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 13 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`matplotlib.pyplot` should be imported as `plt`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 24 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`numpy` should be imported as `np`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 12 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`pandas` should be imported as `pd`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 13 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`seaborn` should be imported as `sns`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 14 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`altair` should be imported as `alt`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 21 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`matplotlib.pyplot` should be imported as `plt`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 32 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`numpy` should be imported as `np`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 19 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`pandas` should be imported as `pd`" - suggestion: ~ - fixable: false - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 21 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`seaborn` should be imported as `sns`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 22 - fix: ~ - parent: ~ +- - kind: + name: UnconventionalImportAlias + body: "`altair` should be imported as `alt`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 13 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`matplotlib.pyplot` should be imported as `plt`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 24 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`numpy` should be imported as `np`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 12 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`pandas` should be imported as `pd`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 13 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`seaborn` should be imported as `sns`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 14 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`altair` should be imported as `alt`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 21 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`matplotlib.pyplot` should be imported as `plt`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 32 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`numpy` should be imported as `np`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 19 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`pandas` should be imported as `pd`" + suggestion: ~ + fixable: false + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 21 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`seaborn` should be imported as `sns`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 22 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__from_imports.snap b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__from_imports.snap index 4ebb3c5e699741..008e10b3cdb183 100644 --- a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__from_imports.snap +++ b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__from_imports.snap @@ -2,108 +2,108 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs expression: diagnostics --- -- kind: - name: UnconventionalImportAlias - body: "`xml.dom.minidom` should be imported as `md`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 22 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`xml.dom.minidom` should be imported as `md`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 31 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`xml.dom.minidom` should be imported as `md`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 36 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`xml.dom.minidom` should be imported as `md`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 27 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`xml.dom.minidom.parseString` should be imported as `pstr`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 48 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`xml.dom.minidom.parseString` should be imported as `pstr`" - suggestion: ~ - fixable: false - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 39 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`xml.dom.minidom.parseString` should be imported as `pstr`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 46 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`xml.dom.minidom.parseString` should be imported as `pstr`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 61 - fix: ~ - parent: ~ +- - kind: + name: UnconventionalImportAlias + body: "`xml.dom.minidom` should be imported as `md`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 22 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`xml.dom.minidom` should be imported as `md`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 31 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`xml.dom.minidom` should be imported as `md`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 36 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`xml.dom.minidom` should be imported as `md`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 27 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`xml.dom.minidom.parseString` should be imported as `pstr`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 48 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`xml.dom.minidom.parseString` should be imported as `pstr`" + suggestion: ~ + fixable: false + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 39 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`xml.dom.minidom.parseString` should be imported as `pstr`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 46 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`xml.dom.minidom.parseString` should be imported as `pstr`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 61 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__override_default.snap b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__override_default.snap index ee169a6bc9bf67..65a7eaebdb375a 100644 --- a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__override_default.snap +++ b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__override_default.snap @@ -2,134 +2,134 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs expression: diagnostics --- -- kind: - name: UnconventionalImportAlias - body: "`altair` should be imported as `alt`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 13 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`matplotlib.pyplot` should be imported as `plt`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 24 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`numpy` should be imported as `nmp`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 12 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`pandas` should be imported as `pd`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 13 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`seaborn` should be imported as `sns`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 14 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`altair` should be imported as `alt`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 21 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`matplotlib.pyplot` should be imported as `plt`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 32 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`numpy` should be imported as `nmp`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 18 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`pandas` should be imported as `pd`" - suggestion: ~ - fixable: false - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 21 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`seaborn` should be imported as `sns`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 22 - fix: ~ - parent: ~ +- - kind: + name: UnconventionalImportAlias + body: "`altair` should be imported as `alt`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 13 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`matplotlib.pyplot` should be imported as `plt`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 24 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`numpy` should be imported as `nmp`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 12 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`pandas` should be imported as `pd`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 13 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`seaborn` should be imported as `sns`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 14 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`altair` should be imported as `alt`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 21 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`matplotlib.pyplot` should be imported as `plt`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 32 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`numpy` should be imported as `nmp`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 18 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`pandas` should be imported as `pd`" + suggestion: ~ + fixable: false + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 21 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`seaborn` should be imported as `sns`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 22 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__remove_default.snap b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__remove_default.snap index 3fa3cc89eca066..9dcac7355b624b 100644 --- a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__remove_default.snap +++ b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__remove_default.snap @@ -2,108 +2,108 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs expression: diagnostics --- -- kind: - name: UnconventionalImportAlias - body: "`altair` should be imported as `alt`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 13 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`matplotlib.pyplot` should be imported as `plt`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 24 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`pandas` should be imported as `pd`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 13 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`seaborn` should be imported as `sns`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 14 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`altair` should be imported as `alt`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 21 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`matplotlib.pyplot` should be imported as `plt`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 32 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`pandas` should be imported as `pd`" - suggestion: ~ - fixable: false - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 21 - fix: ~ - parent: ~ -- kind: - name: UnconventionalImportAlias - body: "`seaborn` should be imported as `sns`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 22 - fix: ~ - parent: ~ +- - kind: + name: UnconventionalImportAlias + body: "`altair` should be imported as `alt`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 13 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`matplotlib.pyplot` should be imported as `plt`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 24 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`pandas` should be imported as `pd`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 13 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`seaborn` should be imported as `sns`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 14 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`altair` should be imported as `alt`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 21 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`matplotlib.pyplot` should be imported as `plt`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 32 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`pandas` should be imported as `pd`" + suggestion: ~ + fixable: false + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 21 + fix: ~ + parent: ~ + - kind: + name: UnconventionalImportAlias + body: "`seaborn` should be imported as `sns`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 22 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G001.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G001.py.snap index cb945fa72f91ba..3be11785e71276 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G001.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G001.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- -- kind: - name: LoggingStringFormat - body: "Logging statement uses `string.format()`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 13 - end_location: - row: 3 - column: 40 - fix: ~ - parent: ~ +- - kind: + name: LoggingStringFormat + body: "Logging statement uses `string.format()`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 13 + end_location: + row: 3 + column: 40 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G002.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G002.py.snap index 6f0fea8958a7ee..7089f00993c6be 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G002.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G002.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- -- kind: - name: LoggingPercentFormat - body: "Logging statement uses `%`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 13 - end_location: - row: 3 - column: 34 - fix: ~ - parent: ~ +- - kind: + name: LoggingPercentFormat + body: "Logging statement uses `%`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 13 + end_location: + row: 3 + column: 34 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G003.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G003.py.snap index 6f54ca0d5a4b6d..60df52e14511dc 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G003.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G003.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- -- kind: - name: LoggingStringConcat - body: "Logging statement uses `+`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 13 - end_location: - row: 3 - column: 37 - fix: ~ - parent: ~ +- - kind: + name: LoggingStringConcat + body: "Logging statement uses `+`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 13 + end_location: + row: 3 + column: 37 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G004.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G004.py.snap index 3ee12ae84e8fa1..c5173ce4f67258 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G004.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G004.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- -- kind: - name: LoggingFString - body: Logging statement uses f-string - suggestion: ~ - fixable: false - location: - row: 4 - column: 13 - end_location: - row: 4 - column: 28 - fix: ~ - parent: ~ +- - kind: + name: LoggingFString + body: Logging statement uses f-string + suggestion: ~ + fixable: false + location: + row: 4 + column: 13 + end_location: + row: 4 + column: 28 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G010.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G010.py.snap index 8acad06bf0a301..d678b47b3e990e 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G010.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G010.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- -- kind: - name: LoggingWarn - body: "Logging statement uses `warn` instead of `warning`" - suggestion: "Convert to `warn`" - fixable: true - location: - row: 3 - column: 8 - end_location: - row: 3 - column: 12 - fix: - content: warning +- - kind: + name: LoggingWarn + body: "Logging statement uses `warn` instead of `warning`" + suggestion: "Convert to `warn`" + fixable: true location: row: 3 column: 8 end_location: row: 3 column: 12 - parent: ~ + fix: + content: warning + location: + row: 3 + column: 8 + end_location: + row: 3 + column: 12 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_1.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_1.py.snap index 772347a51fe36a..7ebdfef99ccb65 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_1.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_1.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- -- kind: - name: LoggingExtraAttrClash - body: "Logging statement uses an extra field that clashes with a LogRecord field: `name`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 8 - end_location: - row: 6 - column: 14 - fix: ~ - parent: ~ +- - kind: + name: LoggingExtraAttrClash + body: "Logging statement uses an extra field that clashes with a LogRecord field: `name`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 8 + end_location: + row: 6 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_2.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_2.py.snap index 52f92e5f0e0b63..7b877791f6156a 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_2.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_2.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- -- kind: - name: LoggingExtraAttrClash - body: "Logging statement uses an extra field that clashes with a LogRecord field: `name`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 8 - end_location: - row: 6 - column: 21 - fix: ~ - parent: ~ +- - kind: + name: LoggingExtraAttrClash + body: "Logging statement uses an extra field that clashes with a LogRecord field: `name`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 8 + end_location: + row: 6 + column: 21 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G201.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G201.py.snap index 8a84f8095e4c37..32bdb2870ba397 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G201.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G201.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- -- kind: - name: LoggingExcInfo - body: "Logging `.exception(...)` should be used instead of `.error(..., exc_info=True)`" - suggestion: ~ - fixable: false - location: - row: 8 - column: 12 - end_location: - row: 8 - column: 17 - fix: ~ - parent: ~ -- kind: - name: LoggingExcInfo - body: "Logging `.exception(...)` should be used instead of `.error(..., exc_info=True)`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 12 - end_location: - row: 13 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: LoggingExcInfo + body: "Logging `.exception(...)` should be used instead of `.error(..., exc_info=True)`" + suggestion: ~ + fixable: false + location: + row: 8 + column: 12 + end_location: + row: 8 + column: 17 + fix: ~ + parent: ~ + - kind: + name: LoggingExcInfo + body: "Logging `.exception(...)` should be used instead of `.error(..., exc_info=True)`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 12 + end_location: + row: 13 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G202.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G202.py.snap index 618250295301b3..fcf111313f01e6 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G202.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G202.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- -- kind: - name: LoggingRedundantExcInfo - body: "Logging statement has redundant `exc_info`" - suggestion: ~ - fixable: false - location: - row: 8 - column: 37 - end_location: - row: 8 - column: 50 - fix: ~ - parent: ~ -- kind: - name: LoggingRedundantExcInfo - body: "Logging statement has redundant `exc_info`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 37 - end_location: - row: 13 - column: 60 - fix: ~ - parent: ~ +- - kind: + name: LoggingRedundantExcInfo + body: "Logging statement has redundant `exc_info`" + suggestion: ~ + fixable: false + location: + row: 8 + column: 37 + end_location: + row: 8 + column: 50 + fix: ~ + parent: ~ + - kind: + name: LoggingRedundantExcInfo + body: "Logging statement has redundant `exc_info`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 37 + end_location: + row: 13 + column: 60 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_argparse_parser_error_ok.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_argparse_parser_error_ok.py.snap index c3e0ede3d2c812..60e8193deb8b60 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_argparse_parser_error_ok.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_argparse_parser_error_ok.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_logging_format/mod.rs +source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_extra_ok.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_extra_ok.py.snap index c3e0ede3d2c812..60e8193deb8b60 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_extra_ok.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_extra_ok.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_logging_format/mod.rs +source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_extra_str_format_ok.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_extra_str_format_ok.py.snap index c3e0ede3d2c812..60e8193deb8b60 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_extra_str_format_ok.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_extra_str_format_ok.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_logging_format/mod.rs +source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_simple_ok.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_simple_ok.py.snap index c3e0ede3d2c812..60e8193deb8b60 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_simple_ok.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_simple_ok.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_logging_format/mod.rs +source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_warnings_ok.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_warnings_ok.py.snap index c3e0ede3d2c812..60e8193deb8b60 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_warnings_ok.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G_warnings_ok.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_logging_format/mod.rs +source: crates/ruff/src/rules/flake8_logging_format/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_empty.snap b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_empty.snap index b38e65e42ff17a..8546cee565c396 100644 --- a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_empty.snap +++ b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_empty.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_no_pep420/mod.rs expression: diagnostics --- -- kind: - name: ImplicitNamespacePackage - body: "File `./resources/test/fixtures/flake8_no_pep420/test_fail_empty/example.py` is part of an implicit namespace package. Add an `__init__.py`." - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: ~ - parent: ~ +- - kind: + name: ImplicitNamespacePackage + body: "File `./resources/test/fixtures/flake8_no_pep420/test_fail_empty/example.py` is part of an implicit namespace package. Add an `__init__.py`." + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 0 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_nonempty.snap b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_nonempty.snap index 0adfeb0881d980..c01eb961b15663 100644 --- a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_nonempty.snap +++ b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_nonempty.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_no_pep420/mod.rs expression: diagnostics --- -- kind: - name: ImplicitNamespacePackage - body: "File `./resources/test/fixtures/flake8_no_pep420/test_fail_nonempty/example.py` is part of an implicit namespace package. Add an `__init__.py`." - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: ~ - parent: ~ +- - kind: + name: ImplicitNamespacePackage + body: "File `./resources/test/fixtures/flake8_no_pep420/test_fail_nonempty/example.py` is part of an implicit namespace package. Add an `__init__.py`." + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 0 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_shebang.snap b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_shebang.snap index 8a931e5242bd9d..5bbbf3fd91428d 100644 --- a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_shebang.snap +++ b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_shebang.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_no_pep420/mod.rs expression: diagnostics --- -- kind: - name: ImplicitNamespacePackage - body: "File `./resources/test/fixtures/flake8_no_pep420/test_fail_shebang/example.py` is part of an implicit namespace package. Add an `__init__.py`." - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: ~ - parent: ~ +- - kind: + name: ImplicitNamespacePackage + body: "File `./resources/test/fixtures/flake8_no_pep420/test_fail_shebang/example.py` is part of an implicit namespace package. Add an `__init__.py`." + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 0 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_ignored.snap b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_ignored.snap index 622ebcff04079e..4bac35fa4b2a50 100644 --- a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_ignored.snap +++ b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_ignored.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_no_pep420/mod.rs +source: crates/ruff/src/rules/flake8_no_pep420/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_pass_init.snap b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_pass_init.snap index 622ebcff04079e..4bac35fa4b2a50 100644 --- a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_pass_init.snap +++ b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_pass_init.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_no_pep420/mod.rs +source: crates/ruff/src/rules/flake8_no_pep420/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_pass_namespace_package.snap b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_pass_namespace_package.snap index 622ebcff04079e..4bac35fa4b2a50 100644 --- a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_pass_namespace_package.snap +++ b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_pass_namespace_package.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_no_pep420/mod.rs +source: crates/ruff/src/rules/flake8_no_pep420/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_pass_pyi.snap b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_pass_pyi.snap index 622ebcff04079e..4bac35fa4b2a50 100644 --- a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_pass_pyi.snap +++ b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_pass_pyi.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_no_pep420/mod.rs +source: crates/ruff/src/rules/flake8_no_pep420/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_pass_script.snap b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_pass_script.snap index b25a9aa1ca84ff..4bac35fa4b2a50 100644 --- a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_pass_script.snap +++ b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_pass_script.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/flake8_no_pep420/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE790_PIE790.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE790_PIE790.py.snap index a82fccfa28e892..f26133882d36d1 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE790_PIE790.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE790_PIE790.py.snap @@ -2,344 +2,344 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 8 - fix: - content: "" +- - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 4 - column: 0 + column: 4 end_location: - row: 5 - column: 0 - parent: ~ -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 8 - fix: - content: "" + row: 4 + column: 8 + fix: + content: "" + location: + row: 4 + column: 0 + end_location: + row: 5 + column: 0 + parent: ~ + - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 9 - column: 0 + column: 4 end_location: - row: 10 - column: 0 - parent: ~ -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 8 - fix: - content: "" + row: 9 + column: 8 + fix: + content: "" + location: + row: 9 + column: 0 + end_location: + row: 10 + column: 0 + parent: ~ + - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 14 column: 4 end_location: row: 14 - column: 10 - parent: ~ -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 21 - column: 4 - end_location: - row: 21 - column: 8 - fix: - content: "" + column: 8 + fix: + content: "" + location: + row: 14 + column: 4 + end_location: + row: 14 + column: 10 + parent: ~ + - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 21 - column: 0 + column: 4 end_location: - row: 22 - column: 0 - parent: ~ -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 28 - column: 4 - end_location: - row: 28 - column: 8 - fix: - content: "" + row: 21 + column: 8 + fix: + content: "" + location: + row: 21 + column: 0 + end_location: + row: 22 + column: 0 + parent: ~ + - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 28 - column: 0 + column: 4 end_location: - row: 29 - column: 0 - parent: ~ -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 35 - column: 4 - end_location: - row: 35 - column: 8 - fix: - content: "" + row: 28 + column: 8 + fix: + content: "" + location: + row: 28 + column: 0 + end_location: + row: 29 + column: 0 + parent: ~ + - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 35 - column: 0 + column: 4 end_location: - row: 36 - column: 0 - parent: ~ -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 42 - column: 4 - end_location: - row: 42 - column: 8 - fix: - content: "" + row: 35 + column: 8 + fix: + content: "" + location: + row: 35 + column: 0 + end_location: + row: 36 + column: 0 + parent: ~ + - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 42 - column: 0 + column: 4 end_location: - row: 43 - column: 0 - parent: ~ -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 50 - column: 4 - end_location: - row: 50 - column: 8 - fix: - content: "" + row: 42 + column: 8 + fix: + content: "" + location: + row: 42 + column: 0 + end_location: + row: 43 + column: 0 + parent: ~ + - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 50 - column: 0 + column: 4 end_location: - row: 51 - column: 0 - parent: ~ -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 58 - column: 4 - end_location: - row: 58 - column: 8 - fix: - content: "" + row: 50 + column: 8 + fix: + content: "" + location: + row: 50 + column: 0 + end_location: + row: 51 + column: 0 + parent: ~ + - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 58 - column: 0 + column: 4 end_location: - row: 59 - column: 0 - parent: ~ -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 65 - column: 4 - end_location: - row: 65 - column: 8 - fix: - content: "" + row: 58 + column: 8 + fix: + content: "" + location: + row: 58 + column: 0 + end_location: + row: 59 + column: 0 + parent: ~ + - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 65 - column: 0 + column: 4 end_location: - row: 66 - column: 0 - parent: ~ -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 74 - column: 4 - end_location: - row: 74 - column: 8 - fix: - content: "" + row: 65 + column: 8 + fix: + content: "" + location: + row: 65 + column: 0 + end_location: + row: 66 + column: 0 + parent: ~ + - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 74 - column: 0 + column: 4 end_location: - row: 75 - column: 0 - parent: ~ -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 79 - column: 4 - end_location: - row: 79 - column: 8 - fix: - content: "" + row: 74 + column: 8 + fix: + content: "" + location: + row: 74 + column: 0 + end_location: + row: 75 + column: 0 + parent: ~ + - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 79 - column: 0 + column: 4 end_location: - row: 80 - column: 0 - parent: ~ -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 83 - column: 4 - end_location: - row: 83 - column: 8 - fix: - content: "" + row: 79 + column: 8 + fix: + content: "" + location: + row: 79 + column: 0 + end_location: + row: 80 + column: 0 + parent: ~ + - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 83 - column: 0 + column: 4 end_location: - row: 84 - column: 0 - parent: ~ -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 87 - column: 4 - end_location: - row: 87 - column: 8 - fix: - content: "" + row: 83 + column: 8 + fix: + content: "" + location: + row: 83 + column: 0 + end_location: + row: 84 + column: 0 + parent: ~ + - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 87 - column: 0 + column: 4 end_location: - row: 88 - column: 0 - parent: ~ -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 92 - column: 4 - end_location: - row: 92 - column: 8 - fix: - content: "" + row: 87 + column: 8 + fix: + content: "" + location: + row: 87 + column: 0 + end_location: + row: 88 + column: 0 + parent: ~ + - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 92 - column: 0 + column: 4 end_location: - row: 93 - column: 0 - parent: ~ -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 96 - column: 4 - end_location: - row: 96 - column: 8 - fix: - content: "" + row: 92 + column: 8 + fix: + content: "" + location: + row: 92 + column: 0 + end_location: + row: 93 + column: 0 + parent: ~ + - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 96 - column: 0 + column: 4 end_location: - row: 97 - column: 0 - parent: ~ -- kind: - name: UnnecessaryPass - body: "Unnecessary `pass` statement" - suggestion: "Remove unnecessary `pass`" - fixable: true - location: - row: 101 - column: 4 - end_location: - row: 101 - column: 8 - fix: - content: "" + row: 96 + column: 8 + fix: + content: "" + location: + row: 96 + column: 0 + end_location: + row: 97 + column: 0 + parent: ~ + - kind: + name: UnnecessaryPass + body: "Unnecessary `pass` statement" + suggestion: "Remove unnecessary `pass`" + fixable: true location: row: 101 column: 4 end_location: row: 101 - column: 10 - parent: ~ + column: 8 + fix: + content: "" + location: + row: 101 + column: 4 + end_location: + row: 101 + column: 10 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE794_PIE794.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE794_PIE794.py.snap index 85cb34cddae4fd..56aaeced442a0a 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE794_PIE794.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE794_PIE794.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs expression: diagnostics --- -- kind: - name: DupeClassFieldDefinitions - body: "Class field `name` is defined multiple times" - suggestion: "Remove duplicate field definition for `name`" - fixable: true - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 24 - fix: - content: "" +- - kind: + name: DupeClassFieldDefinitions + body: "Class field `name` is defined multiple times" + suggestion: "Remove duplicate field definition for `name`" + fixable: true location: row: 4 - column: 0 + column: 4 end_location: - row: 5 - column: 0 - parent: ~ -- kind: - name: DupeClassFieldDefinitions - body: "Class field `name` is defined multiple times" - suggestion: "Remove duplicate field definition for `name`" - fixable: true - location: - row: 13 - column: 4 - end_location: - row: 13 - column: 24 - fix: - content: "" + row: 4 + column: 24 + fix: + content: "" + location: + row: 4 + column: 0 + end_location: + row: 5 + column: 0 + parent: ~ + - kind: + name: DupeClassFieldDefinitions + body: "Class field `name` is defined multiple times" + suggestion: "Remove duplicate field definition for `name`" + fixable: true location: row: 13 - column: 0 + column: 4 end_location: - row: 14 - column: 0 - parent: ~ -- kind: - name: DupeClassFieldDefinitions - body: "Class field `bar` is defined multiple times" - suggestion: "Remove duplicate field definition for `bar`" - fixable: true - location: - row: 23 - column: 4 - end_location: - row: 23 - column: 23 - fix: - content: "" + row: 13 + column: 24 + fix: + content: "" + location: + row: 13 + column: 0 + end_location: + row: 14 + column: 0 + parent: ~ + - kind: + name: DupeClassFieldDefinitions + body: "Class field `bar` is defined multiple times" + suggestion: "Remove duplicate field definition for `bar`" + fixable: true location: row: 23 - column: 0 + column: 4 end_location: - row: 24 - column: 0 - parent: ~ -- kind: - name: DupeClassFieldDefinitions - body: "Class field `bar` is defined multiple times" - suggestion: "Remove duplicate field definition for `bar`" - fixable: true - location: - row: 40 - column: 4 - end_location: - row: 40 - column: 23 - fix: - content: "" + row: 23 + column: 23 + fix: + content: "" + location: + row: 23 + column: 0 + end_location: + row: 24 + column: 0 + parent: ~ + - kind: + name: DupeClassFieldDefinitions + body: "Class field `bar` is defined multiple times" + suggestion: "Remove duplicate field definition for `bar`" + fixable: true location: row: 40 - column: 0 + column: 4 end_location: - row: 41 - column: 0 - parent: ~ + row: 40 + column: 23 + fix: + content: "" + location: + row: 40 + column: 0 + end_location: + row: 41 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE796_PIE796.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE796_PIE796.py.snap index 142e65f08cc407..ffba7fd3445061 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE796_PIE796.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE796_PIE796.py.snap @@ -2,95 +2,95 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs expression: diagnostics --- -- kind: - name: PreferUniqueEnums - body: "Enum contains duplicate value: `\"B\"`" - suggestion: ~ - fixable: false - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 11 - fix: ~ - parent: ~ -- kind: - name: PreferUniqueEnums - body: "Enum contains duplicate value: `2`" - suggestion: ~ - fixable: false - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 9 - fix: ~ - parent: ~ -- kind: - name: PreferUniqueEnums - body: "Enum contains duplicate value: `\"2\"`" - suggestion: ~ - fixable: false - location: - row: 20 - column: 4 - end_location: - row: 20 - column: 11 - fix: ~ - parent: ~ -- kind: - name: PreferUniqueEnums - body: "Enum contains duplicate value: `2.5`" - suggestion: ~ - fixable: false - location: - row: 26 - column: 4 - end_location: - row: 26 - column: 11 - fix: ~ - parent: ~ -- kind: - name: PreferUniqueEnums - body: "Enum contains duplicate value: `False`" - suggestion: ~ - fixable: false - location: - row: 33 - column: 4 - end_location: - row: 33 - column: 13 - fix: ~ - parent: ~ -- kind: - name: PreferUniqueEnums - body: "Enum contains duplicate value: `None`" - suggestion: ~ - fixable: false - location: - row: 40 - column: 4 - end_location: - row: 40 - column: 12 - fix: ~ - parent: ~ -- kind: - name: PreferUniqueEnums - body: "Enum contains duplicate value: `2`" - suggestion: ~ - fixable: false - location: - row: 54 - column: 4 - end_location: - row: 54 - column: 9 - fix: ~ - parent: ~ +- - kind: + name: PreferUniqueEnums + body: "Enum contains duplicate value: `\"B\"`" + suggestion: ~ + fixable: false + location: + row: 8 + column: 4 + end_location: + row: 8 + column: 11 + fix: ~ + parent: ~ + - kind: + name: PreferUniqueEnums + body: "Enum contains duplicate value: `2`" + suggestion: ~ + fixable: false + location: + row: 14 + column: 4 + end_location: + row: 14 + column: 9 + fix: ~ + parent: ~ + - kind: + name: PreferUniqueEnums + body: "Enum contains duplicate value: `\"2\"`" + suggestion: ~ + fixable: false + location: + row: 20 + column: 4 + end_location: + row: 20 + column: 11 + fix: ~ + parent: ~ + - kind: + name: PreferUniqueEnums + body: "Enum contains duplicate value: `2.5`" + suggestion: ~ + fixable: false + location: + row: 26 + column: 4 + end_location: + row: 26 + column: 11 + fix: ~ + parent: ~ + - kind: + name: PreferUniqueEnums + body: "Enum contains duplicate value: `False`" + suggestion: ~ + fixable: false + location: + row: 33 + column: 4 + end_location: + row: 33 + column: 13 + fix: ~ + parent: ~ + - kind: + name: PreferUniqueEnums + body: "Enum contains duplicate value: `None`" + suggestion: ~ + fixable: false + location: + row: 40 + column: 4 + end_location: + row: 40 + column: 12 + fix: ~ + parent: ~ + - kind: + name: PreferUniqueEnums + body: "Enum contains duplicate value: `2`" + suggestion: ~ + fixable: false + location: + row: 54 + column: 4 + end_location: + row: 54 + column: 9 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE800_PIE800.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE800_PIE800.py.snap index 0340c05a869d3b..d276644321536c 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE800_PIE800.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE800_PIE800.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs expression: diagnostics --- -- kind: - name: UnnecessarySpread - body: "Unnecessary spread `**`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 13 - end_location: - row: 1 - column: 23 - fix: ~ - parent: ~ -- kind: - name: UnnecessarySpread - body: "Unnecessary spread `**`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 14 - end_location: - row: 3 - column: 27 - fix: ~ - parent: ~ -- kind: - name: UnnecessarySpread - body: "Unnecessary spread `**`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 10 - end_location: - row: 5 - column: 21 - fix: ~ - parent: ~ -- kind: - name: UnnecessarySpread - body: "Unnecessary spread `**`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 18 - end_location: - row: 7 - column: 27 - fix: ~ - parent: ~ +- - kind: + name: UnnecessarySpread + body: "Unnecessary spread `**`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 13 + end_location: + row: 1 + column: 23 + fix: ~ + parent: ~ + - kind: + name: UnnecessarySpread + body: "Unnecessary spread `**`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 14 + end_location: + row: 3 + column: 27 + fix: ~ + parent: ~ + - kind: + name: UnnecessarySpread + body: "Unnecessary spread `**`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 10 + end_location: + row: 5 + column: 21 + fix: ~ + parent: ~ + - kind: + name: UnnecessarySpread + body: "Unnecessary spread `**`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 18 + end_location: + row: 7 + column: 27 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE802_PIE802.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE802_PIE802.py.snap index a1d76581909e9e..370bdae459f6fe 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE802_PIE802.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE802_PIE802.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryComprehensionAnyAll - body: Unnecessary list comprehension. - suggestion: Remove unnecessary list comprehension - fixable: true - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 23 - fix: - content: any(x.id for x in bar) +- - kind: + name: UnnecessaryComprehensionAnyAll + body: Unnecessary list comprehension. + suggestion: Remove unnecessary list comprehension + fixable: true location: row: 9 - column: 0 + column: 4 end_location: row: 9 - column: 24 - parent: ~ -- kind: - name: UnnecessaryComprehensionAnyAll - body: Unnecessary list comprehension. - suggestion: Remove unnecessary list comprehension - fixable: true - location: - row: 10 - column: 4 - end_location: - row: 10 - column: 23 - fix: - content: all(x.id for x in bar) + column: 23 + fix: + content: any(x.id for x in bar) + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 24 + parent: ~ + - kind: + name: UnnecessaryComprehensionAnyAll + body: Unnecessary list comprehension. + suggestion: Remove unnecessary list comprehension + fixable: true location: row: 10 - column: 0 + column: 4 end_location: row: 10 - column: 24 - parent: ~ -- kind: - name: UnnecessaryComprehensionAnyAll - body: Unnecessary list comprehension. - suggestion: Remove unnecessary list comprehension - fixable: true - location: - row: 12 - column: 4 - end_location: - row: 12 - column: 23 - fix: - content: "any( # first comment\n x.id for x in bar # second comment\n)" + column: 23 + fix: + content: all(x.id for x in bar) + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 24 + parent: ~ + - kind: + name: UnnecessaryComprehensionAnyAll + body: Unnecessary list comprehension. + suggestion: Remove unnecessary list comprehension + fixable: true location: - row: 11 - column: 0 + row: 12 + column: 4 end_location: - row: 13 - column: 1 - parent: ~ -- kind: - name: UnnecessaryComprehensionAnyAll - body: Unnecessary list comprehension. - suggestion: Remove unnecessary list comprehension - fixable: true - location: - row: 15 - column: 4 - end_location: - row: 15 - column: 23 - fix: - content: "all( # first comment\n x.id for x in bar # second comment\n)" + row: 12 + column: 23 + fix: + content: "any( # first comment\n x.id for x in bar # second comment\n)" + location: + row: 11 + column: 0 + end_location: + row: 13 + column: 1 + parent: ~ + - kind: + name: UnnecessaryComprehensionAnyAll + body: Unnecessary list comprehension. + suggestion: Remove unnecessary list comprehension + fixable: true location: - row: 14 - column: 0 + row: 15 + column: 4 end_location: - row: 16 - column: 1 - parent: ~ + row: 15 + column: 23 + fix: + content: "all( # first comment\n x.id for x in bar # second comment\n)" + location: + row: 14 + column: 0 + end_location: + row: 16 + column: 1 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE804_PIE804.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE804_PIE804.py.snap index eb74b1c063f833..87d67439237569 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE804_PIE804.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE804_PIE804.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryDictKwargs - body: "Unnecessary `dict` kwargs" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 20 - fix: ~ - parent: ~ -- kind: - name: UnnecessaryDictKwargs - body: "Unnecessary `dict` kwargs" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 21 - fix: ~ - parent: ~ -- kind: - name: UnnecessaryDictKwargs - body: "Unnecessary `dict` kwargs" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 35 - fix: ~ - parent: ~ -- kind: - name: UnnecessaryDictKwargs - body: "Unnecessary `dict` kwargs" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 38 - fix: ~ - parent: ~ -- kind: - name: UnnecessaryDictKwargs - body: "Unnecessary `dict` kwargs" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 29 - fix: ~ - parent: ~ +- - kind: + name: UnnecessaryDictKwargs + body: "Unnecessary `dict` kwargs" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 20 + fix: ~ + parent: ~ + - kind: + name: UnnecessaryDictKwargs + body: "Unnecessary `dict` kwargs" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 21 + fix: ~ + parent: ~ + - kind: + name: UnnecessaryDictKwargs + body: "Unnecessary `dict` kwargs" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 35 + fix: ~ + parent: ~ + - kind: + name: UnnecessaryDictKwargs + body: "Unnecessary `dict` kwargs" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 38 + fix: ~ + parent: ~ + - kind: + name: UnnecessaryDictKwargs + body: "Unnecessary `dict` kwargs" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 29 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE807_PIE807.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE807_PIE807.py.snap index f8da70a11e71bd..f96772741e8526 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE807_PIE807.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE807_PIE807.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs expression: diagnostics --- -- kind: - name: PreferListBuiltin - body: "Prefer `list` over useless lambda" - suggestion: "Replace with `list`" - fixable: true - location: - row: 3 - column: 43 - end_location: - row: 3 - column: 53 - fix: - content: list +- - kind: + name: PreferListBuiltin + body: "Prefer `list` over useless lambda" + suggestion: "Replace with `list`" + fixable: true location: row: 3 column: 43 end_location: row: 3 column: 53 - parent: ~ -- kind: - name: PreferListBuiltin - body: "Prefer `list` over useless lambda" - suggestion: "Replace with `list`" - fixable: true - location: - row: 7 - column: 35 - end_location: - row: 7 - column: 45 - fix: - content: list + fix: + content: list + location: + row: 3 + column: 43 + end_location: + row: 3 + column: 53 + parent: ~ + - kind: + name: PreferListBuiltin + body: "Prefer `list` over useless lambda" + suggestion: "Replace with `list`" + fixable: true location: row: 7 column: 35 end_location: row: 7 column: 45 - parent: ~ -- kind: - name: PreferListBuiltin - body: "Prefer `list` over useless lambda" - suggestion: "Replace with `list`" - fixable: true - location: - row: 11 - column: 27 - end_location: - row: 11 - column: 37 - fix: - content: list + fix: + content: list + location: + row: 7 + column: 35 + end_location: + row: 7 + column: 45 + parent: ~ + - kind: + name: PreferListBuiltin + body: "Prefer `list` over useless lambda" + suggestion: "Replace with `list`" + fixable: true location: row: 11 column: 27 end_location: row: 11 column: 37 - parent: ~ + fix: + content: list + location: + row: 11 + column: 27 + end_location: + row: 11 + column: 37 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE810_PIE810.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE810_PIE810.py.snap index 0c6b04ab39a5fe..2f24adbaf0e9e9 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE810_PIE810.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE810_PIE810.py.snap @@ -2,104 +2,104 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs expression: diagnostics --- -- kind: - name: SingleStartsEndsWith - body: "Call `startswith` once with a `tuple`" - suggestion: "Merge into a single `startswith` call" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 46 - fix: - content: "obj.startswith((\"foo\", \"bar\"))" +- - kind: + name: SingleStartsEndsWith + body: "Call `startswith` once with a `tuple`" + suggestion: "Merge into a single `startswith` call" + fixable: true location: row: 2 column: 0 end_location: row: 2 column: 46 - parent: ~ -- kind: - name: SingleStartsEndsWith - body: "Call `endswith` once with a `tuple`" - suggestion: "Merge into a single `endswith` call" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 42 - fix: - content: "obj.endswith((\"foo\", \"bar\"))" + fix: + content: "obj.startswith((\"foo\", \"bar\"))" + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 46 + parent: ~ + - kind: + name: SingleStartsEndsWith + body: "Call `endswith` once with a `tuple`" + suggestion: "Merge into a single `endswith` call" + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 42 - parent: ~ -- kind: - name: SingleStartsEndsWith - body: "Call `startswith` once with a `tuple`" - suggestion: "Merge into a single `startswith` call" - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 42 - fix: - content: "obj.startswith((foo, bar))" + fix: + content: "obj.endswith((\"foo\", \"bar\"))" + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 42 + parent: ~ + - kind: + name: SingleStartsEndsWith + body: "Call `startswith` once with a `tuple`" + suggestion: "Merge into a single `startswith` call" + fixable: true location: row: 6 column: 0 end_location: row: 6 column: 42 - parent: ~ -- kind: - name: SingleStartsEndsWith - body: "Call `startswith` once with a `tuple`" - suggestion: "Merge into a single `startswith` call" - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 44 - fix: - content: "obj.startswith((foo, \"foo\"))" + fix: + content: "obj.startswith((foo, bar))" + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 42 + parent: ~ + - kind: + name: SingleStartsEndsWith + body: "Call `startswith` once with a `tuple`" + suggestion: "Merge into a single `startswith` call" + fixable: true location: row: 8 column: 0 end_location: row: 8 column: 44 - parent: ~ -- kind: - name: SingleStartsEndsWith - body: "Call `startswith` once with a `tuple`" - suggestion: "Merge into a single `startswith` call" - fixable: true - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 65 - fix: - content: "obj.endswith(foo) or obj.startswith((foo, \"foo\"))" + fix: + content: "obj.startswith((foo, \"foo\"))" + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 44 + parent: ~ + - kind: + name: SingleStartsEndsWith + body: "Call `startswith` once with a `tuple`" + suggestion: "Merge into a single `startswith` call" + fixable: true location: row: 10 column: 0 end_location: row: 10 column: 65 - parent: ~ + fix: + content: "obj.endswith(foo) or obj.startswith((foo, \"foo\"))" + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 65 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T201_T201.py.snap b/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T201_T201.py.snap index 17d9c26d919fa7..22ac2ee479a23a 100644 --- a/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T201_T201.py.snap +++ b/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T201_T201.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_print/mod.rs expression: diagnostics --- -- kind: - name: PrintFound - body: "`print` found" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 5 - fix: ~ - parent: ~ -- kind: - name: PrintFound - body: "`print` found" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 5 - fix: ~ - parent: ~ -- kind: - name: PrintFound - body: "`print` found" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 5 - fix: ~ - parent: ~ -- kind: - name: PrintFound - body: "`print` found" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 5 - fix: ~ - parent: ~ +- - kind: + name: PrintFound + body: "`print` found" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 5 + fix: ~ + parent: ~ + - kind: + name: PrintFound + body: "`print` found" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 5 + fix: ~ + parent: ~ + - kind: + name: PrintFound + body: "`print` found" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 5 + fix: ~ + parent: ~ + - kind: + name: PrintFound + body: "`print` found" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 5 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T203_T203.py.snap b/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T203_T203.py.snap index 29f805376fa23b..8724d283f6f16b 100644 --- a/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T203_T203.py.snap +++ b/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T203_T203.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_print/mod.rs expression: diagnostics --- -- kind: - name: PPrintFound - body: "`pprint` found" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 6 - fix: ~ - parent: ~ -- kind: - name: PPrintFound - body: "`pprint` found" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 13 - fix: ~ - parent: ~ +- - kind: + name: PPrintFound + body: "`pprint` found" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 6 + fix: ~ + parent: ~ + - kind: + name: PPrintFound + body: "`pprint` found" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 13 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI001_PYI001.py.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI001_PYI001.py.snap index efcc2d0c99b2f3..af67937279603a 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI001_PYI001.py.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI001_PYI001.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI001_PYI001.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI001_PYI001.pyi.snap index 979da78c6570cb..6ae3a47bb8bc2d 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI001_PYI001.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI001_PYI001.pyi.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -- kind: - name: PrefixTypeParams - body: "Name of private `TypeVar` must start with `_`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 16 - fix: ~ - parent: ~ -- kind: - name: PrefixTypeParams - body: "Name of private `TypeVarTuple` must start with `_`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 9 - end_location: - row: 5 - column: 31 - fix: ~ - parent: ~ -- kind: - name: PrefixTypeParams - body: "Name of private `ParamSpec` must start with `_`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 4 - end_location: - row: 7 - column: 18 - fix: ~ - parent: ~ +- - kind: + name: PrefixTypeParams + body: "Name of private `TypeVar` must start with `_`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 16 + fix: ~ + parent: ~ + - kind: + name: PrefixTypeParams + body: "Name of private `TypeVarTuple` must start with `_`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 9 + end_location: + row: 5 + column: 31 + fix: ~ + parent: ~ + - kind: + name: PrefixTypeParams + body: "Name of private `ParamSpec` must start with `_`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 4 + end_location: + row: 7 + column: 18 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI006_PYI006.py.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI006_PYI006.py.snap index efcc2d0c99b2f3..af67937279603a 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI006_PYI006.py.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI006_PYI006.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI006_PYI006.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI006_PYI006.pyi.snap index 8c4709125632ee..033f60fc83589f 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI006_PYI006.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI006_PYI006.pyi.snap @@ -2,82 +2,82 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -- kind: - name: BadVersionInfoComparison - body: "Use `<` or `>=` for version info comparisons" - suggestion: ~ - fixable: false - location: - row: 8 - column: 3 - end_location: - row: 8 - column: 29 - fix: ~ - parent: ~ -- kind: - name: BadVersionInfoComparison - body: "Use `<` or `>=` for version info comparisons" - suggestion: ~ - fixable: false - location: - row: 10 - column: 3 - end_location: - row: 10 - column: 29 - fix: ~ - parent: ~ -- kind: - name: BadVersionInfoComparison - body: "Use `<` or `>=` for version info comparisons" - suggestion: ~ - fixable: false - location: - row: 12 - column: 3 - end_location: - row: 12 - column: 30 - fix: ~ - parent: ~ -- kind: - name: BadVersionInfoComparison - body: "Use `<` or `>=` for version info comparisons" - suggestion: ~ - fixable: false - location: - row: 14 - column: 3 - end_location: - row: 14 - column: 30 - fix: ~ - parent: ~ -- kind: - name: BadVersionInfoComparison - body: "Use `<` or `>=` for version info comparisons" - suggestion: ~ - fixable: false - location: - row: 16 - column: 3 - end_location: - row: 16 - column: 29 - fix: ~ - parent: ~ -- kind: - name: BadVersionInfoComparison - body: "Use `<` or `>=` for version info comparisons" - suggestion: ~ - fixable: false - location: - row: 18 - column: 3 - end_location: - row: 18 - column: 27 - fix: ~ - parent: ~ +- - kind: + name: BadVersionInfoComparison + body: "Use `<` or `>=` for version info comparisons" + suggestion: ~ + fixable: false + location: + row: 8 + column: 3 + end_location: + row: 8 + column: 29 + fix: ~ + parent: ~ + - kind: + name: BadVersionInfoComparison + body: "Use `<` or `>=` for version info comparisons" + suggestion: ~ + fixable: false + location: + row: 10 + column: 3 + end_location: + row: 10 + column: 29 + fix: ~ + parent: ~ + - kind: + name: BadVersionInfoComparison + body: "Use `<` or `>=` for version info comparisons" + suggestion: ~ + fixable: false + location: + row: 12 + column: 3 + end_location: + row: 12 + column: 30 + fix: ~ + parent: ~ + - kind: + name: BadVersionInfoComparison + body: "Use `<` or `>=` for version info comparisons" + suggestion: ~ + fixable: false + location: + row: 14 + column: 3 + end_location: + row: 14 + column: 30 + fix: ~ + parent: ~ + - kind: + name: BadVersionInfoComparison + body: "Use `<` or `>=` for version info comparisons" + suggestion: ~ + fixable: false + location: + row: 16 + column: 3 + end_location: + row: 16 + column: 29 + fix: ~ + parent: ~ + - kind: + name: BadVersionInfoComparison + body: "Use `<` or `>=` for version info comparisons" + suggestion: ~ + fixable: false + location: + row: 18 + column: 3 + end_location: + row: 18 + column: 27 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI007_PYI007.py.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI007_PYI007.py.snap index efcc2d0c99b2f3..af67937279603a 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI007_PYI007.py.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI007_PYI007.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI007_PYI007.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI007_PYI007.pyi.snap index 8090f8af5e8a49..cb5b861a6719d2 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI007_PYI007.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI007_PYI007.pyi.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -- kind: - name: UnrecognizedPlatformCheck - body: "Unrecognized `sys.platform` check" - suggestion: ~ - fixable: false - location: - row: 7 - column: 3 - end_location: - row: 7 - column: 28 - fix: ~ - parent: ~ -- kind: - name: UnrecognizedPlatformCheck - body: "Unrecognized `sys.platform` check" - suggestion: ~ - fixable: false - location: - row: 9 - column: 3 - end_location: - row: 9 - column: 19 - fix: ~ - parent: ~ -- kind: - name: UnrecognizedPlatformCheck - body: "Unrecognized `sys.platform` check" - suggestion: ~ - fixable: false - location: - row: 11 - column: 3 - end_location: - row: 11 - column: 24 - fix: ~ - parent: ~ +- - kind: + name: UnrecognizedPlatformCheck + body: "Unrecognized `sys.platform` check" + suggestion: ~ + fixable: false + location: + row: 7 + column: 3 + end_location: + row: 7 + column: 28 + fix: ~ + parent: ~ + - kind: + name: UnrecognizedPlatformCheck + body: "Unrecognized `sys.platform` check" + suggestion: ~ + fixable: false + location: + row: 9 + column: 3 + end_location: + row: 9 + column: 19 + fix: ~ + parent: ~ + - kind: + name: UnrecognizedPlatformCheck + body: "Unrecognized `sys.platform` check" + suggestion: ~ + fixable: false + location: + row: 11 + column: 3 + end_location: + row: 11 + column: 24 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI008_PYI008.py.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI008_PYI008.py.snap index efcc2d0c99b2f3..af67937279603a 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI008_PYI008.py.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI008_PYI008.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI008_PYI008.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI008_PYI008.pyi.snap index a9aa4f172d80b5..e764d6fc9eae29 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI008_PYI008.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI008_PYI008.pyi.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -- kind: - name: UnrecognizedPlatformName - body: "Unrecognized platform `linus`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 19 - end_location: - row: 3 - column: 26 - fix: ~ - parent: ~ +- - kind: + name: UnrecognizedPlatformName + body: "Unrecognized platform `linus`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 19 + end_location: + row: 3 + column: 26 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI009_PYI009.py.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI009_PYI009.py.snap index efcc2d0c99b2f3..af67937279603a 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI009_PYI009.py.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI009_PYI009.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI009_PYI009.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI009_PYI009.pyi.snap index 04449211461a11..55734d71084082 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI009_PYI009.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI009_PYI009.pyi.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -- kind: - name: PassStatementStubBody - body: "Empty body should contain `...`, not `pass`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 8 - fix: ~ - parent: ~ -- kind: - name: PassStatementStubBody - body: "Empty body should contain `...`, not `pass`" - suggestion: ~ - fixable: false - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: PassStatementStubBody + body: "Empty body should contain `...`, not `pass`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 8 + fix: ~ + parent: ~ + - kind: + name: PassStatementStubBody + body: "Empty body should contain `...`, not `pass`" + suggestion: ~ + fixable: false + location: + row: 8 + column: 4 + end_location: + row: 8 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI010_PYI010.py.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI010_PYI010.py.snap index efcc2d0c99b2f3..af67937279603a 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI010_PYI010.py.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI010_PYI010.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI010_PYI010.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI010_PYI010.pyi.snap index 67cd575147183a..bca78b6d05d83f 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI010_PYI010.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI010_PYI010.pyi.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -- kind: - name: NonEmptyStubBody - body: "Function body must contain only `...`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 17 - fix: ~ - parent: ~ -- kind: - name: NonEmptyStubBody - body: "Function body must contain only `...`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 7 - fix: ~ - parent: ~ -- kind: - name: NonEmptyStubBody - body: "Function body must contain only `...`" - suggestion: ~ - fixable: false - location: - row: 12 - column: 4 - end_location: - row: 12 - column: 11 - fix: ~ - parent: ~ +- - kind: + name: NonEmptyStubBody + body: "Function body must contain only `...`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 4 + end_location: + row: 6 + column: 17 + fix: ~ + parent: ~ + - kind: + name: NonEmptyStubBody + body: "Function body must contain only `...`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 7 + fix: ~ + parent: ~ + - kind: + name: NonEmptyStubBody + body: "Function body must contain only `...`" + suggestion: ~ + fixable: false + location: + row: 12 + column: 4 + end_location: + row: 12 + column: 11 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI011_PYI011.py.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI011_PYI011.py.snap index efcc2d0c99b2f3..af67937279603a 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI011_PYI011.py.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI011_PYI011.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI011_PYI011.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI011_PYI011.pyi.snap index 81f1c12f5a221c..597d63a01929a2 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI011_PYI011.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI011_PYI011.pyi.snap @@ -2,324 +2,324 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -- kind: - name: TypedArgumentSimpleDefaults - body: Only simple default values allowed for typed arguments - suggestion: "Replace default value by `...`" - fixable: true - location: - row: 10 - column: 13 - end_location: - row: 10 - column: 23 - fix: - content: "..." +- - kind: + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + suggestion: "Replace default value by `...`" + fixable: true location: row: 10 column: 13 end_location: row: 10 column: 23 - parent: ~ -- kind: - name: TypedArgumentSimpleDefaults - body: Only simple default values allowed for typed arguments - suggestion: "Replace default value by `...`" - fixable: true - location: - row: 16 - column: 8 - end_location: - row: 20 - column: 5 - fix: - content: "..." + fix: + content: "..." + location: + row: 10 + column: 13 + end_location: + row: 10 + column: 23 + parent: ~ + - kind: + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + suggestion: "Replace default value by `...`" + fixable: true location: row: 16 column: 8 end_location: row: 20 column: 5 - parent: ~ -- kind: - name: TypedArgumentSimpleDefaults - body: Only simple default values allowed for typed arguments - suggestion: "Replace default value by `...`" - fixable: true - location: - row: 25 - column: 8 - end_location: - row: 29 - column: 5 - fix: - content: "..." + fix: + content: "..." + location: + row: 16 + column: 8 + end_location: + row: 20 + column: 5 + parent: ~ + - kind: + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + suggestion: "Replace default value by `...`" + fixable: true location: row: 25 column: 8 end_location: row: 29 column: 5 - parent: ~ -- kind: - name: TypedArgumentSimpleDefaults - body: Only simple default values allowed for typed arguments - suggestion: "Replace default value by `...`" - fixable: true - location: - row: 34 - column: 8 - end_location: - row: 38 - column: 5 - fix: - content: "..." + fix: + content: "..." + location: + row: 25 + column: 8 + end_location: + row: 29 + column: 5 + parent: ~ + - kind: + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + suggestion: "Replace default value by `...`" + fixable: true location: row: 34 column: 8 end_location: row: 38 column: 5 - parent: ~ -- kind: - name: TypedArgumentSimpleDefaults - body: Only simple default values allowed for typed arguments - suggestion: "Replace default value by `...`" - fixable: true - location: - row: 43 - column: 8 - end_location: - row: 45 - column: 5 - fix: - content: "..." + fix: + content: "..." + location: + row: 34 + column: 8 + end_location: + row: 38 + column: 5 + parent: ~ + - kind: + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + suggestion: "Replace default value by `...`" + fixable: true location: row: 43 column: 8 end_location: row: 45 column: 5 - parent: ~ -- kind: - name: TypedArgumentSimpleDefaults - body: Only simple default values allowed for typed arguments - suggestion: "Replace default value by `...`" - fixable: true - location: - row: 48 - column: 13 - end_location: - row: 49 - column: 11 - fix: - content: "..." + fix: + content: "..." + location: + row: 43 + column: 8 + end_location: + row: 45 + column: 5 + parent: ~ + - kind: + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + suggestion: "Replace default value by `...`" + fixable: true location: row: 48 column: 13 end_location: row: 49 column: 11 - parent: ~ -- kind: - name: TypedArgumentSimpleDefaults - body: Only simple default values allowed for typed arguments - suggestion: "Replace default value by `...`" - fixable: true - location: - row: 52 - column: 13 - end_location: - row: 53 - column: 12 - fix: - content: "..." + fix: + content: "..." + location: + row: 48 + column: 13 + end_location: + row: 49 + column: 11 + parent: ~ + - kind: + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + suggestion: "Replace default value by `...`" + fixable: true location: row: 52 column: 13 end_location: row: 53 column: 12 - parent: ~ -- kind: - name: TypedArgumentSimpleDefaults - body: Only simple default values allowed for typed arguments - suggestion: "Replace default value by `...`" - fixable: true - location: - row: 56 - column: 16 - end_location: - row: 57 - column: 7 - fix: - content: "..." + fix: + content: "..." + location: + row: 52 + column: 13 + end_location: + row: 53 + column: 12 + parent: ~ + - kind: + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + suggestion: "Replace default value by `...`" + fixable: true location: row: 56 column: 16 end_location: row: 57 column: 7 - parent: ~ -- kind: - name: TypedArgumentSimpleDefaults - body: Only simple default values allowed for typed arguments - suggestion: "Replace default value by `...`" - fixable: true - location: - row: 60 - column: 13 - end_location: - row: 61 - column: 7 - fix: - content: "..." + fix: + content: "..." + location: + row: 56 + column: 16 + end_location: + row: 57 + column: 7 + parent: ~ + - kind: + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + suggestion: "Replace default value by `...`" + fixable: true location: row: 60 column: 13 end_location: row: 61 column: 7 - parent: ~ -- kind: - name: TypedArgumentSimpleDefaults - body: Only simple default values allowed for typed arguments - suggestion: "Replace default value by `...`" - fixable: true - location: - row: 64 - column: 17 - end_location: - row: 65 - column: 8 - fix: - content: "..." + fix: + content: "..." + location: + row: 60 + column: 13 + end_location: + row: 61 + column: 7 + parent: ~ + - kind: + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + suggestion: "Replace default value by `...`" + fixable: true location: row: 64 column: 17 end_location: row: 65 column: 8 - parent: ~ -- kind: - name: TypedArgumentSimpleDefaults - body: Only simple default values allowed for typed arguments - suggestion: "Replace default value by `...`" - fixable: true - location: - row: 68 - column: 17 - end_location: - row: 69 - column: 10 - fix: - content: "..." + fix: + content: "..." + location: + row: 64 + column: 17 + end_location: + row: 65 + column: 8 + parent: ~ + - kind: + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + suggestion: "Replace default value by `...`" + fixable: true location: row: 68 column: 17 end_location: row: 69 column: 10 - parent: ~ -- kind: - name: TypedArgumentSimpleDefaults - body: Only simple default values allowed for typed arguments - suggestion: "Replace default value by `...`" - fixable: true - location: - row: 96 - column: 15 - end_location: - row: 96 - column: 18 - fix: - content: "..." + fix: + content: "..." + location: + row: 68 + column: 17 + end_location: + row: 69 + column: 10 + parent: ~ + - kind: + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + suggestion: "Replace default value by `...`" + fixable: true location: row: 96 column: 15 end_location: row: 96 column: 18 - parent: ~ -- kind: - name: TypedArgumentSimpleDefaults - body: Only simple default values allowed for typed arguments - suggestion: "Replace default value by `...`" - fixable: true - location: - row: 99 - column: 15 - end_location: - row: 99 - column: 21 - fix: - content: "..." + fix: + content: "..." + location: + row: 96 + column: 15 + end_location: + row: 96 + column: 18 + parent: ~ + - kind: + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + suggestion: "Replace default value by `...`" + fixable: true location: row: 99 column: 15 end_location: row: 99 column: 21 - parent: ~ -- kind: - name: TypedArgumentSimpleDefaults - body: Only simple default values allowed for typed arguments - suggestion: "Replace default value by `...`" - fixable: true - location: - row: 105 - column: 15 - end_location: - row: 105 - column: 24 - fix: - content: "..." + fix: + content: "..." + location: + row: 99 + column: 15 + end_location: + row: 99 + column: 21 + parent: ~ + - kind: + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + suggestion: "Replace default value by `...`" + fixable: true location: row: 105 column: 15 end_location: row: 105 column: 24 - parent: ~ -- kind: - name: TypedArgumentSimpleDefaults - body: Only simple default values allowed for typed arguments - suggestion: "Replace default value by `...`" - fixable: true - location: - row: 108 - column: 17 - end_location: - row: 109 - column: 8 - fix: - content: "..." + fix: + content: "..." + location: + row: 105 + column: 15 + end_location: + row: 105 + column: 24 + parent: ~ + - kind: + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + suggestion: "Replace default value by `...`" + fixable: true location: row: 108 column: 17 end_location: row: 109 column: 8 - parent: ~ -- kind: - name: TypedArgumentSimpleDefaults - body: Only simple default values allowed for typed arguments - suggestion: "Replace default value by `...`" - fixable: true - location: - row: 115 - column: 16 - end_location: - row: 115 - column: 23 - fix: - content: "..." + fix: + content: "..." + location: + row: 108 + column: 17 + end_location: + row: 109 + column: 8 + parent: ~ + - kind: + name: TypedArgumentSimpleDefaults + body: Only simple default values allowed for typed arguments + suggestion: "Replace default value by `...`" + fixable: true location: row: 115 column: 16 end_location: row: 115 column: 23 - parent: ~ + fix: + content: "..." + location: + row: 115 + column: 16 + end_location: + row: 115 + column: 23 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI014_PYI014.py.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI014_PYI014.py.snap index efcc2d0c99b2f3..af67937279603a 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI014_PYI014.py.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI014_PYI014.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI014_PYI014.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI014_PYI014.pyi.snap index 62d69d0474fd55..4b5ec4a3f017ff 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI014_PYI014.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI014_PYI014.pyi.snap @@ -2,147 +2,147 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -- kind: - name: ArgumentSimpleDefaults - body: Only simple default values allowed for arguments - suggestion: ~ - fixable: false - location: - row: 3 - column: 6 - end_location: - row: 3 - column: 16 - fix: ~ - parent: ~ -- kind: - name: ArgumentSimpleDefaults - body: Only simple default values allowed for arguments - suggestion: ~ - fixable: false - location: - row: 7 - column: 6 - end_location: - row: 11 - column: 5 - fix: ~ - parent: ~ -- kind: - name: ArgumentSimpleDefaults - body: Only simple default values allowed for arguments - suggestion: ~ - fixable: false - location: - row: 14 - column: 6 - end_location: - row: 18 - column: 5 - fix: ~ - parent: ~ -- kind: - name: ArgumentSimpleDefaults - body: Only simple default values allowed for arguments - suggestion: ~ - fixable: false - location: - row: 21 - column: 6 - end_location: - row: 25 - column: 5 - fix: ~ - parent: ~ -- kind: - name: ArgumentSimpleDefaults - body: Only simple default values allowed for arguments - suggestion: ~ - fixable: false - location: - row: 27 - column: 10 - end_location: - row: 27 - column: 45 - fix: ~ - parent: ~ -- kind: - name: ArgumentSimpleDefaults - body: Only simple default values allowed for arguments - suggestion: ~ - fixable: false - location: - row: 29 - column: 6 - end_location: - row: 29 - column: 19 - fix: ~ - parent: ~ -- kind: - name: ArgumentSimpleDefaults - body: Only simple default values allowed for arguments - suggestion: ~ - fixable: false - location: - row: 32 - column: 6 - end_location: - row: 32 - column: 21 - fix: ~ - parent: ~ -- kind: - name: ArgumentSimpleDefaults - body: Only simple default values allowed for arguments - suggestion: ~ - fixable: false - location: - row: 35 - column: 6 - end_location: - row: 35 - column: 15 - fix: ~ - parent: ~ -- kind: - name: ArgumentSimpleDefaults - body: Only simple default values allowed for arguments - suggestion: ~ - fixable: false - location: - row: 38 - column: 6 - end_location: - row: 38 - column: 11 - fix: ~ - parent: ~ -- kind: - name: ArgumentSimpleDefaults - body: Only simple default values allowed for arguments - suggestion: ~ - fixable: false - location: - row: 41 - column: 6 - end_location: - row: 41 - column: 13 - fix: ~ - parent: ~ -- kind: - name: ArgumentSimpleDefaults - body: Only simple default values allowed for arguments - suggestion: ~ - fixable: false - location: - row: 44 - column: 6 - end_location: - row: 44 - column: 19 - fix: ~ - parent: ~ +- - kind: + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + suggestion: ~ + fixable: false + location: + row: 3 + column: 6 + end_location: + row: 3 + column: 16 + fix: ~ + parent: ~ + - kind: + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + suggestion: ~ + fixable: false + location: + row: 7 + column: 6 + end_location: + row: 11 + column: 5 + fix: ~ + parent: ~ + - kind: + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + suggestion: ~ + fixable: false + location: + row: 14 + column: 6 + end_location: + row: 18 + column: 5 + fix: ~ + parent: ~ + - kind: + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + suggestion: ~ + fixable: false + location: + row: 21 + column: 6 + end_location: + row: 25 + column: 5 + fix: ~ + parent: ~ + - kind: + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + suggestion: ~ + fixable: false + location: + row: 27 + column: 10 + end_location: + row: 27 + column: 45 + fix: ~ + parent: ~ + - kind: + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + suggestion: ~ + fixable: false + location: + row: 29 + column: 6 + end_location: + row: 29 + column: 19 + fix: ~ + parent: ~ + - kind: + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + suggestion: ~ + fixable: false + location: + row: 32 + column: 6 + end_location: + row: 32 + column: 21 + fix: ~ + parent: ~ + - kind: + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + suggestion: ~ + fixable: false + location: + row: 35 + column: 6 + end_location: + row: 35 + column: 15 + fix: ~ + parent: ~ + - kind: + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + suggestion: ~ + fixable: false + location: + row: 38 + column: 6 + end_location: + row: 38 + column: 11 + fix: ~ + parent: ~ + - kind: + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + suggestion: ~ + fixable: false + location: + row: 41 + column: 6 + end_location: + row: 41 + column: 13 + fix: ~ + parent: ~ + - kind: + name: ArgumentSimpleDefaults + body: Only simple default values allowed for arguments + suggestion: ~ + fixable: false + location: + row: 44 + column: 6 + end_location: + row: 44 + column: 19 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI021_PYI021.py.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI021_PYI021.py.snap index efcc2d0c99b2f3..af67937279603a 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI021_PYI021.py.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI021_PYI021.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI021_PYI021.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI021_PYI021.pyi.snap index 690e85b6b18981..706e670dd06d4e 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI021_PYI021.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI021_PYI021.pyi.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -- kind: - name: DocstringInStub - body: Docstrings should not be included in stubs - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 9 - fix: ~ - parent: ~ -- kind: - name: DocstringInStub - body: Docstrings should not be included in stubs - suggestion: ~ - fixable: false - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 13 - fix: ~ - parent: ~ -- kind: - name: DocstringInStub - body: Docstrings should not be included in stubs - suggestion: ~ - fixable: false - location: - row: 7 - column: 4 - end_location: - row: 7 - column: 13 - fix: ~ - parent: ~ +- - kind: + name: DocstringInStub + body: Docstrings should not be included in stubs + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 9 + fix: ~ + parent: ~ + - kind: + name: DocstringInStub + body: Docstrings should not be included in stubs + suggestion: ~ + fixable: false + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 13 + fix: ~ + parent: ~ + - kind: + name: DocstringInStub + body: Docstrings should not be included in stubs + suggestion: ~ + fixable: false + location: + row: 7 + column: 4 + end_location: + row: 7 + column: 13 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI033_PYI033.py.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI033_PYI033.py.snap index efcc2d0c99b2f3..af67937279603a 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI033_PYI033.py.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI033_PYI033.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI033_PYI033.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI033_PYI033.pyi.snap index c6efc83c9cb480..bcb6a3f0130e9d 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI033_PYI033.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI033_PYI033.pyi.snap @@ -2,147 +2,147 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs expression: diagnostics --- -- kind: - name: TypeCommentInStub - body: "Don't use type comments in stub file" - suggestion: ~ - fixable: false - location: - row: 6 - column: 21 - end_location: - row: 6 - column: 127 - fix: ~ - parent: ~ -- kind: - name: TypeCommentInStub - body: "Don't use type comments in stub file" - suggestion: ~ - fixable: false - location: - row: 7 - column: 21 - end_location: - row: 7 - column: 183 - fix: ~ - parent: ~ -- kind: - name: TypeCommentInStub - body: "Don't use type comments in stub file" - suggestion: ~ - fixable: false - location: - row: 8 - column: 21 - end_location: - row: 8 - column: 126 - fix: ~ - parent: ~ -- kind: - name: TypeCommentInStub - body: "Don't use type comments in stub file" - suggestion: ~ - fixable: false - location: - row: 9 - column: 21 - end_location: - row: 9 - column: 132 - fix: ~ - parent: ~ -- kind: - name: TypeCommentInStub - body: "Don't use type comments in stub file" - suggestion: ~ - fixable: false - location: - row: 10 - column: 19 - end_location: - row: 10 - column: 128 - fix: ~ - parent: ~ -- kind: - name: TypeCommentInStub - body: "Don't use type comments in stub file" - suggestion: ~ - fixable: false - location: - row: 11 - column: 19 - end_location: - row: 11 - column: 123 - fix: ~ - parent: ~ -- kind: - name: TypeCommentInStub - body: "Don't use type comments in stub file" - suggestion: ~ - fixable: false - location: - row: 14 - column: 11 - end_location: - row: 14 - column: 128 - fix: ~ - parent: ~ -- kind: - name: TypeCommentInStub - body: "Don't use type comments in stub file" - suggestion: ~ - fixable: false - location: - row: 15 - column: 10 - end_location: - row: 15 - column: 172 - fix: ~ - parent: ~ -- kind: - name: TypeCommentInStub - body: "Don't use type comments in stub file" - suggestion: ~ - fixable: false - location: - row: 19 - column: 28 - end_location: - row: 19 - column: 139 - fix: ~ - parent: ~ -- kind: - name: TypeCommentInStub - body: "Don't use type comments in stub file" - suggestion: ~ - fixable: false - location: - row: 29 - column: 21 - end_location: - row: 29 - column: 44 - fix: ~ - parent: ~ -- kind: - name: TypeCommentInStub - body: "Don't use type comments in stub file" - suggestion: ~ - fixable: false - location: - row: 32 - column: 25 - end_location: - row: 32 - column: 55 - fix: ~ - parent: ~ +- - kind: + name: TypeCommentInStub + body: "Don't use type comments in stub file" + suggestion: ~ + fixable: false + location: + row: 6 + column: 21 + end_location: + row: 6 + column: 127 + fix: ~ + parent: ~ + - kind: + name: TypeCommentInStub + body: "Don't use type comments in stub file" + suggestion: ~ + fixable: false + location: + row: 7 + column: 21 + end_location: + row: 7 + column: 183 + fix: ~ + parent: ~ + - kind: + name: TypeCommentInStub + body: "Don't use type comments in stub file" + suggestion: ~ + fixable: false + location: + row: 8 + column: 21 + end_location: + row: 8 + column: 126 + fix: ~ + parent: ~ + - kind: + name: TypeCommentInStub + body: "Don't use type comments in stub file" + suggestion: ~ + fixable: false + location: + row: 9 + column: 21 + end_location: + row: 9 + column: 132 + fix: ~ + parent: ~ + - kind: + name: TypeCommentInStub + body: "Don't use type comments in stub file" + suggestion: ~ + fixable: false + location: + row: 10 + column: 19 + end_location: + row: 10 + column: 128 + fix: ~ + parent: ~ + - kind: + name: TypeCommentInStub + body: "Don't use type comments in stub file" + suggestion: ~ + fixable: false + location: + row: 11 + column: 19 + end_location: + row: 11 + column: 123 + fix: ~ + parent: ~ + - kind: + name: TypeCommentInStub + body: "Don't use type comments in stub file" + suggestion: ~ + fixable: false + location: + row: 14 + column: 11 + end_location: + row: 14 + column: 128 + fix: ~ + parent: ~ + - kind: + name: TypeCommentInStub + body: "Don't use type comments in stub file" + suggestion: ~ + fixable: false + location: + row: 15 + column: 10 + end_location: + row: 15 + column: 172 + fix: ~ + parent: ~ + - kind: + name: TypeCommentInStub + body: "Don't use type comments in stub file" + suggestion: ~ + fixable: false + location: + row: 19 + column: 28 + end_location: + row: 19 + column: 139 + fix: ~ + parent: ~ + - kind: + name: TypeCommentInStub + body: "Don't use type comments in stub file" + suggestion: ~ + fixable: false + location: + row: 29 + column: 21 + end_location: + row: 29 + column: 44 + fix: ~ + parent: ~ + - kind: + name: TypeCommentInStub + body: "Don't use type comments in stub file" + suggestion: ~ + fixable: false + location: + row: 32 + column: 25 + end_location: + row: 32 + column: 55 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/mod.rs b/crates/ruff/src/rules/flake8_pytest_style/mod.rs index 7a737ac7fbd974..9ce30c3416f130 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/mod.rs +++ b/crates/ruff/src/rules/flake8_pytest_style/mod.rs @@ -248,14 +248,13 @@ mod tests { plugin_settings: Settings, name: &str, ) -> Result<()> { - let mut diagnostics = test_path( + let diagnostics = test_path( Path::new("flake8_pytest_style").join(path).as_path(), &settings::Settings { flake8_pytest_style: plugin_settings, ..settings::Settings::for_rule(rule_code) }, )?; - diagnostics.sort_by_key(|diagnostic| diagnostic.location); assert_yaml_snapshot!(name, diagnostics); Ok(()) } diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_default.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_default.snap index f8482ae96c761f..3177a28c2d922c 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_default.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_default.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: IncorrectFixtureParenthesesStyle - body: "Use `@pytest.fixture()` over `@pytest.fixture`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 9 - column: 1 - end_location: - row: 9 - column: 15 - fix: - content: () +- - kind: + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture()` over `@pytest.fixture`" + suggestion: Add/remove parentheses + fixable: true location: row: 9 - column: 15 + column: 1 end_location: row: 9 column: 15 - parent: ~ -- kind: - name: IncorrectFixtureParenthesesStyle - body: "Use `@pytest.fixture()` over `@pytest.fixture`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 34 - column: 1 - end_location: - row: 34 - column: 8 - fix: - content: () + fix: + content: () + location: + row: 9 + column: 15 + end_location: + row: 9 + column: 15 + parent: ~ + - kind: + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture()` over `@pytest.fixture`" + suggestion: Add/remove parentheses + fixable: true location: row: 34 - column: 8 + column: 1 end_location: row: 34 column: 8 - parent: ~ -- kind: - name: IncorrectFixtureParenthesesStyle - body: "Use `@pytest.fixture()` over `@pytest.fixture`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 59 - column: 1 - end_location: - row: 59 - column: 8 - fix: - content: () + fix: + content: () + location: + row: 34 + column: 8 + end_location: + row: 34 + column: 8 + parent: ~ + - kind: + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture()` over `@pytest.fixture`" + suggestion: Add/remove parentheses + fixable: true location: row: 59 - column: 8 + column: 1 end_location: row: 59 column: 8 - parent: ~ + fix: + content: () + location: + row: 59 + column: 8 + end_location: + row: 59 + column: 8 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_no_parentheses.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_no_parentheses.snap index f9f756695ce01d..f259d8e54c766b 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_no_parentheses.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_no_parentheses.snap @@ -2,124 +2,124 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: IncorrectFixtureParenthesesStyle - body: "Use `@pytest.fixture` over `@pytest.fixture()`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 14 - column: 1 - end_location: - row: 14 - column: 17 - fix: - content: "" +- - kind: + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture` over `@pytest.fixture()`" + suggestion: Add/remove parentheses + fixable: true location: row: 14 - column: 15 + column: 1 end_location: row: 14 column: 17 - parent: ~ -- kind: - name: IncorrectFixtureParenthesesStyle - body: "Use `@pytest.fixture` over `@pytest.fixture()`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 24 - column: 1 - end_location: - row: 26 - column: 1 - fix: - content: "" + fix: + content: "" + location: + row: 14 + column: 15 + end_location: + row: 14 + column: 17 + parent: ~ + - kind: + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture` over `@pytest.fixture()`" + suggestion: Add/remove parentheses + fixable: true location: row: 24 - column: 15 + column: 1 end_location: row: 26 column: 1 - parent: ~ -- kind: - name: IncorrectFixtureParenthesesStyle - body: "Use `@pytest.fixture` over `@pytest.fixture()`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 39 - column: 1 - end_location: - row: 39 - column: 10 - fix: - content: "" + fix: + content: "" + location: + row: 24 + column: 15 + end_location: + row: 26 + column: 1 + parent: ~ + - kind: + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture` over `@pytest.fixture()`" + suggestion: Add/remove parentheses + fixable: true location: row: 39 - column: 8 + column: 1 end_location: row: 39 column: 10 - parent: ~ -- kind: - name: IncorrectFixtureParenthesesStyle - body: "Use `@pytest.fixture` over `@pytest.fixture()`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 49 - column: 1 - end_location: - row: 51 - column: 1 - fix: - content: "" + fix: + content: "" + location: + row: 39 + column: 8 + end_location: + row: 39 + column: 10 + parent: ~ + - kind: + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture` over `@pytest.fixture()`" + suggestion: Add/remove parentheses + fixable: true location: row: 49 - column: 8 + column: 1 end_location: row: 51 column: 1 - parent: ~ -- kind: - name: IncorrectFixtureParenthesesStyle - body: "Use `@pytest.fixture` over `@pytest.fixture()`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 64 - column: 1 - end_location: - row: 64 - column: 10 - fix: - content: "" + fix: + content: "" + location: + row: 49 + column: 8 + end_location: + row: 51 + column: 1 + parent: ~ + - kind: + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture` over `@pytest.fixture()`" + suggestion: Add/remove parentheses + fixable: true location: row: 64 - column: 8 + column: 1 end_location: row: 64 column: 10 - parent: ~ -- kind: - name: IncorrectFixtureParenthesesStyle - body: "Use `@pytest.fixture` over `@pytest.fixture()`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 74 - column: 1 - end_location: - row: 76 - column: 1 - fix: - content: "" + fix: + content: "" + location: + row: 64 + column: 8 + end_location: + row: 64 + column: 10 + parent: ~ + - kind: + name: IncorrectFixtureParenthesesStyle + body: "Use `@pytest.fixture` over `@pytest.fixture()`" + suggestion: Add/remove parentheses + fixable: true location: row: 74 - column: 8 + column: 1 end_location: row: 76 column: 1 - parent: ~ + fix: + content: "" + location: + row: 74 + column: 8 + end_location: + row: 76 + column: 1 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT002.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT002.snap index 3c9f6c1e9917c1..d9ef4e347d5d8f 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT002.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT002.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: FixturePositionalArgs - body: "Configuration for fixture `my_fixture` specified via positional args, use kwargs" - suggestion: ~ - fixable: false - location: - row: 14 - column: 1 - end_location: - row: 14 - column: 25 - fix: ~ - parent: ~ -- kind: - name: FixturePositionalArgs - body: "Configuration for fixture `my_fixture` specified via positional args, use kwargs" - suggestion: ~ - fixable: false - location: - row: 19 - column: 1 - end_location: - row: 19 - column: 39 - fix: ~ - parent: ~ +- - kind: + name: FixturePositionalArgs + body: "Configuration for fixture `my_fixture` specified via positional args, use kwargs" + suggestion: ~ + fixable: false + location: + row: 14 + column: 1 + end_location: + row: 14 + column: 25 + fix: ~ + parent: ~ + - kind: + name: FixturePositionalArgs + body: "Configuration for fixture `my_fixture` specified via positional args, use kwargs" + suggestion: ~ + fixable: false + location: + row: 19 + column: 1 + end_location: + row: 19 + column: 39 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT003.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT003.snap index dc5917f27635bd..7d5629960af884 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT003.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT003.snap @@ -2,164 +2,164 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: ExtraneousScopeFunction - body: "`scope='function'` is implied in `@pytest.fixture()`" - suggestion: "Remove implied `scope` argument" - fixable: true - location: - row: 14 - column: 16 - end_location: - row: 14 - column: 32 - fix: - content: "" +- - kind: + name: ExtraneousScopeFunction + body: "`scope='function'` is implied in `@pytest.fixture()`" + suggestion: "Remove implied `scope` argument" + fixable: true location: row: 14 column: 16 end_location: row: 14 column: 32 - parent: ~ -- kind: - name: ExtraneousScopeFunction - body: "`scope='function'` is implied in `@pytest.fixture()`" - suggestion: "Remove implied `scope` argument" - fixable: true - location: - row: 19 - column: 16 - end_location: - row: 19 - column: 32 - fix: - content: "" + fix: + content: "" + location: + row: 14 + column: 16 + end_location: + row: 14 + column: 32 + parent: ~ + - kind: + name: ExtraneousScopeFunction + body: "`scope='function'` is implied in `@pytest.fixture()`" + suggestion: "Remove implied `scope` argument" + fixable: true location: row: 19 column: 16 end_location: row: 19 - column: 34 - parent: ~ -- kind: - name: ExtraneousScopeFunction - body: "`scope='function'` is implied in `@pytest.fixture()`" - suggestion: "Remove implied `scope` argument" - fixable: true - location: - row: 24 - column: 35 - end_location: - row: 24 - column: 51 - fix: - content: "" + column: 32 + fix: + content: "" + location: + row: 19 + column: 16 + end_location: + row: 19 + column: 34 + parent: ~ + - kind: + name: ExtraneousScopeFunction + body: "`scope='function'` is implied in `@pytest.fixture()`" + suggestion: "Remove implied `scope` argument" + fixable: true location: row: 24 - column: 33 + column: 35 end_location: row: 24 column: 51 - parent: ~ -- kind: - name: ExtraneousScopeFunction - body: "`scope='function'` is implied in `@pytest.fixture()`" - suggestion: "Remove implied `scope` argument" - fixable: true - location: - row: 29 - column: 35 - end_location: - row: 29 - column: 51 - fix: - content: "" + fix: + content: "" + location: + row: 24 + column: 33 + end_location: + row: 24 + column: 51 + parent: ~ + - kind: + name: ExtraneousScopeFunction + body: "`scope='function'` is implied in `@pytest.fixture()`" + suggestion: "Remove implied `scope` argument" + fixable: true location: row: 29 column: 35 end_location: row: 29 - column: 53 - parent: ~ -- kind: - name: ExtraneousScopeFunction - body: "`scope='function'` is implied in `@pytest.fixture()`" - suggestion: "Remove implied `scope` argument" - fixable: true - location: - row: 37 - column: 30 - end_location: - row: 37 - column: 46 - fix: - content: "" + column: 51 + fix: + content: "" + location: + row: 29 + column: 35 + end_location: + row: 29 + column: 53 + parent: ~ + - kind: + name: ExtraneousScopeFunction + body: "`scope='function'` is implied in `@pytest.fixture()`" + suggestion: "Remove implied `scope` argument" + fixable: true location: row: 37 - column: 28 + column: 30 end_location: row: 37 column: 46 - parent: ~ -- kind: - name: ExtraneousScopeFunction - body: "`scope='function'` is implied in `@pytest.fixture()`" - suggestion: "Remove implied `scope` argument" - fixable: true - location: - row: 43 - column: 4 - end_location: - row: 43 - column: 20 - fix: - content: "" + fix: + content: "" + location: + row: 37 + column: 28 + end_location: + row: 37 + column: 46 + parent: ~ + - kind: + name: ExtraneousScopeFunction + body: "`scope='function'` is implied in `@pytest.fixture()`" + suggestion: "Remove implied `scope` argument" + fixable: true location: row: 43 column: 4 end_location: - row: 44 - column: 4 - parent: ~ -- kind: - name: ExtraneousScopeFunction - body: "`scope='function'` is implied in `@pytest.fixture()`" - suggestion: "Remove implied `scope` argument" - fixable: true - location: - row: 52 - column: 4 - end_location: - row: 52 - column: 20 - fix: - content: "" + row: 43 + column: 20 + fix: + content: "" + location: + row: 43 + column: 4 + end_location: + row: 44 + column: 4 + parent: ~ + - kind: + name: ExtraneousScopeFunction + body: "`scope='function'` is implied in `@pytest.fixture()`" + suggestion: "Remove implied `scope` argument" + fixable: true location: - row: 51 - column: 21 + row: 52 + column: 4 end_location: row: 52 column: 20 - parent: ~ -- kind: - name: ExtraneousScopeFunction - body: "`scope='function'` is implied in `@pytest.fixture()`" - suggestion: "Remove implied `scope` argument" - fixable: true - location: - row: 66 - column: 4 - end_location: - row: 67 - column: 18 - fix: - content: "" + fix: + content: "" + location: + row: 51 + column: 21 + end_location: + row: 52 + column: 20 + parent: ~ + - kind: + name: ExtraneousScopeFunction + body: "`scope='function'` is implied in `@pytest.fixture()`" + suggestion: "Remove implied `scope` argument" + fixable: true location: row: 66 column: 4 end_location: - row: 70 - column: 4 - parent: ~ + row: 67 + column: 18 + fix: + content: "" + location: + row: 66 + column: 4 + end_location: + row: 70 + column: 4 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT004.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT004.snap index 9ef62ad148f752..04b02072832727 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT004.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT004.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: MissingFixtureNameUnderscore - body: "Fixture `patch_something` does not return anything, add leading underscore" - suggestion: ~ - fixable: false - location: - row: 51 - column: 0 - end_location: - row: 52 - column: 30 - fix: ~ - parent: ~ -- kind: - name: MissingFixtureNameUnderscore - body: "Fixture `activate_context` does not return anything, add leading underscore" - suggestion: ~ - fixable: false - location: - row: 56 - column: 0 - end_location: - row: 58 - column: 13 - fix: ~ - parent: ~ +- - kind: + name: MissingFixtureNameUnderscore + body: "Fixture `patch_something` does not return anything, add leading underscore" + suggestion: ~ + fixable: false + location: + row: 51 + column: 0 + end_location: + row: 52 + column: 30 + fix: ~ + parent: ~ + - kind: + name: MissingFixtureNameUnderscore + body: "Fixture `activate_context` does not return anything, add leading underscore" + suggestion: ~ + fixable: false + location: + row: 56 + column: 0 + end_location: + row: 58 + column: 13 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT005.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT005.snap index a21b02b10930cb..1221ef48b5788f 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT005.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT005.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: IncorrectFixtureNameUnderscore - body: "Fixture `_my_fixture` returns a value, remove leading underscore" - suggestion: ~ - fixable: false - location: - row: 41 - column: 0 - end_location: - row: 42 - column: 12 - fix: ~ - parent: ~ -- kind: - name: IncorrectFixtureNameUnderscore - body: "Fixture `_activate_context` returns a value, remove leading underscore" - suggestion: ~ - fixable: false - location: - row: 46 - column: 0 - end_location: - row: 48 - column: 21 - fix: ~ - parent: ~ -- kind: - name: IncorrectFixtureNameUnderscore - body: "Fixture `_activate_context` returns a value, remove leading underscore" - suggestion: ~ - fixable: false - location: - row: 52 - column: 0 - end_location: - row: 57 - column: 34 - fix: ~ - parent: ~ +- - kind: + name: IncorrectFixtureNameUnderscore + body: "Fixture `_my_fixture` returns a value, remove leading underscore" + suggestion: ~ + fixable: false + location: + row: 41 + column: 0 + end_location: + row: 42 + column: 12 + fix: ~ + parent: ~ + - kind: + name: IncorrectFixtureNameUnderscore + body: "Fixture `_activate_context` returns a value, remove leading underscore" + suggestion: ~ + fixable: false + location: + row: 46 + column: 0 + end_location: + row: 48 + column: 21 + fix: ~ + parent: ~ + - kind: + name: IncorrectFixtureNameUnderscore + body: "Fixture `_activate_context` returns a value, remove leading underscore" + suggestion: ~ + fixable: false + location: + row: 52 + column: 0 + end_location: + row: 57 + column: 34 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_csv.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_csv.snap index 3c04de31093445..45d50167fa3b00 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_csv.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_csv.snap @@ -2,110 +2,110 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" - suggestion: "Use a `csv` for parameter names" - fixable: true - location: - row: 24 - column: 25 - end_location: - row: 24 - column: 45 - fix: - content: "\"param1,param2\"" +- - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + suggestion: "Use a `csv` for parameter names" + fixable: true location: row: 24 column: 25 end_location: row: 24 column: 45 - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" - suggestion: "Use a `csv` for parameter names" - fixable: true - location: - row: 29 - column: 25 - end_location: - row: 29 - column: 36 - fix: - content: "\"param1\"" + fix: + content: "\"param1,param2\"" + location: + row: 24 + column: 25 + end_location: + row: 24 + column: 45 + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + suggestion: "Use a `csv` for parameter names" + fixable: true location: row: 29 column: 25 end_location: row: 29 column: 36 - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" - suggestion: "Use a `csv` for parameter names" - fixable: true - location: - row: 34 - column: 25 - end_location: - row: 34 - column: 45 - fix: - content: "\"param1,param2\"" + fix: + content: "\"param1\"" + location: + row: 29 + column: 25 + end_location: + row: 29 + column: 36 + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + suggestion: "Use a `csv` for parameter names" + fixable: true location: row: 34 column: 25 end_location: row: 34 column: 45 - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" - suggestion: "Use a `csv` for parameter names" - fixable: true - location: - row: 39 - column: 25 - end_location: - row: 39 - column: 35 - fix: - content: "\"param1\"" + fix: + content: "\"param1,param2\"" + location: + row: 34 + column: 25 + end_location: + row: 34 + column: 45 + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + suggestion: "Use a `csv` for parameter names" + fixable: true location: row: 39 column: 25 end_location: row: 39 column: 35 - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" - suggestion: "Use a `csv` for parameter names" - fixable: true - location: - row: 44 - column: 25 - end_location: - row: 44 - column: 50 - fix: ~ - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" - suggestion: "Use a `csv` for parameter names" - fixable: true - location: - row: 49 - column: 25 - end_location: - row: 49 - column: 46 - fix: ~ - parent: ~ + fix: + content: "\"param1\"" + location: + row: 39 + column: 25 + end_location: + row: 39 + column: 35 + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + suggestion: "Use a `csv` for parameter names" + fixable: true + location: + row: 44 + column: 25 + end_location: + row: 44 + column: 50 + fix: ~ + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + suggestion: "Use a `csv` for parameter names" + fixable: true + location: + row: 49 + column: 25 + end_location: + row: 49 + column: 46 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_default.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_default.snap index 63488d0c25197c..0afacd22bf1cae 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_default.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_default.snap @@ -2,164 +2,164 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" - suggestion: "Use a `tuple` for parameter names" - fixable: true - location: - row: 9 - column: 25 - end_location: - row: 9 - column: 40 - fix: - content: "(\"param1\", \"param2\")" +- - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" + suggestion: "Use a `tuple` for parameter names" + fixable: true location: row: 9 column: 25 end_location: row: 9 column: 40 - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" - suggestion: "Use a `tuple` for parameter names" - fixable: true - location: - row: 14 - column: 25 - end_location: - row: 14 - column: 56 - fix: - content: "(\"param1\", \"param2\")" + fix: + content: "(\"param1\", \"param2\")" + location: + row: 9 + column: 25 + end_location: + row: 9 + column: 40 + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" + suggestion: "Use a `tuple` for parameter names" + fixable: true location: row: 14 column: 25 end_location: row: 14 column: 56 - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" - suggestion: "Use a `tuple` for parameter names" - fixable: true - location: - row: 19 - column: 25 - end_location: - row: 19 - column: 40 - fix: - content: "(\"param1\", \"param2\")" + fix: + content: "(\"param1\", \"param2\")" + location: + row: 14 + column: 25 + end_location: + row: 14 + column: 56 + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" + suggestion: "Use a `tuple` for parameter names" + fixable: true location: row: 19 column: 25 end_location: row: 19 column: 40 - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" - suggestion: "Use a `csv` for parameter names" - fixable: true - location: - row: 29 - column: 25 - end_location: - row: 29 - column: 36 - fix: - content: "\"param1\"" + fix: + content: "(\"param1\", \"param2\")" + location: + row: 19 + column: 25 + end_location: + row: 19 + column: 40 + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + suggestion: "Use a `csv` for parameter names" + fixable: true location: row: 29 column: 25 end_location: row: 29 column: 36 - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" - suggestion: "Use a `tuple` for parameter names" - fixable: true - location: - row: 34 - column: 25 - end_location: - row: 34 - column: 45 - fix: - content: "(\"param1\", \"param2\")" + fix: + content: "\"param1\"" + location: + row: 29 + column: 25 + end_location: + row: 29 + column: 36 + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" + suggestion: "Use a `tuple` for parameter names" + fixable: true location: row: 34 column: 25 end_location: row: 34 column: 45 - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" - suggestion: "Use a `csv` for parameter names" - fixable: true - location: - row: 39 - column: 25 - end_location: - row: 39 - column: 35 - fix: - content: "\"param1\"" + fix: + content: "(\"param1\", \"param2\")" + location: + row: 34 + column: 25 + end_location: + row: 34 + column: 45 + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + suggestion: "Use a `csv` for parameter names" + fixable: true location: row: 39 column: 25 end_location: row: 39 column: 35 - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" - suggestion: "Use a `tuple` for parameter names" - fixable: true - location: - row: 44 - column: 25 - end_location: - row: 44 - column: 50 - fix: - content: "(some_expr, another_expr)" + fix: + content: "\"param1\"" + location: + row: 39 + column: 25 + end_location: + row: 39 + column: 35 + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" + suggestion: "Use a `tuple` for parameter names" + fixable: true location: row: 44 column: 25 end_location: row: 44 column: 50 - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" - suggestion: "Use a `tuple` for parameter names" - fixable: true - location: - row: 49 - column: 25 - end_location: - row: 49 - column: 46 - fix: - content: "(some_expr, \"param2\")" + fix: + content: "(some_expr, another_expr)" + location: + row: 44 + column: 25 + end_location: + row: 44 + column: 50 + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`" + suggestion: "Use a `tuple` for parameter names" + fixable: true location: row: 49 column: 25 end_location: row: 49 column: 46 - parent: ~ + fix: + content: "(some_expr, \"param2\")" + location: + row: 49 + column: 25 + end_location: + row: 49 + column: 46 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_list.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_list.snap index 1374f3f1d7fefa..9037be06a51aae 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_list.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_list.snap @@ -2,124 +2,124 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `list`" - suggestion: "Use a `list` for parameter names" - fixable: true - location: - row: 9 - column: 25 - end_location: - row: 9 - column: 40 - fix: - content: "[\"param1\", \"param2\"]" +- - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `list`" + suggestion: "Use a `list` for parameter names" + fixable: true location: row: 9 column: 25 end_location: row: 9 column: 40 - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `list`" - suggestion: "Use a `list` for parameter names" - fixable: true - location: - row: 14 - column: 25 - end_location: - row: 14 - column: 56 - fix: - content: "[\"param1\", \"param2\"]" + fix: + content: "[\"param1\", \"param2\"]" + location: + row: 9 + column: 25 + end_location: + row: 9 + column: 40 + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `list`" + suggestion: "Use a `list` for parameter names" + fixable: true location: row: 14 column: 25 end_location: row: 14 column: 56 - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `list`" - suggestion: "Use a `list` for parameter names" - fixable: true - location: - row: 19 - column: 25 - end_location: - row: 19 - column: 40 - fix: - content: "[\"param1\", \"param2\"]" + fix: + content: "[\"param1\", \"param2\"]" + location: + row: 14 + column: 25 + end_location: + row: 14 + column: 56 + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `list`" + suggestion: "Use a `list` for parameter names" + fixable: true location: row: 19 column: 25 end_location: row: 19 column: 40 - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `list`" - suggestion: "Use a `list` for parameter names" - fixable: true - location: - row: 24 - column: 25 - end_location: - row: 24 - column: 45 - fix: - content: "[\"param1\", \"param2\"]" + fix: + content: "[\"param1\", \"param2\"]" + location: + row: 19 + column: 25 + end_location: + row: 19 + column: 40 + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `list`" + suggestion: "Use a `list` for parameter names" + fixable: true location: row: 24 column: 25 end_location: row: 24 column: 45 - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" - suggestion: "Use a `csv` for parameter names" - fixable: true - location: - row: 29 - column: 25 - end_location: - row: 29 - column: 36 - fix: - content: "\"param1\"" + fix: + content: "[\"param1\", \"param2\"]" + location: + row: 24 + column: 25 + end_location: + row: 24 + column: 45 + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + suggestion: "Use a `csv` for parameter names" + fixable: true location: row: 29 column: 25 end_location: row: 29 column: 36 - parent: ~ -- kind: - name: ParametrizeNamesWrongType - body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" - suggestion: "Use a `csv` for parameter names" - fixable: true - location: - row: 39 - column: 25 - end_location: - row: 39 - column: 35 - fix: - content: "\"param1\"" + fix: + content: "\"param1\"" + location: + row: 29 + column: 25 + end_location: + row: 29 + column: 36 + parent: ~ + - kind: + name: ParametrizeNamesWrongType + body: "Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv`" + suggestion: "Use a `csv` for parameter names" + fixable: true location: row: 39 column: 25 end_location: row: 39 column: 35 - parent: ~ + fix: + content: "\"param1\"" + location: + row: 39 + column: 25 + end_location: + row: 39 + column: 35 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_lists.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_lists.snap index a5316790e99948..3fadc00b46dc18 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_lists.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_lists.snap @@ -2,134 +2,134 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 34 - end_location: - row: 4 - column: 40 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 4 - end_location: - row: 14 - column: 5 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" - suggestion: ~ - fixable: false - location: - row: 12 - column: 8 - end_location: - row: 12 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 8 - end_location: - row: 13 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" - suggestion: ~ - fixable: false - location: - row: 22 - column: 4 - end_location: - row: 25 - column: 5 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" - suggestion: ~ - fixable: false - location: - row: 39 - column: 8 - end_location: - row: 39 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" - suggestion: ~ - fixable: false - location: - row: 40 - column: 8 - end_location: - row: 40 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" - suggestion: ~ - fixable: false - location: - row: 81 - column: 37 - end_location: - row: 81 - column: 53 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" - suggestion: ~ - fixable: false - location: - row: 81 - column: 38 - end_location: - row: 81 - column: 44 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" - suggestion: ~ - fixable: false - location: - row: 81 - column: 46 - end_location: - row: 81 - column: 52 - fix: ~ - parent: ~ +- - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 34 + end_location: + row: 4 + column: 40 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 4 + end_location: + row: 14 + column: 5 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + suggestion: ~ + fixable: false + location: + row: 12 + column: 8 + end_location: + row: 12 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 8 + end_location: + row: 13 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + suggestion: ~ + fixable: false + location: + row: 22 + column: 4 + end_location: + row: 25 + column: 5 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + suggestion: ~ + fixable: false + location: + row: 39 + column: 8 + end_location: + row: 39 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + suggestion: ~ + fixable: false + location: + row: 40 + column: 8 + end_location: + row: 40 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + suggestion: ~ + fixable: false + location: + row: 81 + column: 37 + end_location: + row: 81 + column: 53 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + suggestion: ~ + fixable: false + location: + row: 81 + column: 38 + end_location: + row: 81 + column: 44 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `list`" + suggestion: ~ + fixable: false + location: + row: 81 + column: 46 + end_location: + row: 81 + column: 52 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_tuples.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_tuples.snap index dcefb617e6aa38..6aa2759f09f4cb 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_tuples.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_tuples.snap @@ -2,134 +2,134 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 34 - end_location: - row: 4 - column: 40 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 4 - end_location: - row: 14 - column: 5 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 22 - column: 4 - end_location: - row: 25 - column: 5 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 23 - column: 8 - end_location: - row: 23 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 24 - column: 8 - end_location: - row: 24 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 50 - column: 8 - end_location: - row: 50 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 51 - column: 8 - end_location: - row: 51 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 61 - column: 8 - end_location: - row: 61 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 62 - column: 8 - end_location: - row: 62 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 81 - column: 37 - end_location: - row: 81 - column: 53 - fix: ~ - parent: ~ +- - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 34 + end_location: + row: 4 + column: 40 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 4 + end_location: + row: 14 + column: 5 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 22 + column: 4 + end_location: + row: 25 + column: 5 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 23 + column: 8 + end_location: + row: 23 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 24 + column: 8 + end_location: + row: 24 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 50 + column: 8 + end_location: + row: 50 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 51 + column: 8 + end_location: + row: 51 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 61 + column: 8 + end_location: + row: 61 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 62 + column: 8 + end_location: + row: 62 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 81 + column: 37 + end_location: + row: 81 + column: 53 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_lists.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_lists.snap index 4d2b8d8164395b..55bed588cf1928 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_lists.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_lists.snap @@ -2,160 +2,160 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" - suggestion: ~ - fixable: false - location: - row: 12 - column: 8 - end_location: - row: 12 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 8 - end_location: - row: 13 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" - suggestion: ~ - fixable: false - location: - row: 31 - column: 34 - end_location: - row: 31 - column: 40 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" - suggestion: ~ - fixable: false - location: - row: 38 - column: 4 - end_location: - row: 41 - column: 5 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" - suggestion: ~ - fixable: false - location: - row: 39 - column: 8 - end_location: - row: 39 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" - suggestion: ~ - fixable: false - location: - row: 40 - column: 8 - end_location: - row: 40 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" - suggestion: ~ - fixable: false - location: - row: 49 - column: 4 - end_location: - row: 52 - column: 5 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" - suggestion: ~ - fixable: false - location: - row: 60 - column: 4 - end_location: - row: 63 - column: 5 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" - suggestion: ~ - fixable: false - location: - row: 71 - column: 4 - end_location: - row: 74 - column: 5 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" - suggestion: ~ - fixable: false - location: - row: 80 - column: 30 - end_location: - row: 80 - column: 36 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" - suggestion: ~ - fixable: false - location: - row: 81 - column: 38 - end_location: - row: 81 - column: 44 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" - suggestion: ~ - fixable: false - location: - row: 81 - column: 46 - end_location: - row: 81 - column: 52 - fix: ~ - parent: ~ +- - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + suggestion: ~ + fixable: false + location: + row: 12 + column: 8 + end_location: + row: 12 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 8 + end_location: + row: 13 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + suggestion: ~ + fixable: false + location: + row: 31 + column: 34 + end_location: + row: 31 + column: 40 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + suggestion: ~ + fixable: false + location: + row: 38 + column: 4 + end_location: + row: 41 + column: 5 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + suggestion: ~ + fixable: false + location: + row: 39 + column: 8 + end_location: + row: 39 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + suggestion: ~ + fixable: false + location: + row: 40 + column: 8 + end_location: + row: 40 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + suggestion: ~ + fixable: false + location: + row: 49 + column: 4 + end_location: + row: 52 + column: 5 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + suggestion: ~ + fixable: false + location: + row: 60 + column: 4 + end_location: + row: 63 + column: 5 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + suggestion: ~ + fixable: false + location: + row: 71 + column: 4 + end_location: + row: 74 + column: 5 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + suggestion: ~ + fixable: false + location: + row: 80 + column: 30 + end_location: + row: 80 + column: 36 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + suggestion: ~ + fixable: false + location: + row: 81 + column: 38 + end_location: + row: 81 + column: 44 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list`" + suggestion: ~ + fixable: false + location: + row: 81 + column: 46 + end_location: + row: 81 + column: 52 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_tuples.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_tuples.snap index f3f714136e4502..4c0f33deb82361 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_tuples.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_tuples.snap @@ -2,160 +2,160 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 23 - column: 8 - end_location: - row: 23 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 24 - column: 8 - end_location: - row: 24 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 31 - column: 34 - end_location: - row: 31 - column: 40 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 38 - column: 4 - end_location: - row: 41 - column: 5 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 49 - column: 4 - end_location: - row: 52 - column: 5 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 50 - column: 8 - end_location: - row: 50 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 51 - column: 8 - end_location: - row: 51 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 60 - column: 4 - end_location: - row: 63 - column: 5 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 61 - column: 8 - end_location: - row: 61 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 62 - column: 8 - end_location: - row: 62 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 71 - column: 4 - end_location: - row: 74 - column: 5 - fix: ~ - parent: ~ -- kind: - name: ParametrizeValuesWrongType - body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" - suggestion: ~ - fixable: false - location: - row: 80 - column: 30 - end_location: - row: 80 - column: 36 - fix: ~ - parent: ~ +- - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 23 + column: 8 + end_location: + row: 23 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 24 + column: 8 + end_location: + row: 24 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 31 + column: 34 + end_location: + row: 31 + column: 40 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 38 + column: 4 + end_location: + row: 41 + column: 5 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 49 + column: 4 + end_location: + row: 52 + column: 5 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 50 + column: 8 + end_location: + row: 50 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 51 + column: 8 + end_location: + row: 51 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 60 + column: 4 + end_location: + row: 63 + column: 5 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 61 + column: 8 + end_location: + row: 61 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 62 + column: 8 + end_location: + row: 62 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 71 + column: 4 + end_location: + row: 74 + column: 5 + fix: ~ + parent: ~ + - kind: + name: ParametrizeValuesWrongType + body: "Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple`" + suggestion: ~ + fixable: false + location: + row: 80 + column: 30 + end_location: + row: 80 + column: 36 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT008.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT008.snap index b2e97bf716935a..377c15c693be5e 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT008.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT008.snap @@ -2,160 +2,160 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: PatchWithLambda - body: "Use `return_value=` instead of patching with `lambda`" - suggestion: ~ - fixable: false - location: - row: 35 - column: 0 - end_location: - row: 35 - column: 12 - fix: ~ - parent: ~ -- kind: - name: PatchWithLambda - body: "Use `return_value=` instead of patching with `lambda`" - suggestion: ~ - fixable: false - location: - row: 36 - column: 0 - end_location: - row: 36 - column: 19 - fix: ~ - parent: ~ -- kind: - name: PatchWithLambda - body: "Use `return_value=` instead of patching with `lambda`" - suggestion: ~ - fixable: false - location: - row: 37 - column: 0 - end_location: - row: 37 - column: 19 - fix: ~ - parent: ~ -- kind: - name: PatchWithLambda - body: "Use `return_value=` instead of patching with `lambda`" - suggestion: ~ - fixable: false - location: - row: 38 - column: 0 - end_location: - row: 38 - column: 26 - fix: ~ - parent: ~ -- kind: - name: PatchWithLambda - body: "Use `return_value=` instead of patching with `lambda`" - suggestion: ~ - fixable: false - location: - row: 40 - column: 0 - end_location: - row: 40 - column: 12 - fix: ~ - parent: ~ -- kind: - name: PatchWithLambda - body: "Use `return_value=` instead of patching with `lambda`" - suggestion: ~ - fixable: false - location: - row: 41 - column: 0 - end_location: - row: 41 - column: 19 - fix: ~ - parent: ~ -- kind: - name: PatchWithLambda - body: "Use `return_value=` instead of patching with `lambda`" - suggestion: ~ - fixable: false - location: - row: 42 - column: 0 - end_location: - row: 42 - column: 19 - fix: ~ - parent: ~ -- kind: - name: PatchWithLambda - body: "Use `return_value=` instead of patching with `lambda`" - suggestion: ~ - fixable: false - location: - row: 43 - column: 0 - end_location: - row: 43 - column: 26 - fix: ~ - parent: ~ -- kind: - name: PatchWithLambda - body: "Use `return_value=` instead of patching with `lambda`" - suggestion: ~ - fixable: false - location: - row: 45 - column: 0 - end_location: - row: 45 - column: 12 - fix: ~ - parent: ~ -- kind: - name: PatchWithLambda - body: "Use `return_value=` instead of patching with `lambda`" - suggestion: ~ - fixable: false - location: - row: 46 - column: 0 - end_location: - row: 46 - column: 19 - fix: ~ - parent: ~ -- kind: - name: PatchWithLambda - body: "Use `return_value=` instead of patching with `lambda`" - suggestion: ~ - fixable: false - location: - row: 47 - column: 0 - end_location: - row: 47 - column: 19 - fix: ~ - parent: ~ -- kind: - name: PatchWithLambda - body: "Use `return_value=` instead of patching with `lambda`" - suggestion: ~ - fixable: false - location: - row: 48 - column: 0 - end_location: - row: 48 - column: 26 - fix: ~ - parent: ~ +- - kind: + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + suggestion: ~ + fixable: false + location: + row: 35 + column: 0 + end_location: + row: 35 + column: 12 + fix: ~ + parent: ~ + - kind: + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + suggestion: ~ + fixable: false + location: + row: 36 + column: 0 + end_location: + row: 36 + column: 19 + fix: ~ + parent: ~ + - kind: + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + suggestion: ~ + fixable: false + location: + row: 37 + column: 0 + end_location: + row: 37 + column: 19 + fix: ~ + parent: ~ + - kind: + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + suggestion: ~ + fixable: false + location: + row: 38 + column: 0 + end_location: + row: 38 + column: 26 + fix: ~ + parent: ~ + - kind: + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + suggestion: ~ + fixable: false + location: + row: 40 + column: 0 + end_location: + row: 40 + column: 12 + fix: ~ + parent: ~ + - kind: + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + suggestion: ~ + fixable: false + location: + row: 41 + column: 0 + end_location: + row: 41 + column: 19 + fix: ~ + parent: ~ + - kind: + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + suggestion: ~ + fixable: false + location: + row: 42 + column: 0 + end_location: + row: 42 + column: 19 + fix: ~ + parent: ~ + - kind: + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + suggestion: ~ + fixable: false + location: + row: 43 + column: 0 + end_location: + row: 43 + column: 26 + fix: ~ + parent: ~ + - kind: + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + suggestion: ~ + fixable: false + location: + row: 45 + column: 0 + end_location: + row: 45 + column: 12 + fix: ~ + parent: ~ + - kind: + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + suggestion: ~ + fixable: false + location: + row: 46 + column: 0 + end_location: + row: 46 + column: 19 + fix: ~ + parent: ~ + - kind: + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + suggestion: ~ + fixable: false + location: + row: 47 + column: 0 + end_location: + row: 47 + column: 19 + fix: ~ + parent: ~ + - kind: + name: PatchWithLambda + body: "Use `return_value=` instead of patching with `lambda`" + suggestion: ~ + fixable: false + location: + row: 48 + column: 0 + end_location: + row: 48 + column: 26 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT009.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT009.snap index a3cac9936dca34..c0693116d1d167 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT009.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT009.snap @@ -2,575 +2,575 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertTrue`" - suggestion: "Replace `assertTrue(...)` with `assert ...`" - fixable: true - location: - row: 11 - column: 8 - end_location: - row: 11 - column: 23 - fix: - content: assert expr +- - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + suggestion: "Replace `assertTrue(...)` with `assert ...`" + fixable: true location: row: 11 column: 8 end_location: row: 11 - column: 29 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertTrue`" - suggestion: "Replace `assertTrue(...)` with `assert ...`" - fixable: true - location: - row: 12 - column: 8 - end_location: - row: 12 - column: 23 - fix: - content: assert expr + column: 23 + fix: + content: assert expr + location: + row: 11 + column: 8 + end_location: + row: 11 + column: 29 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + suggestion: "Replace `assertTrue(...)` with `assert ...`" + fixable: true location: row: 12 column: 8 end_location: row: 12 - column: 34 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertTrue`" - suggestion: "Replace `assertTrue(...)` with `assert ...`" - fixable: true - location: - row: 13 - column: 8 - end_location: - row: 13 - column: 23 - fix: - content: "assert expr, msg" + column: 23 + fix: + content: assert expr + location: + row: 12 + column: 8 + end_location: + row: 12 + column: 34 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + suggestion: "Replace `assertTrue(...)` with `assert ...`" + fixable: true location: row: 13 column: 8 end_location: row: 13 - column: 34 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertTrue`" - suggestion: "Replace `assertTrue(...)` with `assert ...`" - fixable: true - location: - row: 14 - column: 8 - end_location: - row: 14 - column: 23 - fix: - content: "assert expr, msg" + column: 23 + fix: + content: "assert expr, msg" + location: + row: 13 + column: 8 + end_location: + row: 13 + column: 34 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + suggestion: "Replace `assertTrue(...)` with `assert ...`" + fixable: true location: row: 14 column: 8 end_location: row: 14 - column: 43 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertTrue`" - suggestion: "Replace `assertTrue(...)` with `assert ...`" - fixable: true - location: - row: 15 - column: 8 - end_location: - row: 15 - column: 23 - fix: - content: "assert expr, msg" + column: 23 + fix: + content: "assert expr, msg" + location: + row: 14 + column: 8 + end_location: + row: 14 + column: 43 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + suggestion: "Replace `assertTrue(...)` with `assert ...`" + fixable: true location: row: 15 column: 8 end_location: row: 15 - column: 43 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertTrue`" - suggestion: "Replace `assertTrue(...)` with `assert ...`" - fixable: true - location: - row: 16 - column: 8 - end_location: - row: 16 - column: 23 - fix: ~ - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertTrue`" - suggestion: "Replace `assertTrue(...)` with `assert ...`" - fixable: true - location: - row: 17 - column: 8 - end_location: - row: 17 - column: 23 - fix: ~ - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertTrue`" - suggestion: "Replace `assertTrue(...)` with `assert ...`" - fixable: true - location: - row: 18 - column: 8 - end_location: - row: 18 - column: 23 - fix: ~ - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertTrue`" - suggestion: "Replace `assertTrue(...)` with `assert ...`" - fixable: true - location: - row: 19 - column: 8 - end_location: - row: 19 - column: 23 - fix: ~ - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertIsNotNone`" - suggestion: ~ - fixable: false - location: - row: 21 - column: 12 - end_location: - row: 21 - column: 32 - fix: ~ - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertIsNone`" - suggestion: ~ - fixable: false - location: - row: 23 - column: 17 - end_location: - row: 23 - column: 34 - fix: ~ - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertEqual`" - suggestion: ~ - fixable: false - location: - row: 25 - column: 15 - end_location: - row: 25 - column: 31 - fix: ~ - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertFalse`" - suggestion: "Replace `assertFalse(...)` with `assert ...`" - fixable: true - location: - row: 28 - column: 8 - end_location: - row: 28 - column: 24 - fix: - content: assert not True + column: 23 + fix: + content: "assert expr, msg" + location: + row: 15 + column: 8 + end_location: + row: 15 + column: 43 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + suggestion: "Replace `assertTrue(...)` with `assert ...`" + fixable: true + location: + row: 16 + column: 8 + end_location: + row: 16 + column: 23 + fix: ~ + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + suggestion: "Replace `assertTrue(...)` with `assert ...`" + fixable: true + location: + row: 17 + column: 8 + end_location: + row: 17 + column: 23 + fix: ~ + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + suggestion: "Replace `assertTrue(...)` with `assert ...`" + fixable: true + location: + row: 18 + column: 8 + end_location: + row: 18 + column: 23 + fix: ~ + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertTrue`" + suggestion: "Replace `assertTrue(...)` with `assert ...`" + fixable: true + location: + row: 19 + column: 8 + end_location: + row: 19 + column: 23 + fix: ~ + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertIsNotNone`" + suggestion: ~ + fixable: false + location: + row: 21 + column: 12 + end_location: + row: 21 + column: 32 + fix: ~ + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertIsNone`" + suggestion: ~ + fixable: false + location: + row: 23 + column: 17 + end_location: + row: 23 + column: 34 + fix: ~ + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertEqual`" + suggestion: ~ + fixable: false + location: + row: 25 + column: 15 + end_location: + row: 25 + column: 31 + fix: ~ + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertFalse`" + suggestion: "Replace `assertFalse(...)` with `assert ...`" + fixable: true location: row: 28 column: 8 end_location: row: 28 - column: 30 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertEqual`" - suggestion: "Replace `assertEqual(...)` with `assert ...`" - fixable: true - location: - row: 31 - column: 8 - end_location: - row: 31 - column: 24 - fix: - content: assert 1 == 2 + column: 24 + fix: + content: assert not True + location: + row: 28 + column: 8 + end_location: + row: 28 + column: 30 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertEqual`" + suggestion: "Replace `assertEqual(...)` with `assert ...`" + fixable: true location: row: 31 column: 8 end_location: row: 31 - column: 30 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertNotEqual`" - suggestion: "Replace `assertNotEqual(...)` with `assert ...`" - fixable: true - location: - row: 34 - column: 8 - end_location: - row: 34 - column: 27 - fix: - content: assert 1 != 1 + column: 24 + fix: + content: assert 1 == 2 + location: + row: 31 + column: 8 + end_location: + row: 31 + column: 30 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertNotEqual`" + suggestion: "Replace `assertNotEqual(...)` with `assert ...`" + fixable: true location: row: 34 column: 8 end_location: row: 34 - column: 33 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertGreater`" - suggestion: "Replace `assertGreater(...)` with `assert ...`" - fixable: true - location: - row: 37 - column: 8 - end_location: - row: 37 - column: 26 - fix: - content: assert 1 > 2 + column: 27 + fix: + content: assert 1 != 1 + location: + row: 34 + column: 8 + end_location: + row: 34 + column: 33 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertGreater`" + suggestion: "Replace `assertGreater(...)` with `assert ...`" + fixable: true location: row: 37 column: 8 end_location: row: 37 - column: 32 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertGreaterEqual`" - suggestion: "Replace `assertGreaterEqual(...)` with `assert ...`" - fixable: true - location: - row: 40 - column: 8 - end_location: - row: 40 - column: 31 - fix: - content: assert 1 >= 2 + column: 26 + fix: + content: assert 1 > 2 + location: + row: 37 + column: 8 + end_location: + row: 37 + column: 32 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertGreaterEqual`" + suggestion: "Replace `assertGreaterEqual(...)` with `assert ...`" + fixable: true location: row: 40 column: 8 end_location: row: 40 - column: 37 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertLess`" - suggestion: "Replace `assertLess(...)` with `assert ...`" - fixable: true - location: - row: 43 - column: 8 - end_location: - row: 43 - column: 23 - fix: - content: assert 2 < 1 + column: 31 + fix: + content: assert 1 >= 2 + location: + row: 40 + column: 8 + end_location: + row: 40 + column: 37 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertLess`" + suggestion: "Replace `assertLess(...)` with `assert ...`" + fixable: true location: row: 43 column: 8 end_location: row: 43 - column: 29 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertLessEqual`" - suggestion: "Replace `assertLessEqual(...)` with `assert ...`" - fixable: true - location: - row: 46 - column: 8 - end_location: - row: 46 - column: 28 - fix: - content: assert 1 <= 2 + column: 23 + fix: + content: assert 2 < 1 + location: + row: 43 + column: 8 + end_location: + row: 43 + column: 29 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertLessEqual`" + suggestion: "Replace `assertLessEqual(...)` with `assert ...`" + fixable: true location: row: 46 column: 8 end_location: row: 46 - column: 34 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertIn`" - suggestion: "Replace `assertIn(...)` with `assert ...`" - fixable: true - location: - row: 49 - column: 8 - end_location: - row: 49 - column: 21 - fix: - content: "assert 1 in [2, 3]" + column: 28 + fix: + content: assert 1 <= 2 + location: + row: 46 + column: 8 + end_location: + row: 46 + column: 34 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertIn`" + suggestion: "Replace `assertIn(...)` with `assert ...`" + fixable: true location: row: 49 column: 8 end_location: row: 49 - column: 32 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertNotIn`" - suggestion: "Replace `assertNotIn(...)` with `assert ...`" - fixable: true - location: - row: 52 - column: 8 - end_location: - row: 52 - column: 24 - fix: - content: "assert 2 not in [2, 3]" + column: 21 + fix: + content: "assert 1 in [2, 3]" + location: + row: 49 + column: 8 + end_location: + row: 49 + column: 32 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertNotIn`" + suggestion: "Replace `assertNotIn(...)` with `assert ...`" + fixable: true location: row: 52 column: 8 end_location: row: 52 - column: 35 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertIsNone`" - suggestion: "Replace `assertIsNone(...)` with `assert ...`" - fixable: true - location: - row: 55 - column: 8 - end_location: - row: 55 - column: 25 - fix: - content: assert 0 is None + column: 24 + fix: + content: "assert 2 not in [2, 3]" + location: + row: 52 + column: 8 + end_location: + row: 52 + column: 35 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertIsNone`" + suggestion: "Replace `assertIsNone(...)` with `assert ...`" + fixable: true location: row: 55 column: 8 end_location: row: 55 - column: 28 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertIsNotNone`" - suggestion: "Replace `assertIsNotNone(...)` with `assert ...`" - fixable: true - location: - row: 58 - column: 8 - end_location: - row: 58 - column: 28 - fix: - content: assert 0 is not None + column: 25 + fix: + content: assert 0 is None + location: + row: 55 + column: 8 + end_location: + row: 55 + column: 28 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertIsNotNone`" + suggestion: "Replace `assertIsNotNone(...)` with `assert ...`" + fixable: true location: row: 58 column: 8 end_location: row: 58 - column: 31 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertIs`" - suggestion: "Replace `assertIs(...)` with `assert ...`" - fixable: true - location: - row: 61 - column: 8 - end_location: - row: 61 - column: 21 - fix: - content: "assert [] is []" + column: 28 + fix: + content: assert 0 is not None + location: + row: 58 + column: 8 + end_location: + row: 58 + column: 31 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertIs`" + suggestion: "Replace `assertIs(...)` with `assert ...`" + fixable: true location: row: 61 column: 8 end_location: row: 61 - column: 29 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertIsNot`" - suggestion: "Replace `assertIsNot(...)` with `assert ...`" - fixable: true - location: - row: 64 - column: 8 - end_location: - row: 64 - column: 24 - fix: - content: assert 1 is not 1 + column: 21 + fix: + content: "assert [] is []" + location: + row: 61 + column: 8 + end_location: + row: 61 + column: 29 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertIsNot`" + suggestion: "Replace `assertIsNot(...)` with `assert ...`" + fixable: true location: row: 64 column: 8 end_location: row: 64 - column: 30 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertIsInstance`" - suggestion: "Replace `assertIsInstance(...)` with `assert ...`" - fixable: true - location: - row: 67 - column: 8 - end_location: - row: 67 - column: 29 - fix: - content: "assert isinstance(1, str)" + column: 24 + fix: + content: assert 1 is not 1 + location: + row: 64 + column: 8 + end_location: + row: 64 + column: 30 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertIsInstance`" + suggestion: "Replace `assertIsInstance(...)` with `assert ...`" + fixable: true location: row: 67 column: 8 end_location: row: 67 - column: 37 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertNotIsInstance`" - suggestion: "Replace `assertNotIsInstance(...)` with `assert ...`" - fixable: true - location: - row: 70 - column: 8 - end_location: - row: 70 - column: 32 - fix: - content: "assert not isinstance(1, int)" + column: 29 + fix: + content: "assert isinstance(1, str)" + location: + row: 67 + column: 8 + end_location: + row: 67 + column: 37 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertNotIsInstance`" + suggestion: "Replace `assertNotIsInstance(...)` with `assert ...`" + fixable: true location: row: 70 column: 8 end_location: row: 70 - column: 40 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertRegex`" - suggestion: "Replace `assertRegex(...)` with `assert ...`" - fixable: true - location: - row: 73 - column: 8 - end_location: - row: 73 - column: 24 - fix: - content: "assert re.search(\"def\", \"abc\")" + column: 32 + fix: + content: "assert not isinstance(1, int)" + location: + row: 70 + column: 8 + end_location: + row: 70 + column: 40 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertRegex`" + suggestion: "Replace `assertRegex(...)` with `assert ...`" + fixable: true location: row: 73 column: 8 end_location: row: 73 - column: 39 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertNotRegex`" - suggestion: "Replace `assertNotRegex(...)` with `assert ...`" - fixable: true - location: - row: 76 - column: 8 - end_location: - row: 76 - column: 27 - fix: - content: "assert not re.search(\"abc\", \"abc\")" + column: 24 + fix: + content: "assert re.search(\"def\", \"abc\")" + location: + row: 73 + column: 8 + end_location: + row: 73 + column: 39 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertNotRegex`" + suggestion: "Replace `assertNotRegex(...)` with `assert ...`" + fixable: true location: row: 76 column: 8 end_location: row: 76 - column: 42 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertRegexpMatches`" - suggestion: "Replace `assertRegexpMatches(...)` with `assert ...`" - fixable: true - location: - row: 79 - column: 8 - end_location: - row: 79 - column: 32 - fix: - content: "assert re.search(\"def\", \"abc\")" + column: 27 + fix: + content: "assert not re.search(\"abc\", \"abc\")" + location: + row: 76 + column: 8 + end_location: + row: 76 + column: 42 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertRegexpMatches`" + suggestion: "Replace `assertRegexpMatches(...)` with `assert ...`" + fixable: true location: row: 79 column: 8 end_location: row: 79 - column: 47 - parent: ~ -- kind: - name: UnittestAssertion - body: "Use a regular `assert` instead of unittest-style `assertNotRegex`" - suggestion: "Replace `assertNotRegex(...)` with `assert ...`" - fixable: true - location: - row: 82 - column: 8 - end_location: - row: 82 - column: 27 - fix: - content: "assert not re.search(\"abc\", \"abc\")" + column: 32 + fix: + content: "assert re.search(\"def\", \"abc\")" + location: + row: 79 + column: 8 + end_location: + row: 79 + column: 47 + parent: ~ + - kind: + name: UnittestAssertion + body: "Use a regular `assert` instead of unittest-style `assertNotRegex`" + suggestion: "Replace `assertNotRegex(...)` with `assert ...`" + fixable: true location: row: 82 column: 8 end_location: row: 82 - column: 42 - parent: ~ + column: 27 + fix: + content: "assert not re.search(\"abc\", \"abc\")" + location: + row: 82 + column: 8 + end_location: + row: 82 + column: 42 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT010.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT010.snap index d979b4eff7f5ce..828daa0ab10458 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT010.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT010.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: RaisesWithoutException - body: "set the expected exception in `pytest.raises()`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 9 - end_location: - row: 5 - column: 22 - fix: ~ - parent: ~ +- - kind: + name: RaisesWithoutException + body: "set the expected exception in `pytest.raises()`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 9 + end_location: + row: 5 + column: 22 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_default.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_default.snap index 8fe071f8bcd89d..b8293fa98428e1 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_default.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_default.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: RaisesTooBroad - body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" - suggestion: ~ - fixable: false - location: - row: 17 - column: 23 - end_location: - row: 17 - column: 33 - fix: ~ - parent: ~ -- kind: - name: RaisesTooBroad - body: "`pytest.raises(socket.error)` is too broad, set the `match` parameter or use a more specific exception" - suggestion: ~ - fixable: false - location: - row: 20 - column: 23 - end_location: - row: 20 - column: 35 - fix: ~ - parent: ~ -- kind: - name: RaisesTooBroad - body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" - suggestion: ~ - fixable: false - location: - row: 25 - column: 23 - end_location: - row: 25 - column: 33 - fix: ~ - parent: ~ -- kind: - name: RaisesTooBroad - body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" - suggestion: ~ - fixable: false - location: - row: 28 - column: 23 - end_location: - row: 28 - column: 33 - fix: ~ - parent: ~ -- kind: - name: RaisesTooBroad - body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" - suggestion: ~ - fixable: false - location: - row: 31 - column: 23 - end_location: - row: 31 - column: 33 - fix: ~ - parent: ~ +- - kind: + name: RaisesTooBroad + body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" + suggestion: ~ + fixable: false + location: + row: 17 + column: 23 + end_location: + row: 17 + column: 33 + fix: ~ + parent: ~ + - kind: + name: RaisesTooBroad + body: "`pytest.raises(socket.error)` is too broad, set the `match` parameter or use a more specific exception" + suggestion: ~ + fixable: false + location: + row: 20 + column: 23 + end_location: + row: 20 + column: 35 + fix: ~ + parent: ~ + - kind: + name: RaisesTooBroad + body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" + suggestion: ~ + fixable: false + location: + row: 25 + column: 23 + end_location: + row: 25 + column: 33 + fix: ~ + parent: ~ + - kind: + name: RaisesTooBroad + body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" + suggestion: ~ + fixable: false + location: + row: 28 + column: 23 + end_location: + row: 28 + column: 33 + fix: ~ + parent: ~ + - kind: + name: RaisesTooBroad + body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" + suggestion: ~ + fixable: false + location: + row: 31 + column: 23 + end_location: + row: 31 + column: 33 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_extend_broad_exceptions.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_extend_broad_exceptions.snap index 190513ed8d8b1f..89dd111792bca2 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_extend_broad_exceptions.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_extend_broad_exceptions.snap @@ -2,82 +2,82 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: RaisesTooBroad - body: "`pytest.raises(ZeroDivisionError)` is too broad, set the `match` parameter or use a more specific exception" - suggestion: ~ - fixable: false - location: - row: 12 - column: 23 - end_location: - row: 12 - column: 40 - fix: ~ - parent: ~ -- kind: - name: RaisesTooBroad - body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" - suggestion: ~ - fixable: false - location: - row: 17 - column: 23 - end_location: - row: 17 - column: 33 - fix: ~ - parent: ~ -- kind: - name: RaisesTooBroad - body: "`pytest.raises(socket.error)` is too broad, set the `match` parameter or use a more specific exception" - suggestion: ~ - fixable: false - location: - row: 20 - column: 23 - end_location: - row: 20 - column: 35 - fix: ~ - parent: ~ -- kind: - name: RaisesTooBroad - body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" - suggestion: ~ - fixable: false - location: - row: 25 - column: 23 - end_location: - row: 25 - column: 33 - fix: ~ - parent: ~ -- kind: - name: RaisesTooBroad - body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" - suggestion: ~ - fixable: false - location: - row: 28 - column: 23 - end_location: - row: 28 - column: 33 - fix: ~ - parent: ~ -- kind: - name: RaisesTooBroad - body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" - suggestion: ~ - fixable: false - location: - row: 31 - column: 23 - end_location: - row: 31 - column: 33 - fix: ~ - parent: ~ +- - kind: + name: RaisesTooBroad + body: "`pytest.raises(ZeroDivisionError)` is too broad, set the `match` parameter or use a more specific exception" + suggestion: ~ + fixable: false + location: + row: 12 + column: 23 + end_location: + row: 12 + column: 40 + fix: ~ + parent: ~ + - kind: + name: RaisesTooBroad + body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" + suggestion: ~ + fixable: false + location: + row: 17 + column: 23 + end_location: + row: 17 + column: 33 + fix: ~ + parent: ~ + - kind: + name: RaisesTooBroad + body: "`pytest.raises(socket.error)` is too broad, set the `match` parameter or use a more specific exception" + suggestion: ~ + fixable: false + location: + row: 20 + column: 23 + end_location: + row: 20 + column: 35 + fix: ~ + parent: ~ + - kind: + name: RaisesTooBroad + body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" + suggestion: ~ + fixable: false + location: + row: 25 + column: 23 + end_location: + row: 25 + column: 33 + fix: ~ + parent: ~ + - kind: + name: RaisesTooBroad + body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" + suggestion: ~ + fixable: false + location: + row: 28 + column: 23 + end_location: + row: 28 + column: 33 + fix: ~ + parent: ~ + - kind: + name: RaisesTooBroad + body: "`pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception" + suggestion: ~ + fixable: false + location: + row: 31 + column: 23 + end_location: + row: 31 + column: 33 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_replace_broad_exceptions.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_replace_broad_exceptions.snap index 62b1e83ddabf92..454bf56400071c 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_replace_broad_exceptions.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_replace_broad_exceptions.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: RaisesTooBroad - body: "`pytest.raises(ZeroDivisionError)` is too broad, set the `match` parameter or use a more specific exception" - suggestion: ~ - fixable: false - location: - row: 12 - column: 23 - end_location: - row: 12 - column: 40 - fix: ~ - parent: ~ +- - kind: + name: RaisesTooBroad + body: "`pytest.raises(ZeroDivisionError)` is too broad, set the `match` parameter or use a more specific exception" + suggestion: ~ + fixable: false + location: + row: 12 + column: 23 + end_location: + row: 12 + column: 40 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT012.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT012.snap index 80a80cf43a3d29..2c0b07fa74cf7a 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT012.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT012.snap @@ -2,108 +2,108 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: RaisesWithMultipleStatements - body: "`pytest.raises()` block should contain a single simple statement" - suggestion: ~ - fixable: false - location: - row: 28 - column: 4 - end_location: - row: 30 - column: 15 - fix: ~ - parent: ~ -- kind: - name: RaisesWithMultipleStatements - body: "`pytest.raises()` block should contain a single simple statement" - suggestion: ~ - fixable: false - location: - row: 34 - column: 4 - end_location: - row: 36 - column: 19 - fix: ~ - parent: ~ -- kind: - name: RaisesWithMultipleStatements - body: "`pytest.raises()` block should contain a single simple statement" - suggestion: ~ - fixable: false - location: - row: 38 - column: 4 - end_location: - row: 40 - column: 19 - fix: ~ - parent: ~ -- kind: - name: RaisesWithMultipleStatements - body: "`pytest.raises()` block should contain a single simple statement" - suggestion: ~ - fixable: false - location: - row: 42 - column: 4 - end_location: - row: 44 - column: 19 - fix: ~ - parent: ~ -- kind: - name: RaisesWithMultipleStatements - body: "`pytest.raises()` block should contain a single simple statement" - suggestion: ~ - fixable: false - location: - row: 46 - column: 4 - end_location: - row: 48 - column: 19 - fix: ~ - parent: ~ -- kind: - name: RaisesWithMultipleStatements - body: "`pytest.raises()` block should contain a single simple statement" - suggestion: ~ - fixable: false - location: - row: 50 - column: 4 - end_location: - row: 52 - column: 19 - fix: ~ - parent: ~ -- kind: - name: RaisesWithMultipleStatements - body: "`pytest.raises()` block should contain a single simple statement" - suggestion: ~ - fixable: false - location: - row: 54 - column: 4 - end_location: - row: 56 - column: 19 - fix: ~ - parent: ~ -- kind: - name: RaisesWithMultipleStatements - body: "`pytest.raises()` block should contain a single simple statement" - suggestion: ~ - fixable: false - location: - row: 60 - column: 4 - end_location: - row: 64 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: RaisesWithMultipleStatements + body: "`pytest.raises()` block should contain a single simple statement" + suggestion: ~ + fixable: false + location: + row: 28 + column: 4 + end_location: + row: 30 + column: 15 + fix: ~ + parent: ~ + - kind: + name: RaisesWithMultipleStatements + body: "`pytest.raises()` block should contain a single simple statement" + suggestion: ~ + fixable: false + location: + row: 34 + column: 4 + end_location: + row: 36 + column: 19 + fix: ~ + parent: ~ + - kind: + name: RaisesWithMultipleStatements + body: "`pytest.raises()` block should contain a single simple statement" + suggestion: ~ + fixable: false + location: + row: 38 + column: 4 + end_location: + row: 40 + column: 19 + fix: ~ + parent: ~ + - kind: + name: RaisesWithMultipleStatements + body: "`pytest.raises()` block should contain a single simple statement" + suggestion: ~ + fixable: false + location: + row: 42 + column: 4 + end_location: + row: 44 + column: 19 + fix: ~ + parent: ~ + - kind: + name: RaisesWithMultipleStatements + body: "`pytest.raises()` block should contain a single simple statement" + suggestion: ~ + fixable: false + location: + row: 46 + column: 4 + end_location: + row: 48 + column: 19 + fix: ~ + parent: ~ + - kind: + name: RaisesWithMultipleStatements + body: "`pytest.raises()` block should contain a single simple statement" + suggestion: ~ + fixable: false + location: + row: 50 + column: 4 + end_location: + row: 52 + column: 19 + fix: ~ + parent: ~ + - kind: + name: RaisesWithMultipleStatements + body: "`pytest.raises()` block should contain a single simple statement" + suggestion: ~ + fixable: false + location: + row: 54 + column: 4 + end_location: + row: 56 + column: 19 + fix: ~ + parent: ~ + - kind: + name: RaisesWithMultipleStatements + body: "`pytest.raises()` block should contain a single simple statement" + suggestion: ~ + fixable: false + location: + row: 60 + column: 4 + end_location: + row: 64 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT013.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT013.snap index f8dd8f908be898..2b4e7bfc519c2f 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT013.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT013.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: IncorrectPytestImport - body: "Found incorrect import of pytest, use simple `import pytest` instead" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 27 - fix: ~ - parent: ~ -- kind: - name: IncorrectPytestImport - body: "Found incorrect import of pytest, use simple `import pytest` instead" - suggestion: ~ - fixable: false - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 26 - fix: ~ - parent: ~ -- kind: - name: IncorrectPytestImport - body: "Found incorrect import of pytest, use simple `import pytest` instead" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 40 - fix: ~ - parent: ~ +- - kind: + name: IncorrectPytestImport + body: "Found incorrect import of pytest, use simple `import pytest` instead" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 27 + fix: ~ + parent: ~ + - kind: + name: IncorrectPytestImport + body: "Found incorrect import of pytest, use simple `import pytest` instead" + suggestion: ~ + fixable: false + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 26 + fix: ~ + parent: ~ + - kind: + name: IncorrectPytestImport + body: "Found incorrect import of pytest, use simple `import pytest` instead" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 40 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT015.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT015.snap index 48f05f2601945b..68e4d8f5929bc9 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT015.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT015.snap @@ -2,225 +2,225 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 15 - fix: ~ - parent: ~ -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 4 - end_location: - row: 10 - column: 16 - fix: ~ - parent: ~ -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 4 - end_location: - row: 11 - column: 12 - fix: ~ - parent: ~ -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 12 - column: 4 - end_location: - row: 12 - column: 14 - fix: ~ - parent: ~ -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 4 - end_location: - row: 13 - column: 13 - fix: ~ - parent: ~ -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 14 - fix: ~ - parent: ~ -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 15 - column: 4 - end_location: - row: 15 - column: 13 - fix: ~ - parent: ~ -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 13 - fix: ~ - parent: ~ -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 17 - column: 4 - end_location: - row: 17 - column: 13 - fix: ~ - parent: ~ -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 18 - column: 4 - end_location: - row: 18 - column: 17 - fix: ~ - parent: ~ -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 19 - column: 4 - end_location: - row: 19 - column: 16 - fix: ~ - parent: ~ -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 20 - column: 4 - end_location: - row: 20 - column: 18 - fix: ~ - parent: ~ -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 21 - column: 4 - end_location: - row: 21 - column: 17 - fix: ~ - parent: ~ -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 22 - column: 4 - end_location: - row: 22 - column: 22 - fix: ~ - parent: ~ -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 23 - column: 4 - end_location: - row: 23 - column: 19 - fix: ~ - parent: ~ -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 24 - column: 4 - end_location: - row: 24 - column: 21 - fix: ~ - parent: ~ -- kind: - name: AssertAlwaysFalse - body: "Assertion always fails, replace with `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 25 - column: 4 - end_location: - row: 25 - column: 20 - fix: ~ - parent: ~ +- - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 15 + fix: ~ + parent: ~ + - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 4 + end_location: + row: 10 + column: 16 + fix: ~ + parent: ~ + - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 4 + end_location: + row: 11 + column: 12 + fix: ~ + parent: ~ + - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 12 + column: 4 + end_location: + row: 12 + column: 14 + fix: ~ + parent: ~ + - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 4 + end_location: + row: 13 + column: 13 + fix: ~ + parent: ~ + - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 14 + column: 4 + end_location: + row: 14 + column: 14 + fix: ~ + parent: ~ + - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 15 + column: 4 + end_location: + row: 15 + column: 13 + fix: ~ + parent: ~ + - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 16 + column: 4 + end_location: + row: 16 + column: 13 + fix: ~ + parent: ~ + - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 17 + column: 4 + end_location: + row: 17 + column: 13 + fix: ~ + parent: ~ + - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 18 + column: 4 + end_location: + row: 18 + column: 17 + fix: ~ + parent: ~ + - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 19 + column: 4 + end_location: + row: 19 + column: 16 + fix: ~ + parent: ~ + - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 20 + column: 4 + end_location: + row: 20 + column: 18 + fix: ~ + parent: ~ + - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 21 + column: 4 + end_location: + row: 21 + column: 17 + fix: ~ + parent: ~ + - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 22 + column: 4 + end_location: + row: 22 + column: 22 + fix: ~ + parent: ~ + - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 23 + column: 4 + end_location: + row: 23 + column: 19 + fix: ~ + parent: ~ + - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 24 + column: 4 + end_location: + row: 24 + column: 21 + fix: ~ + parent: ~ + - kind: + name: AssertAlwaysFalse + body: "Assertion always fails, replace with `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 25 + column: 4 + end_location: + row: 25 + column: 20 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT016.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT016.snap index b1a68e35136cc0..38f90547a1eaef 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT016.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT016.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: FailWithoutMessage - body: "No message passed to `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 4 - end_location: - row: 13 - column: 15 - fix: ~ - parent: ~ -- kind: - name: FailWithoutMessage - body: "No message passed to `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 15 - fix: ~ - parent: ~ -- kind: - name: FailWithoutMessage - body: "No message passed to `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 15 - column: 4 - end_location: - row: 15 - column: 15 - fix: ~ - parent: ~ -- kind: - name: FailWithoutMessage - body: "No message passed to `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 15 - fix: ~ - parent: ~ -- kind: - name: FailWithoutMessage - body: "No message passed to `pytest.fail()`" - suggestion: ~ - fixable: false - location: - row: 17 - column: 4 - end_location: - row: 17 - column: 15 - fix: ~ - parent: ~ +- - kind: + name: FailWithoutMessage + body: "No message passed to `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 4 + end_location: + row: 13 + column: 15 + fix: ~ + parent: ~ + - kind: + name: FailWithoutMessage + body: "No message passed to `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 14 + column: 4 + end_location: + row: 14 + column: 15 + fix: ~ + parent: ~ + - kind: + name: FailWithoutMessage + body: "No message passed to `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 15 + column: 4 + end_location: + row: 15 + column: 15 + fix: ~ + parent: ~ + - kind: + name: FailWithoutMessage + body: "No message passed to `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 16 + column: 4 + end_location: + row: 16 + column: 15 + fix: ~ + parent: ~ + - kind: + name: FailWithoutMessage + body: "No message passed to `pytest.fail()`" + suggestion: ~ + fixable: false + location: + row: 17 + column: 4 + end_location: + row: 17 + column: 15 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT017.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT017.snap index f4ebfafed5796d..5f295cfb057983 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT017.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT017.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: AssertInExcept - body: "Found assertion on exception `e` in `except` block, use `pytest.raises()` instead" - suggestion: ~ - fixable: false - location: - row: 19 - column: 8 - end_location: - row: 19 - column: 37 - fix: ~ - parent: ~ +- - kind: + name: AssertInExcept + body: "Found assertion on exception `e` in `except` block, use `pytest.raises()` instead" + suggestion: ~ + fixable: false + location: + row: 19 + column: 8 + end_location: + row: 19 + column: 37 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT018.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT018.snap index 09e48dee514cc8..080563f0f13dc7 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT018.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT018.snap @@ -2,406 +2,406 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: Break down assertion into multiple parts - fixable: true - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 39 - fix: - content: " assert something\n assert something_else\n" +- - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: Break down assertion into multiple parts + fixable: true location: row: 14 - column: 0 + column: 4 end_location: - row: 15 - column: 0 - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: Break down assertion into multiple parts - fixable: true - location: - row: 15 - column: 4 - end_location: - row: 15 - column: 59 - fix: - content: " assert something and something_else\n assert something_third\n" + row: 14 + column: 39 + fix: + content: " assert something\n assert something_else\n" + location: + row: 14 + column: 0 + end_location: + row: 15 + column: 0 + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: Break down assertion into multiple parts + fixable: true location: row: 15 - column: 0 + column: 4 end_location: - row: 16 - column: 0 - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: Break down assertion into multiple parts - fixable: true - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 43 - fix: - content: " assert something\n assert not something_else\n" + row: 15 + column: 59 + fix: + content: " assert something and something_else\n assert something_third\n" + location: + row: 15 + column: 0 + end_location: + row: 16 + column: 0 + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: Break down assertion into multiple parts + fixable: true location: row: 16 - column: 0 + column: 4 end_location: - row: 17 - column: 0 - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: Break down assertion into multiple parts - fixable: true - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 39 - fix: - content: " assert something\n assert something_else\n" - location: row: 16 - column: 0 - end_location: - row: 17 - column: 0 - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: Break down assertion into multiple parts - fixable: true - location: - row: 17 - column: 4 - end_location: - row: 17 - column: 60 - fix: - content: " assert something\n assert (something_else or something_third)\n" + column: 43 + fix: + content: " assert something\n assert not something_else\n" + location: + row: 16 + column: 0 + end_location: + row: 17 + column: 0 + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: Break down assertion into multiple parts + fixable: true location: row: 17 - column: 0 + column: 4 end_location: - row: 18 - column: 0 - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: Break down assertion into multiple parts - fixable: true - location: - row: 18 - column: 4 - end_location: - row: 18 - column: 43 - fix: - content: " assert not something\n assert something_else\n" + row: 17 + column: 60 + fix: + content: " assert something\n assert (something_else or something_third)\n" + location: + row: 17 + column: 0 + end_location: + row: 18 + column: 0 + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: Break down assertion into multiple parts + fixable: true location: row: 18 - column: 0 + column: 4 end_location: - row: 19 - column: 0 - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: Break down assertion into multiple parts - fixable: true - location: - row: 19 - column: 4 - end_location: - row: 19 - column: 44 - fix: - content: " assert not something\n assert not something_else\n" + row: 18 + column: 43 + fix: + content: " assert not something\n assert something_else\n" + location: + row: 18 + column: 0 + end_location: + row: 19 + column: 0 + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: Break down assertion into multiple parts + fixable: true location: row: 19 - column: 0 + column: 4 end_location: - row: 20 - column: 0 - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: Break down assertion into multiple parts - fixable: true - location: - row: 20 - column: 4 - end_location: - row: 20 - column: 63 - fix: - content: " assert not something or something_else\n assert not something_third\n" + row: 19 + column: 44 + fix: + content: " assert not something\n assert not something_else\n" + location: + row: 19 + column: 0 + end_location: + row: 20 + column: 0 + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: Break down assertion into multiple parts + fixable: true location: row: 20 - column: 0 + column: 4 end_location: - row: 21 - column: 0 - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: Break down assertion into multiple parts - fixable: true - location: - row: 21 - column: 4 - end_location: - row: 23 - column: 7 - fix: - content: " assert something\n assert something_else == \"\"\"error\n message\n \"\"\"\n" + row: 20 + column: 63 + fix: + content: " assert not something or something_else\n assert not something_third\n" + location: + row: 20 + column: 0 + end_location: + row: 21 + column: 0 + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: Break down assertion into multiple parts + fixable: true location: row: 21 - column: 0 + column: 4 end_location: - row: 24 - column: 0 - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: Break down assertion into multiple parts - fixable: true - location: - row: 26 - column: 4 - end_location: - row: 26 - column: 34 - fix: - content: " assert not a\n assert (b or c)\n" + row: 23 + column: 7 + fix: + content: " assert something\n assert something_else == \"\"\"error\n message\n \"\"\"\n" + location: + row: 21 + column: 0 + end_location: + row: 24 + column: 0 + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: Break down assertion into multiple parts + fixable: true location: row: 26 - column: 0 + column: 4 end_location: - row: 27 - column: 0 - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: Break down assertion into multiple parts - fixable: true - location: - row: 27 - column: 4 - end_location: - row: 27 - column: 35 - fix: - content: " assert not a\n assert (b and c)\n" + row: 26 + column: 34 + fix: + content: " assert not a\n assert (b or c)\n" + location: + row: 26 + column: 0 + end_location: + row: 27 + column: 0 + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: Break down assertion into multiple parts + fixable: true location: row: 27 - column: 0 + column: 4 + end_location: + row: 27 + column: 35 + fix: + content: " assert not a\n assert (b and c)\n" + location: + row: 27 + column: 0 + end_location: + row: 28 + column: 0 + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: ~ + fixable: false + location: + row: 30 + column: 4 + end_location: + row: 30 + column: 56 + fix: ~ + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: ~ + fixable: false + location: + row: 31 + column: 4 + end_location: + row: 31 + column: 80 + fix: ~ + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: ~ + fixable: false + location: + row: 33 + column: 4 + end_location: + row: 33 + column: 64 + fix: ~ + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: Break down assertion into multiple parts + fixable: true + location: + row: 35 + column: 4 + end_location: + row: 41 + column: 5 + fix: ~ + parent: ~ +- - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: Break down assertion into multiple parts + fixable: true + location: + row: 16 + column: 4 + end_location: + row: 16 + column: 39 + fix: + content: " assert something\n assert something_else\n" + location: + row: 16 + column: 0 + end_location: + row: 17 + column: 0 + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: Break down assertion into multiple parts + fixable: true + location: + row: 37 + column: 4 + end_location: + row: 37 + column: 20 + fix: ~ + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: ~ + fixable: false + location: + row: 40 + column: 4 + end_location: + row: 40 + column: 56 + fix: ~ + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: ~ + fixable: false + location: + row: 41 + column: 4 + end_location: + row: 41 + column: 80 + fix: ~ + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: ~ + fixable: false + location: + row: 43 + column: 4 + end_location: + row: 43 + column: 64 + fix: ~ + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: Break down assertion into multiple parts + fixable: true + location: + row: 45 + column: 4 + end_location: + row: 51 + column: 5 + fix: ~ + parent: ~ +- - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: Break down assertion into multiple parts + fixable: true + location: + row: 38 + column: 4 + end_location: + row: 38 + column: 20 + fix: ~ + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: ~ + fixable: false + location: + row: 41 + column: 4 + end_location: + row: 41 + column: 56 + fix: ~ + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: ~ + fixable: false + location: + row: 42 + column: 4 + end_location: + row: 42 + column: 80 + fix: ~ + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: ~ + fixable: false + location: + row: 44 + column: 4 + end_location: + row: 44 + column: 64 + fix: ~ + parent: ~ + - kind: + name: CompositeAssertion + body: Assertion should be broken down into multiple parts + suggestion: Break down assertion into multiple parts + fixable: true + location: + row: 46 + column: 4 end_location: - row: 28 - column: 0 - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: ~ - fixable: false - location: - row: 30 - column: 4 - end_location: - row: 30 - column: 56 - fix: ~ - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: ~ - fixable: false - location: - row: 31 - column: 4 - end_location: - row: 31 - column: 80 - fix: ~ - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: ~ - fixable: false - location: - row: 33 - column: 4 - end_location: - row: 33 - column: 64 - fix: ~ - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: Break down assertion into multiple parts - fixable: true - location: - row: 35 - column: 4 - end_location: - row: 41 - column: 5 - fix: ~ - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: Break down assertion into multiple parts - fixable: true - location: - row: 37 - column: 4 - end_location: - row: 37 - column: 20 - fix: ~ - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: Break down assertion into multiple parts - fixable: true - location: - row: 38 - column: 4 - end_location: - row: 38 - column: 20 - fix: ~ - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: ~ - fixable: false - location: - row: 40 - column: 4 - end_location: - row: 40 - column: 56 - fix: ~ - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: ~ - fixable: false - location: - row: 41 - column: 4 - end_location: - row: 41 - column: 80 - fix: ~ - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: ~ - fixable: false - location: - row: 41 - column: 4 - end_location: - row: 41 - column: 56 - fix: ~ - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: ~ - fixable: false - location: - row: 42 - column: 4 - end_location: - row: 42 - column: 80 - fix: ~ - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: ~ - fixable: false - location: - row: 43 - column: 4 - end_location: - row: 43 - column: 64 - fix: ~ - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: ~ - fixable: false - location: - row: 44 - column: 4 - end_location: - row: 44 - column: 64 - fix: ~ - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: Break down assertion into multiple parts - fixable: true - location: - row: 45 - column: 4 - end_location: - row: 51 - column: 5 - fix: ~ - parent: ~ -- kind: - name: CompositeAssertion - body: Assertion should be broken down into multiple parts - suggestion: Break down assertion into multiple parts - fixable: true - location: - row: 46 - column: 4 - end_location: - row: 52 - column: 5 - fix: ~ - parent: ~ + row: 52 + column: 5 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT019.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT019.snap index 2645392ce63e46..5c8c08a334d795 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT019.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT019.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: FixtureParamWithoutValue - body: "Fixture `_fixture` without value is injected as parameter, use `@pytest.mark.usefixtures` instead" - suggestion: ~ - fixable: false - location: - row: 9 - column: 13 - end_location: - row: 9 - column: 21 - fix: ~ - parent: ~ -- kind: - name: FixtureParamWithoutValue - body: "Fixture `_fixture` without value is injected as parameter, use `@pytest.mark.usefixtures` instead" - suggestion: ~ - fixable: false - location: - row: 13 - column: 16 - end_location: - row: 13 - column: 24 - fix: ~ - parent: ~ +- - kind: + name: FixtureParamWithoutValue + body: "Fixture `_fixture` without value is injected as parameter, use `@pytest.mark.usefixtures` instead" + suggestion: ~ + fixable: false + location: + row: 9 + column: 13 + end_location: + row: 9 + column: 21 + fix: ~ + parent: ~ + - kind: + name: FixtureParamWithoutValue + body: "Fixture `_fixture` without value is injected as parameter, use `@pytest.mark.usefixtures` instead" + suggestion: ~ + fixable: false + location: + row: 13 + column: 16 + end_location: + row: 13 + column: 24 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT020.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT020.snap index 3cffad8624a299..5ac0154ed278f3 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT020.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT020.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: DeprecatedYieldFixture - body: "`@pytest.yield_fixture` is deprecated, use `@pytest.fixture`" - suggestion: ~ - fixable: false - location: - row: 14 - column: 1 - end_location: - row: 14 - column: 23 - fix: ~ - parent: ~ -- kind: - name: DeprecatedYieldFixture - body: "`@pytest.yield_fixture` is deprecated, use `@pytest.fixture`" - suggestion: ~ - fixable: false - location: - row: 19 - column: 1 - end_location: - row: 19 - column: 21 - fix: ~ - parent: ~ +- - kind: + name: DeprecatedYieldFixture + body: "`@pytest.yield_fixture` is deprecated, use `@pytest.fixture`" + suggestion: ~ + fixable: false + location: + row: 14 + column: 1 + end_location: + row: 14 + column: 23 + fix: ~ + parent: ~ + - kind: + name: DeprecatedYieldFixture + body: "`@pytest.yield_fixture` is deprecated, use `@pytest.fixture`" + suggestion: ~ + fixable: false + location: + row: 19 + column: 1 + end_location: + row: 19 + column: 21 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT021.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT021.snap index 58361edc62a471..1da02a8a6a12d9 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT021.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT021.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: FixtureFinalizerCallback - body: "Use `yield` instead of `request.addfinalizer`" - suggestion: ~ - fixable: false - location: - row: 49 - column: 4 - end_location: - row: 49 - column: 42 - fix: ~ - parent: ~ -- kind: - name: FixtureFinalizerCallback - body: "Use `yield` instead of `request.addfinalizer`" - suggestion: ~ - fixable: false - location: - row: 56 - column: 4 - end_location: - row: 56 - column: 42 - fix: ~ - parent: ~ +- - kind: + name: FixtureFinalizerCallback + body: "Use `yield` instead of `request.addfinalizer`" + suggestion: ~ + fixable: false + location: + row: 49 + column: 4 + end_location: + row: 49 + column: 42 + fix: ~ + parent: ~ + - kind: + name: FixtureFinalizerCallback + body: "Use `yield` instead of `request.addfinalizer`" + suggestion: ~ + fixable: false + location: + row: 56 + column: 4 + end_location: + row: 56 + column: 42 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT022.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT022.snap index 8e990231bc6b59..60bade482ec88c 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT022.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT022.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: UselessYieldFixture - body: "No teardown in fixture `error`, use `return` instead of `yield`" - suggestion: "Replace `yield` with `return`" - fixable: true - location: - row: 17 - column: 4 - end_location: - row: 17 - column: 18 - fix: - content: return +- - kind: + name: UselessYieldFixture + body: "No teardown in fixture `error`, use `return` instead of `yield`" + suggestion: "Replace `yield` with `return`" + fixable: true location: row: 17 column: 4 end_location: row: 17 - column: 9 - parent: ~ + column: 18 + fix: + content: return + location: + row: 17 + column: 4 + end_location: + row: 17 + column: 9 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_default.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_default.snap index b5323a1f62b8b4..b30e5759564e8b 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_default.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_default.snap @@ -2,104 +2,104 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: IncorrectMarkParenthesesStyle - body: "Use `@pytest.mark.foo()` over `@pytest.mark.foo`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 12 - column: 1 - end_location: - row: 12 - column: 16 - fix: - content: () +- - kind: + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo()` over `@pytest.mark.foo`" + suggestion: Add/remove parentheses + fixable: true location: row: 12 - column: 16 + column: 1 end_location: row: 12 column: 16 - parent: ~ -- kind: - name: IncorrectMarkParenthesesStyle - body: "Use `@pytest.mark.foo()` over `@pytest.mark.foo`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 17 - column: 1 - end_location: - row: 17 - column: 16 - fix: - content: () + fix: + content: () + location: + row: 12 + column: 16 + end_location: + row: 12 + column: 16 + parent: ~ + - kind: + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo()` over `@pytest.mark.foo`" + suggestion: Add/remove parentheses + fixable: true location: row: 17 - column: 16 + column: 1 end_location: row: 17 column: 16 - parent: ~ -- kind: - name: IncorrectMarkParenthesesStyle - body: "Use `@pytest.mark.foo()` over `@pytest.mark.foo`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 24 - column: 5 - end_location: - row: 24 - column: 20 - fix: - content: () + fix: + content: () + location: + row: 17 + column: 16 + end_location: + row: 17 + column: 16 + parent: ~ + - kind: + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo()` over `@pytest.mark.foo`" + suggestion: Add/remove parentheses + fixable: true location: row: 24 - column: 20 + column: 5 end_location: row: 24 column: 20 - parent: ~ -- kind: - name: IncorrectMarkParenthesesStyle - body: "Use `@pytest.mark.foo()` over `@pytest.mark.foo`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 30 - column: 5 - end_location: - row: 30 - column: 20 - fix: - content: () + fix: + content: () + location: + row: 24 + column: 20 + end_location: + row: 24 + column: 20 + parent: ~ + - kind: + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo()` over `@pytest.mark.foo`" + suggestion: Add/remove parentheses + fixable: true location: row: 30 - column: 20 + column: 5 end_location: row: 30 column: 20 - parent: ~ -- kind: - name: IncorrectMarkParenthesesStyle - body: "Use `@pytest.mark.foo()` over `@pytest.mark.foo`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 38 - column: 9 - end_location: - row: 38 - column: 24 - fix: - content: () + fix: + content: () + location: + row: 30 + column: 20 + end_location: + row: 30 + column: 20 + parent: ~ + - kind: + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo()` over `@pytest.mark.foo`" + suggestion: Add/remove parentheses + fixable: true location: row: 38 - column: 24 + column: 9 end_location: row: 38 column: 24 - parent: ~ + fix: + content: () + location: + row: 38 + column: 24 + end_location: + row: 38 + column: 24 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_no_parentheses.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_no_parentheses.snap index 331723fdaeba60..a5a9626f0356d1 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_no_parentheses.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_no_parentheses.snap @@ -2,104 +2,104 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: IncorrectMarkParenthesesStyle - body: "Use `@pytest.mark.foo` over `@pytest.mark.foo()`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 46 - column: 1 - end_location: - row: 46 - column: 18 - fix: - content: "" +- - kind: + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo` over `@pytest.mark.foo()`" + suggestion: Add/remove parentheses + fixable: true location: row: 46 - column: 16 + column: 1 end_location: row: 46 column: 18 - parent: ~ -- kind: - name: IncorrectMarkParenthesesStyle - body: "Use `@pytest.mark.foo` over `@pytest.mark.foo()`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 51 - column: 1 - end_location: - row: 51 - column: 18 - fix: - content: "" + fix: + content: "" + location: + row: 46 + column: 16 + end_location: + row: 46 + column: 18 + parent: ~ + - kind: + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo` over `@pytest.mark.foo()`" + suggestion: Add/remove parentheses + fixable: true location: row: 51 - column: 16 + column: 1 end_location: row: 51 column: 18 - parent: ~ -- kind: - name: IncorrectMarkParenthesesStyle - body: "Use `@pytest.mark.foo` over `@pytest.mark.foo()`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 58 - column: 5 - end_location: - row: 58 - column: 22 - fix: - content: "" + fix: + content: "" + location: + row: 51 + column: 16 + end_location: + row: 51 + column: 18 + parent: ~ + - kind: + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo` over `@pytest.mark.foo()`" + suggestion: Add/remove parentheses + fixable: true location: row: 58 - column: 20 + column: 5 end_location: row: 58 column: 22 - parent: ~ -- kind: - name: IncorrectMarkParenthesesStyle - body: "Use `@pytest.mark.foo` over `@pytest.mark.foo()`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 64 - column: 5 - end_location: - row: 64 - column: 22 - fix: - content: "" + fix: + content: "" + location: + row: 58 + column: 20 + end_location: + row: 58 + column: 22 + parent: ~ + - kind: + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo` over `@pytest.mark.foo()`" + suggestion: Add/remove parentheses + fixable: true location: row: 64 - column: 20 + column: 5 end_location: row: 64 column: 22 - parent: ~ -- kind: - name: IncorrectMarkParenthesesStyle - body: "Use `@pytest.mark.foo` over `@pytest.mark.foo()`" - suggestion: Add/remove parentheses - fixable: true - location: - row: 72 - column: 9 - end_location: - row: 72 - column: 26 - fix: - content: "" + fix: + content: "" + location: + row: 64 + column: 20 + end_location: + row: 64 + column: 22 + parent: ~ + - kind: + name: IncorrectMarkParenthesesStyle + body: "Use `@pytest.mark.foo` over `@pytest.mark.foo()`" + suggestion: Add/remove parentheses + fixable: true location: row: 72 - column: 24 + column: 9 end_location: row: 72 column: 26 - parent: ~ + fix: + content: "" + location: + row: 72 + column: 24 + end_location: + row: 72 + column: 26 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT024.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT024.snap index 96de80ef647de9..fa0559e7eefa52 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT024.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT024.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryAsyncioMarkOnFixture - body: "`pytest.mark.asyncio` is unnecessary for fixtures" - suggestion: "Remove `pytest.mark.asyncio`" - fixable: true - location: - row: 14 - column: 1 - end_location: - row: 14 - column: 22 - fix: - content: "" +- - kind: + name: UnnecessaryAsyncioMarkOnFixture + body: "`pytest.mark.asyncio` is unnecessary for fixtures" + suggestion: "Remove `pytest.mark.asyncio`" + fixable: true location: row: 14 - column: 0 + column: 1 end_location: - row: 15 - column: 0 - parent: ~ -- kind: - name: UnnecessaryAsyncioMarkOnFixture - body: "`pytest.mark.asyncio` is unnecessary for fixtures" - suggestion: "Remove `pytest.mark.asyncio`" - fixable: true - location: - row: 20 - column: 1 - end_location: - row: 20 - column: 20 - fix: - content: "" + row: 14 + column: 22 + fix: + content: "" + location: + row: 14 + column: 0 + end_location: + row: 15 + column: 0 + parent: ~ + - kind: + name: UnnecessaryAsyncioMarkOnFixture + body: "`pytest.mark.asyncio` is unnecessary for fixtures" + suggestion: "Remove `pytest.mark.asyncio`" + fixable: true location: row: 20 - column: 0 + column: 1 end_location: - row: 21 - column: 0 - parent: ~ -- kind: - name: UnnecessaryAsyncioMarkOnFixture - body: "`pytest.mark.asyncio` is unnecessary for fixtures" - suggestion: "Remove `pytest.mark.asyncio`" - fixable: true - location: - row: 27 - column: 1 - end_location: - row: 27 - column: 22 - fix: - content: "" + row: 20 + column: 20 + fix: + content: "" + location: + row: 20 + column: 0 + end_location: + row: 21 + column: 0 + parent: ~ + - kind: + name: UnnecessaryAsyncioMarkOnFixture + body: "`pytest.mark.asyncio` is unnecessary for fixtures" + suggestion: "Remove `pytest.mark.asyncio`" + fixable: true location: row: 27 - column: 0 + column: 1 end_location: - row: 28 - column: 0 - parent: ~ -- kind: - name: UnnecessaryAsyncioMarkOnFixture - body: "`pytest.mark.asyncio` is unnecessary for fixtures" - suggestion: "Remove `pytest.mark.asyncio`" - fixable: true - location: - row: 33 - column: 1 - end_location: - row: 33 - column: 20 - fix: - content: "" + row: 27 + column: 22 + fix: + content: "" + location: + row: 27 + column: 0 + end_location: + row: 28 + column: 0 + parent: ~ + - kind: + name: UnnecessaryAsyncioMarkOnFixture + body: "`pytest.mark.asyncio` is unnecessary for fixtures" + suggestion: "Remove `pytest.mark.asyncio`" + fixable: true location: row: 33 - column: 0 + column: 1 end_location: - row: 34 - column: 0 - parent: ~ + row: 33 + column: 20 + fix: + content: "" + location: + row: 33 + column: 0 + end_location: + row: 34 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT025.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT025.snap index 5705b206d876e4..c8944b9d389eea 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT025.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT025.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: ErroneousUseFixturesOnFixture - body: "`pytest.mark.usefixtures` has no effect on fixtures" - suggestion: "Remove `pytest.mark.usefixtures`" - fixable: true - location: - row: 9 - column: 1 - end_location: - row: 9 - column: 29 - fix: - content: "" +- - kind: + name: ErroneousUseFixturesOnFixture + body: "`pytest.mark.usefixtures` has no effect on fixtures" + suggestion: "Remove `pytest.mark.usefixtures`" + fixable: true location: row: 9 - column: 0 + column: 1 end_location: - row: 10 - column: 0 - parent: ~ -- kind: - name: ErroneousUseFixturesOnFixture - body: "`pytest.mark.usefixtures` has no effect on fixtures" - suggestion: "Remove `pytest.mark.usefixtures`" - fixable: true - location: - row: 16 - column: 1 - end_location: - row: 16 - column: 29 - fix: - content: "" + row: 9 + column: 29 + fix: + content: "" + location: + row: 9 + column: 0 + end_location: + row: 10 + column: 0 + parent: ~ + - kind: + name: ErroneousUseFixturesOnFixture + body: "`pytest.mark.usefixtures` has no effect on fixtures" + suggestion: "Remove `pytest.mark.usefixtures`" + fixable: true location: row: 16 - column: 0 + column: 1 end_location: - row: 17 - column: 0 - parent: ~ + row: 16 + column: 29 + fix: + content: "" + location: + row: 16 + column: 0 + end_location: + row: 17 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT026.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT026.snap index 41246b6e602043..de4ce9d4d7c48e 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT026.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT026.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs expression: diagnostics --- -- kind: - name: UseFixturesWithoutParameters - body: "Useless `pytest.mark.usefixtures` without parameters" - suggestion: "Remove `usefixtures` decorator or pass parameters" - fixable: true - location: - row: 19 - column: 1 - end_location: - row: 19 - column: 26 - fix: - content: "" +- - kind: + name: UseFixturesWithoutParameters + body: "Useless `pytest.mark.usefixtures` without parameters" + suggestion: "Remove `usefixtures` decorator or pass parameters" + fixable: true location: row: 19 - column: 0 + column: 1 end_location: row: 19 column: 26 - parent: ~ -- kind: - name: UseFixturesWithoutParameters - body: "Useless `pytest.mark.usefixtures` without parameters" - suggestion: "Remove `usefixtures` decorator or pass parameters" - fixable: true - location: - row: 24 - column: 1 - end_location: - row: 24 - column: 24 - fix: - content: "" + fix: + content: "" + location: + row: 19 + column: 0 + end_location: + row: 19 + column: 26 + parent: ~ + - kind: + name: UseFixturesWithoutParameters + body: "Useless `pytest.mark.usefixtures` without parameters" + suggestion: "Remove `usefixtures` decorator or pass parameters" + fixable: true location: row: 24 - column: 0 + column: 1 end_location: row: 24 column: 24 - parent: ~ + fix: + content: "" + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 24 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap index 93049719ded179..ea90ce25d8c124 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap @@ -2,104 +2,104 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 7 - column: 3 - fix: - content: "'''\nthis is not a docstring\n'''" +- - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 5 column: 0 end_location: row: 7 column: 3 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 16 - column: 4 - end_location: - row: 18 - column: 7 - fix: - content: "'''\n this is not a docstring\n '''" + fix: + content: "'''\nthis is not a docstring\n'''" + location: + row: 5 + column: 0 + end_location: + row: 7 + column: 3 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 16 column: 4 end_location: row: 18 column: 7 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 21 - column: 20 - end_location: - row: 22 - column: 37 - fix: - content: "'''\n definitely not a docstring'''" + fix: + content: "'''\n this is not a docstring\n '''" + location: + row: 16 + column: 4 + end_location: + row: 18 + column: 7 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 21 column: 20 end_location: row: 22 column: 37 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 30 - column: 8 - end_location: - row: 32 - column: 11 - fix: - content: "'''\n this is not a docstring\n '''" + fix: + content: "'''\n definitely not a docstring'''" + location: + row: 21 + column: 20 + end_location: + row: 22 + column: 37 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 30 column: 8 end_location: row: 32 column: 11 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 35 - column: 12 - end_location: - row: 37 - column: 15 - fix: - content: "'''\n Looks like a docstring, but in reality it isn't - only modules, classes and functions\n '''" + fix: + content: "'''\n this is not a docstring\n '''" + location: + row: 30 + column: 8 + end_location: + row: 32 + column: 11 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 35 column: 12 end_location: row: 37 column: 15 - parent: ~ + fix: + content: "'''\n Looks like a docstring, but in reality it isn't - only modules, classes and functions\n '''" + location: + row: 35 + column: 12 + end_location: + row: 37 + column: 15 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap index 1d30b97bac488b..074b0d67c28ee4 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 27 - fix: - content: "''' Not a docstring '''" +- - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 3 column: 4 end_location: row: 3 column: 27 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 5 - column: 22 - end_location: - row: 5 - column: 43 - fix: - content: "'''not a docstring'''" + fix: + content: "''' Not a docstring '''" + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 27 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 5 column: 22 end_location: row: 5 column: 43 - parent: ~ + fix: + content: "'''not a docstring'''" + location: + row: 5 + column: 22 + end_location: + row: 5 + column: 43 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap index b3794039a40495..566708773c3540 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap @@ -2,104 +2,104 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 26 - fix: - content: "''' not a docstring'''" +- - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 3 column: 4 end_location: row: 3 column: 26 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 11 - column: 4 - end_location: - row: 11 - column: 26 - fix: - content: "''' not a docstring'''" + fix: + content: "''' not a docstring'''" + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 26 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 11 column: 4 end_location: row: 11 column: 26 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 15 - column: 38 - end_location: - row: 17 - column: 3 - fix: - content: "'''\n not a\n'''" + fix: + content: "''' not a docstring'''" + location: + row: 11 + column: 4 + end_location: + row: 11 + column: 26 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 15 column: 38 end_location: row: 17 column: 3 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 17 - column: 4 - end_location: - row: 17 - column: 19 - fix: - content: "'''docstring'''" + fix: + content: "'''\n not a\n'''" + location: + row: 15 + column: 38 + end_location: + row: 17 + column: 3 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 17 column: 4 end_location: row: 17 column: 19 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 22 - column: 4 - end_location: - row: 22 - column: 27 - fix: - content: "''' not a docstring '''" + fix: + content: "'''docstring'''" + location: + row: 17 + column: 4 + end_location: + row: 17 + column: 19 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 22 column: 4 end_location: row: 22 column: 27 - parent: ~ + fix: + content: "''' not a docstring '''" + location: + row: 22 + column: 4 + end_location: + row: 22 + column: 27 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap index df6330a1192de8..a6c0b0aef21079 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 6 - column: 3 - fix: - content: "'''\nthis is not a docstring\n'''" +- - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 4 column: 0 end_location: row: 6 column: 3 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 9 - column: 0 - end_location: - row: 11 - column: 3 - fix: - content: "'''\nthis is not a docstring\n'''" + fix: + content: "'''\nthis is not a docstring\n'''" + location: + row: 4 + column: 0 + end_location: + row: 6 + column: 3 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 9 column: 0 end_location: row: 11 column: 3 - parent: ~ + fix: + content: "'''\nthis is not a docstring\n'''" + location: + row: 9 + column: 0 + end_location: + row: 11 + column: 3 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap index fd5dcbb7f32a1d..47dbc1252366ee 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 31 - fix: - content: "''' this is not a docstring '''" +- - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 2 column: 0 end_location: row: 2 column: 31 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 31 - fix: - content: "''' this is not a docstring '''" + fix: + content: "''' this is not a docstring '''" + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 31 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 6 column: 0 end_location: row: 6 column: 31 - parent: ~ + fix: + content: "''' this is not a docstring '''" + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 31 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap index ff4d153566ee57..45cb42385c5140 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesDocstring - body: Single quote docstring found but double quotes preferred - suggestion: Replace single quotes docstring with double quotes - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 3 - column: 3 - fix: - content: "\"\"\"\nSingle quotes multiline module docstring\n\"\"\"" +- - kind: + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + suggestion: Replace single quotes docstring with double quotes + fixable: true location: row: 1 column: 0 end_location: row: 3 column: 3 - parent: ~ -- kind: - name: BadQuotesDocstring - body: Single quote docstring found but double quotes preferred - suggestion: Replace single quotes docstring with double quotes - fixable: true - location: - row: 14 - column: 4 - end_location: - row: 16 - column: 7 - fix: - content: "\"\"\"\n Single quotes multiline class docstring\n \"\"\"" + fix: + content: "\"\"\"\nSingle quotes multiline module docstring\n\"\"\"" + location: + row: 1 + column: 0 + end_location: + row: 3 + column: 3 + parent: ~ + - kind: + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + suggestion: Replace single quotes docstring with double quotes + fixable: true location: row: 14 column: 4 end_location: row: 16 column: 7 - parent: ~ -- kind: - name: BadQuotesDocstring - body: Single quote docstring found but double quotes preferred - suggestion: Replace single quotes docstring with double quotes - fixable: true - location: - row: 26 - column: 8 - end_location: - row: 28 - column: 11 - fix: - content: "\"\"\"\n Single quotes multiline function docstring\n \"\"\"" + fix: + content: "\"\"\"\n Single quotes multiline class docstring\n \"\"\"" + location: + row: 14 + column: 4 + end_location: + row: 16 + column: 7 + parent: ~ + - kind: + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + suggestion: Replace single quotes docstring with double quotes + fixable: true location: row: 26 column: 8 end_location: row: 28 column: 11 - parent: ~ + fix: + content: "\"\"\"\n Single quotes multiline function docstring\n \"\"\"" + location: + row: 26 + column: 8 + end_location: + row: 28 + column: 11 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap index 3b85426c844b0b..d7e049fb816378 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesDocstring - body: Single quote docstring found but double quotes preferred - suggestion: Replace single quotes docstring with double quotes - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 53 - fix: - content: "\"\"\" Double quotes single line class docstring \"\"\"" +- - kind: + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + suggestion: Replace single quotes docstring with double quotes + fixable: true location: row: 2 column: 4 end_location: row: 2 column: 53 - parent: ~ -- kind: - name: BadQuotesDocstring - body: Single quote docstring found but double quotes preferred - suggestion: Replace single quotes docstring with double quotes - fixable: true - location: - row: 6 - column: 8 - end_location: - row: 6 - column: 57 - fix: - content: "\"\"\" Double quotes single line method docstring\"\"\"" + fix: + content: "\"\"\" Double quotes single line class docstring \"\"\"" + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 53 + parent: ~ + - kind: + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + suggestion: Replace single quotes docstring with double quotes + fixable: true location: row: 6 column: 8 end_location: row: 6 column: 57 - parent: ~ -- kind: - name: BadQuotesDocstring - body: Single quote docstring found but double quotes preferred - suggestion: Replace single quotes docstring with double quotes - fixable: true - location: - row: 9 - column: 28 - end_location: - row: 9 - column: 52 - fix: - content: "\"\"\" inline docstring \"\"\"" + fix: + content: "\"\"\" Double quotes single line method docstring\"\"\"" + location: + row: 6 + column: 8 + end_location: + row: 6 + column: 57 + parent: ~ + - kind: + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + suggestion: Replace single quotes docstring with double quotes + fixable: true location: row: 9 column: 28 end_location: row: 9 column: 52 - parent: ~ + fix: + content: "\"\"\" inline docstring \"\"\"" + location: + row: 9 + column: 28 + end_location: + row: 9 + column: 52 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap index ad663e2cf09c89..5d20c7d5b9ace4 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesDocstring - body: Single quote docstring found but double quotes preferred - suggestion: Replace single quotes docstring with double quotes - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 56 - fix: - content: "\"\"\"function without params, single line docstring\"\"\"" +- - kind: + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + suggestion: Replace single quotes docstring with double quotes + fixable: true location: row: 2 column: 4 end_location: row: 2 column: 56 - parent: ~ -- kind: - name: BadQuotesDocstring - body: Single quote docstring found but double quotes preferred - suggestion: Replace single quotes docstring with double quotes - fixable: true - location: - row: 8 - column: 4 - end_location: - row: 10 - column: 7 - fix: - content: "\"\"\"\n function without params, multiline docstring\n \"\"\"" + fix: + content: "\"\"\"function without params, single line docstring\"\"\"" + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 56 + parent: ~ + - kind: + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + suggestion: Replace single quotes docstring with double quotes + fixable: true location: row: 8 column: 4 end_location: row: 10 column: 7 - parent: ~ -- kind: - name: BadQuotesDocstring - body: Single quote docstring found but double quotes preferred - suggestion: Replace single quotes docstring with double quotes - fixable: true - location: - row: 27 - column: 4 - end_location: - row: 27 - column: 27 - fix: - content: "\"Single line docstring\"" + fix: + content: "\"\"\"\n function without params, multiline docstring\n \"\"\"" + location: + row: 8 + column: 4 + end_location: + row: 10 + column: 7 + parent: ~ + - kind: + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + suggestion: Replace single quotes docstring with double quotes + fixable: true location: row: 27 column: 4 end_location: row: 27 column: 27 - parent: ~ + fix: + content: "\"Single line docstring\"" + location: + row: 27 + column: 4 + end_location: + row: 27 + column: 27 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap index 4344c740c36573..f9cad67bbb2229 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesDocstring - body: Single quote docstring found but double quotes preferred - suggestion: Replace single quotes docstring with double quotes - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 3 - column: 3 - fix: - content: "\"\"\"\nDouble quotes multiline module docstring\n\"\"\"" +- - kind: + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + suggestion: Replace single quotes docstring with double quotes + fixable: true location: row: 1 column: 0 end_location: row: 3 column: 3 - parent: ~ + fix: + content: "\"\"\"\nDouble quotes multiline module docstring\n\"\"\"" + location: + row: 1 + column: 0 + end_location: + row: 3 + column: 3 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap index d0f49b1f144a43..ed97368b888958 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesDocstring - body: Single quote docstring found but double quotes preferred - suggestion: Replace single quotes docstring with double quotes - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 49 - fix: - content: "\"\"\" Double quotes singleline module docstring \"\"\"" +- - kind: + name: BadQuotesDocstring + body: Single quote docstring found but double quotes preferred + suggestion: Replace single quotes docstring with double quotes + fixable: true location: row: 1 column: 0 end_location: row: 1 column: 49 - parent: ~ + fix: + content: "\"\"\" Double quotes singleline module docstring \"\"\"" + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 49 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap index 9502deb17d2981..5f8408bd3c3a8f 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesDocstring - body: Double quote docstring found but single quotes preferred - suggestion: Replace double quotes docstring with single quotes - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 3 - column: 3 - fix: - content: "'''\nDouble quotes multiline module docstring\n'''" +- - kind: + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + suggestion: Replace double quotes docstring with single quotes + fixable: true location: row: 1 column: 0 end_location: row: 3 column: 3 - parent: ~ -- kind: - name: BadQuotesDocstring - body: Double quote docstring found but single quotes preferred - suggestion: Replace double quotes docstring with single quotes - fixable: true - location: - row: 12 - column: 4 - end_location: - row: 14 - column: 7 - fix: - content: "'''\n Double quotes multiline class docstring\n '''" + fix: + content: "'''\nDouble quotes multiline module docstring\n'''" + location: + row: 1 + column: 0 + end_location: + row: 3 + column: 3 + parent: ~ + - kind: + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + suggestion: Replace double quotes docstring with single quotes + fixable: true location: row: 12 column: 4 end_location: row: 14 column: 7 - parent: ~ -- kind: - name: BadQuotesDocstring - body: Double quote docstring found but single quotes preferred - suggestion: Replace double quotes docstring with single quotes - fixable: true - location: - row: 24 - column: 8 - end_location: - row: 26 - column: 11 - fix: - content: "'''\n Double quotes multiline function docstring\n '''" + fix: + content: "'''\n Double quotes multiline class docstring\n '''" + location: + row: 12 + column: 4 + end_location: + row: 14 + column: 7 + parent: ~ + - kind: + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + suggestion: Replace double quotes docstring with single quotes + fixable: true location: row: 24 column: 8 end_location: row: 26 column: 11 - parent: ~ + fix: + content: "'''\n Double quotes multiline function docstring\n '''" + location: + row: 24 + column: 8 + end_location: + row: 26 + column: 11 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap index a67e8d7a3ac9e6..02938e69a41e7a 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesDocstring - body: Double quote docstring found but single quotes preferred - suggestion: Replace double quotes docstring with single quotes - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 53 - fix: - content: "''' Double quotes single line class docstring '''" +- - kind: + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + suggestion: Replace double quotes docstring with single quotes + fixable: true location: row: 2 column: 4 end_location: row: 2 column: 53 - parent: ~ -- kind: - name: BadQuotesDocstring - body: Double quote docstring found but single quotes preferred - suggestion: Replace double quotes docstring with single quotes - fixable: true - location: - row: 6 - column: 8 - end_location: - row: 6 - column: 57 - fix: - content: "''' Double quotes single line method docstring'''" + fix: + content: "''' Double quotes single line class docstring '''" + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 53 + parent: ~ + - kind: + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + suggestion: Replace double quotes docstring with single quotes + fixable: true location: row: 6 column: 8 end_location: row: 6 column: 57 - parent: ~ -- kind: - name: BadQuotesDocstring - body: Double quote docstring found but single quotes preferred - suggestion: Replace double quotes docstring with single quotes - fixable: true - location: - row: 9 - column: 28 - end_location: - row: 9 - column: 52 - fix: - content: "''' inline docstring '''" + fix: + content: "''' Double quotes single line method docstring'''" + location: + row: 6 + column: 8 + end_location: + row: 6 + column: 57 + parent: ~ + - kind: + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + suggestion: Replace double quotes docstring with single quotes + fixable: true location: row: 9 column: 28 end_location: row: 9 column: 52 - parent: ~ + fix: + content: "''' inline docstring '''" + location: + row: 9 + column: 28 + end_location: + row: 9 + column: 52 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap index 630ea19991e28a..618222f0f241e6 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesDocstring - body: Double quote docstring found but single quotes preferred - suggestion: Replace double quotes docstring with single quotes - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 56 - fix: - content: "'''function without params, single line docstring'''" +- - kind: + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + suggestion: Replace double quotes docstring with single quotes + fixable: true location: row: 2 column: 4 end_location: row: 2 column: 56 - parent: ~ -- kind: - name: BadQuotesDocstring - body: Double quote docstring found but single quotes preferred - suggestion: Replace double quotes docstring with single quotes - fixable: true - location: - row: 8 - column: 4 - end_location: - row: 10 - column: 7 - fix: - content: "'''\n function without params, multiline docstring\n '''" + fix: + content: "'''function without params, single line docstring'''" + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 56 + parent: ~ + - kind: + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + suggestion: Replace double quotes docstring with single quotes + fixable: true location: row: 8 column: 4 end_location: row: 10 column: 7 - parent: ~ -- kind: - name: BadQuotesDocstring - body: Double quote docstring found but single quotes preferred - suggestion: Replace double quotes docstring with single quotes - fixable: true - location: - row: 27 - column: 4 - end_location: - row: 27 - column: 27 - fix: - content: "'Single line docstring'" + fix: + content: "'''\n function without params, multiline docstring\n '''" + location: + row: 8 + column: 4 + end_location: + row: 10 + column: 7 + parent: ~ + - kind: + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + suggestion: Replace double quotes docstring with single quotes + fixable: true location: row: 27 column: 4 end_location: row: 27 column: 27 - parent: ~ + fix: + content: "'Single line docstring'" + location: + row: 27 + column: 4 + end_location: + row: 27 + column: 27 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap index 04a51637226b01..0b69c87f1c0cd9 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesDocstring - body: Double quote docstring found but single quotes preferred - suggestion: Replace double quotes docstring with single quotes - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 3 - column: 3 - fix: - content: "'''\nDouble quotes multiline module docstring\n'''" +- - kind: + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + suggestion: Replace double quotes docstring with single quotes + fixable: true location: row: 1 column: 0 end_location: row: 3 column: 3 - parent: ~ + fix: + content: "'''\nDouble quotes multiline module docstring\n'''" + location: + row: 1 + column: 0 + end_location: + row: 3 + column: 3 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap index 3d2746184b5643..f95453a4949acb 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesDocstring - body: Double quote docstring found but single quotes preferred - suggestion: Replace double quotes docstring with single quotes - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 49 - fix: - content: "''' Double quotes singleline module docstring '''" +- - kind: + name: BadQuotesDocstring + body: Double quote docstring found but single quotes preferred + suggestion: Replace double quotes docstring with single quotes + fixable: true location: row: 1 column: 0 end_location: row: 1 column: 49 - parent: ~ + fix: + content: "''' Double quotes singleline module docstring '''" + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 49 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap index 5de2f20f876e21..f38a3d3607dbef 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap @@ -2,124 +2,124 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 7 - column: 3 - fix: - content: "\"\"\"\nthis is not a docstring\n\"\"\"" +- - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 5 column: 0 end_location: row: 7 column: 3 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 11 - column: 20 - end_location: - row: 13 - column: 3 - fix: - content: "\"\"\"\n class params \\t not a docstring\n\"\"\"" + fix: + content: "\"\"\"\nthis is not a docstring\n\"\"\"" + location: + row: 5 + column: 0 + end_location: + row: 7 + column: 3 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 11 column: 20 end_location: row: 13 column: 3 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 18 - column: 4 - end_location: - row: 20 - column: 7 - fix: - content: "\"\"\"\n this is not a docstring\n \"\"\"" + fix: + content: "\"\"\"\n class params \\t not a docstring\n\"\"\"" + location: + row: 11 + column: 20 + end_location: + row: 13 + column: 3 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 18 column: 4 end_location: row: 20 column: 7 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 23 - column: 20 - end_location: - row: 24 - column: 37 - fix: - content: "\"\"\"\n definitely not a docstring\"\"\"" + fix: + content: "\"\"\"\n this is not a docstring\n \"\"\"" + location: + row: 18 + column: 4 + end_location: + row: 20 + column: 7 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 23 column: 20 end_location: row: 24 column: 37 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 32 - column: 8 - end_location: - row: 34 - column: 11 - fix: - content: "\"\"\"\n this is not a docstring\n \"\"\"" + fix: + content: "\"\"\"\n definitely not a docstring\"\"\"" + location: + row: 23 + column: 20 + end_location: + row: 24 + column: 37 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 32 column: 8 end_location: row: 34 column: 11 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 37 - column: 12 - end_location: - row: 39 - column: 15 - fix: - content: "\"\"\"\n Looks like a docstring, but in reality it isn't - only modules, classes and functions\n \"\"\"" + fix: + content: "\"\"\"\n this is not a docstring\n \"\"\"" + location: + row: 32 + column: 8 + end_location: + row: 34 + column: 11 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 37 column: 12 end_location: row: 39 column: 15 - parent: ~ + fix: + content: "\"\"\"\n Looks like a docstring, but in reality it isn't - only modules, classes and functions\n \"\"\"" + location: + row: 37 + column: 12 + end_location: + row: 39 + column: 15 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap index 7498c57b13178f..ffca191c344233 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 27 - fix: - content: "\"\"\" Not a docstring \"\"\"" +- - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 3 column: 4 end_location: row: 3 column: 27 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 5 - column: 22 - end_location: - row: 5 - column: 43 - fix: - content: "\"\"\"not a docstring\"\"\"" + fix: + content: "\"\"\" Not a docstring \"\"\"" + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 27 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 5 column: 22 end_location: row: 5 column: 43 - parent: ~ + fix: + content: "\"\"\"not a docstring\"\"\"" + location: + row: 5 + column: 22 + end_location: + row: 5 + column: 43 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap index e545c2d4cf11a1..443810940bd991 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap @@ -2,104 +2,104 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 26 - fix: - content: "\"\"\" not a docstring\"\"\"" +- - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 3 column: 4 end_location: row: 3 column: 26 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 11 - column: 4 - end_location: - row: 11 - column: 26 - fix: - content: "\"\"\" not a docstring\"\"\"" + fix: + content: "\"\"\" not a docstring\"\"\"" + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 26 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 11 column: 4 end_location: row: 11 column: 26 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 15 - column: 38 - end_location: - row: 17 - column: 3 - fix: - content: "\"\"\"\n not a\n\"\"\"" + fix: + content: "\"\"\" not a docstring\"\"\"" + location: + row: 11 + column: 4 + end_location: + row: 11 + column: 26 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 15 column: 38 end_location: row: 17 column: 3 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 17 - column: 4 - end_location: - row: 17 - column: 19 - fix: - content: "\"\"\"docstring\"\"\"" + fix: + content: "\"\"\"\n not a\n\"\"\"" + location: + row: 15 + column: 38 + end_location: + row: 17 + column: 3 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 17 column: 4 end_location: row: 17 column: 19 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 22 - column: 4 - end_location: - row: 22 - column: 27 - fix: - content: "\"\"\" not a docstring \"\"\"" + fix: + content: "\"\"\"docstring\"\"\"" + location: + row: 17 + column: 4 + end_location: + row: 17 + column: 19 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 22 column: 4 end_location: row: 22 column: 27 - parent: ~ + fix: + content: "\"\"\" not a docstring \"\"\"" + location: + row: 22 + column: 4 + end_location: + row: 22 + column: 27 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap index cf5f281c49d704..eb2148eccd6d2b 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 6 - column: 3 - fix: - content: "\"\"\"\nthis is not a docstring\n\"\"\"" +- - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 4 column: 0 end_location: row: 6 column: 3 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 9 - column: 0 - end_location: - row: 11 - column: 3 - fix: - content: "\"\"\"\nthis is not a docstring\n\"\"\"" + fix: + content: "\"\"\"\nthis is not a docstring\n\"\"\"" + location: + row: 4 + column: 0 + end_location: + row: 6 + column: 3 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 9 column: 0 end_location: row: 11 column: 3 - parent: ~ + fix: + content: "\"\"\"\nthis is not a docstring\n\"\"\"" + location: + row: 9 + column: 0 + end_location: + row: 11 + column: 3 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap index 5ca4d42fa7f090..3185ba1fc4d9eb 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 31 - fix: - content: "\"\"\" this is not a docstring \"\"\"" +- - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 2 column: 0 end_location: row: 2 column: 31 - parent: ~ -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 31 - fix: - content: "\"\"\" this is not a docstring \"\"\"" + fix: + content: "\"\"\" this is not a docstring \"\"\"" + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 31 + parent: ~ + - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 6 column: 0 end_location: row: 6 column: 31 - parent: ~ + fix: + content: "\"\"\" this is not a docstring \"\"\"" + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 31 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap index 00ae770ba05006..24c0534e0a9545 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesInlineString - body: Single quotes found but double quotes preferred - suggestion: Replace single quotes with double quotes - fixable: true - location: - row: 1 - column: 24 - end_location: - row: 1 - column: 45 - fix: - content: "\"single quote string\"" +- - kind: + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + suggestion: Replace single quotes with double quotes + fixable: true location: row: 1 column: 24 end_location: row: 1 column: 45 - parent: ~ -- kind: - name: BadQuotesInlineString - body: Single quotes found but double quotes preferred - suggestion: Replace single quotes with double quotes - fixable: true - location: - row: 2 - column: 24 - end_location: - row: 2 - column: 46 - fix: - content: "u\"double quote string\"" + fix: + content: "\"single quote string\"" + location: + row: 1 + column: 24 + end_location: + row: 1 + column: 45 + parent: ~ + - kind: + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + suggestion: Replace single quotes with double quotes + fixable: true location: row: 2 column: 24 end_location: row: 2 column: 46 - parent: ~ -- kind: - name: BadQuotesInlineString - body: Single quotes found but double quotes preferred - suggestion: Replace single quotes with double quotes - fixable: true - location: - row: 3 - column: 24 - end_location: - row: 3 - column: 46 - fix: - content: "f\"double quote string\"" + fix: + content: "u\"double quote string\"" + location: + row: 2 + column: 24 + end_location: + row: 2 + column: 46 + parent: ~ + - kind: + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + suggestion: Replace single quotes with double quotes + fixable: true location: row: 3 column: 24 end_location: row: 3 column: 46 - parent: ~ + fix: + content: "f\"double quote string\"" + location: + row: 3 + column: 24 + end_location: + row: 3 + column: 46 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap index 012d697ef2a1eb..bc51f37490beca 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: AvoidableEscapedQuote - body: Change outer quotes to avoid escaping inner quotes - suggestion: Change outer quotes to avoid escaping inner quotes - fixable: true - location: - row: 1 - column: 25 - end_location: - row: 1 - column: 47 - fix: - content: "'This is a \"string\"'" +- - kind: + name: AvoidableEscapedQuote + body: Change outer quotes to avoid escaping inner quotes + suggestion: Change outer quotes to avoid escaping inner quotes + fixable: true location: row: 1 column: 25 end_location: row: 1 column: 47 - parent: ~ -- kind: - name: AvoidableEscapedQuote - body: Change outer quotes to avoid escaping inner quotes - suggestion: Change outer quotes to avoid escaping inner quotes - fixable: true - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 16 - fix: - content: "'\"string\"'" + fix: + content: "'This is a \"string\"'" + location: + row: 1 + column: 25 + end_location: + row: 1 + column: 47 + parent: ~ + - kind: + name: AvoidableEscapedQuote + body: Change outer quotes to avoid escaping inner quotes + suggestion: Change outer quotes to avoid escaping inner quotes + fixable: true location: row: 9 column: 4 end_location: row: 9 column: 16 - parent: ~ + fix: + content: "'\"string\"'" + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 16 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap index f78b3dcb0ed564..40e409b068c0f6 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap @@ -2,144 +2,144 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesInlineString - body: Single quotes found but double quotes preferred - suggestion: Replace single quotes with double quotes - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 10 - fix: - content: "\"This\"" +- - kind: + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + suggestion: Replace single quotes with double quotes + fixable: true location: row: 2 column: 4 end_location: row: 2 column: 10 - parent: ~ -- kind: - name: BadQuotesInlineString - body: Single quotes found but double quotes preferred - suggestion: Replace single quotes with double quotes - fixable: true - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 8 - fix: - content: "\"is\"" + fix: + content: "\"This\"" + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 10 + parent: ~ + - kind: + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + suggestion: Replace single quotes with double quotes + fixable: true location: row: 3 column: 4 end_location: row: 3 column: 8 - parent: ~ -- kind: - name: BadQuotesInlineString - body: Single quotes found but double quotes preferred - suggestion: Replace single quotes with double quotes - fixable: true - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 9 - fix: - content: "\"not\"" + fix: + content: "\"is\"" + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 8 + parent: ~ + - kind: + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + suggestion: Replace single quotes with double quotes + fixable: true location: row: 4 column: 4 end_location: row: 4 column: 9 - parent: ~ -- kind: - name: BadQuotesInlineString - body: Single quotes found but double quotes preferred - suggestion: Replace single quotes with double quotes - fixable: true - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 10 - fix: - content: "\"This\"" + fix: + content: "\"not\"" + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 9 + parent: ~ + - kind: + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + suggestion: Replace single quotes with double quotes + fixable: true location: row: 8 column: 4 end_location: row: 8 column: 10 - parent: ~ -- kind: - name: BadQuotesInlineString - body: Single quotes found but double quotes preferred - suggestion: Replace single quotes with double quotes - fixable: true - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 8 - fix: - content: "\"is\"" + fix: + content: "\"This\"" + location: + row: 8 + column: 4 + end_location: + row: 8 + column: 10 + parent: ~ + - kind: + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + suggestion: Replace single quotes with double quotes + fixable: true location: row: 9 column: 4 end_location: row: 9 column: 8 - parent: ~ -- kind: - name: BadQuotesInlineString - body: Single quotes found but double quotes preferred - suggestion: Replace single quotes with double quotes - fixable: true - location: - row: 10 - column: 4 - end_location: - row: 10 - column: 9 - fix: - content: "\"not\"" + fix: + content: "\"is\"" + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 8 + parent: ~ + - kind: + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + suggestion: Replace single quotes with double quotes + fixable: true location: row: 10 column: 4 end_location: row: 10 column: 9 - parent: ~ -- kind: - name: BadQuotesInlineString - body: Single quotes found but double quotes preferred - suggestion: Replace single quotes with double quotes - fixable: true - location: - row: 27 - column: 0 - end_location: - row: 27 - column: 30 - fix: - content: "\"But this needs to be changed\"" + fix: + content: "\"not\"" + location: + row: 10 + column: 4 + end_location: + row: 10 + column: 9 + parent: ~ + - kind: + name: BadQuotesInlineString + body: Single quotes found but double quotes preferred + suggestion: Replace single quotes with double quotes + fixable: true location: row: 27 column: 0 end_location: row: 27 column: 30 - parent: ~ + fix: + content: "\"But this needs to be changed\"" + location: + row: 27 + column: 0 + end_location: + row: 27 + column: 30 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap index d2396e06d7d630..acac2fb6877961 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesMultilineString - body: Single quote multiline found but double quotes preferred - suggestion: Replace single multiline quotes with double quotes - fixable: true - location: - row: 1 - column: 4 - end_location: - row: 3 - column: 12 - fix: - content: "\"\"\" This 'should'\nbe\n'linted' \"\"\"" +- - kind: + name: BadQuotesMultilineString + body: Single quote multiline found but double quotes preferred + suggestion: Replace single multiline quotes with double quotes + fixable: true location: row: 1 column: 4 end_location: row: 3 column: 12 - parent: ~ + fix: + content: "\"\"\" This 'should'\nbe\n'linted' \"\"\"" + location: + row: 1 + column: 4 + end_location: + row: 3 + column: 12 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_noqa.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_noqa.py.snap index c185aeed46dc4b..c196c1436b82e9 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_noqa.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_noqa.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_quotes/mod.rs +source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_wrapped.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_wrapped.py.snap index c185aeed46dc4b..c196c1436b82e9 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_wrapped.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_wrapped.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_quotes/mod.rs +source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap index 63190603674641..9a71041f356c54 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesInlineString - body: Double quotes found but single quotes preferred - suggestion: Replace double quotes with single quotes - fixable: true - location: - row: 1 - column: 24 - end_location: - row: 1 - column: 45 - fix: - content: "'double quote string'" +- - kind: + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + suggestion: Replace double quotes with single quotes + fixable: true location: row: 1 column: 24 end_location: row: 1 column: 45 - parent: ~ -- kind: - name: BadQuotesInlineString - body: Double quotes found but single quotes preferred - suggestion: Replace double quotes with single quotes - fixable: true - location: - row: 2 - column: 24 - end_location: - row: 2 - column: 46 - fix: - content: "u'double quote string'" + fix: + content: "'double quote string'" + location: + row: 1 + column: 24 + end_location: + row: 1 + column: 45 + parent: ~ + - kind: + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + suggestion: Replace double quotes with single quotes + fixable: true location: row: 2 column: 24 end_location: row: 2 column: 46 - parent: ~ -- kind: - name: BadQuotesInlineString - body: Double quotes found but single quotes preferred - suggestion: Replace double quotes with single quotes - fixable: true - location: - row: 3 - column: 24 - end_location: - row: 3 - column: 46 - fix: - content: "f'double quote string'" + fix: + content: "u'double quote string'" + location: + row: 2 + column: 24 + end_location: + row: 2 + column: 46 + parent: ~ + - kind: + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + suggestion: Replace double quotes with single quotes + fixable: true location: row: 3 column: 24 end_location: row: 3 column: 46 - parent: ~ + fix: + content: "f'double quote string'" + location: + row: 3 + column: 24 + end_location: + row: 3 + column: 46 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap index ae806159e02359..1588f3d9f930b2 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: AvoidableEscapedQuote - body: Change outer quotes to avoid escaping inner quotes - suggestion: Change outer quotes to avoid escaping inner quotes - fixable: true - location: - row: 1 - column: 25 - end_location: - row: 1 - column: 47 - fix: - content: "\"This is a 'string'\"" +- - kind: + name: AvoidableEscapedQuote + body: Change outer quotes to avoid escaping inner quotes + suggestion: Change outer quotes to avoid escaping inner quotes + fixable: true location: row: 1 column: 25 end_location: row: 1 column: 47 - parent: ~ -- kind: - name: AvoidableEscapedQuote - body: Change outer quotes to avoid escaping inner quotes - suggestion: Change outer quotes to avoid escaping inner quotes - fixable: true - location: - row: 2 - column: 25 - end_location: - row: 2 - column: 52 - fix: - content: "\"This is \\\\ a \\\\'string'\"" + fix: + content: "\"This is a 'string'\"" + location: + row: 1 + column: 25 + end_location: + row: 1 + column: 47 + parent: ~ + - kind: + name: AvoidableEscapedQuote + body: Change outer quotes to avoid escaping inner quotes + suggestion: Change outer quotes to avoid escaping inner quotes + fixable: true location: row: 2 column: 25 end_location: row: 2 column: 52 - parent: ~ -- kind: - name: AvoidableEscapedQuote - body: Change outer quotes to avoid escaping inner quotes - suggestion: Change outer quotes to avoid escaping inner quotes - fixable: true - location: - row: 10 - column: 4 - end_location: - row: 10 - column: 16 - fix: - content: "\"'string'\"" + fix: + content: "\"This is \\\\ a \\\\'string'\"" + location: + row: 2 + column: 25 + end_location: + row: 2 + column: 52 + parent: ~ + - kind: + name: AvoidableEscapedQuote + body: Change outer quotes to avoid escaping inner quotes + suggestion: Change outer quotes to avoid escaping inner quotes + fixable: true location: row: 10 column: 4 end_location: row: 10 column: 16 - parent: ~ + fix: + content: "\"'string'\"" + location: + row: 10 + column: 4 + end_location: + row: 10 + column: 16 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap index 5474a5733a7d41..379bddb326c915 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap @@ -2,144 +2,144 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesInlineString - body: Double quotes found but single quotes preferred - suggestion: Replace double quotes with single quotes - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 10 - fix: - content: "'This'" +- - kind: + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + suggestion: Replace double quotes with single quotes + fixable: true location: row: 2 column: 4 end_location: row: 2 column: 10 - parent: ~ -- kind: - name: BadQuotesInlineString - body: Double quotes found but single quotes preferred - suggestion: Replace double quotes with single quotes - fixable: true - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 8 - fix: - content: "'is'" + fix: + content: "'This'" + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 10 + parent: ~ + - kind: + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + suggestion: Replace double quotes with single quotes + fixable: true location: row: 3 column: 4 end_location: row: 3 column: 8 - parent: ~ -- kind: - name: BadQuotesInlineString - body: Double quotes found but single quotes preferred - suggestion: Replace double quotes with single quotes - fixable: true - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 9 - fix: - content: "'not'" + fix: + content: "'is'" + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 8 + parent: ~ + - kind: + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + suggestion: Replace double quotes with single quotes + fixable: true location: row: 4 column: 4 end_location: row: 4 column: 9 - parent: ~ -- kind: - name: BadQuotesInlineString - body: Double quotes found but single quotes preferred - suggestion: Replace double quotes with single quotes - fixable: true - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 10 - fix: - content: "'This'" + fix: + content: "'not'" + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 9 + parent: ~ + - kind: + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + suggestion: Replace double quotes with single quotes + fixable: true location: row: 8 column: 4 end_location: row: 8 column: 10 - parent: ~ -- kind: - name: BadQuotesInlineString - body: Double quotes found but single quotes preferred - suggestion: Replace double quotes with single quotes - fixable: true - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 8 - fix: - content: "'is'" + fix: + content: "'This'" + location: + row: 8 + column: 4 + end_location: + row: 8 + column: 10 + parent: ~ + - kind: + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + suggestion: Replace double quotes with single quotes + fixable: true location: row: 9 column: 4 end_location: row: 9 column: 8 - parent: ~ -- kind: - name: BadQuotesInlineString - body: Double quotes found but single quotes preferred - suggestion: Replace double quotes with single quotes - fixable: true - location: - row: 10 - column: 4 - end_location: - row: 10 - column: 9 - fix: - content: "'not'" + fix: + content: "'is'" + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 8 + parent: ~ + - kind: + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + suggestion: Replace double quotes with single quotes + fixable: true location: row: 10 column: 4 end_location: row: 10 column: 9 - parent: ~ -- kind: - name: BadQuotesInlineString - body: Double quotes found but single quotes preferred - suggestion: Replace double quotes with single quotes - fixable: true - location: - row: 27 - column: 0 - end_location: - row: 27 - column: 30 - fix: - content: "'But this needs to be changed'" + fix: + content: "'not'" + location: + row: 10 + column: 4 + end_location: + row: 10 + column: 9 + parent: ~ + - kind: + name: BadQuotesInlineString + body: Double quotes found but single quotes preferred + suggestion: Replace double quotes with single quotes + fixable: true location: row: 27 column: 0 end_location: row: 27 column: 30 - parent: ~ + fix: + content: "'But this needs to be changed'" + location: + row: 27 + column: 0 + end_location: + row: 27 + column: 30 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap index b0c1ffc4f57ec0..864de659be4f50 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -- kind: - name: BadQuotesMultilineString - body: Double quote multiline found but single quotes preferred - suggestion: Replace double multiline quotes with single quotes - fixable: true - location: - row: 1 - column: 4 - end_location: - row: 3 - column: 12 - fix: - content: "''' This \"should\"\nbe\n\"linted\" '''" +- - kind: + name: BadQuotesMultilineString + body: Double quote multiline found but single quotes preferred + suggestion: Replace double multiline quotes with single quotes + fixable: true location: row: 1 column: 4 end_location: row: 3 column: 12 - parent: ~ + fix: + content: "''' This \"should\"\nbe\n\"linted\" '''" + location: + row: 1 + column: 4 + end_location: + row: 3 + column: 12 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_noqa.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_noqa.py.snap index c185aeed46dc4b..c196c1436b82e9 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_noqa.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_noqa.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_quotes/mod.rs +source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_wrapped.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_wrapped.py.snap index c185aeed46dc4b..c196c1436b82e9 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_wrapped.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_wrapped.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_quotes/mod.rs +source: crates/ruff/src/rules/flake8_quotes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_raise/snapshots/ruff__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap b/crates/ruff/src/rules/flake8_raise/snapshots/ruff__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap index 64701a4b17fa28..a1b75b25f2b457 100644 --- a/crates/ruff/src/rules/flake8_raise/snapshots/ruff__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap +++ b/crates/ruff/src/rules/flake8_raise/snapshots/ruff__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap @@ -2,124 +2,124 @@ source: crates/ruff/src/rules/flake8_raise/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryParenOnRaiseException - body: Unnecessary parentheses on raised exception - suggestion: Remove unnecessary parentheses - fixable: true - location: - row: 5 - column: 20 - end_location: - row: 5 - column: 22 - fix: - content: "" +- - kind: + name: UnnecessaryParenOnRaiseException + body: Unnecessary parentheses on raised exception + suggestion: Remove unnecessary parentheses + fixable: true location: row: 5 column: 20 end_location: row: 5 column: 22 - parent: ~ -- kind: - name: UnnecessaryParenOnRaiseException - body: Unnecessary parentheses on raised exception - suggestion: Remove unnecessary parentheses - fixable: true - location: - row: 13 - column: 15 - end_location: - row: 13 - column: 17 - fix: - content: "" + fix: + content: "" + location: + row: 5 + column: 20 + end_location: + row: 5 + column: 22 + parent: ~ + - kind: + name: UnnecessaryParenOnRaiseException + body: Unnecessary parentheses on raised exception + suggestion: Remove unnecessary parentheses + fixable: true location: row: 13 column: 15 end_location: row: 13 column: 17 - parent: ~ -- kind: - name: UnnecessaryParenOnRaiseException - body: Unnecessary parentheses on raised exception - suggestion: Remove unnecessary parentheses - fixable: true - location: - row: 16 - column: 16 - end_location: - row: 16 - column: 18 - fix: - content: "" + fix: + content: "" + location: + row: 13 + column: 15 + end_location: + row: 13 + column: 17 + parent: ~ + - kind: + name: UnnecessaryParenOnRaiseException + body: Unnecessary parentheses on raised exception + suggestion: Remove unnecessary parentheses + fixable: true location: row: 16 - column: 15 + column: 16 end_location: row: 16 column: 18 - parent: ~ -- kind: - name: UnnecessaryParenOnRaiseException - body: Unnecessary parentheses on raised exception - suggestion: Remove unnecessary parentheses - fixable: true - location: - row: 20 - column: 4 - end_location: - row: 20 - column: 6 - fix: - content: "" + fix: + content: "" + location: + row: 16 + column: 15 + end_location: + row: 16 + column: 18 + parent: ~ + - kind: + name: UnnecessaryParenOnRaiseException + body: Unnecessary parentheses on raised exception + suggestion: Remove unnecessary parentheses + fixable: true location: - row: 19 - column: 15 + row: 20 + column: 4 end_location: row: 20 column: 6 - parent: ~ -- kind: - name: UnnecessaryParenOnRaiseException - body: Unnecessary parentheses on raised exception - suggestion: Remove unnecessary parentheses - fixable: true - location: - row: 23 - column: 15 - end_location: - row: 25 - column: 1 - fix: - content: "" + fix: + content: "" + location: + row: 19 + column: 15 + end_location: + row: 20 + column: 6 + parent: ~ + - kind: + name: UnnecessaryParenOnRaiseException + body: Unnecessary parentheses on raised exception + suggestion: Remove unnecessary parentheses + fixable: true location: row: 23 column: 15 end_location: row: 25 column: 1 - parent: ~ -- kind: - name: UnnecessaryParenOnRaiseException - body: Unnecessary parentheses on raised exception - suggestion: Remove unnecessary parentheses - fixable: true - location: - row: 28 - column: 15 - end_location: - row: 30 - column: 1 - fix: - content: "" + fix: + content: "" + location: + row: 23 + column: 15 + end_location: + row: 25 + column: 1 + parent: ~ + - kind: + name: UnnecessaryParenOnRaiseException + body: Unnecessary parentheses on raised exception + suggestion: Remove unnecessary parentheses + fixable: true location: row: 28 column: 15 end_location: row: 30 column: 1 - parent: ~ + fix: + content: "" + location: + row: 28 + column: 15 + end_location: + row: 30 + column: 1 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET501_RET501.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET501_RET501.py.snap index 650524d1a1fdb7..c27befa0c495a6 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET501_RET501.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET501_RET501.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/flake8_return/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryReturnNone - body: "Do not explicitly `return None` in function if it is the only possible return value" - suggestion: "Remove explicit `return None`" - fixable: true - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 15 - fix: - content: return +- - kind: + name: UnnecessaryReturnNone + body: "Do not explicitly `return None` in function if it is the only possible return value" + suggestion: "Remove explicit `return None`" + fixable: true location: row: 4 column: 4 end_location: row: 4 column: 15 - parent: ~ + fix: + content: return + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 15 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET502_RET502.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET502_RET502.py.snap index 1a92947f9fcfc5..ed752658114b1b 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET502_RET502.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET502_RET502.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/flake8_return/mod.rs expression: diagnostics --- -- kind: - name: ImplicitReturnValue - body: "Do not implicitly `return None` in function able to return non-`None` value" - suggestion: "Add explicit `None` return value" - fixable: true - location: - row: 3 - column: 8 - end_location: - row: 3 - column: 14 - fix: - content: return None +- - kind: + name: ImplicitReturnValue + body: "Do not implicitly `return None` in function able to return non-`None` value" + suggestion: "Add explicit `None` return value" + fixable: true location: row: 3 column: 8 end_location: row: 3 column: 14 - parent: ~ + fix: + content: return None + location: + row: 3 + column: 8 + end_location: + row: 3 + column: 14 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET503_RET503.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET503_RET503.py.snap index 12f483d969eea5..7c506827fd716d 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET503_RET503.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET503_RET503.py.snap @@ -2,384 +2,384 @@ source: crates/ruff/src/rules/flake8_return/mod.rs expression: diagnostics --- -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 20 - column: 4 - end_location: - row: 21 - column: 16 - fix: - content: "\n return None" +- - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: - row: 21 - column: 16 + row: 20 + column: 4 end_location: row: 21 column: 16 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 27 - column: 8 - end_location: - row: 27 - column: 15 - fix: - content: "\n return None" + fix: + content: "\n return None" + location: + row: 21 + column: 16 + end_location: + row: 21 + column: 16 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: row: 27 - column: 24 + column: 8 end_location: row: 27 - column: 24 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 36 - column: 4 - end_location: - row: 36 - column: 11 - fix: - content: "\n return None" + column: 15 + fix: + content: "\n return None" + location: + row: 27 + column: 24 + end_location: + row: 27 + column: 24 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: row: 36 - column: 20 + column: 4 end_location: row: 36 - column: 20 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 41 - column: 4 - end_location: - row: 43 - column: 20 - fix: - content: "\n return None" + column: 11 + fix: + content: "\n return None" + location: + row: 36 + column: 20 + end_location: + row: 36 + column: 20 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: - row: 43 - column: 20 + row: 41 + column: 4 end_location: row: 43 column: 20 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 52 - column: 8 - end_location: - row: 52 - column: 15 - fix: - content: "\n return None" + fix: + content: "\n return None" + location: + row: 43 + column: 20 + end_location: + row: 43 + column: 20 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: row: 52 - column: 24 + column: 8 end_location: row: 52 - column: 24 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 59 - column: 4 - end_location: - row: 59 - column: 22 - fix: - content: "\n return None" + column: 15 + fix: + content: "\n return None" + location: + row: 52 + column: 24 + end_location: + row: 52 + column: 24 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: row: 59 - column: 31 + column: 4 end_location: row: 59 - column: 31 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 66 - column: 4 - end_location: - row: 66 - column: 21 - fix: - content: "\n return None" + column: 22 + fix: + content: "\n return None" + location: + row: 59 + column: 31 + end_location: + row: 59 + column: 31 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: row: 66 - column: 30 + column: 4 end_location: row: 66 - column: 30 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 82 - column: 4 - end_location: - row: 85 - column: 14 - fix: - content: "\n return None" + column: 21 + fix: + content: "\n return None" + location: + row: 66 + column: 30 + end_location: + row: 66 + column: 30 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: - row: 85 - column: 14 + row: 82 + column: 4 end_location: row: 85 column: 14 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 113 - column: 4 - end_location: - row: 116 - column: 16 - fix: - content: "\n return None" + fix: + content: "\n return None" + location: + row: 85 + column: 14 + end_location: + row: 85 + column: 14 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: - row: 116 - column: 16 + row: 113 + column: 4 end_location: row: 116 column: 16 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 120 - column: 4 - end_location: - row: 126 - column: 19 - fix: - content: "\n return None" + fix: + content: "\n return None" + location: + row: 116 + column: 16 + end_location: + row: 116 + column: 16 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: - row: 126 - column: 19 + row: 120 + column: 4 end_location: row: 126 column: 19 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 130 - column: 4 - end_location: - row: 133 - column: 16 - fix: - content: "\n return None" + fix: + content: "\n return None" + location: + row: 126 + column: 19 + end_location: + row: 126 + column: 19 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: - row: 133 - column: 16 + row: 130 + column: 4 end_location: row: 133 column: 16 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 137 - column: 4 - end_location: - row: 143 - column: 19 - fix: - content: "\n return None" + fix: + content: "\n return None" + location: + row: 133 + column: 16 + end_location: + row: 133 + column: 16 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: - row: 143 - column: 19 + row: 137 + column: 4 end_location: row: 143 column: 19 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 274 - column: 4 - end_location: - row: 275 - column: 20 - fix: - content: "\n return None" + fix: + content: "\n return None" + location: + row: 143 + column: 19 + end_location: + row: 143 + column: 19 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: - row: 275 - column: 20 + row: 274 + column: 4 end_location: row: 275 column: 20 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 291 - column: 12 - end_location: - row: 291 - column: 19 - fix: - content: "\n return None" + fix: + content: "\n return None" + location: + row: 275 + column: 20 + end_location: + row: 275 + column: 20 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: row: 291 - column: 28 + column: 12 end_location: row: 291 - column: 28 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 300 - column: 8 - end_location: - row: 301 - column: 21 - fix: - content: "\n return None" + column: 19 + fix: + content: "\n return None" + location: + row: 291 + column: 28 + end_location: + row: 291 + column: 28 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: - row: 301 - column: 21 + row: 300 + column: 8 end_location: row: 301 column: 21 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 305 - column: 8 - end_location: - row: 306 - column: 21 - fix: - content: "\n return None" + fix: + content: "\n return None" + location: + row: 301 + column: 21 + end_location: + row: 301 + column: 21 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: - row: 306 - column: 21 + row: 305 + column: 8 end_location: row: 306 column: 21 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 310 - column: 8 - end_location: - row: 311 - column: 21 - fix: - content: "\n return None" + fix: + content: "\n return None" + location: + row: 306 + column: 21 + end_location: + row: 306 + column: 21 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: - row: 311 - column: 37 + row: 310 + column: 8 end_location: row: 311 - column: 37 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 315 - column: 8 - end_location: - row: 316 - column: 21 - fix: - content: "\n return None" + column: 21 + fix: + content: "\n return None" + location: + row: 311 + column: 37 + end_location: + row: 311 + column: 37 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: - row: 316 - column: 24 + row: 315 + column: 8 end_location: row: 316 - column: 24 - parent: ~ -- kind: - name: ImplicitReturn - body: "Missing explicit `return` at the end of function able to return non-`None` value" - suggestion: "Add explicit `return` statement" - fixable: true - location: - row: 320 - column: 8 - end_location: - row: 321 - column: 21 - fix: - content: "\n return None" + column: 21 + fix: + content: "\n return None" + location: + row: 316 + column: 24 + end_location: + row: 316 + column: 24 + parent: ~ + - kind: + name: ImplicitReturn + body: "Missing explicit `return` at the end of function able to return non-`None` value" + suggestion: "Add explicit `return` statement" + fixable: true location: - row: 322 - column: 33 + row: 320 + column: 8 end_location: - row: 322 - column: 33 - parent: ~ + row: 321 + column: 21 + fix: + content: "\n return None" + location: + row: 322 + column: 33 + end_location: + row: 322 + column: 33 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET504_RET504.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET504_RET504.py.snap index dfd279940a3886..d044ef900b3132 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET504_RET504.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET504_RET504.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_return/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryAssign - body: "Unnecessary variable assignment before `return` statement" - suggestion: ~ - fixable: false - location: - row: 6 - column: 11 - end_location: - row: 6 - column: 12 - fix: ~ - parent: ~ -- kind: - name: UnnecessaryAssign - body: "Unnecessary variable assignment before `return` statement" - suggestion: ~ - fixable: false - location: - row: 249 - column: 11 - end_location: - row: 249 - column: 19 - fix: ~ - parent: ~ +- - kind: + name: UnnecessaryAssign + body: "Unnecessary variable assignment before `return` statement" + suggestion: ~ + fixable: false + location: + row: 6 + column: 11 + end_location: + row: 6 + column: 12 + fix: ~ + parent: ~ + - kind: + name: UnnecessaryAssign + body: "Unnecessary variable assignment before `return` statement" + suggestion: ~ + fixable: false + location: + row: 249 + column: 11 + end_location: + row: 249 + column: 19 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET505_RET505.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET505_RET505.py.snap index bbec7b4db8eb68..39b3281b359f91 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET505_RET505.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET505_RET505.py.snap @@ -2,108 +2,108 @@ source: crates/ruff/src/rules/flake8_return/mod.rs expression: diagnostics --- -- kind: - name: SuperfluousElseReturn - body: "Unnecessary `elif` after `return` statement" - suggestion: ~ - fixable: false - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 8 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseReturn - body: "Unnecessary `elif` after `return` statement" - suggestion: ~ - fixable: false - location: - row: 23 - column: 4 - end_location: - row: 23 - column: 8 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseReturn - body: "Unnecessary `elif` after `return` statement" - suggestion: ~ - fixable: false - location: - row: 41 - column: 4 - end_location: - row: 41 - column: 8 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseReturn - body: "Unnecessary `else` after `return` statement" - suggestion: ~ - fixable: false - location: - row: 53 - column: 4 - end_location: - row: 53 - column: 8 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseReturn - body: "Unnecessary `else` after `return` statement" - suggestion: ~ - fixable: false - location: - row: 64 - column: 8 - end_location: - row: 64 - column: 12 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseReturn - body: "Unnecessary `else` after `return` statement" - suggestion: ~ - fixable: false - location: - row: 79 - column: 4 - end_location: - row: 79 - column: 8 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseReturn - body: "Unnecessary `else` after `return` statement" - suggestion: ~ - fixable: false - location: - row: 89 - column: 8 - end_location: - row: 89 - column: 12 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseReturn - body: "Unnecessary `else` after `return` statement" - suggestion: ~ - fixable: false - location: - row: 99 - column: 4 - end_location: - row: 99 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: SuperfluousElseReturn + body: "Unnecessary `elif` after `return` statement" + suggestion: ~ + fixable: false + location: + row: 8 + column: 4 + end_location: + row: 8 + column: 8 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseReturn + body: "Unnecessary `elif` after `return` statement" + suggestion: ~ + fixable: false + location: + row: 23 + column: 4 + end_location: + row: 23 + column: 8 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseReturn + body: "Unnecessary `elif` after `return` statement" + suggestion: ~ + fixable: false + location: + row: 41 + column: 4 + end_location: + row: 41 + column: 8 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseReturn + body: "Unnecessary `else` after `return` statement" + suggestion: ~ + fixable: false + location: + row: 53 + column: 4 + end_location: + row: 53 + column: 8 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseReturn + body: "Unnecessary `else` after `return` statement" + suggestion: ~ + fixable: false + location: + row: 64 + column: 8 + end_location: + row: 64 + column: 12 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseReturn + body: "Unnecessary `else` after `return` statement" + suggestion: ~ + fixable: false + location: + row: 79 + column: 4 + end_location: + row: 79 + column: 8 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseReturn + body: "Unnecessary `else` after `return` statement" + suggestion: ~ + fixable: false + location: + row: 89 + column: 8 + end_location: + row: 89 + column: 12 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseReturn + body: "Unnecessary `else` after `return` statement" + suggestion: ~ + fixable: false + location: + row: 99 + column: 4 + end_location: + row: 99 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET506_RET506.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET506_RET506.py.snap index 17b6268fc28ab7..ddc2cf2ceb3c3b 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET506_RET506.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET506_RET506.py.snap @@ -2,95 +2,95 @@ source: crates/ruff/src/rules/flake8_return/mod.rs expression: diagnostics --- -- kind: - name: SuperfluousElseRaise - body: "Unnecessary `elif` after `raise` statement" - suggestion: ~ - fixable: false - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 8 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseRaise - body: "Unnecessary `elif` after `raise` statement" - suggestion: ~ - fixable: false - location: - row: 23 - column: 4 - end_location: - row: 23 - column: 8 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseRaise - body: "Unnecessary `else` after `raise` statement" - suggestion: ~ - fixable: false - location: - row: 34 - column: 4 - end_location: - row: 34 - column: 8 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseRaise - body: "Unnecessary `else` after `raise` statement" - suggestion: ~ - fixable: false - location: - row: 45 - column: 8 - end_location: - row: 45 - column: 12 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseRaise - body: "Unnecessary `else` after `raise` statement" - suggestion: ~ - fixable: false - location: - row: 60 - column: 4 - end_location: - row: 60 - column: 8 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseRaise - body: "Unnecessary `else` after `raise` statement" - suggestion: ~ - fixable: false - location: - row: 70 - column: 8 - end_location: - row: 70 - column: 12 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseRaise - body: "Unnecessary `else` after `raise` statement" - suggestion: ~ - fixable: false - location: - row: 80 - column: 4 - end_location: - row: 80 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: SuperfluousElseRaise + body: "Unnecessary `elif` after `raise` statement" + suggestion: ~ + fixable: false + location: + row: 8 + column: 4 + end_location: + row: 8 + column: 8 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseRaise + body: "Unnecessary `elif` after `raise` statement" + suggestion: ~ + fixable: false + location: + row: 23 + column: 4 + end_location: + row: 23 + column: 8 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseRaise + body: "Unnecessary `else` after `raise` statement" + suggestion: ~ + fixable: false + location: + row: 34 + column: 4 + end_location: + row: 34 + column: 8 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseRaise + body: "Unnecessary `else` after `raise` statement" + suggestion: ~ + fixable: false + location: + row: 45 + column: 8 + end_location: + row: 45 + column: 12 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseRaise + body: "Unnecessary `else` after `raise` statement" + suggestion: ~ + fixable: false + location: + row: 60 + column: 4 + end_location: + row: 60 + column: 8 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseRaise + body: "Unnecessary `else` after `raise` statement" + suggestion: ~ + fixable: false + location: + row: 70 + column: 8 + end_location: + row: 70 + column: 12 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseRaise + body: "Unnecessary `else` after `raise` statement" + suggestion: ~ + fixable: false + location: + row: 80 + column: 4 + end_location: + row: 80 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET507_RET507.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET507_RET507.py.snap index f873fa9b6251c6..920753620f0ec1 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET507_RET507.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET507_RET507.py.snap @@ -2,95 +2,95 @@ source: crates/ruff/src/rules/flake8_return/mod.rs expression: diagnostics --- -- kind: - name: SuperfluousElseContinue - body: "Unnecessary `elif` after `continue` statement" - suggestion: ~ - fixable: false - location: - row: 8 - column: 8 - end_location: - row: 8 - column: 12 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseContinue - body: "Unnecessary `elif` after `continue` statement" - suggestion: ~ - fixable: false - location: - row: 22 - column: 8 - end_location: - row: 22 - column: 12 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseContinue - body: "Unnecessary `else` after `continue` statement" - suggestion: ~ - fixable: false - location: - row: 36 - column: 8 - end_location: - row: 36 - column: 12 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseContinue - body: "Unnecessary `else` after `continue` statement" - suggestion: ~ - fixable: false - location: - row: 47 - column: 12 - end_location: - row: 47 - column: 16 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseContinue - body: "Unnecessary `else` after `continue` statement" - suggestion: ~ - fixable: false - location: - row: 63 - column: 8 - end_location: - row: 63 - column: 12 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseContinue - body: "Unnecessary `else` after `continue` statement" - suggestion: ~ - fixable: false - location: - row: 74 - column: 12 - end_location: - row: 74 - column: 16 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseContinue - body: "Unnecessary `else` after `continue` statement" - suggestion: ~ - fixable: false - location: - row: 85 - column: 8 - end_location: - row: 85 - column: 12 - fix: ~ - parent: ~ +- - kind: + name: SuperfluousElseContinue + body: "Unnecessary `elif` after `continue` statement" + suggestion: ~ + fixable: false + location: + row: 8 + column: 8 + end_location: + row: 8 + column: 12 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseContinue + body: "Unnecessary `elif` after `continue` statement" + suggestion: ~ + fixable: false + location: + row: 22 + column: 8 + end_location: + row: 22 + column: 12 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseContinue + body: "Unnecessary `else` after `continue` statement" + suggestion: ~ + fixable: false + location: + row: 36 + column: 8 + end_location: + row: 36 + column: 12 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseContinue + body: "Unnecessary `else` after `continue` statement" + suggestion: ~ + fixable: false + location: + row: 47 + column: 12 + end_location: + row: 47 + column: 16 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseContinue + body: "Unnecessary `else` after `continue` statement" + suggestion: ~ + fixable: false + location: + row: 63 + column: 8 + end_location: + row: 63 + column: 12 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseContinue + body: "Unnecessary `else` after `continue` statement" + suggestion: ~ + fixable: false + location: + row: 74 + column: 12 + end_location: + row: 74 + column: 16 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseContinue + body: "Unnecessary `else` after `continue` statement" + suggestion: ~ + fixable: false + location: + row: 85 + column: 8 + end_location: + row: 85 + column: 12 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET508_RET508.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET508_RET508.py.snap index 2922304d9c306f..b4dac2bfc870d8 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET508_RET508.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET508_RET508.py.snap @@ -2,95 +2,95 @@ source: crates/ruff/src/rules/flake8_return/mod.rs expression: diagnostics --- -- kind: - name: SuperfluousElseBreak - body: "Unnecessary `elif` after `break` statement" - suggestion: ~ - fixable: false - location: - row: 8 - column: 8 - end_location: - row: 8 - column: 12 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseBreak - body: "Unnecessary `elif` after `break` statement" - suggestion: ~ - fixable: false - location: - row: 22 - column: 8 - end_location: - row: 22 - column: 12 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseBreak - body: "Unnecessary `else` after `break` statement" - suggestion: ~ - fixable: false - location: - row: 33 - column: 8 - end_location: - row: 33 - column: 12 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseBreak - body: "Unnecessary `else` after `break` statement" - suggestion: ~ - fixable: false - location: - row: 44 - column: 12 - end_location: - row: 44 - column: 16 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseBreak - body: "Unnecessary `else` after `break` statement" - suggestion: ~ - fixable: false - location: - row: 60 - column: 8 - end_location: - row: 60 - column: 12 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseBreak - body: "Unnecessary `else` after `break` statement" - suggestion: ~ - fixable: false - location: - row: 71 - column: 12 - end_location: - row: 71 - column: 16 - fix: ~ - parent: ~ -- kind: - name: SuperfluousElseBreak - body: "Unnecessary `else` after `break` statement" - suggestion: ~ - fixable: false - location: - row: 82 - column: 8 - end_location: - row: 82 - column: 12 - fix: ~ - parent: ~ +- - kind: + name: SuperfluousElseBreak + body: "Unnecessary `elif` after `break` statement" + suggestion: ~ + fixable: false + location: + row: 8 + column: 8 + end_location: + row: 8 + column: 12 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseBreak + body: "Unnecessary `elif` after `break` statement" + suggestion: ~ + fixable: false + location: + row: 22 + column: 8 + end_location: + row: 22 + column: 12 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseBreak + body: "Unnecessary `else` after `break` statement" + suggestion: ~ + fixable: false + location: + row: 33 + column: 8 + end_location: + row: 33 + column: 12 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseBreak + body: "Unnecessary `else` after `break` statement" + suggestion: ~ + fixable: false + location: + row: 44 + column: 12 + end_location: + row: 44 + column: 16 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseBreak + body: "Unnecessary `else` after `break` statement" + suggestion: ~ + fixable: false + location: + row: 60 + column: 8 + end_location: + row: 60 + column: 12 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseBreak + body: "Unnecessary `else` after `break` statement" + suggestion: ~ + fixable: false + location: + row: 71 + column: 12 + end_location: + row: 71 + column: 16 + fix: ~ + parent: ~ + - kind: + name: SuperfluousElseBreak + body: "Unnecessary `else` after `break` statement" + suggestion: ~ + fixable: false + location: + row: 82 + column: 8 + end_location: + row: 82 + column: 12 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_self/snapshots/ruff__rules__flake8_self__tests__private-member-access_SLF001.py.snap b/crates/ruff/src/rules/flake8_self/snapshots/ruff__rules__flake8_self__tests__private-member-access_SLF001.py.snap index 8c4abb26abdec0..b565362b5c3f5b 100644 --- a/crates/ruff/src/rules/flake8_self/snapshots/ruff__rules__flake8_self__tests__private-member-access_SLF001.py.snap +++ b/crates/ruff/src/rules/flake8_self/snapshots/ruff__rules__flake8_self__tests__private-member-access_SLF001.py.snap @@ -2,147 +2,147 @@ source: crates/ruff/src/rules/flake8_self/mod.rs expression: diagnostics --- -- kind: - name: PrivateMemberAccess - body: "Private member accessed: `_private`" - suggestion: ~ - fixable: false - location: - row: 34 - column: 11 - end_location: - row: 34 - column: 28 - fix: ~ - parent: ~ -- kind: - name: PrivateMemberAccess - body: "Private member accessed: `_private`" - suggestion: ~ - fixable: false - location: - row: 36 - column: 11 - end_location: - row: 36 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PrivateMemberAccess - body: "Private member accessed: `_private_thing`" - suggestion: ~ - fixable: false - location: - row: 38 - column: 11 - end_location: - row: 38 - column: 29 - fix: ~ - parent: ~ -- kind: - name: PrivateMemberAccess - body: "Private member accessed: `_private_thing`" - suggestion: ~ - fixable: false - location: - row: 43 - column: 11 - end_location: - row: 43 - column: 29 - fix: ~ - parent: ~ -- kind: - name: PrivateMemberAccess - body: "Private member accessed: `_private_thing`" - suggestion: ~ - fixable: false - location: - row: 59 - column: 6 - end_location: - row: 59 - column: 24 - fix: ~ - parent: ~ -- kind: - name: PrivateMemberAccess - body: "Private member accessed: `__really_private_thing`" - suggestion: ~ - fixable: false - location: - row: 60 - column: 6 - end_location: - row: 60 - column: 32 - fix: ~ - parent: ~ -- kind: - name: PrivateMemberAccess - body: "Private member accessed: `_private_func`" - suggestion: ~ - fixable: false - location: - row: 61 - column: 6 - end_location: - row: 61 - column: 23 - fix: ~ - parent: ~ -- kind: - name: PrivateMemberAccess - body: "Private member accessed: `__really_private_func`" - suggestion: ~ - fixable: false - location: - row: 62 - column: 6 - end_location: - row: 62 - column: 31 - fix: ~ - parent: ~ -- kind: - name: PrivateMemberAccess - body: "Private member accessed: `_private`" - suggestion: ~ - fixable: false - location: - row: 63 - column: 6 - end_location: - row: 63 - column: 22 - fix: ~ - parent: ~ -- kind: - name: PrivateMemberAccess - body: "Private member accessed: `_private_thing`" - suggestion: ~ - fixable: false - location: - row: 64 - column: 6 - end_location: - row: 64 - column: 26 - fix: ~ - parent: ~ -- kind: - name: PrivateMemberAccess - body: "Private member accessed: `_private_thing__`" - suggestion: ~ - fixable: false - location: - row: 65 - column: 6 - end_location: - row: 65 - column: 28 - fix: ~ - parent: ~ +- - kind: + name: PrivateMemberAccess + body: "Private member accessed: `_private`" + suggestion: ~ + fixable: false + location: + row: 34 + column: 11 + end_location: + row: 34 + column: 28 + fix: ~ + parent: ~ + - kind: + name: PrivateMemberAccess + body: "Private member accessed: `_private`" + suggestion: ~ + fixable: false + location: + row: 36 + column: 11 + end_location: + row: 36 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PrivateMemberAccess + body: "Private member accessed: `_private_thing`" + suggestion: ~ + fixable: false + location: + row: 38 + column: 11 + end_location: + row: 38 + column: 29 + fix: ~ + parent: ~ + - kind: + name: PrivateMemberAccess + body: "Private member accessed: `_private_thing`" + suggestion: ~ + fixable: false + location: + row: 43 + column: 11 + end_location: + row: 43 + column: 29 + fix: ~ + parent: ~ + - kind: + name: PrivateMemberAccess + body: "Private member accessed: `_private_thing`" + suggestion: ~ + fixable: false + location: + row: 59 + column: 6 + end_location: + row: 59 + column: 24 + fix: ~ + parent: ~ + - kind: + name: PrivateMemberAccess + body: "Private member accessed: `__really_private_thing`" + suggestion: ~ + fixable: false + location: + row: 60 + column: 6 + end_location: + row: 60 + column: 32 + fix: ~ + parent: ~ + - kind: + name: PrivateMemberAccess + body: "Private member accessed: `_private_func`" + suggestion: ~ + fixable: false + location: + row: 61 + column: 6 + end_location: + row: 61 + column: 23 + fix: ~ + parent: ~ + - kind: + name: PrivateMemberAccess + body: "Private member accessed: `__really_private_func`" + suggestion: ~ + fixable: false + location: + row: 62 + column: 6 + end_location: + row: 62 + column: 31 + fix: ~ + parent: ~ + - kind: + name: PrivateMemberAccess + body: "Private member accessed: `_private`" + suggestion: ~ + fixable: false + location: + row: 63 + column: 6 + end_location: + row: 63 + column: 22 + fix: ~ + parent: ~ + - kind: + name: PrivateMemberAccess + body: "Private member accessed: `_private_thing`" + suggestion: ~ + fixable: false + location: + row: 64 + column: 6 + end_location: + row: 64 + column: 26 + fix: ~ + parent: ~ + - kind: + name: PrivateMemberAccess + body: "Private member accessed: `_private_thing__`" + suggestion: ~ + fixable: false + location: + row: 65 + column: 6 + end_location: + row: 65 + column: 28 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM101_SIM101.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM101_SIM101.py.snap index 3f8f7e3c8d52f1..6b0f2a5a8ec8d6 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM101_SIM101.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM101_SIM101.py.snap @@ -2,124 +2,124 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: DuplicateIsinstanceCall - body: "Multiple `isinstance` calls for `a`, merge into a single call" - suggestion: "Merge `isinstance` calls for `a`" - fixable: true - location: - row: 1 - column: 3 - end_location: - row: 1 - column: 45 - fix: - content: "isinstance(a, (int, float))" +- - kind: + name: DuplicateIsinstanceCall + body: "Multiple `isinstance` calls for `a`, merge into a single call" + suggestion: "Merge `isinstance` calls for `a`" + fixable: true location: row: 1 column: 3 end_location: row: 1 column: 45 - parent: ~ -- kind: - name: DuplicateIsinstanceCall - body: "Multiple `isinstance` calls for `a`, merge into a single call" - suggestion: "Merge `isinstance` calls for `a`" - fixable: true - location: - row: 4 - column: 3 - end_location: - row: 4 - column: 53 - fix: - content: "isinstance(a, (int, float, bool))" + fix: + content: "isinstance(a, (int, float))" + location: + row: 1 + column: 3 + end_location: + row: 1 + column: 45 + parent: ~ + - kind: + name: DuplicateIsinstanceCall + body: "Multiple `isinstance` calls for `a`, merge into a single call" + suggestion: "Merge `isinstance` calls for `a`" + fixable: true location: row: 4 column: 3 end_location: row: 4 column: 53 - parent: ~ -- kind: - name: DuplicateIsinstanceCall - body: "Multiple `isinstance` calls for `a`, merge into a single call" - suggestion: "Merge `isinstance` calls for `a`" - fixable: true - location: - row: 7 - column: 3 - end_location: - row: 7 - column: 68 - fix: - content: "isinstance(a, (int, float)) or isinstance(b, bool)" + fix: + content: "isinstance(a, (int, float, bool))" + location: + row: 4 + column: 3 + end_location: + row: 4 + column: 53 + parent: ~ + - kind: + name: DuplicateIsinstanceCall + body: "Multiple `isinstance` calls for `a`, merge into a single call" + suggestion: "Merge `isinstance` calls for `a`" + fixable: true location: row: 7 column: 3 end_location: row: 7 column: 68 - parent: ~ -- kind: - name: DuplicateIsinstanceCall - body: "Multiple `isinstance` calls for `a`, merge into a single call" - suggestion: "Merge `isinstance` calls for `a`" - fixable: true - location: - row: 10 - column: 3 - end_location: - row: 10 - column: 68 - fix: - content: "isinstance(a, (int, float)) or isinstance(b, bool)" + fix: + content: "isinstance(a, (int, float)) or isinstance(b, bool)" + location: + row: 7 + column: 3 + end_location: + row: 7 + column: 68 + parent: ~ + - kind: + name: DuplicateIsinstanceCall + body: "Multiple `isinstance` calls for `a`, merge into a single call" + suggestion: "Merge `isinstance` calls for `a`" + fixable: true location: row: 10 column: 3 end_location: row: 10 column: 68 - parent: ~ -- kind: - name: DuplicateIsinstanceCall - body: "Multiple `isinstance` calls for `a`, merge into a single call" - suggestion: "Merge `isinstance` calls for `a`" - fixable: true - location: - row: 13 - column: 3 - end_location: - row: 13 - column: 68 - fix: - content: "isinstance(a, (int, float)) or isinstance(b, bool)" + fix: + content: "isinstance(a, (int, float)) or isinstance(b, bool)" + location: + row: 10 + column: 3 + end_location: + row: 10 + column: 68 + parent: ~ + - kind: + name: DuplicateIsinstanceCall + body: "Multiple `isinstance` calls for `a`, merge into a single call" + suggestion: "Merge `isinstance` calls for `a`" + fixable: true location: row: 13 column: 3 end_location: row: 13 column: 68 - parent: ~ -- kind: - name: DuplicateIsinstanceCall - body: "Multiple `isinstance` calls for `a`, merge into a single call" - suggestion: "Merge `isinstance` calls for `a`" - fixable: true - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 46 - fix: - content: "isinstance(a, (int, float))" + fix: + content: "isinstance(a, (int, float)) or isinstance(b, bool)" + location: + row: 13 + column: 3 + end_location: + row: 13 + column: 68 + parent: ~ + - kind: + name: DuplicateIsinstanceCall + body: "Multiple `isinstance` calls for `a`, merge into a single call" + suggestion: "Merge `isinstance` calls for `a`" + fixable: true location: row: 16 column: 4 end_location: row: 16 column: 46 - parent: ~ + fix: + content: "isinstance(a, (int, float))" + location: + row: 16 + column: 4 + end_location: + row: 16 + column: 46 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM102_SIM102.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM102_SIM102.py.snap index 3ab87028c39318..37a9be04e59054 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM102_SIM102.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM102_SIM102.py.snap @@ -2,243 +2,243 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: CollapsibleIf - body: "Use a single `if` statement instead of nested `if` statements" - suggestion: "Combine `if` statements using `and`" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 3 - column: 9 - fix: - content: "if a and b:\n c\n" +- - kind: + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + suggestion: "Combine `if` statements using `and`" + fixable: true location: row: 2 column: 0 end_location: - row: 5 - column: 0 - parent: ~ -- kind: - name: CollapsibleIf - body: "Use a single `if` statement instead of nested `if` statements" - suggestion: "Combine `if` statements using `and`" - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 7 - column: 9 - fix: - content: "if a and b and c:\n d\n" + row: 3 + column: 9 + fix: + content: "if a and b:\n c\n" + location: + row: 2 + column: 0 + end_location: + row: 5 + column: 0 + parent: ~ + - kind: + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + suggestion: "Combine `if` statements using `and`" + fixable: true location: - row: 6 + row: 7 column: 0 end_location: row: 9 - column: 0 - parent: ~ -- kind: - name: CollapsibleIf - body: "Use a single `if` statement instead of nested `if` statements" - suggestion: "Combine `if` statements using `and`" - fixable: true - location: - row: 7 - column: 0 - end_location: - row: 9 - column: 13 - fix: - content: "if a and b:\n if c:\n d\n" + column: 13 + fix: + content: "if a and b:\n if c:\n d\n" + location: + row: 7 + column: 0 + end_location: + row: 11 + column: 0 + parent: ~ + - kind: + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + suggestion: "Combine `if` statements using `and`" + fixable: true location: - row: 7 + row: 15 column: 0 end_location: - row: 11 - column: 0 - parent: ~ -- kind: - name: CollapsibleIf - body: "Use a single `if` statement instead of nested `if` statements" - suggestion: "Combine `if` statements using `and`" - fixable: true - location: - row: 15 - column: 0 - end_location: - row: 16 - column: 9 - fix: - content: "elif b and c:\n d\n" + row: 16 + column: 9 + fix: + content: "elif b and c:\n d\n" + location: + row: 15 + column: 0 + end_location: + row: 18 + column: 0 + parent: ~ + - kind: + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + suggestion: ~ + fixable: false location: - row: 15 + row: 20 column: 0 end_location: - row: 18 - column: 0 - parent: ~ -- kind: - name: CollapsibleIf - body: "Use a single `if` statement instead of nested `if` statements" - suggestion: ~ - fixable: false - location: - row: 16 - column: 0 - end_location: - row: 18 - column: 9 - fix: ~ - parent: ~ -- kind: - name: CollapsibleIf - body: "Use a single `if` statement instead of nested `if` statements" - suggestion: ~ - fixable: false - location: - row: 17 - column: 0 - end_location: - row: 19 - column: 9 - fix: ~ - parent: ~ -- kind: - name: CollapsibleIf - body: "Use a single `if` statement instead of nested `if` statements" - suggestion: ~ - fixable: false - location: - row: 20 - column: 0 - end_location: - row: 22 - column: 9 - fix: ~ - parent: ~ -- kind: - name: CollapsibleIf - body: "Use a single `if` statement instead of nested `if` statements" - suggestion: "Combine `if` statements using `and`" - fixable: true - location: - row: 26 - column: 0 - end_location: - row: 27 - column: 9 - fix: - content: "if a and b:\n # Fixable due to placement of this comment.\n c\n" + row: 22 + column: 9 + fix: ~ + parent: ~ + - kind: + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + suggestion: "Combine `if` statements using `and`" + fixable: true location: row: 26 column: 0 end_location: - row: 30 - column: 0 - parent: ~ -- kind: - name: CollapsibleIf - body: "Use a single `if` statement instead of nested `if` statements" - suggestion: "Combine `if` statements using `and`" - fixable: true - location: - row: 51 - column: 4 - end_location: - row: 52 - column: 16 - fix: - content: " if True and True:\n \"\"\"this\nis valid\"\"\"\n\n \"\"\"the indentation on\n this line is significant\"\"\"\n\n \"this is\" \\\n\"allowed too\"\n\n (\"so is\"\n\"this for some reason\")\n" + row: 27 + column: 9 + fix: + content: "if a and b:\n # Fixable due to placement of this comment.\n c\n" + location: + row: 26 + column: 0 + end_location: + row: 30 + column: 0 + parent: ~ + - kind: + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + suggestion: "Combine `if` statements using `and`" + fixable: true location: row: 51 - column: 0 + column: 4 end_location: - row: 64 - column: 0 - parent: ~ -- kind: - name: CollapsibleIf - body: "Use a single `if` statement instead of nested `if` statements" - suggestion: "Combine `if` statements using `and`" - fixable: true - location: - row: 67 - column: 0 - end_location: - row: 68 - column: 12 - fix: - content: "if True and True:\n \"\"\"this\nis valid\"\"\"\n\n \"\"\"the indentation on\n this line is significant\"\"\"\n\n \"this is\" \\\n\"allowed too\"\n\n (\"so is\"\n\"this for some reason\")\n" + row: 52 + column: 16 + fix: + content: " if True and True:\n \"\"\"this\nis valid\"\"\"\n\n \"\"\"the indentation on\n this line is significant\"\"\"\n\n \"this is\" \\\n\"allowed too\"\n\n (\"so is\"\n\"this for some reason\")\n" + location: + row: 51 + column: 0 + end_location: + row: 64 + column: 0 + parent: ~ + - kind: + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + suggestion: "Combine `if` statements using `and`" + fixable: true location: row: 67 column: 0 end_location: - row: 80 - column: 0 - parent: ~ -- kind: - name: CollapsibleIf - body: "Use a single `if` statement instead of nested `if` statements" - suggestion: "Combine `if` statements using `and`" - fixable: true - location: - row: 83 - column: 4 - end_location: - row: 86 - column: 10 - fix: - content: " if node.module and (node.module == \"multiprocessing\" or node.module.startswith(\n \"multiprocessing.\"\n )):\n print(\"Bad module!\")\n" + row: 68 + column: 12 + fix: + content: "if True and True:\n \"\"\"this\nis valid\"\"\"\n\n \"\"\"the indentation on\n this line is significant\"\"\"\n\n \"this is\" \\\n\"allowed too\"\n\n (\"so is\"\n\"this for some reason\")\n" + location: + row: 67 + column: 0 + end_location: + row: 80 + column: 0 + parent: ~ + - kind: + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + suggestion: "Combine `if` statements using `and`" + fixable: true location: row: 83 - column: 0 + column: 4 end_location: - row: 88 - column: 0 - parent: ~ -- kind: - name: CollapsibleIf - body: "Use a single `if` statement instead of nested `if` statements" - suggestion: "Combine `if` statements using `and`" - fixable: true - location: - row: 90 - column: 0 - end_location: - row: 93 - column: 6 - fix: - content: "if node.module and (node.module == \"multiprocessing\" or node.module.startswith(\n \"multiprocessing.\"\n)):\n print(\"Bad module!\")\n" + row: 86 + column: 10 + fix: + content: " if node.module and (node.module == \"multiprocessing\" or node.module.startswith(\n \"multiprocessing.\"\n )):\n print(\"Bad module!\")\n" + location: + row: 83 + column: 0 + end_location: + row: 88 + column: 0 + parent: ~ + - kind: + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + suggestion: "Combine `if` statements using `and`" + fixable: true location: row: 90 column: 0 end_location: - row: 95 - column: 0 - parent: ~ -- kind: - name: CollapsibleIf - body: "Use a single `if` statement instead of nested `if` statements" - suggestion: "Combine `if` statements using `and`" - fixable: true - location: - row: 117 - column: 4 - end_location: - row: 118 - column: 13 - fix: - content: " if b and c:\n print(\"foo\")\n" + row: 93 + column: 6 + fix: + content: "if node.module and (node.module == \"multiprocessing\" or node.module.startswith(\n \"multiprocessing.\"\n)):\n print(\"Bad module!\")\n" + location: + row: 90 + column: 0 + end_location: + row: 95 + column: 0 + parent: ~ + - kind: + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + suggestion: "Combine `if` statements using `and`" + fixable: true location: row: 117 + column: 4 + end_location: + row: 118 + column: 13 + fix: + content: " if b and c:\n print(\"foo\")\n" + location: + row: 117 + column: 0 + end_location: + row: 120 + column: 0 + parent: ~ +- - kind: + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + suggestion: "Combine `if` statements using `and`" + fixable: true + location: + row: 6 column: 0 end_location: - row: 120 + row: 7 + column: 9 + fix: + content: "if a and b and c:\n d\n" + location: + row: 6 + column: 0 + end_location: + row: 9 + column: 0 + parent: ~ + - kind: + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + suggestion: ~ + fixable: false + location: + row: 17 + column: 0 + end_location: + row: 19 + column: 9 + fix: ~ + parent: ~ +- - kind: + name: CollapsibleIf + body: "Use a single `if` statement instead of nested `if` statements" + suggestion: ~ + fixable: false + location: + row: 16 column: 0 - parent: ~ + end_location: + row: 18 + column: 9 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM103_SIM103.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM103_SIM103.py.snap index eeba8a0ec62b6e..6554d37fd27ef5 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM103_SIM103.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM103_SIM103.py.snap @@ -2,136 +2,136 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: NeedlessBool - body: "Return the condition `a` directly" - suggestion: "Replace with `return a`" - fixable: true - location: - row: 3 - column: 4 - end_location: - row: 6 - column: 20 - fix: - content: return bool(a) +- - kind: + name: NeedlessBool + body: "Return the condition `a` directly" + suggestion: "Replace with `return a`" + fixable: true location: row: 3 column: 4 end_location: row: 6 column: 20 - parent: ~ -- kind: - name: NeedlessBool - body: "Return the condition `a == b` directly" - suggestion: "Replace with `return a == b`" - fixable: true - location: - row: 11 - column: 4 - end_location: - row: 14 - column: 20 - fix: - content: return a == b + fix: + content: return bool(a) + location: + row: 3 + column: 4 + end_location: + row: 6 + column: 20 + parent: ~ + - kind: + name: NeedlessBool + body: "Return the condition `a == b` directly" + suggestion: "Replace with `return a == b`" + fixable: true location: row: 11 column: 4 end_location: row: 14 column: 20 - parent: ~ -- kind: - name: NeedlessBool - body: "Return the condition `b` directly" - suggestion: "Replace with `return b`" - fixable: true - location: - row: 21 - column: 4 - end_location: - row: 24 - column: 20 - fix: - content: return bool(b) + fix: + content: return a == b + location: + row: 11 + column: 4 + end_location: + row: 14 + column: 20 + parent: ~ + - kind: + name: NeedlessBool + body: "Return the condition `b` directly" + suggestion: "Replace with `return b`" + fixable: true location: row: 21 column: 4 end_location: row: 24 column: 20 - parent: ~ -- kind: - name: NeedlessBool - body: "Return the condition `b` directly" - suggestion: "Replace with `return b`" - fixable: true - location: - row: 32 - column: 8 - end_location: - row: 35 - column: 24 - fix: - content: return bool(b) + fix: + content: return bool(b) + location: + row: 21 + column: 4 + end_location: + row: 24 + column: 20 + parent: ~ + - kind: + name: NeedlessBool + body: "Return the condition `b` directly" + suggestion: "Replace with `return b`" + fixable: true location: row: 32 column: 8 end_location: row: 35 column: 24 - parent: ~ -- kind: - name: NeedlessBool - body: "Return the condition `a` directly" - suggestion: ~ - fixable: false - location: - row: 45 - column: 4 - end_location: - row: 48 - column: 19 - fix: ~ - parent: ~ -- kind: - name: NeedlessBool - body: "Return the condition `a` directly" - suggestion: ~ - fixable: false - location: - row: 57 - column: 4 - end_location: - row: 60 - column: 19 - fix: ~ - parent: ~ -- kind: - name: NeedlessBool - body: "Return the condition `a` directly" - suggestion: ~ - fixable: false - location: - row: 71 - column: 4 - end_location: - row: 74 - column: 20 - fix: ~ - parent: ~ -- kind: - name: NeedlessBool - body: "Return the condition `a` directly" - suggestion: ~ - fixable: false - location: - row: 83 - column: 4 - end_location: - row: 86 - column: 20 - fix: ~ - parent: ~ + fix: + content: return bool(b) + location: + row: 32 + column: 8 + end_location: + row: 35 + column: 24 + parent: ~ + - kind: + name: NeedlessBool + body: "Return the condition `a` directly" + suggestion: ~ + fixable: false + location: + row: 57 + column: 4 + end_location: + row: 60 + column: 19 + fix: ~ + parent: ~ + - kind: + name: NeedlessBool + body: "Return the condition `a` directly" + suggestion: ~ + fixable: false + location: + row: 83 + column: 4 + end_location: + row: 86 + column: 20 + fix: ~ + parent: ~ +- - kind: + name: NeedlessBool + body: "Return the condition `a` directly" + suggestion: ~ + fixable: false + location: + row: 45 + column: 4 + end_location: + row: 48 + column: 19 + fix: ~ + parent: ~ + - kind: + name: NeedlessBool + body: "Return the condition `a` directly" + suggestion: ~ + fixable: false + location: + row: 71 + column: 4 + end_location: + row: 74 + column: 20 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM105_SIM105.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM105_SIM105.py.snap index 36448613b2603b..d3646368ea2f3e 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM105_SIM105.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM105_SIM105.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: UseContextlibSuppress - body: "Use `contextlib.suppress(ValueError)` instead of try-except-pass" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 7 - column: 8 - fix: ~ - parent: ~ -- kind: - name: UseContextlibSuppress - body: "Use `contextlib.suppress(ValueError, OSError)` instead of try-except-pass" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 12 - column: 8 - fix: ~ - parent: ~ -- kind: - name: UseContextlibSuppress - body: "Use `contextlib.suppress(Exception)` instead of try-except-pass" - suggestion: ~ - fixable: false - location: - row: 14 - column: 0 - end_location: - row: 17 - column: 8 - fix: ~ - parent: ~ -- kind: - name: UseContextlibSuppress - body: "Use `contextlib.suppress(a.Error, b.Error)` instead of try-except-pass" - suggestion: ~ - fixable: false - location: - row: 19 - column: 0 - end_location: - row: 22 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: UseContextlibSuppress + body: "Use `contextlib.suppress(ValueError)` instead of try-except-pass" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 7 + column: 8 + fix: ~ + parent: ~ + - kind: + name: UseContextlibSuppress + body: "Use `contextlib.suppress(ValueError, OSError)` instead of try-except-pass" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 12 + column: 8 + fix: ~ + parent: ~ + - kind: + name: UseContextlibSuppress + body: "Use `contextlib.suppress(Exception)` instead of try-except-pass" + suggestion: ~ + fixable: false + location: + row: 14 + column: 0 + end_location: + row: 17 + column: 8 + fix: ~ + parent: ~ + - kind: + name: UseContextlibSuppress + body: "Use `contextlib.suppress(a.Error, b.Error)` instead of try-except-pass" + suggestion: ~ + fixable: false + location: + row: 19 + column: 0 + end_location: + row: 22 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM107_SIM107.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM107_SIM107.py.snap index e2b7b3beb90a15..c5616d9af9a6c8 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM107_SIM107.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM107_SIM107.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: ReturnInTryExceptFinally - body: "Don't use `return` in `try`/`except` and `finally`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 8 - end_location: - row: 9 - column: 18 - fix: ~ - parent: ~ +- - kind: + name: ReturnInTryExceptFinally + body: "Don't use `return` in `try`/`except` and `finally`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 8 + end_location: + row: 9 + column: 18 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM108_SIM108.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM108_SIM108.py.snap index 0a1e2bb94b44b8..26a1251ffe9a1e 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM108_SIM108.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM108_SIM108.py.snap @@ -2,148 +2,148 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: UseTernaryOperator - body: "Use ternary operator `b = c if a else d` instead of `if`-`else`-block" - suggestion: "Replace `if`-`else`-block with `b = c if a else d`" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 5 - column: 9 - fix: - content: b = c if a else d +- - kind: + name: UseTernaryOperator + body: "Use ternary operator `b = c if a else d` instead of `if`-`else`-block" + suggestion: "Replace `if`-`else`-block with `b = c if a else d`" + fixable: true location: row: 2 column: 0 end_location: row: 5 column: 9 - parent: ~ -- kind: - name: UseTernaryOperator - body: "Use ternary operator `abc = x if x > 0 else -x` instead of `if`-`else`-block" - suggestion: ~ - fixable: false - location: - row: 55 - column: 0 - end_location: - row: 60 - column: 12 - fix: ~ - parent: ~ -- kind: - name: UseTernaryOperator - body: "Use ternary operator `abc = x if x > 0 else -x` instead of `if`-`else`-block" - suggestion: ~ - fixable: false - location: - row: 58 - column: 0 - end_location: - row: 63 - column: 12 - fix: ~ - parent: ~ -- kind: - name: UseTernaryOperator - body: "Use ternary operator `b = cccccccccccccccccccccccccccccccccccc if a else ddddddddddddddddddddddddddddddddddddd` instead of `if`-`else`-block" - suggestion: "Replace `if`-`else`-block with `b = cccccccccccccccccccccccccccccccccccc if a else ddddddddddddddddddddddddddddddddddddd`" - fixable: true - location: - row: 82 - column: 0 - end_location: - row: 85 - column: 45 - fix: - content: b = cccccccccccccccccccccccccccccccccccc if a else ddddddddddddddddddddddddddddddddddddd + fix: + content: b = c if a else d + location: + row: 2 + column: 0 + end_location: + row: 5 + column: 9 + parent: ~ + - kind: + name: UseTernaryOperator + body: "Use ternary operator `abc = x if x > 0 else -x` instead of `if`-`else`-block" + suggestion: ~ + fixable: false + location: + row: 58 + column: 0 + end_location: + row: 63 + column: 12 + fix: ~ + parent: ~ + - kind: + name: UseTernaryOperator + body: "Use ternary operator `b = cccccccccccccccccccccccccccccccccccc if a else ddddddddddddddddddddddddddddddddddddd` instead of `if`-`else`-block" + suggestion: "Replace `if`-`else`-block with `b = cccccccccccccccccccccccccccccccccccc if a else ddddddddddddddddddddddddddddddddddddd`" + fixable: true location: row: 82 column: 0 end_location: row: 85 column: 45 - parent: ~ -- kind: - name: UseTernaryOperator - body: "Use ternary operator `exitcode = 0 if True else 1` instead of `if`-`else`-block" - suggestion: ~ - fixable: false - location: - row: 91 - column: 0 - end_location: - row: 94 - column: 16 - fix: ~ - parent: ~ -- kind: - name: UseTernaryOperator - body: "Use ternary operator `exitcode = 0 if True else 1` instead of `if`-`else`-block" - suggestion: ~ - fixable: false - location: - row: 97 - column: 0 - end_location: - row: 100 - column: 16 - fix: ~ - parent: ~ -- kind: - name: UseTernaryOperator - body: "Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block" - suggestion: ~ - fixable: false - location: - row: 98 - column: 0 - end_location: - row: 99 - column: 11 - fix: ~ - parent: ~ -- kind: - name: UseTernaryOperator - body: "Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block" - suggestion: ~ - fixable: false - location: - row: 103 - column: 0 - end_location: - row: 106 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UseTernaryOperator - body: "Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block" - suggestion: ~ - fixable: false - location: - row: 104 - column: 0 - end_location: - row: 105 - column: 11 - fix: ~ - parent: ~ -- kind: - name: UseTernaryOperator - body: "Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block" - suggestion: ~ - fixable: false - location: - row: 109 - column: 0 - end_location: - row: 112 - column: 9 - fix: ~ - parent: ~ + fix: + content: b = cccccccccccccccccccccccccccccccccccc if a else ddddddddddddddddddddddddddddddddddddd + location: + row: 82 + column: 0 + end_location: + row: 85 + column: 45 + parent: ~ + - kind: + name: UseTernaryOperator + body: "Use ternary operator `exitcode = 0 if True else 1` instead of `if`-`else`-block" + suggestion: ~ + fixable: false + location: + row: 97 + column: 0 + end_location: + row: 100 + column: 16 + fix: ~ + parent: ~ + - kind: + name: UseTernaryOperator + body: "Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block" + suggestion: ~ + fixable: false + location: + row: 104 + column: 0 + end_location: + row: 105 + column: 11 + fix: ~ + parent: ~ + - kind: + name: UseTernaryOperator + body: "Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block" + suggestion: ~ + fixable: false + location: + row: 109 + column: 0 + end_location: + row: 112 + column: 9 + fix: ~ + parent: ~ +- - kind: + name: UseTernaryOperator + body: "Use ternary operator `abc = x if x > 0 else -x` instead of `if`-`else`-block" + suggestion: ~ + fixable: false + location: + row: 55 + column: 0 + end_location: + row: 60 + column: 12 + fix: ~ + parent: ~ + - kind: + name: UseTernaryOperator + body: "Use ternary operator `exitcode = 0 if True else 1` instead of `if`-`else`-block" + suggestion: ~ + fixable: false + location: + row: 91 + column: 0 + end_location: + row: 94 + column: 16 + fix: ~ + parent: ~ + - kind: + name: UseTernaryOperator + body: "Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block" + suggestion: ~ + fixable: false + location: + row: 98 + column: 0 + end_location: + row: 99 + column: 11 + fix: ~ + parent: ~ + - kind: + name: UseTernaryOperator + body: "Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block" + suggestion: ~ + fixable: false + location: + row: 103 + column: 0 + end_location: + row: 106 + column: 9 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM109_SIM109.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM109_SIM109.py.snap index aa33b925aafe40..fdde3fe8148af0 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM109_SIM109.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM109_SIM109.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: CompareWithTuple - body: "Use `a in (b, c)` instead of multiple equality comparisons" - suggestion: "Replace with `a in (b, c)`" - fixable: true - location: - row: 2 - column: 3 - end_location: - row: 2 - column: 19 - fix: - content: "a in (b, c)" +- - kind: + name: CompareWithTuple + body: "Use `a in (b, c)` instead of multiple equality comparisons" + suggestion: "Replace with `a in (b, c)`" + fixable: true location: row: 2 column: 3 end_location: row: 2 column: 19 - parent: ~ -- kind: - name: CompareWithTuple - body: "Use `a in (b, c)` instead of multiple equality comparisons" - suggestion: "Replace with `a in (b, c)`" - fixable: true - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 20 - fix: - content: "a in (b, c)" + fix: + content: "a in (b, c)" + location: + row: 2 + column: 3 + end_location: + row: 2 + column: 19 + parent: ~ + - kind: + name: CompareWithTuple + body: "Use `a in (b, c)` instead of multiple equality comparisons" + suggestion: "Replace with `a in (b, c)`" + fixable: true location: row: 6 column: 4 end_location: row: 6 column: 20 - parent: ~ -- kind: - name: CompareWithTuple - body: "Use `a in (b, c)` instead of multiple equality comparisons" - suggestion: "Replace with `a in (b, c)`" - fixable: true - location: - row: 10 - column: 3 - end_location: - row: 10 - column: 27 - fix: - content: "a in (b, c) or None" + fix: + content: "a in (b, c)" + location: + row: 6 + column: 4 + end_location: + row: 6 + column: 20 + parent: ~ + - kind: + name: CompareWithTuple + body: "Use `a in (b, c)` instead of multiple equality comparisons" + suggestion: "Replace with `a in (b, c)`" + fixable: true location: row: 10 column: 3 end_location: row: 10 column: 27 - parent: ~ -- kind: - name: CompareWithTuple - body: "Use `a in (b, c)` instead of multiple equality comparisons" - suggestion: "Replace with `a in (b, c)`" - fixable: true - location: - row: 14 - column: 3 - end_location: - row: 14 - column: 27 - fix: - content: "a in (b, c) or None" + fix: + content: "a in (b, c) or None" + location: + row: 10 + column: 3 + end_location: + row: 10 + column: 27 + parent: ~ + - kind: + name: CompareWithTuple + body: "Use `a in (b, c)` instead of multiple equality comparisons" + suggestion: "Replace with `a in (b, c)`" + fixable: true location: row: 14 column: 3 end_location: row: 14 column: 27 - parent: ~ + fix: + content: "a in (b, c) or None" + location: + row: 14 + column: 3 + end_location: + row: 14 + column: 27 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM110.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM110.py.snap index f6ed711250dba0..665cdec3bcfa7c 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM110.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM110.py.snap @@ -2,236 +2,236 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: ReimplementedBuiltin - body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return any(check(x) for x in iterable)`" - fixable: true - location: - row: 3 - column: 4 - end_location: - row: 5 - column: 23 - fix: - content: return any(check(x) for x in iterable) +- - kind: + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 3 column: 4 end_location: - row: 6 - column: 16 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return all(not check(x) for x in iterable)`" - fixable: true - location: - row: 25 - column: 4 - end_location: - row: 27 - column: 24 - fix: - content: return all(not check(x) for x in iterable) + row: 5 + column: 23 + fix: + content: return any(check(x) for x in iterable) + location: + row: 3 + column: 4 + end_location: + row: 6 + column: 16 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 25 column: 4 end_location: - row: 28 - column: 15 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return all(x.is_empty() for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return all(x.is_empty() for x in iterable)`" - fixable: true - location: - row: 33 - column: 4 - end_location: - row: 35 - column: 24 - fix: - content: return all(x.is_empty() for x in iterable) + row: 27 + column: 24 + fix: + content: return all(not check(x) for x in iterable) + location: + row: 25 + column: 4 + end_location: + row: 28 + column: 15 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return all(x.is_empty() for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return all(x.is_empty() for x in iterable)`" + fixable: true location: row: 33 column: 4 end_location: - row: 36 - column: 15 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return any(check(x) for x in iterable)`" - fixable: true - location: - row: 55 - column: 4 - end_location: - row: 59 - column: 20 - fix: - content: return any(check(x) for x in iterable) + row: 35 + column: 24 + fix: + content: return all(x.is_empty() for x in iterable) + location: + row: 33 + column: 4 + end_location: + row: 36 + column: 15 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 55 column: 4 end_location: row: 59 column: 20 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return all(not check(x) for x in iterable)`" - fixable: true - location: - row: 64 - column: 4 - end_location: - row: 68 - column: 19 - fix: - content: return all(not check(x) for x in iterable) + fix: + content: return any(check(x) for x in iterable) + location: + row: 55 + column: 4 + end_location: + row: 59 + column: 20 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 64 column: 4 end_location: row: 68 column: 19 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return any(check(x) for x in iterable)`" - fixable: true - location: - row: 73 - column: 4 - end_location: - row: 77 - column: 20 - fix: - content: return any(check(x) for x in iterable) + fix: + content: return all(not check(x) for x in iterable) + location: + row: 64 + column: 4 + end_location: + row: 68 + column: 19 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 73 column: 4 end_location: row: 77 column: 20 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return all(not check(x) for x in iterable)`" - fixable: true - location: - row: 83 - column: 4 - end_location: - row: 87 - column: 19 - fix: - content: return all(not check(x) for x in iterable) + fix: + content: return any(check(x) for x in iterable) + location: + row: 73 + column: 4 + end_location: + row: 77 + column: 20 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 83 column: 4 end_location: row: 87 column: 19 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return any(check(x) for x in iterable)`" - fixable: true - location: - row: 99 - column: 4 - end_location: - row: 101 - column: 23 - fix: ~ - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return all(not check(x) for x in iterable)`" - fixable: true - location: - row: 109 - column: 4 - end_location: - row: 111 - column: 24 - fix: ~ - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return any(check(x) for x in iterable)`" - fixable: true - location: - row: 124 - column: 4 - end_location: - row: 126 - column: 23 - fix: ~ - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return all(not check(x) for x in iterable)`" - fixable: true - location: - row: 134 - column: 4 - end_location: - row: 136 - column: 24 - fix: ~ - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return any(check(x) for x in iterable)`" - fixable: true - location: - row: 144 - column: 4 - end_location: - row: 146 - column: 23 - fix: - content: return any(check(x) for x in iterable) + fix: + content: return all(not check(x) for x in iterable) + location: + row: 83 + column: 4 + end_location: + row: 87 + column: 19 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return any(check(x) for x in iterable)`" + fixable: true + location: + row: 124 + column: 4 + end_location: + row: 126 + column: 23 + fix: ~ + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true + location: + row: 134 + column: 4 + end_location: + row: 136 + column: 24 + fix: ~ + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 144 column: 4 end_location: - row: 147 - column: 16 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return all(not check(x) for x in iterable)`" - fixable: true - location: - row: 154 - column: 4 - end_location: - row: 156 - column: 24 - fix: - content: return all(not check(x) for x in iterable) + row: 146 + column: 23 + fix: + content: return any(check(x) for x in iterable) + location: + row: 144 + column: 4 + end_location: + row: 147 + column: 16 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 154 column: 4 end_location: - row: 157 - column: 15 - parent: ~ + row: 156 + column: 24 + fix: + content: return all(not check(x) for x in iterable) + location: + row: 154 + column: 4 + end_location: + row: 157 + column: 15 + parent: ~ +- - kind: + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return any(check(x) for x in iterable)`" + fixable: true + location: + row: 99 + column: 4 + end_location: + row: 101 + column: 23 + fix: ~ + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true + location: + row: 109 + column: 4 + end_location: + row: 111 + column: 24 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM111.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM111.py.snap index 6f79de00254ddf..ce14f9b0db5255 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM111.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM111.py.snap @@ -2,276 +2,276 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: ReimplementedBuiltin - body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return any(check(x) for x in iterable)`" - fixable: true - location: - row: 3 - column: 4 - end_location: - row: 5 - column: 23 - fix: - content: return any(check(x) for x in iterable) +- - kind: + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 3 column: 4 end_location: - row: 6 - column: 16 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return all(not check(x) for x in iterable)`" - fixable: true - location: - row: 25 - column: 4 - end_location: - row: 27 - column: 24 - fix: - content: return all(not check(x) for x in iterable) + row: 5 + column: 23 + fix: + content: return any(check(x) for x in iterable) + location: + row: 3 + column: 4 + end_location: + row: 6 + column: 16 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 25 column: 4 end_location: - row: 28 - column: 15 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return all(x.is_empty() for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return all(x.is_empty() for x in iterable)`" - fixable: true - location: - row: 33 - column: 4 - end_location: - row: 35 - column: 24 - fix: - content: return all(x.is_empty() for x in iterable) + row: 27 + column: 24 + fix: + content: return all(not check(x) for x in iterable) + location: + row: 25 + column: 4 + end_location: + row: 28 + column: 15 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return all(x.is_empty() for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return all(x.is_empty() for x in iterable)`" + fixable: true location: row: 33 column: 4 end_location: - row: 36 - column: 15 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return any(check(x) for x in iterable)`" - fixable: true - location: - row: 55 - column: 4 - end_location: - row: 59 - column: 20 - fix: - content: return any(check(x) for x in iterable) + row: 35 + column: 24 + fix: + content: return all(x.is_empty() for x in iterable) + location: + row: 33 + column: 4 + end_location: + row: 36 + column: 15 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 55 column: 4 end_location: row: 59 column: 20 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return all(not check(x) for x in iterable)`" - fixable: true - location: - row: 64 - column: 4 - end_location: - row: 68 - column: 19 - fix: - content: return all(not check(x) for x in iterable) + fix: + content: return any(check(x) for x in iterable) + location: + row: 55 + column: 4 + end_location: + row: 59 + column: 20 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 64 column: 4 end_location: row: 68 column: 19 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return any(check(x) for x in iterable)`" - fixable: true - location: - row: 73 - column: 4 - end_location: - row: 77 - column: 20 - fix: - content: return any(check(x) for x in iterable) + fix: + content: return all(not check(x) for x in iterable) + location: + row: 64 + column: 4 + end_location: + row: 68 + column: 19 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 73 column: 4 end_location: row: 77 column: 20 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return all(not check(x) for x in iterable)`" - fixable: true - location: - row: 83 - column: 4 - end_location: - row: 87 - column: 19 - fix: - content: return all(not check(x) for x in iterable) + fix: + content: return any(check(x) for x in iterable) + location: + row: 73 + column: 4 + end_location: + row: 77 + column: 20 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 83 column: 4 end_location: row: 87 column: 19 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return any(check(x) for x in iterable)`" - fixable: true - location: - row: 99 - column: 4 - end_location: - row: 101 - column: 23 - fix: ~ - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return all(not check(x) for x in iterable)`" - fixable: true - location: - row: 109 - column: 4 - end_location: - row: 111 - column: 24 - fix: ~ - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return any(check(x) for x in iterable)`" - fixable: true - location: - row: 124 - column: 4 - end_location: - row: 126 - column: 23 - fix: ~ - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return all(not check(x) for x in iterable)`" - fixable: true - location: - row: 134 - column: 4 - end_location: - row: 136 - column: 24 - fix: ~ - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return any(check(x) for x in iterable)`" - fixable: true - location: - row: 144 - column: 4 - end_location: - row: 146 - column: 23 - fix: - content: return any(check(x) for x in iterable) + fix: + content: return all(not check(x) for x in iterable) + location: + row: 83 + column: 4 + end_location: + row: 87 + column: 19 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return any(check(x) for x in iterable)`" + fixable: true + location: + row: 124 + column: 4 + end_location: + row: 126 + column: 23 + fix: ~ + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true + location: + row: 134 + column: 4 + end_location: + row: 136 + column: 24 + fix: ~ + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return any(check(x) for x in iterable)`" + fixable: true location: row: 144 column: 4 end_location: - row: 147 - column: 16 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return all(not check(x) for x in iterable)`" - fixable: true - location: - row: 154 - column: 4 - end_location: - row: 156 - column: 24 - fix: - content: return all(not check(x) for x in iterable) + row: 146 + column: 23 + fix: + content: return any(check(x) for x in iterable) + location: + row: 144 + column: 4 + end_location: + row: 147 + column: 16 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true location: row: 154 column: 4 end_location: - row: 157 - column: 15 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return all(x in y for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return all(x in y for x in iterable)`" - fixable: true - location: - row: 162 - column: 4 - end_location: - row: 164 - column: 24 - fix: - content: return all(x in y for x in iterable) + row: 156 + column: 24 + fix: + content: return all(not check(x) for x in iterable) + location: + row: 154 + column: 4 + end_location: + row: 157 + column: 15 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return all(x in y for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return all(x in y for x in iterable)`" + fixable: true location: row: 162 column: 4 end_location: - row: 165 - column: 15 - parent: ~ -- kind: - name: ReimplementedBuiltin - body: "Use `return all(x <= y for x in iterable)` instead of `for` loop" - suggestion: "Replace with `return all(x <= y for x in iterable)`" - fixable: true - location: - row: 170 - column: 4 - end_location: - row: 172 - column: 24 - fix: - content: return all(x <= y for x in iterable) + row: 164 + column: 24 + fix: + content: return all(x in y for x in iterable) + location: + row: 162 + column: 4 + end_location: + row: 165 + column: 15 + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return all(x <= y for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return all(x <= y for x in iterable)`" + fixable: true location: row: 170 column: 4 end_location: - row: 173 - column: 15 - parent: ~ + row: 172 + column: 24 + fix: + content: return all(x <= y for x in iterable) + location: + row: 170 + column: 4 + end_location: + row: 173 + column: 15 + parent: ~ +- - kind: + name: ReimplementedBuiltin + body: "Use `return any(check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return any(check(x) for x in iterable)`" + fixable: true + location: + row: 99 + column: 4 + end_location: + row: 101 + column: 23 + fix: ~ + parent: ~ + - kind: + name: ReimplementedBuiltin + body: "Use `return all(not check(x) for x in iterable)` instead of `for` loop" + suggestion: "Replace with `return all(not check(x) for x in iterable)`" + fixable: true + location: + row: 109 + column: 4 + end_location: + row: 111 + column: 24 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM112_SIM112.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM112_SIM112.py.snap index 0a1ee784c2dc99..78d750d5303201 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM112_SIM112.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM112_SIM112.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: UseCapitalEnvironmentVariables - body: "Use capitalized environment variable `FOO` instead of `foo`" - suggestion: "Replace `foo` with `FOO`" - fixable: true - location: - row: 4 - column: 11 - end_location: - row: 4 - column: 16 - fix: - content: "'FOO'" +- - kind: + name: UseCapitalEnvironmentVariables + body: "Use capitalized environment variable `FOO` instead of `foo`" + suggestion: "Replace `foo` with `FOO`" + fixable: true location: row: 4 column: 11 end_location: row: 4 column: 16 - parent: ~ -- kind: - name: UseCapitalEnvironmentVariables - body: "Use capitalized environment variable `FOO` instead of `foo`" - suggestion: "Replace `foo` with `FOO`" - fixable: true - location: - row: 6 - column: 15 - end_location: - row: 6 - column: 20 - fix: - content: "'FOO'" + fix: + content: "'FOO'" + location: + row: 4 + column: 11 + end_location: + row: 4 + column: 16 + parent: ~ + - kind: + name: UseCapitalEnvironmentVariables + body: "Use capitalized environment variable `FOO` instead of `foo`" + suggestion: "Replace `foo` with `FOO`" + fixable: true location: row: 6 column: 15 end_location: row: 6 column: 20 - parent: ~ -- kind: - name: UseCapitalEnvironmentVariables - body: "Use capitalized environment variable `FOO` instead of `foo`" - suggestion: "Replace `foo` with `FOO`" - fixable: true - location: - row: 8 - column: 15 - end_location: - row: 8 - column: 20 - fix: - content: "'FOO'" + fix: + content: "'FOO'" + location: + row: 6 + column: 15 + end_location: + row: 6 + column: 20 + parent: ~ + - kind: + name: UseCapitalEnvironmentVariables + body: "Use capitalized environment variable `FOO` instead of `foo`" + suggestion: "Replace `foo` with `FOO`" + fixable: true location: row: 8 column: 15 end_location: row: 8 column: 20 - parent: ~ -- kind: - name: UseCapitalEnvironmentVariables - body: "Use capitalized environment variable `FOO` instead of `foo`" - suggestion: "Replace `foo` with `FOO`" - fixable: true - location: - row: 10 - column: 10 - end_location: - row: 10 - column: 15 - fix: - content: "'FOO'" + fix: + content: "'FOO'" + location: + row: 8 + column: 15 + end_location: + row: 8 + column: 20 + parent: ~ + - kind: + name: UseCapitalEnvironmentVariables + body: "Use capitalized environment variable `FOO` instead of `foo`" + suggestion: "Replace `foo` with `FOO`" + fixable: true location: row: 10 column: 10 end_location: row: 10 column: 15 - parent: ~ + fix: + content: "'FOO'" + location: + row: 10 + column: 10 + end_location: + row: 10 + column: 15 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM114_SIM114.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM114_SIM114.py.snap index 3185d28892bc58..1bd827ce2f64a1 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM114_SIM114.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM114_SIM114.py.snap @@ -2,108 +2,108 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: IfWithSameArms - body: "Combine `if` branches using logical `or` operator" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 5 - column: 5 - fix: ~ - parent: ~ -- kind: - name: IfWithSameArms - body: "Combine `if` branches using logical `or` operator" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 12 - column: 22 - fix: ~ - parent: ~ -- kind: - name: IfWithSameArms - body: "Combine `if` branches using logical `or` operator" - suggestion: ~ - fixable: false - location: - row: 14 - column: 0 - end_location: - row: 21 - column: 26 - fix: ~ - parent: ~ -- kind: - name: IfWithSameArms - body: "Combine `if` branches using logical `or` operator" - suggestion: ~ - fixable: false - location: - row: 23 - column: 0 - end_location: - row: 36 - column: 26 - fix: ~ - parent: ~ -- kind: - name: IfWithSameArms - body: "Combine `if` branches using logical `or` operator" - suggestion: ~ - fixable: false - location: - row: 24 - column: 4 - end_location: - row: 29 - column: 26 - fix: ~ - parent: ~ -- kind: - name: IfWithSameArms - body: "Combine `if` branches using logical `or` operator" - suggestion: ~ - fixable: false - location: - row: 31 - column: 4 - end_location: - row: 36 - column: 26 - fix: ~ - parent: ~ -- kind: - name: IfWithSameArms - body: "Combine `if` branches using logical `or` operator" - suggestion: ~ - fixable: false - location: - row: 38 - column: 0 - end_location: - row: 56 - column: 8 - fix: ~ - parent: ~ -- kind: - name: IfWithSameArms - body: "Combine `if` branches using logical `or` operator" - suggestion: ~ - fixable: false - location: - row: 62 - column: 5 - end_location: - row: 65 - column: 14 - fix: ~ - parent: ~ +- - kind: + name: IfWithSameArms + body: "Combine `if` branches using logical `or` operator" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 5 + column: 5 + fix: ~ + parent: ~ + - kind: + name: IfWithSameArms + body: "Combine `if` branches using logical `or` operator" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 12 + column: 22 + fix: ~ + parent: ~ + - kind: + name: IfWithSameArms + body: "Combine `if` branches using logical `or` operator" + suggestion: ~ + fixable: false + location: + row: 14 + column: 0 + end_location: + row: 21 + column: 26 + fix: ~ + parent: ~ + - kind: + name: IfWithSameArms + body: "Combine `if` branches using logical `or` operator" + suggestion: ~ + fixable: false + location: + row: 23 + column: 0 + end_location: + row: 36 + column: 26 + fix: ~ + parent: ~ + - kind: + name: IfWithSameArms + body: "Combine `if` branches using logical `or` operator" + suggestion: ~ + fixable: false + location: + row: 24 + column: 4 + end_location: + row: 29 + column: 26 + fix: ~ + parent: ~ + - kind: + name: IfWithSameArms + body: "Combine `if` branches using logical `or` operator" + suggestion: ~ + fixable: false + location: + row: 31 + column: 4 + end_location: + row: 36 + column: 26 + fix: ~ + parent: ~ + - kind: + name: IfWithSameArms + body: "Combine `if` branches using logical `or` operator" + suggestion: ~ + fixable: false + location: + row: 38 + column: 0 + end_location: + row: 56 + column: 8 + fix: ~ + parent: ~ + - kind: + name: IfWithSameArms + body: "Combine `if` branches using logical `or` operator" + suggestion: ~ + fixable: false + location: + row: 62 + column: 5 + end_location: + row: 65 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM115_SIM115.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM115_SIM115.py.snap index 682bbc990e5d0f..96f069a5510679 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM115_SIM115.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM115_SIM115.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: OpenFileWithContextHandler - body: Use context handler for opening files - suggestion: ~ - fixable: false - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 8 - fix: ~ - parent: ~ -- kind: - name: OpenFileWithContextHandler - body: Use context handler for opening files - suggestion: ~ - fixable: false - location: - row: 31 - column: 8 - end_location: - row: 31 - column: 12 - fix: ~ - parent: ~ +- - kind: + name: OpenFileWithContextHandler + body: Use context handler for opening files + suggestion: ~ + fixable: false + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 8 + fix: ~ + parent: ~ + - kind: + name: OpenFileWithContextHandler + body: Use context handler for opening files + suggestion: ~ + fixable: false + location: + row: 31 + column: 8 + end_location: + row: 31 + column: 12 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM116_SIM116.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM116_SIM116.py.snap index 142757ded4bec4..9dcab0f2189256 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM116_SIM116.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM116_SIM116.py.snap @@ -2,95 +2,95 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: ManualDictLookup - body: "Use a dictionary instead of consecutive `if` statements" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 12 - column: 13 - fix: ~ - parent: ~ -- kind: - name: ManualDictLookup - body: "Use a dictionary instead of consecutive `if` statements" - suggestion: ~ - fixable: false - location: - row: 15 - column: 0 - end_location: - row: 22 - column: 23 - fix: ~ - parent: ~ -- kind: - name: ManualDictLookup - body: "Use a dictionary instead of consecutive `if` statements" - suggestion: ~ - fixable: false - location: - row: 25 - column: 0 - end_location: - row: 30 - column: 20 - fix: ~ - parent: ~ -- kind: - name: ManualDictLookup - body: "Use a dictionary instead of consecutive `if` statements" - suggestion: ~ - fixable: false - location: - row: 33 - column: 0 - end_location: - row: 40 - column: 23 - fix: ~ - parent: ~ -- kind: - name: ManualDictLookup - body: "Use a dictionary instead of consecutive `if` statements" - suggestion: ~ - fixable: false - location: - row: 43 - column: 0 - end_location: - row: 48 - column: 12 - fix: ~ - parent: ~ -- kind: - name: ManualDictLookup - body: "Use a dictionary instead of consecutive `if` statements" - suggestion: ~ - fixable: false - location: - row: 51 - column: 0 - end_location: - row: 58 - column: 23 - fix: ~ - parent: ~ -- kind: - name: ManualDictLookup - body: "Use a dictionary instead of consecutive `if` statements" - suggestion: ~ - fixable: false - location: - row: 79 - column: 0 - end_location: - row: 86 - column: 15 - fix: ~ - parent: ~ +- - kind: + name: ManualDictLookup + body: "Use a dictionary instead of consecutive `if` statements" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 12 + column: 13 + fix: ~ + parent: ~ + - kind: + name: ManualDictLookup + body: "Use a dictionary instead of consecutive `if` statements" + suggestion: ~ + fixable: false + location: + row: 15 + column: 0 + end_location: + row: 22 + column: 23 + fix: ~ + parent: ~ + - kind: + name: ManualDictLookup + body: "Use a dictionary instead of consecutive `if` statements" + suggestion: ~ + fixable: false + location: + row: 25 + column: 0 + end_location: + row: 30 + column: 20 + fix: ~ + parent: ~ + - kind: + name: ManualDictLookup + body: "Use a dictionary instead of consecutive `if` statements" + suggestion: ~ + fixable: false + location: + row: 33 + column: 0 + end_location: + row: 40 + column: 23 + fix: ~ + parent: ~ + - kind: + name: ManualDictLookup + body: "Use a dictionary instead of consecutive `if` statements" + suggestion: ~ + fixable: false + location: + row: 43 + column: 0 + end_location: + row: 48 + column: 12 + fix: ~ + parent: ~ + - kind: + name: ManualDictLookup + body: "Use a dictionary instead of consecutive `if` statements" + suggestion: ~ + fixable: false + location: + row: 51 + column: 0 + end_location: + row: 58 + column: 23 + fix: ~ + parent: ~ + - kind: + name: ManualDictLookup + body: "Use a dictionary instead of consecutive `if` statements" + suggestion: ~ + fixable: false + location: + row: 79 + column: 0 + end_location: + row: 86 + column: 15 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM117_SIM117.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM117_SIM117.py.snap index 09ad5fc1ddb919..d0b808cdcd97b7 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM117_SIM117.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM117_SIM117.py.snap @@ -2,203 +2,203 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: MultipleWithStatements - body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" - suggestion: "Combine `with` statements" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 3 - column: 18 - fix: - content: "with A() as a, B() as b:\n print(\"hello\")\n" +- - kind: + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + suggestion: "Combine `with` statements" + fixable: true location: row: 2 column: 0 end_location: - row: 5 - column: 0 - parent: ~ -- kind: - name: MultipleWithStatements - body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" - suggestion: "Combine `with` statements" - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 7 - column: 13 - fix: - content: "with A(), B(), C():\n print(\"hello\")\n" + row: 3 + column: 18 + fix: + content: "with A() as a, B() as b:\n print(\"hello\")\n" + location: + row: 2 + column: 0 + end_location: + row: 5 + column: 0 + parent: ~ + - kind: + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + suggestion: "Combine `with` statements" + fixable: true location: - row: 6 + row: 7 column: 0 end_location: row: 9 - column: 0 - parent: ~ -- kind: - name: MultipleWithStatements - body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" - suggestion: "Combine `with` statements" - fixable: true - location: - row: 7 - column: 0 - end_location: - row: 9 - column: 17 - fix: - content: "with A(), B():\n with C():\n print(\"hello\")\n" + column: 17 + fix: + content: "with A(), B():\n with C():\n print(\"hello\")\n" + location: + row: 7 + column: 0 + end_location: + row: 11 + column: 0 + parent: ~ + - kind: + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + suggestion: ~ + fixable: false location: - row: 7 + row: 13 column: 0 end_location: - row: 11 - column: 0 - parent: ~ -- kind: - name: MultipleWithStatements - body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 12 - column: 18 - fix: ~ - parent: ~ -- kind: - name: MultipleWithStatements - body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 13 - column: 18 - fix: ~ - parent: ~ -- kind: - name: MultipleWithStatements - body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 15 - column: 18 - fix: ~ - parent: ~ -- kind: - name: MultipleWithStatements - body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" - suggestion: "Combine `with` statements" - fixable: true - location: - row: 19 - column: 0 - end_location: - row: 20 - column: 18 - fix: - content: "with A() as a, B() as b:\n # Fixable due to placement of this comment.\n print(\"hello\")\n" + row: 15 + column: 18 + fix: ~ + parent: ~ + - kind: + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + suggestion: "Combine `with` statements" + fixable: true location: row: 19 column: 0 end_location: - row: 23 - column: 0 - parent: ~ -- kind: - name: MultipleWithStatements - body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" - suggestion: "Combine `with` statements" - fixable: true - location: - row: 53 - column: 4 - end_location: - row: 54 - column: 22 - fix: - content: " with A() as a, B() as b:\n \"\"\"this\nis valid\"\"\"\n\n \"\"\"the indentation on\n this line is significant\"\"\"\n\n \"this is\" \\\n\"allowed too\"\n\n (\"so is\"\n\"this for some reason\")\n" + row: 20 + column: 18 + fix: + content: "with A() as a, B() as b:\n # Fixable due to placement of this comment.\n print(\"hello\")\n" + location: + row: 19 + column: 0 + end_location: + row: 23 + column: 0 + parent: ~ + - kind: + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + suggestion: "Combine `with` statements" + fixable: true location: row: 53 - column: 0 + column: 4 end_location: - row: 66 - column: 0 - parent: ~ -- kind: - name: MultipleWithStatements - body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" - suggestion: "Combine `with` statements" - fixable: true - location: - row: 68 - column: 0 - end_location: - row: 72 - column: 18 - fix: - content: "with (\n A() as a,\n B() as b,C() as c\n):\n print(\"hello\")\n" + row: 54 + column: 22 + fix: + content: " with A() as a, B() as b:\n \"\"\"this\nis valid\"\"\"\n\n \"\"\"the indentation on\n this line is significant\"\"\"\n\n \"this is\" \\\n\"allowed too\"\n\n (\"so is\"\n\"this for some reason\")\n" + location: + row: 53 + column: 0 + end_location: + row: 66 + column: 0 + parent: ~ + - kind: + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + suggestion: "Combine `with` statements" + fixable: true location: row: 68 column: 0 end_location: - row: 74 - column: 0 - parent: ~ -- kind: - name: MultipleWithStatements - body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" - suggestion: "Combine `with` statements" - fixable: true - location: - row: 76 - column: 0 - end_location: - row: 80 - column: 6 - fix: - content: "with (\n A() as a, B() as b,\n C() as c,\n):\n print(\"hello\")\n" + row: 72 + column: 18 + fix: + content: "with (\n A() as a,\n B() as b,C() as c\n):\n print(\"hello\")\n" + location: + row: 68 + column: 0 + end_location: + row: 74 + column: 0 + parent: ~ + - kind: + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + suggestion: "Combine `with` statements" + fixable: true location: row: 76 column: 0 end_location: - row: 82 - column: 0 - parent: ~ -- kind: - name: MultipleWithStatements - body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" - suggestion: "Combine `with` statements" - fixable: true - location: - row: 84 - column: 0 - end_location: - row: 91 - column: 6 - fix: - content: "with (\n A() as a,\n B() as b,C() as c,\n D() as d,\n):\n print(\"hello\")\n" + row: 80 + column: 6 + fix: + content: "with (\n A() as a, B() as b,\n C() as c,\n):\n print(\"hello\")\n" + location: + row: 76 + column: 0 + end_location: + row: 82 + column: 0 + parent: ~ + - kind: + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + suggestion: "Combine `with` statements" + fixable: true location: row: 84 column: 0 end_location: - row: 93 + row: 91 + column: 6 + fix: + content: "with (\n A() as a,\n B() as b,C() as c,\n D() as d,\n):\n print(\"hello\")\n" + location: + row: 84 + column: 0 + end_location: + row: 93 + column: 0 + parent: ~ +- - kind: + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + suggestion: "Combine `with` statements" + fixable: true + location: + row: 6 column: 0 - parent: ~ + end_location: + row: 7 + column: 13 + fix: + content: "with A(), B(), C():\n print(\"hello\")\n" + location: + row: 6 + column: 0 + end_location: + row: 9 + column: 0 + parent: ~ + - kind: + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 13 + column: 18 + fix: ~ + parent: ~ +- - kind: + name: MultipleWithStatements + body: "Use a single `with` statement with multiple contexts instead of nested `with` statements" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 12 + column: 18 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM118_SIM118.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM118_SIM118.py.snap index 71546436267fac..0b2e9420ef69d8 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM118_SIM118.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM118_SIM118.py.snap @@ -2,184 +2,184 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: KeyInDict - body: "Use `key in obj` instead of `key in obj.keys()`" - suggestion: "Convert to `key in obj`" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 17 - fix: - content: obj +- - kind: + name: KeyInDict + body: "Use `key in obj` instead of `key in obj.keys()`" + suggestion: "Convert to `key in obj`" + fixable: true location: row: 1 - column: 7 + column: 0 end_location: row: 1 column: 17 - parent: ~ -- kind: - name: KeyInDict - body: "Use `foo[\"bar\"] in obj` instead of `foo[\"bar\"] in obj.keys()`" - suggestion: "Convert to `foo[\"bar\"] in obj`" - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 24 - fix: - content: obj + fix: + content: obj + location: + row: 1 + column: 7 + end_location: + row: 1 + column: 17 + parent: ~ + - kind: + name: KeyInDict + body: "Use `foo[\"bar\"] in obj` instead of `foo[\"bar\"] in obj.keys()`" + suggestion: "Convert to `foo[\"bar\"] in obj`" + fixable: true location: row: 3 - column: 14 + column: 0 end_location: row: 3 column: 24 - parent: ~ -- kind: - name: KeyInDict - body: "Use `foo['bar'] in obj` instead of `foo['bar'] in obj.keys()`" - suggestion: "Convert to `foo['bar'] in obj`" - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 24 - fix: - content: obj + fix: + content: obj + location: + row: 3 + column: 14 + end_location: + row: 3 + column: 24 + parent: ~ + - kind: + name: KeyInDict + body: "Use `foo['bar'] in obj` instead of `foo['bar'] in obj.keys()`" + suggestion: "Convert to `foo['bar'] in obj`" + fixable: true location: row: 5 - column: 14 + column: 0 end_location: row: 5 column: 24 - parent: ~ -- kind: - name: KeyInDict - body: "Use `foo() in obj` instead of `foo() in obj.keys()`" - suggestion: "Convert to `foo() in obj`" - fixable: true - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 19 - fix: - content: obj + fix: + content: obj + location: + row: 5 + column: 14 + end_location: + row: 5 + column: 24 + parent: ~ + - kind: + name: KeyInDict + body: "Use `foo() in obj` instead of `foo() in obj.keys()`" + suggestion: "Convert to `foo() in obj`" + fixable: true location: row: 7 - column: 9 + column: 0 end_location: row: 7 column: 19 - parent: ~ -- kind: - name: KeyInDict - body: "Use `key in obj` instead of `key in obj.keys()`" - suggestion: "Convert to `key in obj`" - fixable: true - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 21 - fix: - content: obj + fix: + content: obj + location: + row: 7 + column: 9 + end_location: + row: 7 + column: 19 + parent: ~ + - kind: + name: KeyInDict + body: "Use `key in obj` instead of `key in obj.keys()`" + suggestion: "Convert to `key in obj`" + fixable: true location: row: 9 - column: 11 + column: 4 end_location: row: 9 column: 21 - parent: ~ -- kind: - name: KeyInDict - body: "Use `k in obj` instead of `k in obj.keys()`" - suggestion: "Convert to `k in obj`" - fixable: true - location: - row: 16 - column: 7 - end_location: - row: 16 - column: 22 - fix: - content: obj + fix: + content: obj + location: + row: 9 + column: 11 + end_location: + row: 9 + column: 21 + parent: ~ + - kind: + name: KeyInDict + body: "Use `k in obj` instead of `k in obj.keys()`" + suggestion: "Convert to `k in obj`" + fixable: true location: row: 16 - column: 12 + column: 7 end_location: row: 16 column: 22 - parent: ~ -- kind: - name: KeyInDict - body: "Use `k in obj` instead of `k in obj.keys()`" - suggestion: "Convert to `k in obj`" - fixable: true - location: - row: 18 - column: 7 - end_location: - row: 18 - column: 22 - fix: - content: obj + fix: + content: obj + location: + row: 16 + column: 12 + end_location: + row: 16 + column: 22 + parent: ~ + - kind: + name: KeyInDict + body: "Use `k in obj` instead of `k in obj.keys()`" + suggestion: "Convert to `k in obj`" + fixable: true location: row: 18 - column: 12 + column: 7 end_location: row: 18 column: 22 - parent: ~ -- kind: - name: KeyInDict - body: "Use `k in obj` instead of `k in obj.keys()`" - suggestion: "Convert to `k in obj`" - fixable: true - location: - row: 20 - column: 10 - end_location: - row: 20 - column: 25 - fix: - content: obj + fix: + content: obj + location: + row: 18 + column: 12 + end_location: + row: 18 + column: 22 + parent: ~ + - kind: + name: KeyInDict + body: "Use `k in obj` instead of `k in obj.keys()`" + suggestion: "Convert to `k in obj`" + fixable: true location: row: 20 - column: 15 + column: 10 end_location: row: 20 column: 25 - parent: ~ -- kind: - name: KeyInDict - body: "Use `k in obj` instead of `k in obj.keys()`" - suggestion: "Convert to `k in obj`" - fixable: true - location: - row: 22 - column: 7 - end_location: - row: 22 - column: 22 - fix: - content: obj + fix: + content: obj + location: + row: 20 + column: 15 + end_location: + row: 20 + column: 25 + parent: ~ + - kind: + name: KeyInDict + body: "Use `k in obj` instead of `k in obj.keys()`" + suggestion: "Convert to `k in obj`" + fixable: true location: row: 22 - column: 12 + column: 7 end_location: row: 22 column: 22 - parent: ~ + fix: + content: obj + location: + row: 22 + column: 12 + end_location: + row: 22 + column: 22 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM201_SIM201.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM201_SIM201.py.snap index 13993db58015a5..7e9db39516b65e 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM201_SIM201.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM201_SIM201.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: NegateEqualOp - body: "Use `a != b` instead of `not a == b`" - suggestion: "Replace with `!=` operator" - fixable: true - location: - row: 2 - column: 3 - end_location: - row: 2 - column: 13 - fix: - content: a != b +- - kind: + name: NegateEqualOp + body: "Use `a != b` instead of `not a == b`" + suggestion: "Replace with `!=` operator" + fixable: true location: row: 2 column: 3 end_location: row: 2 column: 13 - parent: ~ -- kind: - name: NegateEqualOp - body: "Use `a != b + c` instead of `not a == b + c`" - suggestion: "Replace with `!=` operator" - fixable: true - location: - row: 6 - column: 3 - end_location: - row: 6 - column: 19 - fix: - content: a != b + c + fix: + content: a != b + location: + row: 2 + column: 3 + end_location: + row: 2 + column: 13 + parent: ~ + - kind: + name: NegateEqualOp + body: "Use `a != b + c` instead of `not a == b + c`" + suggestion: "Replace with `!=` operator" + fixable: true location: row: 6 column: 3 end_location: row: 6 column: 19 - parent: ~ -- kind: - name: NegateEqualOp - body: "Use `a + b != c` instead of `not a + b == c`" - suggestion: "Replace with `!=` operator" - fixable: true - location: - row: 10 - column: 3 - end_location: - row: 10 - column: 19 - fix: - content: a + b != c + fix: + content: a != b + c + location: + row: 6 + column: 3 + end_location: + row: 6 + column: 19 + parent: ~ + - kind: + name: NegateEqualOp + body: "Use `a + b != c` instead of `not a + b == c`" + suggestion: "Replace with `!=` operator" + fixable: true location: row: 10 column: 3 end_location: row: 10 column: 19 - parent: ~ + fix: + content: a + b != c + location: + row: 10 + column: 3 + end_location: + row: 10 + column: 19 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM202_SIM202.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM202_SIM202.py.snap index 132abb3c5c1eab..4ab2b95c57a85b 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM202_SIM202.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM202_SIM202.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: NegateNotEqualOp - body: "Use `a == b` instead of `not a != b`" - suggestion: "Replace with `==` operator" - fixable: true - location: - row: 2 - column: 3 - end_location: - row: 2 - column: 13 - fix: - content: a == b +- - kind: + name: NegateNotEqualOp + body: "Use `a == b` instead of `not a != b`" + suggestion: "Replace with `==` operator" + fixable: true location: row: 2 column: 3 end_location: row: 2 column: 13 - parent: ~ -- kind: - name: NegateNotEqualOp - body: "Use `a == b + c` instead of `not a != b + c`" - suggestion: "Replace with `==` operator" - fixable: true - location: - row: 6 - column: 3 - end_location: - row: 6 - column: 19 - fix: - content: a == b + c + fix: + content: a == b + location: + row: 2 + column: 3 + end_location: + row: 2 + column: 13 + parent: ~ + - kind: + name: NegateNotEqualOp + body: "Use `a == b + c` instead of `not a != b + c`" + suggestion: "Replace with `==` operator" + fixable: true location: row: 6 column: 3 end_location: row: 6 column: 19 - parent: ~ -- kind: - name: NegateNotEqualOp - body: "Use `a + b == c` instead of `not a + b != c`" - suggestion: "Replace with `==` operator" - fixable: true - location: - row: 10 - column: 3 - end_location: - row: 10 - column: 19 - fix: - content: a + b == c + fix: + content: a == b + c + location: + row: 6 + column: 3 + end_location: + row: 6 + column: 19 + parent: ~ + - kind: + name: NegateNotEqualOp + body: "Use `a + b == c` instead of `not a + b != c`" + suggestion: "Replace with `==` operator" + fixable: true location: row: 10 column: 3 end_location: row: 10 column: 19 - parent: ~ + fix: + content: a + b == c + location: + row: 10 + column: 3 + end_location: + row: 10 + column: 19 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM208_SIM208.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM208_SIM208.py.snap index 6c40fa40f8f8b1..a3ce7c47fae835 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM208_SIM208.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM208_SIM208.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: DoubleNegation - body: "Use `a` instead of `not (not a)`" - suggestion: "Replace with `a`" - fixable: true - location: - row: 1 - column: 3 - end_location: - row: 1 - column: 14 - fix: - content: a +- - kind: + name: DoubleNegation + body: "Use `a` instead of `not (not a)`" + suggestion: "Replace with `a`" + fixable: true location: row: 1 column: 3 end_location: row: 1 column: 14 - parent: ~ -- kind: - name: DoubleNegation - body: "Use `a == b` instead of `not (not a == b)`" - suggestion: "Replace with `a == b`" - fixable: true - location: - row: 4 - column: 3 - end_location: - row: 4 - column: 21 - fix: - content: a == b + fix: + content: a + location: + row: 1 + column: 3 + end_location: + row: 1 + column: 14 + parent: ~ + - kind: + name: DoubleNegation + body: "Use `a == b` instead of `not (not a == b)`" + suggestion: "Replace with `a == b`" + fixable: true location: row: 4 column: 3 end_location: row: 4 column: 21 - parent: ~ + fix: + content: a == b + location: + row: 4 + column: 3 + end_location: + row: 4 + column: 21 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM210_SIM210.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM210_SIM210.py.snap index 1dbb45fa2e4991..8ca338981b6270 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM210_SIM210.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM210_SIM210.py.snap @@ -2,77 +2,77 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: IfExprWithTrueFalse - body: "Use `bool(b)` instead of `True if b else False`" - suggestion: "Replace with `not b" - fixable: true - location: - row: 1 - column: 4 - end_location: - row: 1 - column: 24 - fix: - content: bool(b) +- - kind: + name: IfExprWithTrueFalse + body: "Use `bool(b)` instead of `True if b else False`" + suggestion: "Replace with `not b" + fixable: true location: row: 1 column: 4 end_location: row: 1 column: 24 - parent: ~ -- kind: - name: IfExprWithTrueFalse - body: "Use `bool(b != c)` instead of `True if b != c else False`" - suggestion: "Replace with `not b != c" - fixable: true - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 29 - fix: - content: b != c + fix: + content: bool(b) + location: + row: 1 + column: 4 + end_location: + row: 1 + column: 24 + parent: ~ + - kind: + name: IfExprWithTrueFalse + body: "Use `bool(b != c)` instead of `True if b != c else False`" + suggestion: "Replace with `not b != c" + fixable: true location: row: 3 column: 4 end_location: row: 3 column: 29 - parent: ~ -- kind: - name: IfExprWithTrueFalse - body: "Use `bool(b + c)` instead of `True if b + c else False`" - suggestion: "Replace with `not b + c" - fixable: true - location: - row: 5 - column: 4 - end_location: - row: 5 - column: 28 - fix: - content: bool(b + c) + fix: + content: b != c + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 29 + parent: ~ + - kind: + name: IfExprWithTrueFalse + body: "Use `bool(b + c)` instead of `True if b + c else False`" + suggestion: "Replace with `not b + c" + fixable: true location: row: 5 column: 4 end_location: row: 5 column: 28 - parent: ~ -- kind: - name: IfExprWithTrueFalse - body: "Use `bool(b)` instead of `True if b else False`" - suggestion: "Replace with `not b" - fixable: true - location: - row: 14 - column: 8 - end_location: - row: 14 - column: 28 - fix: ~ - parent: ~ + fix: + content: bool(b + c) + location: + row: 5 + column: 4 + end_location: + row: 5 + column: 28 + parent: ~ + - kind: + name: IfExprWithTrueFalse + body: "Use `bool(b)` instead of `True if b else False`" + suggestion: "Replace with `not b" + fixable: true + location: + row: 14 + column: 8 + end_location: + row: 14 + column: 28 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM211_SIM211.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM211_SIM211.py.snap index 19e0cb3bc3a8d8..cf152ea66e0d74 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM211_SIM211.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM211_SIM211.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: IfExprWithFalseTrue - body: "Use `not b` instead of `False if b else True`" - suggestion: "Replace with `bool(b)" - fixable: true - location: - row: 1 - column: 4 - end_location: - row: 1 - column: 24 - fix: - content: not b +- - kind: + name: IfExprWithFalseTrue + body: "Use `not b` instead of `False if b else True`" + suggestion: "Replace with `bool(b)" + fixable: true location: row: 1 column: 4 end_location: row: 1 column: 24 - parent: ~ -- kind: - name: IfExprWithFalseTrue - body: "Use `not b != c` instead of `False if b != c else True`" - suggestion: "Replace with `bool(b != c)" - fixable: true - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 29 - fix: - content: not b != c + fix: + content: not b + location: + row: 1 + column: 4 + end_location: + row: 1 + column: 24 + parent: ~ + - kind: + name: IfExprWithFalseTrue + body: "Use `not b != c` instead of `False if b != c else True`" + suggestion: "Replace with `bool(b != c)" + fixable: true location: row: 3 column: 4 end_location: row: 3 column: 29 - parent: ~ -- kind: - name: IfExprWithFalseTrue - body: "Use `not b + c` instead of `False if b + c else True`" - suggestion: "Replace with `bool(b + c)" - fixable: true - location: - row: 5 - column: 4 - end_location: - row: 5 - column: 28 - fix: - content: not b + c + fix: + content: not b != c + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 29 + parent: ~ + - kind: + name: IfExprWithFalseTrue + body: "Use `not b + c` instead of `False if b + c else True`" + suggestion: "Replace with `bool(b + c)" + fixable: true location: row: 5 column: 4 end_location: row: 5 column: 28 - parent: ~ + fix: + content: not b + c + location: + row: 5 + column: 4 + end_location: + row: 5 + column: 28 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM212_SIM212.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM212_SIM212.py.snap index 3401515663cf10..96083c88745e78 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM212_SIM212.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM212_SIM212.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: IfExprWithTwistedArms - body: "Use `a if a else b` instead of `b if not a else a`" - suggestion: "Replace with `a if a else b`" - fixable: true - location: - row: 1 - column: 4 - end_location: - row: 1 - column: 21 - fix: - content: a if a else b +- - kind: + name: IfExprWithTwistedArms + body: "Use `a if a else b` instead of `b if not a else a`" + suggestion: "Replace with `a if a else b`" + fixable: true location: row: 1 column: 4 end_location: row: 1 column: 21 - parent: ~ -- kind: - name: IfExprWithTwistedArms - body: "Use `a if a else b + c` instead of `b + c if not a else a`" - suggestion: "Replace with `a if a else b + c`" - fixable: true - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 25 - fix: - content: a if a else b + c + fix: + content: a if a else b + location: + row: 1 + column: 4 + end_location: + row: 1 + column: 21 + parent: ~ + - kind: + name: IfExprWithTwistedArms + body: "Use `a if a else b + c` instead of `b + c if not a else a`" + suggestion: "Replace with `a if a else b + c`" + fixable: true location: row: 3 column: 4 end_location: row: 3 column: 25 - parent: ~ + fix: + content: a if a else b + c + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 25 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM220_SIM220.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM220_SIM220.py.snap index f239a4139a98cf..d4e5242d98474b 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM220_SIM220.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM220_SIM220.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: ExprAndNotExpr - body: "Use `False` instead of `a and not a`" - suggestion: "Replace with `False`" - fixable: true - location: - row: 1 - column: 3 - end_location: - row: 1 - column: 14 - fix: - content: "False" +- - kind: + name: ExprAndNotExpr + body: "Use `False` instead of `a and not a`" + suggestion: "Replace with `False`" + fixable: true location: row: 1 column: 3 end_location: row: 1 column: 14 - parent: ~ -- kind: - name: ExprAndNotExpr - body: "Use `False` instead of `a and not a`" - suggestion: "Replace with `False`" - fixable: true - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 15 - fix: - content: "False" + fix: + content: "False" + location: + row: 1 + column: 3 + end_location: + row: 1 + column: 14 + parent: ~ + - kind: + name: ExprAndNotExpr + body: "Use `False` instead of `a and not a`" + suggestion: "Replace with `False`" + fixable: true location: row: 4 column: 4 end_location: row: 4 column: 15 - parent: ~ -- kind: - name: ExprAndNotExpr - body: "Use `False` instead of `a and not a`" - suggestion: "Replace with `False`" - fixable: true - location: - row: 7 - column: 4 - end_location: - row: 7 - column: 15 - fix: - content: "False" + fix: + content: "False" + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 15 + parent: ~ + - kind: + name: ExprAndNotExpr + body: "Use `False` instead of `a and not a`" + suggestion: "Replace with `False`" + fixable: true location: row: 7 column: 4 end_location: row: 7 column: 15 - parent: ~ + fix: + content: "False" + location: + row: 7 + column: 4 + end_location: + row: 7 + column: 15 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM221_SIM221.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM221_SIM221.py.snap index acf65022e6ad4d..98a841371fb6fe 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM221_SIM221.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM221_SIM221.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: ExprOrNotExpr - body: "Use `True` instead of `a or not a`" - suggestion: "Replace with `True`" - fixable: true - location: - row: 1 - column: 3 - end_location: - row: 1 - column: 13 - fix: - content: "True" +- - kind: + name: ExprOrNotExpr + body: "Use `True` instead of `a or not a`" + suggestion: "Replace with `True`" + fixable: true location: row: 1 column: 3 end_location: row: 1 column: 13 - parent: ~ -- kind: - name: ExprOrNotExpr - body: "Use `True` instead of `a or not a`" - suggestion: "Replace with `True`" - fixable: true - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 14 - fix: - content: "True" + fix: + content: "True" + location: + row: 1 + column: 3 + end_location: + row: 1 + column: 13 + parent: ~ + - kind: + name: ExprOrNotExpr + body: "Use `True` instead of `a or not a`" + suggestion: "Replace with `True`" + fixable: true location: row: 4 column: 4 end_location: row: 4 column: 14 - parent: ~ -- kind: - name: ExprOrNotExpr - body: "Use `True` instead of `a or not a`" - suggestion: "Replace with `True`" - fixable: true - location: - row: 7 - column: 4 - end_location: - row: 7 - column: 14 - fix: - content: "True" + fix: + content: "True" + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 14 + parent: ~ + - kind: + name: ExprOrNotExpr + body: "Use `True` instead of `a or not a`" + suggestion: "Replace with `True`" + fixable: true location: row: 7 column: 4 end_location: row: 7 column: 14 - parent: ~ + fix: + content: "True" + location: + row: 7 + column: 4 + end_location: + row: 7 + column: 14 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM222_SIM222.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM222_SIM222.py.snap index 628543a95c6538..ec4f70e908b084 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM222_SIM222.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM222_SIM222.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: ExprOrTrue - body: "Use `True` instead of `... or True`" - suggestion: "Replace with `True`" - fixable: true - location: - row: 1 - column: 8 - end_location: - row: 1 - column: 12 - fix: - content: "True" +- - kind: + name: ExprOrTrue + body: "Use `True` instead of `... or True`" + suggestion: "Replace with `True`" + fixable: true location: row: 1 - column: 3 + column: 8 end_location: row: 1 column: 12 - parent: ~ -- kind: - name: ExprOrTrue - body: "Use `True` instead of `... or True`" - suggestion: "Replace with `True`" - fixable: true - location: - row: 4 - column: 15 - end_location: - row: 4 - column: 19 - fix: - content: "True" + fix: + content: "True" + location: + row: 1 + column: 3 + end_location: + row: 1 + column: 12 + parent: ~ + - kind: + name: ExprOrTrue + body: "Use `True` instead of `... or True`" + suggestion: "Replace with `True`" + fixable: true location: row: 4 - column: 3 + column: 15 end_location: row: 4 column: 19 - parent: ~ -- kind: - name: ExprOrTrue - body: "Use `True` instead of `... or True`" - suggestion: "Replace with `True`" - fixable: true - location: - row: 7 - column: 9 - end_location: - row: 7 - column: 13 - fix: - content: "True" + fix: + content: "True" + location: + row: 4 + column: 3 + end_location: + row: 4 + column: 19 + parent: ~ + - kind: + name: ExprOrTrue + body: "Use `True` instead of `... or True`" + suggestion: "Replace with `True`" + fixable: true location: row: 7 - column: 3 + column: 14 end_location: row: 7 - column: 14 - parent: ~ -- kind: - name: ExprOrTrue - body: "Use `True` instead of `... or True`" - suggestion: "Replace with `True`" - fixable: true - location: - row: 7 - column: 14 - end_location: - row: 7 - column: 18 - fix: - content: "True" + column: 18 + fix: + content: "True" + location: + row: 7 + column: 9 + end_location: + row: 7 + column: 18 + parent: ~ +- - kind: + name: ExprOrTrue + body: "Use `True` instead of `... or True`" + suggestion: "Replace with `True`" + fixable: true location: row: 7 column: 9 end_location: row: 7 - column: 18 - parent: ~ + column: 13 + fix: + content: "True" + location: + row: 7 + column: 3 + end_location: + row: 7 + column: 14 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM223_SIM223.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM223_SIM223.py.snap index c8382d830b9f51..8b5b5caba0827a 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM223_SIM223.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM223_SIM223.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: ExprAndFalse - body: "Use `False` instead of `... and False`" - suggestion: "Replace with `False`" - fixable: true - location: - row: 1 - column: 9 - end_location: - row: 1 - column: 14 - fix: - content: "False" +- - kind: + name: ExprAndFalse + body: "Use `False` instead of `... and False`" + suggestion: "Replace with `False`" + fixable: true location: row: 1 - column: 3 + column: 9 end_location: row: 1 column: 14 - parent: ~ -- kind: - name: ExprAndFalse - body: "Use `False` instead of `... and False`" - suggestion: "Replace with `False`" - fixable: true - location: - row: 4 - column: 16 - end_location: - row: 4 - column: 21 - fix: - content: "False" + fix: + content: "False" + location: + row: 1 + column: 3 + end_location: + row: 1 + column: 14 + parent: ~ + - kind: + name: ExprAndFalse + body: "Use `False` instead of `... and False`" + suggestion: "Replace with `False`" + fixable: true location: row: 4 - column: 3 + column: 16 end_location: row: 4 column: 21 - parent: ~ -- kind: - name: ExprAndFalse - body: "Use `False` instead of `... and False`" - suggestion: "Replace with `False`" - fixable: true - location: - row: 7 - column: 15 - end_location: - row: 7 - column: 20 - fix: - content: "False" + fix: + content: "False" + location: + row: 4 + column: 3 + end_location: + row: 4 + column: 21 + parent: ~ + - kind: + name: ExprAndFalse + body: "Use `False` instead of `... and False`" + suggestion: "Replace with `False`" + fixable: true location: row: 7 - column: 9 + column: 15 end_location: row: 7 column: 20 - parent: ~ + fix: + content: "False" + location: + row: 7 + column: 9 + end_location: + row: 7 + column: 20 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM300_SIM300.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM300_SIM300.py.snap index 81a84330380018..76c6abc85f62a2 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM300_SIM300.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM300_SIM300.py.snap @@ -2,304 +2,304 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: YodaConditions - body: "Yoda conditions are discouraged, use `compare == \"yoda\"` instead" - suggestion: "Replace Yoda condition with `compare == \"yoda\"`" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 17 - fix: - content: "compare == \"yoda\"" +- - kind: + name: YodaConditions + body: "Yoda conditions are discouraged, use `compare == \"yoda\"` instead" + suggestion: "Replace Yoda condition with `compare == \"yoda\"`" + fixable: true location: row: 2 column: 0 end_location: row: 2 column: 17 - parent: ~ -- kind: - name: YodaConditions - body: "Yoda conditions are discouraged, use `compare == \"yoda\"` instead" - suggestion: "Replace Yoda condition with `compare == \"yoda\"`" - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 17 - fix: - content: "compare == \"yoda\"" + fix: + content: "compare == \"yoda\"" + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 17 + parent: ~ + - kind: + name: YodaConditions + body: "Yoda conditions are discouraged, use `compare == \"yoda\"` instead" + suggestion: "Replace Yoda condition with `compare == \"yoda\"`" + fixable: true location: row: 3 column: 0 end_location: row: 3 column: 17 - parent: ~ -- kind: - name: YodaConditions - body: "Yoda conditions are discouraged, use `age == 42` instead" - suggestion: "Replace Yoda condition with `age == 42`" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 9 - fix: - content: age == 42 + fix: + content: "compare == \"yoda\"" + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 17 + parent: ~ + - kind: + name: YodaConditions + body: "Yoda conditions are discouraged, use `age == 42` instead" + suggestion: "Replace Yoda condition with `age == 42`" + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 9 - parent: ~ -- kind: - name: YodaConditions - body: "Yoda conditions are discouraged, use `compare == (\"a\", \"b\")` instead" - suggestion: "Replace Yoda condition with `compare == (\"a\", \"b\")`" - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 21 - fix: - content: "compare == (\"a\", \"b\")" + fix: + content: age == 42 + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 9 + parent: ~ + - kind: + name: YodaConditions + body: "Yoda conditions are discouraged, use `compare == (\"a\", \"b\")` instead" + suggestion: "Replace Yoda condition with `compare == (\"a\", \"b\")`" + fixable: true location: row: 5 column: 0 end_location: row: 5 column: 21 - parent: ~ -- kind: - name: YodaConditions - body: "Yoda conditions are discouraged, use `compare >= \"yoda\"` instead" - suggestion: "Replace Yoda condition with `compare >= \"yoda\"`" - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 17 - fix: - content: "compare >= \"yoda\"" + fix: + content: "compare == (\"a\", \"b\")" + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 21 + parent: ~ + - kind: + name: YodaConditions + body: "Yoda conditions are discouraged, use `compare >= \"yoda\"` instead" + suggestion: "Replace Yoda condition with `compare >= \"yoda\"`" + fixable: true location: row: 6 column: 0 end_location: row: 6 column: 17 - parent: ~ -- kind: - name: YodaConditions - body: "Yoda conditions are discouraged, use `compare > \"yoda\"` instead" - suggestion: "Replace Yoda condition with `compare > \"yoda\"`" - fixable: true - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 16 - fix: - content: "compare > \"yoda\"" + fix: + content: "compare >= \"yoda\"" + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 17 + parent: ~ + - kind: + name: YodaConditions + body: "Yoda conditions are discouraged, use `compare > \"yoda\"` instead" + suggestion: "Replace Yoda condition with `compare > \"yoda\"`" + fixable: true location: row: 7 column: 0 end_location: row: 7 column: 16 - parent: ~ -- kind: - name: YodaConditions - body: "Yoda conditions are discouraged, use `age < 42` instead" - suggestion: "Replace Yoda condition with `age < 42`" - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 8 - fix: - content: age < 42 + fix: + content: "compare > \"yoda\"" + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 16 + parent: ~ + - kind: + name: YodaConditions + body: "Yoda conditions are discouraged, use `age < 42` instead" + suggestion: "Replace Yoda condition with `age < 42`" + fixable: true location: row: 8 column: 0 end_location: row: 8 column: 8 - parent: ~ -- kind: - name: YodaConditions - body: "Yoda conditions are discouraged, use `age < -42` instead" - suggestion: "Replace Yoda condition with `age < -42`" - fixable: true - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 9 - fix: - content: age < -42 + fix: + content: age < 42 + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 8 + parent: ~ + - kind: + name: YodaConditions + body: "Yoda conditions are discouraged, use `age < -42` instead" + suggestion: "Replace Yoda condition with `age < -42`" + fixable: true location: row: 9 column: 0 end_location: row: 9 column: 9 - parent: ~ -- kind: - name: YodaConditions - body: "Yoda conditions are discouraged, use `age < +42` instead" - suggestion: "Replace Yoda condition with `age < +42`" - fixable: true - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 9 - fix: - content: age < +42 + fix: + content: age < -42 + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 9 + parent: ~ + - kind: + name: YodaConditions + body: "Yoda conditions are discouraged, use `age < +42` instead" + suggestion: "Replace Yoda condition with `age < +42`" + fixable: true location: row: 10 column: 0 end_location: row: 10 column: 9 - parent: ~ -- kind: - name: YodaConditions - body: "Yoda conditions are discouraged, use `age == YODA` instead" - suggestion: "Replace Yoda condition with `age == YODA`" - fixable: true - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 11 - fix: - content: age == YODA + fix: + content: age < +42 + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 9 + parent: ~ + - kind: + name: YodaConditions + body: "Yoda conditions are discouraged, use `age == YODA` instead" + suggestion: "Replace Yoda condition with `age == YODA`" + fixable: true location: row: 11 column: 0 end_location: row: 11 column: 11 - parent: ~ -- kind: - name: YodaConditions - body: "Yoda conditions are discouraged, use `age < YODA` instead" - suggestion: "Replace Yoda condition with `age < YODA`" - fixable: true - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 10 - fix: - content: age < YODA + fix: + content: age == YODA + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 11 + parent: ~ + - kind: + name: YodaConditions + body: "Yoda conditions are discouraged, use `age < YODA` instead" + suggestion: "Replace Yoda condition with `age < YODA`" + fixable: true location: row: 12 column: 0 end_location: row: 12 column: 10 - parent: ~ -- kind: - name: YodaConditions - body: "Yoda conditions are discouraged, use `age <= YODA` instead" - suggestion: "Replace Yoda condition with `age <= YODA`" - fixable: true - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 11 - fix: - content: age <= YODA + fix: + content: age < YODA + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 10 + parent: ~ + - kind: + name: YodaConditions + body: "Yoda conditions are discouraged, use `age <= YODA` instead" + suggestion: "Replace Yoda condition with `age <= YODA`" + fixable: true location: row: 13 column: 0 end_location: row: 13 column: 11 - parent: ~ -- kind: - name: YodaConditions - body: "Yoda conditions are discouraged, use `age == JediOrder.YODA` instead" - suggestion: "Replace Yoda condition with `age == JediOrder.YODA`" - fixable: true - location: - row: 14 - column: 0 - end_location: - row: 14 - column: 21 - fix: - content: age == JediOrder.YODA + fix: + content: age <= YODA + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 11 + parent: ~ + - kind: + name: YodaConditions + body: "Yoda conditions are discouraged, use `age == JediOrder.YODA` instead" + suggestion: "Replace Yoda condition with `age == JediOrder.YODA`" + fixable: true location: row: 14 column: 0 end_location: row: 14 column: 21 - parent: ~ -- kind: - name: YodaConditions - body: "Yoda conditions are discouraged, use `(number - 100) > 0` instead" - suggestion: "Replace Yoda condition with `(number - 100) > 0`" - fixable: true - location: - row: 15 - column: 0 - end_location: - row: 15 - column: 18 - fix: - content: (number - 100) > 0 + fix: + content: age == JediOrder.YODA + location: + row: 14 + column: 0 + end_location: + row: 14 + column: 21 + parent: ~ + - kind: + name: YodaConditions + body: "Yoda conditions are discouraged, use `(number - 100) > 0` instead" + suggestion: "Replace Yoda condition with `(number - 100) > 0`" + fixable: true location: row: 15 column: 0 end_location: row: 15 column: 18 - parent: ~ -- kind: - name: YodaConditions - body: "Yoda conditions are discouraged, use `(60 * 60) < SomeClass().settings.SOME_CONSTANT_VALUE` instead" - suggestion: "Replace Yoda condition with `(60 * 60) < SomeClass().settings.SOME_CONSTANT_VALUE`" - fixable: true - location: - row: 16 - column: 0 - end_location: - row: 16 - column: 52 - fix: - content: (60 * 60) < SomeClass().settings.SOME_CONSTANT_VALUE + fix: + content: (number - 100) > 0 + location: + row: 15 + column: 0 + end_location: + row: 15 + column: 18 + parent: ~ + - kind: + name: YodaConditions + body: "Yoda conditions are discouraged, use `(60 * 60) < SomeClass().settings.SOME_CONSTANT_VALUE` instead" + suggestion: "Replace Yoda condition with `(60 * 60) < SomeClass().settings.SOME_CONSTANT_VALUE`" + fixable: true location: row: 16 column: 0 end_location: row: 16 column: 52 - parent: ~ + fix: + content: (60 * 60) < SomeClass().settings.SOME_CONSTANT_VALUE + location: + row: 16 + column: 0 + end_location: + row: 16 + column: 52 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM401_SIM401.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM401_SIM401.py.snap index 7f34a32bab0bcb..28de2e5a70be67 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM401_SIM401.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM401_SIM401.py.snap @@ -2,124 +2,124 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs expression: diagnostics --- -- kind: - name: DictGetWithDefault - body: "Use `var = a_dict.get(key, \"default1\")` instead of an `if` block" - suggestion: "Replace with `var = a_dict.get(key, \"default1\")`" - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 9 - column: 20 - fix: - content: "var = a_dict.get(key, \"default1\")" +- - kind: + name: DictGetWithDefault + body: "Use `var = a_dict.get(key, \"default1\")` instead of an `if` block" + suggestion: "Replace with `var = a_dict.get(key, \"default1\")`" + fixable: true location: row: 6 column: 0 end_location: row: 9 column: 20 - parent: ~ -- kind: - name: DictGetWithDefault - body: "Use `var = a_dict.get(key, \"default2\")` instead of an `if` block" - suggestion: "Replace with `var = a_dict.get(key, \"default2\")`" - fixable: true - location: - row: 12 - column: 0 - end_location: - row: 15 - column: 21 - fix: - content: "var = a_dict.get(key, \"default2\")" + fix: + content: "var = a_dict.get(key, \"default1\")" + location: + row: 6 + column: 0 + end_location: + row: 9 + column: 20 + parent: ~ + - kind: + name: DictGetWithDefault + body: "Use `var = a_dict.get(key, \"default2\")` instead of an `if` block" + suggestion: "Replace with `var = a_dict.get(key, \"default2\")`" + fixable: true location: row: 12 column: 0 end_location: row: 15 column: 21 - parent: ~ -- kind: - name: DictGetWithDefault - body: "Use `var = a_dict.get(key, val1 + val2)` instead of an `if` block" - suggestion: "Replace with `var = a_dict.get(key, val1 + val2)`" - fixable: true - location: - row: 18 - column: 0 - end_location: - row: 21 - column: 21 - fix: - content: "var = a_dict.get(key, val1 + val2)" + fix: + content: "var = a_dict.get(key, \"default2\")" + location: + row: 12 + column: 0 + end_location: + row: 15 + column: 21 + parent: ~ + - kind: + name: DictGetWithDefault + body: "Use `var = a_dict.get(key, val1 + val2)` instead of an `if` block" + suggestion: "Replace with `var = a_dict.get(key, val1 + val2)`" + fixable: true location: row: 18 column: 0 end_location: row: 21 column: 21 - parent: ~ -- kind: - name: DictGetWithDefault - body: "Use `var = a_dict.get(keys[idx], \"default\")` instead of an `if` block" - suggestion: "Replace with `var = a_dict.get(keys[idx], \"default\")`" - fixable: true - location: - row: 24 - column: 0 - end_location: - row: 27 - column: 19 - fix: - content: "var = a_dict.get(keys[idx], \"default\")" + fix: + content: "var = a_dict.get(key, val1 + val2)" + location: + row: 18 + column: 0 + end_location: + row: 21 + column: 21 + parent: ~ + - kind: + name: DictGetWithDefault + body: "Use `var = a_dict.get(keys[idx], \"default\")` instead of an `if` block" + suggestion: "Replace with `var = a_dict.get(keys[idx], \"default\")`" + fixable: true location: row: 24 column: 0 end_location: row: 27 column: 19 - parent: ~ -- kind: - name: DictGetWithDefault - body: "Use `var = dicts[idx].get(key, \"default\")` instead of an `if` block" - suggestion: "Replace with `var = dicts[idx].get(key, \"default\")`" - fixable: true - location: - row: 30 - column: 0 - end_location: - row: 33 - column: 19 - fix: - content: "var = dicts[idx].get(key, \"default\")" + fix: + content: "var = a_dict.get(keys[idx], \"default\")" + location: + row: 24 + column: 0 + end_location: + row: 27 + column: 19 + parent: ~ + - kind: + name: DictGetWithDefault + body: "Use `var = dicts[idx].get(key, \"default\")` instead of an `if` block" + suggestion: "Replace with `var = dicts[idx].get(key, \"default\")`" + fixable: true location: row: 30 column: 0 end_location: row: 33 column: 19 - parent: ~ -- kind: - name: DictGetWithDefault - body: "Use `vars[idx] = a_dict.get(key, \"default\")` instead of an `if` block" - suggestion: "Replace with `vars[idx] = a_dict.get(key, \"default\")`" - fixable: true - location: - row: 36 - column: 0 - end_location: - row: 39 - column: 25 - fix: - content: "vars[idx] = a_dict.get(key, \"default\")" + fix: + content: "var = dicts[idx].get(key, \"default\")" + location: + row: 30 + column: 0 + end_location: + row: 33 + column: 19 + parent: ~ + - kind: + name: DictGetWithDefault + body: "Use `vars[idx] = a_dict.get(key, \"default\")` instead of an `if` block" + suggestion: "Replace with `vars[idx] = a_dict.get(key, \"default\")`" + fixable: true location: row: 36 column: 0 end_location: row: 39 column: 25 - parent: ~ + fix: + content: "vars[idx] = a_dict.get(key, \"default\")" + location: + row: 36 + column: 0 + end_location: + row: 39 + column: 25 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__banned_api__tests__banned_api_true_positives.snap b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__banned_api__tests__banned_api_true_positives.snap index 5880eccea68301..4526eba78e19a5 100644 --- a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__banned_api__tests__banned_api_true_positives.snap +++ b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__banned_api__tests__banned_api_true_positives.snap @@ -2,160 +2,160 @@ source: crates/ruff/src/rules/flake8_tidy_imports/banned_api.rs expression: diagnostics --- -- kind: - name: BannedApi - body: "`cgi` is banned: The cgi module is deprecated." - suggestion: ~ - fixable: false - location: - row: 2 - column: 7 - end_location: - row: 2 - column: 10 - fix: ~ - parent: ~ -- kind: - name: BannedApi - body: "`cgi` is banned: The cgi module is deprecated." - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 17 - fix: ~ - parent: ~ -- kind: - name: BannedApi - body: "`cgi` is banned: The cgi module is deprecated." - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 23 - fix: ~ - parent: ~ -- kind: - name: BannedApi - body: "`cgi` is banned: The cgi module is deprecated." - suggestion: ~ - fixable: false - location: - row: 9 - column: 7 - end_location: - row: 9 - column: 18 - fix: ~ - parent: ~ -- kind: - name: BannedApi - body: "`cgi` is banned: The cgi module is deprecated." - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 23 - fix: ~ - parent: ~ -- kind: - name: BannedApi - body: "`cgi` is banned: The cgi module is deprecated." - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 25 - fix: ~ - parent: ~ -- kind: - name: BannedApi - body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." - suggestion: ~ - fixable: false - location: - row: 17 - column: 19 - end_location: - row: 17 - column: 28 - fix: ~ - parent: ~ -- kind: - name: BannedApi - body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." - suggestion: ~ - fixable: false - location: - row: 22 - column: 0 - end_location: - row: 22 - column: 16 - fix: ~ - parent: ~ -- kind: - name: BannedApi - body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." - suggestion: ~ - fixable: false - location: - row: 24 - column: 0 - end_location: - row: 24 - column: 16 - fix: ~ - parent: ~ -- kind: - name: BannedApi - body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." - suggestion: ~ - fixable: false - location: - row: 27 - column: 0 - end_location: - row: 27 - column: 16 - fix: ~ - parent: ~ -- kind: - name: BannedApi - body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." - suggestion: ~ - fixable: false - location: - row: 29 - column: 0 - end_location: - row: 29 - column: 16 - fix: ~ - parent: ~ -- kind: - name: BannedApi - body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." - suggestion: ~ - fixable: false - location: - row: 33 - column: 0 - end_location: - row: 33 - column: 28 - fix: ~ - parent: ~ +- - kind: + name: BannedApi + body: "`cgi` is banned: The cgi module is deprecated." + suggestion: ~ + fixable: false + location: + row: 2 + column: 7 + end_location: + row: 2 + column: 10 + fix: ~ + parent: ~ + - kind: + name: BannedApi + body: "`cgi` is banned: The cgi module is deprecated." + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 17 + fix: ~ + parent: ~ + - kind: + name: BannedApi + body: "`cgi` is banned: The cgi module is deprecated." + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 23 + fix: ~ + parent: ~ + - kind: + name: BannedApi + body: "`cgi` is banned: The cgi module is deprecated." + suggestion: ~ + fixable: false + location: + row: 9 + column: 7 + end_location: + row: 9 + column: 18 + fix: ~ + parent: ~ + - kind: + name: BannedApi + body: "`cgi` is banned: The cgi module is deprecated." + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 23 + fix: ~ + parent: ~ + - kind: + name: BannedApi + body: "`cgi` is banned: The cgi module is deprecated." + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 25 + fix: ~ + parent: ~ + - kind: + name: BannedApi + body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." + suggestion: ~ + fixable: false + location: + row: 17 + column: 19 + end_location: + row: 17 + column: 28 + fix: ~ + parent: ~ + - kind: + name: BannedApi + body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." + suggestion: ~ + fixable: false + location: + row: 22 + column: 0 + end_location: + row: 22 + column: 16 + fix: ~ + parent: ~ + - kind: + name: BannedApi + body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." + suggestion: ~ + fixable: false + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 16 + fix: ~ + parent: ~ + - kind: + name: BannedApi + body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." + suggestion: ~ + fixable: false + location: + row: 27 + column: 0 + end_location: + row: 27 + column: 16 + fix: ~ + parent: ~ + - kind: + name: BannedApi + body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." + suggestion: ~ + fixable: false + location: + row: 29 + column: 0 + end_location: + row: 29 + column: 16 + fix: ~ + parent: ~ + - kind: + name: BannedApi + body: "`typing.TypedDict` is banned: Use typing_extensions.TypedDict instead." + suggestion: ~ + fixable: false + location: + row: 33 + column: 0 + end_location: + row: 33 + column: 28 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_all_imports.snap b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_all_imports.snap index 398d7fb0a03a66..0c17de838f261b 100644 --- a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_all_imports.snap +++ b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_all_imports.snap @@ -2,225 +2,225 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs expression: diagnostics --- -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 21 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 28 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 21 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 28 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 27 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 34 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 26 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 14 - column: 0 - end_location: - row: 16 - column: 19 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 17 - column: 0 - end_location: - row: 20 - column: 15 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 21 - column: 0 - end_location: - row: 21 - column: 34 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 22 - column: 0 - end_location: - row: 22 - column: 35 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 23 - column: 0 - end_location: - row: 23 - column: 36 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 24 - column: 0 - end_location: - row: 24 - column: 38 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 25 - column: 0 - end_location: - row: 25 - column: 56 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 26 - column: 0 - end_location: - row: 26 - column: 40 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 27 - column: 0 - end_location: - row: 27 - column: 44 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports are banned - suggestion: Replace relative imports with absolute imports - fixable: true - location: - row: 28 - column: 0 - end_location: - row: 28 - column: 62 - fix: ~ - parent: ~ +- - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 21 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 28 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 21 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 28 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 27 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 34 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 26 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 14 + column: 0 + end_location: + row: 16 + column: 19 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 17 + column: 0 + end_location: + row: 20 + column: 15 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 21 + column: 0 + end_location: + row: 21 + column: 34 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 22 + column: 0 + end_location: + row: 22 + column: 35 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 23 + column: 0 + end_location: + row: 23 + column: 36 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 38 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 25 + column: 0 + end_location: + row: 25 + column: 56 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 26 + column: 0 + end_location: + row: 26 + column: 40 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 27 + column: 0 + end_location: + row: 27 + column: 44 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports are banned + suggestion: Replace relative imports with absolute imports + fixable: true + location: + row: 28 + column: 0 + end_location: + row: 28 + column: 62 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports.snap b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports.snap index c8173563141c7a..2969d97afdb0ab 100644 --- a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports.snap +++ b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports.snap @@ -2,173 +2,173 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs expression: diagnostics --- -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 21 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 28 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 27 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 34 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 17 - column: 0 - end_location: - row: 20 - column: 15 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 21 - column: 0 - end_location: - row: 21 - column: 34 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 22 - column: 0 - end_location: - row: 22 - column: 35 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 23 - column: 0 - end_location: - row: 23 - column: 36 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 24 - column: 0 - end_location: - row: 24 - column: 38 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 25 - column: 0 - end_location: - row: 25 - column: 56 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 26 - column: 0 - end_location: - row: 26 - column: 40 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 27 - column: 0 - end_location: - row: 27 - column: 44 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 28 - column: 0 - end_location: - row: 28 - column: 62 - fix: ~ - parent: ~ +- - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 21 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 28 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 27 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 34 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true + location: + row: 17 + column: 0 + end_location: + row: 20 + column: 15 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true + location: + row: 21 + column: 0 + end_location: + row: 21 + column: 34 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true + location: + row: 22 + column: 0 + end_location: + row: 22 + column: 35 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true + location: + row: 23 + column: 0 + end_location: + row: 23 + column: 36 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 38 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true + location: + row: 25 + column: 0 + end_location: + row: 25 + column: 56 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true + location: + row: 26 + column: 0 + end_location: + row: 26 + column: 40 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true + location: + row: 27 + column: 0 + end_location: + row: 27 + column: 44 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true + location: + row: 28 + column: 0 + end_location: + row: 28 + column: 62 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports_package.snap b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports_package.snap index 0079f39870d38e..a99e1b88fc1610 100644 --- a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports_package.snap +++ b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports_package.snap @@ -2,77 +2,117 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs expression: diagnostics --- -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 23 - fix: ~ - parent: ~ -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 55 - fix: - content: "from my_package.sublib.protocol import commands, definitions, responses" +- - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 23 + fix: ~ + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 55 + fix: + content: "from my_package.sublib.protocol import commands, definitions, responses" + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 55 + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 55 + fix: + content: "from my_package.sublib.protocol import commands, definitions, responses" + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 55 + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 6 column: 0 end_location: row: 6 column: 55 - parent: ~ -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 28 - fix: - content: from my_package.sublib.server import example + fix: + content: "from my_package.sublib.protocol import commands, definitions, responses" + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 55 + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 7 column: 0 end_location: row: 7 column: 28 - parent: ~ -- kind: - name: RelativeImports - body: Relative imports from parent modules are banned - suggestion: Replace relative imports from parent modules with absolute imports - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 21 - fix: - content: from my_package.sublib import server + fix: + content: from my_package.sublib.server import example + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 28 + parent: ~ + - kind: + name: RelativeImports + body: Relative imports from parent modules are banned + suggestion: Replace relative imports from parent modules with absolute imports + fixable: true location: row: 8 column: 0 end_location: row: 8 column: 21 - parent: ~ + fix: + content: from my_package.sublib import server + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 21 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TCH005.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TCH005.py.snap index 878759b61ddbaa..5dd398fa651e08 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TCH005.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TCH005.py.snap @@ -2,104 +2,104 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: EmptyTypeCheckingBlock - body: Found empty type-checking block - suggestion: Delete empty type-checking block - fixable: true - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 8 - fix: - content: "" +- - kind: + name: EmptyTypeCheckingBlock + body: Found empty type-checking block + suggestion: Delete empty type-checking block + fixable: true location: - row: 3 - column: 0 + row: 4 + column: 4 end_location: - row: 5 - column: 0 - parent: ~ -- kind: - name: EmptyTypeCheckingBlock - body: Found empty type-checking block - suggestion: Delete empty type-checking block - fixable: true - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 8 - fix: - content: "" + row: 4 + column: 8 + fix: + content: "" + location: + row: 3 + column: 0 + end_location: + row: 5 + column: 0 + parent: ~ + - kind: + name: EmptyTypeCheckingBlock + body: Found empty type-checking block + suggestion: Delete empty type-checking block + fixable: true location: - row: 7 - column: 0 + row: 8 + column: 4 end_location: - row: 9 - column: 0 - parent: ~ -- kind: - name: EmptyTypeCheckingBlock - body: Found empty type-checking block - suggestion: Delete empty type-checking block - fixable: true - location: - row: 11 - column: 4 - end_location: - row: 11 - column: 8 - fix: - content: "" + row: 8 + column: 8 + fix: + content: "" + location: + row: 7 + column: 0 + end_location: + row: 9 + column: 0 + parent: ~ + - kind: + name: EmptyTypeCheckingBlock + body: Found empty type-checking block + suggestion: Delete empty type-checking block + fixable: true location: - row: 10 - column: 0 + row: 11 + column: 4 end_location: - row: 12 - column: 0 - parent: ~ -- kind: - name: EmptyTypeCheckingBlock - body: Found empty type-checking block - suggestion: Delete empty type-checking block - fixable: true - location: - row: 16 - column: 8 - end_location: - row: 16 - column: 12 - fix: - content: "" + row: 11 + column: 8 + fix: + content: "" + location: + row: 10 + column: 0 + end_location: + row: 12 + column: 0 + parent: ~ + - kind: + name: EmptyTypeCheckingBlock + body: Found empty type-checking block + suggestion: Delete empty type-checking block + fixable: true location: - row: 15 - column: 0 + row: 16 + column: 8 end_location: - row: 17 - column: 0 - parent: ~ -- kind: - name: EmptyTypeCheckingBlock - body: Found empty type-checking block - suggestion: Delete empty type-checking block - fixable: true - location: - row: 22 - column: 8 - end_location: - row: 22 - column: 12 - fix: - content: "" + row: 16 + column: 12 + fix: + content: "" + location: + row: 15 + column: 0 + end_location: + row: 17 + column: 0 + parent: ~ + - kind: + name: EmptyTypeCheckingBlock + body: Found empty type-checking block + suggestion: Delete empty type-checking block + fixable: true location: - row: 21 - column: 0 + row: 22 + column: 8 end_location: - row: 23 - column: 0 - parent: ~ + row: 22 + column: 12 + fix: + content: "" + location: + row: 21 + column: 0 + end_location: + row: 23 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__exempt_modules.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__exempt_modules.snap index aba8f65b1b1a5a..96b79ed6cdfcd5 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__exempt_modules.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__exempt_modules.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: TypingOnlyThirdPartyImport - body: "Move third-party import `flask` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 14 - column: 11 - end_location: - row: 14 - column: 16 - fix: ~ - parent: ~ +- - kind: + name: TypingOnlyThirdPartyImport + body: "Move third-party import `flask` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 14 + column: 11 + end_location: + row: 14 + column: 16 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_1.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_1.py.snap index 307476d0d9c520..8307b8d9db12f6 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_1.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_1.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: RuntimeImportInTypeCheckingBlock - body: "Move import `datetime.datetime` out of type-checking block. Import is used for more than type hinting." - suggestion: ~ - fixable: false - location: - row: 4 - column: 25 - end_location: - row: 4 - column: 33 - fix: ~ - parent: ~ +- - kind: + name: RuntimeImportInTypeCheckingBlock + body: "Move import `datetime.datetime` out of type-checking block. Import is used for more than type hinting." + suggestion: ~ + fixable: false + location: + row: 4 + column: 25 + end_location: + row: 4 + column: 33 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_10.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_10.py.snap index b308635bbdd2ee..80ec77d8175dbc 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_10.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_10.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_11.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_11.py.snap index 0dfb363fd0fd60..8732a6c24a453d 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_11.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_11.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: RuntimeImportInTypeCheckingBlock - body: "Move import `typing.List` out of type-checking block. Import is used for more than type hinting." - suggestion: ~ - fixable: false - location: - row: 4 - column: 23 - end_location: - row: 4 - column: 27 - fix: ~ - parent: ~ +- - kind: + name: RuntimeImportInTypeCheckingBlock + body: "Move import `typing.List` out of type-checking block. Import is used for more than type hinting." + suggestion: ~ + fixable: false + location: + row: 4 + column: 23 + end_location: + row: 4 + column: 27 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_12.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_12.py.snap index d009a67ad7deb1..89cd636a1aac13 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_12.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_12.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: RuntimeImportInTypeCheckingBlock - body: "Move import `collections.abc.Callable` out of type-checking block. Import is used for more than type hinting." - suggestion: ~ - fixable: false - location: - row: 6 - column: 32 - end_location: - row: 6 - column: 40 - fix: ~ - parent: ~ +- - kind: + name: RuntimeImportInTypeCheckingBlock + body: "Move import `collections.abc.Callable` out of type-checking block. Import is used for more than type hinting." + suggestion: ~ + fixable: false + location: + row: 6 + column: 32 + end_location: + row: 6 + column: 40 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_13.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_13.py.snap index b308635bbdd2ee..80ec77d8175dbc 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_13.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_13.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_14.pyi.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_14.pyi.snap index b308635bbdd2ee..80ec77d8175dbc 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_14.pyi.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_14.pyi.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_2.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_2.py.snap index 34456223b4e9c7..b534914ca6a06f 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_2.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_2.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: RuntimeImportInTypeCheckingBlock - body: "Move import `datetime.date` out of type-checking block. Import is used for more than type hinting." - suggestion: ~ - fixable: false - location: - row: 4 - column: 25 - end_location: - row: 4 - column: 29 - fix: ~ - parent: ~ +- - kind: + name: RuntimeImportInTypeCheckingBlock + body: "Move import `datetime.date` out of type-checking block. Import is used for more than type hinting." + suggestion: ~ + fixable: false + location: + row: 4 + column: 25 + end_location: + row: 4 + column: 29 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_3.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_3.py.snap index d1924b10c2c9e4..80ec77d8175dbc 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_3.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_3.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_type_checking/mod.rs +source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_4.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_4.py.snap index 17075ce3eb1014..27f75c4fbad2ee 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_4.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_4.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: RuntimeImportInTypeCheckingBlock - body: "Move import `typing.Any` out of type-checking block. Import is used for more than type hinting." - suggestion: ~ - fixable: false - location: - row: 4 - column: 23 - end_location: - row: 4 - column: 26 - fix: ~ - parent: ~ +- - kind: + name: RuntimeImportInTypeCheckingBlock + body: "Move import `typing.Any` out of type-checking block. Import is used for more than type hinting." + suggestion: ~ + fixable: false + location: + row: 4 + column: 23 + end_location: + row: 4 + column: 26 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_5.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_5.py.snap index 86762da70f0147..07709991e42830 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_5.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_5.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: RuntimeImportInTypeCheckingBlock - body: "Move import `typing.List` out of type-checking block. Import is used for more than type hinting." - suggestion: ~ - fixable: false - location: - row: 4 - column: 23 - end_location: - row: 4 - column: 27 - fix: ~ - parent: ~ -- kind: - name: RuntimeImportInTypeCheckingBlock - body: "Move import `typing.Sequence` out of type-checking block. Import is used for more than type hinting." - suggestion: ~ - fixable: false - location: - row: 4 - column: 29 - end_location: - row: 4 - column: 37 - fix: ~ - parent: ~ -- kind: - name: RuntimeImportInTypeCheckingBlock - body: "Move import `typing.Set` out of type-checking block. Import is used for more than type hinting." - suggestion: ~ - fixable: false - location: - row: 4 - column: 39 - end_location: - row: 4 - column: 42 - fix: ~ - parent: ~ +- - kind: + name: RuntimeImportInTypeCheckingBlock + body: "Move import `typing.List` out of type-checking block. Import is used for more than type hinting." + suggestion: ~ + fixable: false + location: + row: 4 + column: 23 + end_location: + row: 4 + column: 27 + fix: ~ + parent: ~ + - kind: + name: RuntimeImportInTypeCheckingBlock + body: "Move import `typing.Sequence` out of type-checking block. Import is used for more than type hinting." + suggestion: ~ + fixable: false + location: + row: 4 + column: 29 + end_location: + row: 4 + column: 37 + fix: ~ + parent: ~ + - kind: + name: RuntimeImportInTypeCheckingBlock + body: "Move import `typing.Set` out of type-checking block. Import is used for more than type hinting." + suggestion: ~ + fixable: false + location: + row: 4 + column: 39 + end_location: + row: 4 + column: 42 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_6.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_6.py.snap index d1924b10c2c9e4..80ec77d8175dbc 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_6.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_6.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_type_checking/mod.rs +source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_7.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_7.py.snap index d1924b10c2c9e4..80ec77d8175dbc 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_7.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_7.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_type_checking/mod.rs +source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_8.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_8.py.snap index b308635bbdd2ee..80ec77d8175dbc 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_8.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_8.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_9.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_9.py.snap index b7ab69ac2241aa..f47bc6abcfced3 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_9.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_9.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: RuntimeImportInTypeCheckingBlock - body: "Move import `typing.Tuple` out of type-checking block. Import is used for more than type hinting." - suggestion: ~ - fixable: false - location: - row: 4 - column: 23 - end_location: - row: 4 - column: 28 - fix: ~ - parent: ~ -- kind: - name: RuntimeImportInTypeCheckingBlock - body: "Move import `typing.List` out of type-checking block. Import is used for more than type hinting." - suggestion: ~ - fixable: false - location: - row: 4 - column: 30 - end_location: - row: 4 - column: 34 - fix: ~ - parent: ~ +- - kind: + name: RuntimeImportInTypeCheckingBlock + body: "Move import `typing.Tuple` out of type-checking block. Import is used for more than type hinting." + suggestion: ~ + fixable: false + location: + row: 4 + column: 23 + end_location: + row: 4 + column: 28 + fix: ~ + parent: ~ + - kind: + name: RuntimeImportInTypeCheckingBlock + body: "Move import `typing.List` out of type-checking block. Import is used for more than type hinting." + suggestion: ~ + fixable: false + location: + row: 4 + column: 30 + end_location: + row: 4 + column: 34 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap index a559c4d5fa4a46..15c677a3358279 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: RuntimeImportInTypeCheckingBlock - body: "Move import `datetime` out of type-checking block. Import is used for more than type hinting." - suggestion: ~ - fixable: false - location: - row: 10 - column: 11 - end_location: - row: 10 - column: 19 - fix: ~ - parent: ~ -- kind: - name: RuntimeImportInTypeCheckingBlock - body: "Move import `array.array` out of type-checking block. Import is used for more than type hinting." - suggestion: ~ - fixable: false - location: - row: 11 - column: 22 - end_location: - row: 11 - column: 27 - fix: ~ - parent: ~ -- kind: - name: RuntimeImportInTypeCheckingBlock - body: "Move import `pandas` out of type-checking block. Import is used for more than type hinting." - suggestion: ~ - fixable: false - location: - row: 13 - column: 11 - end_location: - row: 13 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: RuntimeImportInTypeCheckingBlock + body: "Move import `datetime` out of type-checking block. Import is used for more than type hinting." + suggestion: ~ + fixable: false + location: + row: 10 + column: 11 + end_location: + row: 10 + column: 19 + fix: ~ + parent: ~ + - kind: + name: RuntimeImportInTypeCheckingBlock + body: "Move import `array.array` out of type-checking block. Import is used for more than type hinting." + suggestion: ~ + fixable: false + location: + row: 11 + column: 22 + end_location: + row: 11 + column: 27 + fix: ~ + parent: ~ + - kind: + name: RuntimeImportInTypeCheckingBlock + body: "Move import `pandas` out of type-checking block. Import is used for more than type hinting." + suggestion: ~ + fixable: false + location: + row: 13 + column: 11 + end_location: + row: 13 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap index ffff6d8db94c12..966d30d3bfe105 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: RuntimeImportInTypeCheckingBlock - body: "Move import `datetime` out of type-checking block. Import is used for more than type hinting." - suggestion: ~ - fixable: false - location: - row: 12 - column: 11 - end_location: - row: 12 - column: 19 - fix: ~ - parent: ~ -- kind: - name: RuntimeImportInTypeCheckingBlock - body: "Move import `array.array` out of type-checking block. Import is used for more than type hinting." - suggestion: ~ - fixable: false - location: - row: 13 - column: 22 - end_location: - row: 13 - column: 27 - fix: ~ - parent: ~ -- kind: - name: RuntimeImportInTypeCheckingBlock - body: "Move import `pandas` out of type-checking block. Import is used for more than type hinting." - suggestion: ~ - fixable: false - location: - row: 15 - column: 11 - end_location: - row: 15 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: RuntimeImportInTypeCheckingBlock + body: "Move import `datetime` out of type-checking block. Import is used for more than type hinting." + suggestion: ~ + fixable: false + location: + row: 12 + column: 11 + end_location: + row: 12 + column: 19 + fix: ~ + parent: ~ + - kind: + name: RuntimeImportInTypeCheckingBlock + body: "Move import `array.array` out of type-checking block. Import is used for more than type hinting." + suggestion: ~ + fixable: false + location: + row: 13 + column: 22 + end_location: + row: 13 + column: 27 + fix: ~ + parent: ~ + - kind: + name: RuntimeImportInTypeCheckingBlock + body: "Move import `pandas` out of type-checking block. Import is used for more than type hinting." + suggestion: ~ + fixable: false + location: + row: 15 + column: 11 + end_location: + row: 15 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__strict.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__strict.snap index 0851e7d6b56093..f43069e7bc7ace 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__strict.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__strict.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: TypingOnlyThirdPartyImport - body: "Move third-party import `pkg.A` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 24 - column: 20 - end_location: - row: 24 - column: 21 - fix: ~ - parent: ~ -- kind: - name: TypingOnlyThirdPartyImport - body: "Move third-party import `pkg.A` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 32 - column: 20 - end_location: - row: 32 - column: 21 - fix: ~ - parent: ~ -- kind: - name: TypingOnlyThirdPartyImport - body: "Move third-party import `pkg.bar.A` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 51 - column: 24 - end_location: - row: 51 - column: 25 - fix: ~ - parent: ~ +- - kind: + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pkg.A` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 24 + column: 20 + end_location: + row: 24 + column: 21 + fix: ~ + parent: ~ + - kind: + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pkg.A` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 32 + column: 20 + end_location: + row: 32 + column: 21 + fix: ~ + parent: ~ + - kind: + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pkg.bar.A` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 51 + column: 24 + end_location: + row: 51 + column: 25 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TCH001.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TCH001.py.snap index 741a9def50c1b0..25e8e482672996 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TCH001.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TCH001.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: TypingOnlyFirstPartyImport - body: "Move application import `.TYP001` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 20 - column: 18 - end_location: - row: 20 - column: 24 - fix: ~ - parent: ~ +- - kind: + name: TypingOnlyFirstPartyImport + body: "Move application import `.TYP001` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 20 + column: 18 + end_location: + row: 20 + column: 24 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TCH003.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TCH003.py.snap index ac3db1ea808226..73a19180a28153 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TCH003.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TCH003.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: TypingOnlyStandardLibraryImport - body: "Move standard library import `os` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 8 - column: 11 - end_location: - row: 8 - column: 13 - fix: ~ - parent: ~ +- - kind: + name: TypingOnlyStandardLibraryImport + body: "Move standard library import `os` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 8 + column: 11 + end_location: + row: 8 + column: 13 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_base_classes_3.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_base_classes_3.py.snap index cd98cae8e145dc..b6b64509cfb3fe 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_base_classes_3.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_base_classes_3.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: TypingOnlyStandardLibraryImport - body: "Move standard library import `uuid.UUID` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 5 - column: 17 - end_location: - row: 5 - column: 21 - fix: ~ - parent: ~ +- - kind: + name: TypingOnlyStandardLibraryImport + body: "Move standard library import `uuid.UUID` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 5 + column: 17 + end_location: + row: 5 + column: 21 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_decorators_3.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_decorators_3.py.snap index ef65e746bd3b88..2024c4b04f164e 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_decorators_3.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_decorators_3.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: TypingOnlyStandardLibraryImport - body: "Move standard library import `uuid.UUID` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 6 - column: 17 - end_location: - row: 6 - column: 21 - fix: ~ - parent: ~ +- - kind: + name: TypingOnlyStandardLibraryImport + body: "Move standard library import `uuid.UUID` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 6 + column: 17 + end_location: + row: 6 + column: 21 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TCH002.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TCH002.py.snap index 0384b0d2d7cea3..4f9aa44cedb6ce 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TCH002.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TCH002.py.snap @@ -2,108 +2,108 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: TypingOnlyThirdPartyImport - body: "Move third-party import `pandas` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 5 - column: 11 - end_location: - row: 5 - column: 23 - fix: ~ - parent: ~ -- kind: - name: TypingOnlyThirdPartyImport - body: "Move third-party import `pandas.DataFrame` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 11 - column: 23 - end_location: - row: 11 - column: 32 - fix: ~ - parent: ~ -- kind: - name: TypingOnlyThirdPartyImport - body: "Move third-party import `pandas.DataFrame` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 17 - column: 23 - end_location: - row: 17 - column: 38 - fix: ~ - parent: ~ -- kind: - name: TypingOnlyThirdPartyImport - body: "Move third-party import `pandas` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 23 - column: 11 - end_location: - row: 23 - column: 23 - fix: ~ - parent: ~ -- kind: - name: TypingOnlyThirdPartyImport - body: "Move third-party import `pandas.DataFrame` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 29 - column: 23 - end_location: - row: 29 - column: 32 - fix: ~ - parent: ~ -- kind: - name: TypingOnlyThirdPartyImport - body: "Move third-party import `pandas.DataFrame` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 35 - column: 23 - end_location: - row: 35 - column: 38 - fix: ~ - parent: ~ -- kind: - name: TypingOnlyThirdPartyImport - body: "Move third-party import `pandas` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 41 - column: 11 - end_location: - row: 41 - column: 23 - fix: ~ - parent: ~ -- kind: - name: TypingOnlyThirdPartyImport - body: "Move third-party import `pandas` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 47 - column: 11 - end_location: - row: 47 - column: 23 - fix: ~ - parent: ~ +- - kind: + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pandas` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 5 + column: 11 + end_location: + row: 5 + column: 23 + fix: ~ + parent: ~ + - kind: + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pandas.DataFrame` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 11 + column: 23 + end_location: + row: 11 + column: 32 + fix: ~ + parent: ~ + - kind: + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pandas.DataFrame` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 17 + column: 23 + end_location: + row: 17 + column: 38 + fix: ~ + parent: ~ + - kind: + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pandas` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 23 + column: 11 + end_location: + row: 23 + column: 23 + fix: ~ + parent: ~ + - kind: + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pandas.DataFrame` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 29 + column: 23 + end_location: + row: 29 + column: 32 + fix: ~ + parent: ~ + - kind: + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pandas.DataFrame` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 35 + column: 23 + end_location: + row: 35 + column: 38 + fix: ~ + parent: ~ + - kind: + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pandas` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 41 + column: 11 + end_location: + row: 41 + column: 23 + fix: ~ + parent: ~ + - kind: + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pandas` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 47 + column: 11 + end_location: + row: 47 + column: 23 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_base_classes_2.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_base_classes_2.py.snap index 4ce589f1e6f71c..ff4bb066bf395d 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_base_classes_2.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_base_classes_2.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: TypingOnlyThirdPartyImport - body: "Move third-party import `geopandas` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 3 - column: 7 - end_location: - row: 3 - column: 23 - fix: ~ - parent: ~ -- kind: - name: TypingOnlyThirdPartyImport - body: "Move third-party import `pyproj` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 5 - column: 7 - end_location: - row: 5 - column: 13 - fix: ~ - parent: ~ +- - kind: + name: TypingOnlyThirdPartyImport + body: "Move third-party import `geopandas` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 3 + column: 7 + end_location: + row: 3 + column: 23 + fix: ~ + parent: ~ + - kind: + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pyproj` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 5 + column: 7 + end_location: + row: 5 + column: 13 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap index 10d5bf0a8bcdc4..e29f6eefcc1db2 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: TypingOnlyThirdPartyImport - body: "Move third-party import `numpy` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 10 - column: 7 - end_location: - row: 10 - column: 12 - fix: ~ - parent: ~ +- - kind: + name: TypingOnlyThirdPartyImport + body: "Move third-party import `numpy` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 10 + column: 7 + end_location: + row: 10 + column: 12 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_strict.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_strict.py.snap index c2e9668c68e5b9..eaa83630d45dcb 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_strict.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_strict.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs expression: diagnostics --- -- kind: - name: TypingOnlyThirdPartyImport - body: "Move third-party import `pkg.bar.A` into a type-checking block" - suggestion: ~ - fixable: false - location: - row: 51 - column: 24 - end_location: - row: 51 - column: 25 - fix: ~ - parent: ~ +- - kind: + name: TypingOnlyThirdPartyImport + body: "Move third-party import `pkg.bar.A` into a type-checking block" + suggestion: ~ + fixable: false + location: + row: 51 + column: 24 + end_location: + row: 51 + column: 25 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG001_ARG.py.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG001_ARG.py.snap index 218dbd1b3b2a51..e0dbda641bd2b5 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG001_ARG.py.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG001_ARG.py.snap @@ -2,108 +2,108 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs expression: diagnostics --- -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `self`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 6 - end_location: - row: 9 - column: 10 - fix: ~ - parent: ~ -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `x`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 12 - end_location: - row: 9 - column: 13 - fix: ~ - parent: ~ -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `cls`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 6 - end_location: - row: 13 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `x`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 11 - end_location: - row: 13 - column: 12 - fix: ~ - parent: ~ -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `self`" - suggestion: ~ - fixable: false - location: - row: 17 - column: 6 - end_location: - row: 17 - column: 10 - fix: ~ - parent: ~ -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `x`" - suggestion: ~ - fixable: false - location: - row: 17 - column: 12 - end_location: - row: 17 - column: 13 - fix: ~ - parent: ~ -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `cls`" - suggestion: ~ - fixable: false - location: - row: 21 - column: 6 - end_location: - row: 21 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `x`" - suggestion: ~ - fixable: false - location: - row: 21 - column: 11 - end_location: - row: 21 - column: 12 - fix: ~ - parent: ~ +- - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `self`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 6 + end_location: + row: 9 + column: 10 + fix: ~ + parent: ~ + - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `x`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 12 + end_location: + row: 9 + column: 13 + fix: ~ + parent: ~ + - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `cls`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 6 + end_location: + row: 13 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `x`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 11 + end_location: + row: 13 + column: 12 + fix: ~ + parent: ~ + - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `self`" + suggestion: ~ + fixable: false + location: + row: 17 + column: 6 + end_location: + row: 17 + column: 10 + fix: ~ + parent: ~ + - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `x`" + suggestion: ~ + fixable: false + location: + row: 17 + column: 12 + end_location: + row: 17 + column: 13 + fix: ~ + parent: ~ + - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `cls`" + suggestion: ~ + fixable: false + location: + row: 21 + column: 6 + end_location: + row: 21 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `x`" + suggestion: ~ + fixable: false + location: + row: 21 + column: 11 + end_location: + row: 21 + column: 12 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG002_ARG.py.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG002_ARG.py.snap index 1ea9777e08fd42..0c948ea49d1394 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG002_ARG.py.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG002_ARG.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs expression: diagnostics --- -- kind: - name: UnusedMethodArgument - body: "Unused method argument: `x`" - suggestion: ~ - fixable: false - location: - row: 35 - column: 16 - end_location: - row: 35 - column: 17 - fix: ~ - parent: ~ -- kind: - name: UnusedMethodArgument - body: "Unused method argument: `x`" - suggestion: ~ - fixable: false - location: - row: 38 - column: 19 - end_location: - row: 38 - column: 20 - fix: ~ - parent: ~ -- kind: - name: UnusedMethodArgument - body: "Unused method argument: `x`" - suggestion: ~ - fixable: false - location: - row: 41 - column: 15 - end_location: - row: 41 - column: 16 - fix: ~ - parent: ~ -- kind: - name: UnusedMethodArgument - body: "Unused method argument: `x`" - suggestion: ~ - fixable: false - location: - row: 190 - column: 23 - end_location: - row: 190 - column: 24 - fix: ~ - parent: ~ +- - kind: + name: UnusedMethodArgument + body: "Unused method argument: `x`" + suggestion: ~ + fixable: false + location: + row: 35 + column: 16 + end_location: + row: 35 + column: 17 + fix: ~ + parent: ~ + - kind: + name: UnusedMethodArgument + body: "Unused method argument: `x`" + suggestion: ~ + fixable: false + location: + row: 38 + column: 19 + end_location: + row: 38 + column: 20 + fix: ~ + parent: ~ + - kind: + name: UnusedMethodArgument + body: "Unused method argument: `x`" + suggestion: ~ + fixable: false + location: + row: 41 + column: 15 + end_location: + row: 41 + column: 16 + fix: ~ + parent: ~ + - kind: + name: UnusedMethodArgument + body: "Unused method argument: `x`" + suggestion: ~ + fixable: false + location: + row: 190 + column: 23 + end_location: + row: 190 + column: 24 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG003_ARG.py.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG003_ARG.py.snap index eadbaeaad7bae0..628ba9b4d2793b 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG003_ARG.py.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG003_ARG.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs expression: diagnostics --- -- kind: - name: UnusedClassMethodArgument - body: "Unused class method argument: `x`" - suggestion: ~ - fixable: false - location: - row: 45 - column: 15 - end_location: - row: 45 - column: 16 - fix: ~ - parent: ~ +- - kind: + name: UnusedClassMethodArgument + body: "Unused class method argument: `x`" + suggestion: ~ + fixable: false + location: + row: 45 + column: 15 + end_location: + row: 45 + column: 16 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG004_ARG.py.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG004_ARG.py.snap index 1eea3ea6e4ceda..2a5e60535e1930 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG004_ARG.py.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG004_ARG.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs expression: diagnostics --- -- kind: - name: UnusedStaticMethodArgument - body: "Unused static method argument: `cls`" - suggestion: ~ - fixable: false - location: - row: 49 - column: 10 - end_location: - row: 49 - column: 13 - fix: ~ - parent: ~ -- kind: - name: UnusedStaticMethodArgument - body: "Unused static method argument: `x`" - suggestion: ~ - fixable: false - location: - row: 49 - column: 15 - end_location: - row: 49 - column: 16 - fix: ~ - parent: ~ -- kind: - name: UnusedStaticMethodArgument - body: "Unused static method argument: `x`" - suggestion: ~ - fixable: false - location: - row: 53 - column: 10 - end_location: - row: 53 - column: 11 - fix: ~ - parent: ~ +- - kind: + name: UnusedStaticMethodArgument + body: "Unused static method argument: `cls`" + suggestion: ~ + fixable: false + location: + row: 49 + column: 10 + end_location: + row: 49 + column: 13 + fix: ~ + parent: ~ + - kind: + name: UnusedStaticMethodArgument + body: "Unused static method argument: `x`" + suggestion: ~ + fixable: false + location: + row: 49 + column: 15 + end_location: + row: 49 + column: 16 + fix: ~ + parent: ~ + - kind: + name: UnusedStaticMethodArgument + body: "Unused static method argument: `x`" + suggestion: ~ + fixable: false + location: + row: 53 + column: 10 + end_location: + row: 53 + column: 11 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG005_ARG.py.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG005_ARG.py.snap index afd9bf361761d3..1b6e693831de73 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG005_ARG.py.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG005_ARG.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs expression: diagnostics --- -- kind: - name: UnusedLambdaArgument - body: "Unused lambda argument: `x`" - suggestion: ~ - fixable: false - location: - row: 28 - column: 7 - end_location: - row: 28 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: UnusedLambdaArgument + body: "Unused lambda argument: `x`" + suggestion: ~ + fixable: false + location: + row: 28 + column: 7 + end_location: + row: 28 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__enforce_variadic_names.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__enforce_variadic_names.snap index 703553a4ace5ba..ee30b3f0505329 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__enforce_variadic_names.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__enforce_variadic_names.snap @@ -2,160 +2,160 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs expression: diagnostics --- -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `a`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 6 - end_location: - row: 1 - column: 7 - fix: ~ - parent: ~ -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `b`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 9 - end_location: - row: 1 - column: 10 - fix: ~ - parent: ~ -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `a`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 6 - end_location: - row: 5 - column: 7 - fix: ~ - parent: ~ -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `b`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 9 - end_location: - row: 5 - column: 10 - fix: ~ - parent: ~ -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `args`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 13 - end_location: - row: 5 - column: 17 - fix: ~ - parent: ~ -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `kwargs`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 21 - end_location: - row: 5 - column: 27 - fix: ~ - parent: ~ -- kind: - name: UnusedMethodArgument - body: "Unused method argument: `a`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 16 - end_location: - row: 10 - column: 17 - fix: ~ - parent: ~ -- kind: - name: UnusedMethodArgument - body: "Unused method argument: `b`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 19 - end_location: - row: 10 - column: 20 - fix: ~ - parent: ~ -- kind: - name: UnusedMethodArgument - body: "Unused method argument: `a`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 16 - end_location: - row: 13 - column: 17 - fix: ~ - parent: ~ -- kind: - name: UnusedMethodArgument - body: "Unused method argument: `b`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 19 - end_location: - row: 13 - column: 20 - fix: ~ - parent: ~ -- kind: - name: UnusedMethodArgument - body: "Unused method argument: `args`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 23 - end_location: - row: 13 - column: 27 - fix: ~ - parent: ~ -- kind: - name: UnusedMethodArgument - body: "Unused method argument: `kwargs`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 31 - end_location: - row: 13 - column: 37 - fix: ~ - parent: ~ +- - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `a`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 6 + end_location: + row: 1 + column: 7 + fix: ~ + parent: ~ + - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `b`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 9 + end_location: + row: 1 + column: 10 + fix: ~ + parent: ~ + - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `a`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 6 + end_location: + row: 5 + column: 7 + fix: ~ + parent: ~ + - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `b`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 9 + end_location: + row: 5 + column: 10 + fix: ~ + parent: ~ + - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `args`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 13 + end_location: + row: 5 + column: 17 + fix: ~ + parent: ~ + - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `kwargs`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 21 + end_location: + row: 5 + column: 27 + fix: ~ + parent: ~ + - kind: + name: UnusedMethodArgument + body: "Unused method argument: `a`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 16 + end_location: + row: 10 + column: 17 + fix: ~ + parent: ~ + - kind: + name: UnusedMethodArgument + body: "Unused method argument: `b`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 19 + end_location: + row: 10 + column: 20 + fix: ~ + parent: ~ + - kind: + name: UnusedMethodArgument + body: "Unused method argument: `a`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 16 + end_location: + row: 13 + column: 17 + fix: ~ + parent: ~ + - kind: + name: UnusedMethodArgument + body: "Unused method argument: `b`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 19 + end_location: + row: 13 + column: 20 + fix: ~ + parent: ~ + - kind: + name: UnusedMethodArgument + body: "Unused method argument: `args`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 23 + end_location: + row: 13 + column: 27 + fix: ~ + parent: ~ + - kind: + name: UnusedMethodArgument + body: "Unused method argument: `kwargs`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 31 + end_location: + row: 13 + column: 37 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ignore_variadic_names.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ignore_variadic_names.snap index 3f6885aad08881..3d840082f1394f 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ignore_variadic_names.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ignore_variadic_names.snap @@ -2,108 +2,108 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs expression: diagnostics --- -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `a`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 6 - end_location: - row: 1 - column: 7 - fix: ~ - parent: ~ -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `b`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 9 - end_location: - row: 1 - column: 10 - fix: ~ - parent: ~ -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `a`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 6 - end_location: - row: 5 - column: 7 - fix: ~ - parent: ~ -- kind: - name: UnusedFunctionArgument - body: "Unused function argument: `b`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 9 - end_location: - row: 5 - column: 10 - fix: ~ - parent: ~ -- kind: - name: UnusedMethodArgument - body: "Unused method argument: `a`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 16 - end_location: - row: 10 - column: 17 - fix: ~ - parent: ~ -- kind: - name: UnusedMethodArgument - body: "Unused method argument: `b`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 19 - end_location: - row: 10 - column: 20 - fix: ~ - parent: ~ -- kind: - name: UnusedMethodArgument - body: "Unused method argument: `a`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 16 - end_location: - row: 13 - column: 17 - fix: ~ - parent: ~ -- kind: - name: UnusedMethodArgument - body: "Unused method argument: `b`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 19 - end_location: - row: 13 - column: 20 - fix: ~ - parent: ~ +- - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `a`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 6 + end_location: + row: 1 + column: 7 + fix: ~ + parent: ~ + - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `b`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 9 + end_location: + row: 1 + column: 10 + fix: ~ + parent: ~ + - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `a`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 6 + end_location: + row: 5 + column: 7 + fix: ~ + parent: ~ + - kind: + name: UnusedFunctionArgument + body: "Unused function argument: `b`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 9 + end_location: + row: 5 + column: 10 + fix: ~ + parent: ~ + - kind: + name: UnusedMethodArgument + body: "Unused method argument: `a`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 16 + end_location: + row: 10 + column: 17 + fix: ~ + parent: ~ + - kind: + name: UnusedMethodArgument + body: "Unused method argument: `b`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 19 + end_location: + row: 10 + column: 20 + fix: ~ + parent: ~ + - kind: + name: UnusedMethodArgument + body: "Unused method argument: `a`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 16 + end_location: + row: 13 + column: 17 + fix: ~ + parent: ~ + - kind: + name: UnusedMethodArgument + body: "Unused method argument: `b`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 19 + end_location: + row: 13 + column: 20 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_1.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_1.py.snap index e883d38ff7ac28..d8dfc59c345137 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_1.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_1.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs expression: diagnostics --- -- kind: - name: PathlibPyPath - body: "`py.path` is in maintenance mode, use `pathlib` instead" - suggestion: ~ - fixable: false - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: PathlibPyPath + body: "`py.path` is in maintenance mode, use `pathlib` instead" + suggestion: ~ + fixable: false + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_2.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_2.py.snap index 7a0304d1c0ed27..9da8c604781fdc 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_2.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_2.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs expression: diagnostics --- -- kind: - name: PathlibPyPath - body: "`py.path` is in maintenance mode, use `pathlib` instead" - suggestion: ~ - fixable: false - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: PathlibPyPath + body: "`py.path` is in maintenance mode, use `pathlib` instead" + suggestion: ~ + fixable: false + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__full_name.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__full_name.py.snap index 5d32cde4c131c8..6c2dbdfe1fa841 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__full_name.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__full_name.py.snap @@ -2,342 +2,342 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs expression: diagnostics --- -- kind: - name: PathlibAbspath - body: "`os.path.abspath()` should be replaced by `Path.resolve()`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 19 - fix: ~ - parent: ~ -- kind: - name: PathlibChmod - body: "`os.chmod()` should be replaced by `Path.chmod()`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 5 - end_location: - row: 7 - column: 13 - fix: ~ - parent: ~ -- kind: - name: PathlibMkdir - body: "`os.mkdir()` should be replaced by `Path.mkdir()`" - suggestion: ~ - fixable: false - location: - row: 8 - column: 6 - end_location: - row: 8 - column: 14 - fix: ~ - parent: ~ -- kind: - name: PathlibMakedirs - body: "`os.makedirs()` should be replaced by `Path.mkdir(parents=True)`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 11 - fix: ~ - parent: ~ -- kind: - name: PathlibRename - body: "`os.rename()` should be replaced by `Path.rename()`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 9 - fix: ~ - parent: ~ -- kind: - name: PathlibReplace - body: "`os.replace()` should be replaced by `Path.replace()`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 10 - fix: ~ - parent: ~ -- kind: - name: PathlibRmdir - body: "`os.rmdir()` should be replaced by `Path.rmdir()`" - suggestion: ~ - fixable: false - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 8 - fix: ~ - parent: ~ -- kind: - name: PathlibRemove - body: "`os.remove()` should be replaced by `Path.unlink()`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 9 - fix: ~ - parent: ~ -- kind: - name: PathlibUnlink - body: "`os.unlink()` should be replaced by `Path.unlink()`" - suggestion: ~ - fixable: false - location: - row: 14 - column: 0 - end_location: - row: 14 - column: 9 - fix: ~ - parent: ~ -- kind: - name: PathlibGetcwd - body: "`os.getcwd()` should be replaced by `Path.cwd()`" - suggestion: ~ - fixable: false - location: - row: 15 - column: 0 - end_location: - row: 15 - column: 9 - fix: ~ - parent: ~ -- kind: - name: PathlibExists - body: "`os.path.exists()` should be replaced by `Path.exists()`" - suggestion: ~ - fixable: false - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 18 - fix: ~ - parent: ~ -- kind: - name: PathlibExpanduser - body: "`os.path.expanduser()` should be replaced by `Path.expanduser()`" - suggestion: ~ - fixable: false - location: - row: 17 - column: 5 - end_location: - row: 17 - column: 23 - fix: ~ - parent: ~ -- kind: - name: PathlibIsDir - body: "`os.path.isdir()` should be replaced by `Path.is_dir()`" - suggestion: ~ - fixable: false - location: - row: 18 - column: 6 - end_location: - row: 18 - column: 19 - fix: ~ - parent: ~ -- kind: - name: PathlibIsFile - body: "`os.path.isfile()` should be replaced by `Path.is_file()`" - suggestion: ~ - fixable: false - location: - row: 19 - column: 7 - end_location: - row: 19 - column: 21 - fix: ~ - parent: ~ -- kind: - name: PathlibIsLink - body: "`os.path.islink()` should be replaced by `Path.is_symlink()`" - suggestion: ~ - fixable: false - location: - row: 20 - column: 8 - end_location: - row: 20 - column: 22 - fix: ~ - parent: ~ -- kind: - name: PathlibReadlink - body: "`os.readlink()` should be replaced by `Path.readlink()`" - suggestion: ~ - fixable: false - location: - row: 21 - column: 0 - end_location: - row: 21 - column: 11 - fix: ~ - parent: ~ -- kind: - name: PathlibStat - body: "`os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()`" - suggestion: ~ - fixable: false - location: - row: 22 - column: 0 - end_location: - row: 22 - column: 7 - fix: ~ - parent: ~ -- kind: - name: PathlibIsAbs - body: "`os.path.isabs()` should be replaced by `Path.is_absolute()`" - suggestion: ~ - fixable: false - location: - row: 23 - column: 0 - end_location: - row: 23 - column: 13 - fix: ~ - parent: ~ -- kind: - name: PathlibJoin - body: "`os.path.join()` should be replaced by `Path` with `/` operator" - suggestion: ~ - fixable: false - location: - row: 24 - column: 0 - end_location: - row: 24 - column: 12 - fix: ~ - parent: ~ -- kind: - name: PathlibBasename - body: "`os.path.basename()` should be replaced by `Path.name`" - suggestion: ~ - fixable: false - location: - row: 25 - column: 0 - end_location: - row: 25 - column: 16 - fix: ~ - parent: ~ -- kind: - name: PathlibDirname - body: "`os.path.dirname()` should be replaced by `Path.parent`" - suggestion: ~ - fixable: false - location: - row: 26 - column: 0 - end_location: - row: 26 - column: 15 - fix: ~ - parent: ~ -- kind: - name: PathlibSamefile - body: "`os.path.samefile()` should be replaced by `Path.samefile()`" - suggestion: ~ - fixable: false - location: - row: 27 - column: 0 - end_location: - row: 27 - column: 16 - fix: ~ - parent: ~ -- kind: - name: PathlibSplitext - body: "`os.path.splitext()` should be replaced by `Path.suffix`" - suggestion: ~ - fixable: false - location: - row: 28 - column: 0 - end_location: - row: 28 - column: 16 - fix: ~ - parent: ~ -- kind: - name: PathlibOpen - body: "`open()` should be replaced by `Path.open()`" - suggestion: ~ - fixable: false - location: - row: 29 - column: 5 - end_location: - row: 29 - column: 9 - fix: ~ - parent: ~ -- kind: - name: PathlibOpen - body: "`open()` should be replaced by `Path.open()`" - suggestion: ~ - fixable: false - location: - row: 31 - column: 0 - end_location: - row: 31 - column: 4 - fix: ~ - parent: ~ -- kind: - name: PathlibGetcwd - body: "`os.getcwd()` should be replaced by `Path.cwd()`" - suggestion: ~ - fixable: false - location: - row: 32 - column: 0 - end_location: - row: 32 - column: 10 - fix: ~ - parent: ~ +- - kind: + name: PathlibAbspath + body: "`os.path.abspath()` should be replaced by `Path.resolve()`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 4 + end_location: + row: 6 + column: 19 + fix: ~ + parent: ~ + - kind: + name: PathlibChmod + body: "`os.chmod()` should be replaced by `Path.chmod()`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 5 + end_location: + row: 7 + column: 13 + fix: ~ + parent: ~ + - kind: + name: PathlibMkdir + body: "`os.mkdir()` should be replaced by `Path.mkdir()`" + suggestion: ~ + fixable: false + location: + row: 8 + column: 6 + end_location: + row: 8 + column: 14 + fix: ~ + parent: ~ + - kind: + name: PathlibMakedirs + body: "`os.makedirs()` should be replaced by `Path.mkdir(parents=True)`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 11 + fix: ~ + parent: ~ + - kind: + name: PathlibRename + body: "`os.rename()` should be replaced by `Path.rename()`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 9 + fix: ~ + parent: ~ + - kind: + name: PathlibReplace + body: "`os.replace()` should be replaced by `Path.replace()`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 10 + fix: ~ + parent: ~ + - kind: + name: PathlibRmdir + body: "`os.rmdir()` should be replaced by `Path.rmdir()`" + suggestion: ~ + fixable: false + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 8 + fix: ~ + parent: ~ + - kind: + name: PathlibRemove + body: "`os.remove()` should be replaced by `Path.unlink()`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 9 + fix: ~ + parent: ~ + - kind: + name: PathlibUnlink + body: "`os.unlink()` should be replaced by `Path.unlink()`" + suggestion: ~ + fixable: false + location: + row: 14 + column: 0 + end_location: + row: 14 + column: 9 + fix: ~ + parent: ~ + - kind: + name: PathlibGetcwd + body: "`os.getcwd()` should be replaced by `Path.cwd()`" + suggestion: ~ + fixable: false + location: + row: 15 + column: 0 + end_location: + row: 15 + column: 9 + fix: ~ + parent: ~ + - kind: + name: PathlibExists + body: "`os.path.exists()` should be replaced by `Path.exists()`" + suggestion: ~ + fixable: false + location: + row: 16 + column: 4 + end_location: + row: 16 + column: 18 + fix: ~ + parent: ~ + - kind: + name: PathlibExpanduser + body: "`os.path.expanduser()` should be replaced by `Path.expanduser()`" + suggestion: ~ + fixable: false + location: + row: 17 + column: 5 + end_location: + row: 17 + column: 23 + fix: ~ + parent: ~ + - kind: + name: PathlibIsDir + body: "`os.path.isdir()` should be replaced by `Path.is_dir()`" + suggestion: ~ + fixable: false + location: + row: 18 + column: 6 + end_location: + row: 18 + column: 19 + fix: ~ + parent: ~ + - kind: + name: PathlibIsFile + body: "`os.path.isfile()` should be replaced by `Path.is_file()`" + suggestion: ~ + fixable: false + location: + row: 19 + column: 7 + end_location: + row: 19 + column: 21 + fix: ~ + parent: ~ + - kind: + name: PathlibIsLink + body: "`os.path.islink()` should be replaced by `Path.is_symlink()`" + suggestion: ~ + fixable: false + location: + row: 20 + column: 8 + end_location: + row: 20 + column: 22 + fix: ~ + parent: ~ + - kind: + name: PathlibReadlink + body: "`os.readlink()` should be replaced by `Path.readlink()`" + suggestion: ~ + fixable: false + location: + row: 21 + column: 0 + end_location: + row: 21 + column: 11 + fix: ~ + parent: ~ + - kind: + name: PathlibStat + body: "`os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()`" + suggestion: ~ + fixable: false + location: + row: 22 + column: 0 + end_location: + row: 22 + column: 7 + fix: ~ + parent: ~ + - kind: + name: PathlibIsAbs + body: "`os.path.isabs()` should be replaced by `Path.is_absolute()`" + suggestion: ~ + fixable: false + location: + row: 23 + column: 0 + end_location: + row: 23 + column: 13 + fix: ~ + parent: ~ + - kind: + name: PathlibJoin + body: "`os.path.join()` should be replaced by `Path` with `/` operator" + suggestion: ~ + fixable: false + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 12 + fix: ~ + parent: ~ + - kind: + name: PathlibBasename + body: "`os.path.basename()` should be replaced by `Path.name`" + suggestion: ~ + fixable: false + location: + row: 25 + column: 0 + end_location: + row: 25 + column: 16 + fix: ~ + parent: ~ + - kind: + name: PathlibDirname + body: "`os.path.dirname()` should be replaced by `Path.parent`" + suggestion: ~ + fixable: false + location: + row: 26 + column: 0 + end_location: + row: 26 + column: 15 + fix: ~ + parent: ~ + - kind: + name: PathlibSamefile + body: "`os.path.samefile()` should be replaced by `Path.samefile()`" + suggestion: ~ + fixable: false + location: + row: 27 + column: 0 + end_location: + row: 27 + column: 16 + fix: ~ + parent: ~ + - kind: + name: PathlibSplitext + body: "`os.path.splitext()` should be replaced by `Path.suffix`" + suggestion: ~ + fixable: false + location: + row: 28 + column: 0 + end_location: + row: 28 + column: 16 + fix: ~ + parent: ~ + - kind: + name: PathlibOpen + body: "`open()` should be replaced by `Path.open()`" + suggestion: ~ + fixable: false + location: + row: 29 + column: 5 + end_location: + row: 29 + column: 9 + fix: ~ + parent: ~ + - kind: + name: PathlibOpen + body: "`open()` should be replaced by `Path.open()`" + suggestion: ~ + fixable: false + location: + row: 31 + column: 0 + end_location: + row: 31 + column: 4 + fix: ~ + parent: ~ + - kind: + name: PathlibGetcwd + body: "`os.getcwd()` should be replaced by `Path.cwd()`" + suggestion: ~ + fixable: false + location: + row: 32 + column: 0 + end_location: + row: 32 + column: 10 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_as.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_as.py.snap index 64057ab7ea58f8..0265c696edbe6c 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_as.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_as.py.snap @@ -2,303 +2,303 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs expression: diagnostics --- -- kind: - name: PathlibAbspath - body: "`os.path.abspath()` should be replaced by `Path.resolve()`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 17 - fix: ~ - parent: ~ -- kind: - name: PathlibChmod - body: "`os.chmod()` should be replaced by `Path.chmod()`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 5 - end_location: - row: 7 - column: 14 - fix: ~ - parent: ~ -- kind: - name: PathlibMkdir - body: "`os.mkdir()` should be replaced by `Path.mkdir()`" - suggestion: ~ - fixable: false - location: - row: 8 - column: 6 - end_location: - row: 8 - column: 15 - fix: ~ - parent: ~ -- kind: - name: PathlibMakedirs - body: "`os.makedirs()` should be replaced by `Path.mkdir(parents=True)`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 12 - fix: ~ - parent: ~ -- kind: - name: PathlibRename - body: "`os.rename()` should be replaced by `Path.rename()`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 10 - fix: ~ - parent: ~ -- kind: - name: PathlibReplace - body: "`os.replace()` should be replaced by `Path.replace()`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 11 - fix: ~ - parent: ~ -- kind: - name: PathlibRmdir - body: "`os.rmdir()` should be replaced by `Path.rmdir()`" - suggestion: ~ - fixable: false - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 9 - fix: ~ - parent: ~ -- kind: - name: PathlibRemove - body: "`os.remove()` should be replaced by `Path.unlink()`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 10 - fix: ~ - parent: ~ -- kind: - name: PathlibUnlink - body: "`os.unlink()` should be replaced by `Path.unlink()`" - suggestion: ~ - fixable: false - location: - row: 14 - column: 0 - end_location: - row: 14 - column: 10 - fix: ~ - parent: ~ -- kind: - name: PathlibGetcwd - body: "`os.getcwd()` should be replaced by `Path.cwd()`" - suggestion: ~ - fixable: false - location: - row: 15 - column: 0 - end_location: - row: 15 - column: 10 - fix: ~ - parent: ~ -- kind: - name: PathlibExists - body: "`os.path.exists()` should be replaced by `Path.exists()`" - suggestion: ~ - fixable: false - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 16 - fix: ~ - parent: ~ -- kind: - name: PathlibExpanduser - body: "`os.path.expanduser()` should be replaced by `Path.expanduser()`" - suggestion: ~ - fixable: false - location: - row: 17 - column: 5 - end_location: - row: 17 - column: 21 - fix: ~ - parent: ~ -- kind: - name: PathlibIsDir - body: "`os.path.isdir()` should be replaced by `Path.is_dir()`" - suggestion: ~ - fixable: false - location: - row: 18 - column: 6 - end_location: - row: 18 - column: 17 - fix: ~ - parent: ~ -- kind: - name: PathlibIsFile - body: "`os.path.isfile()` should be replaced by `Path.is_file()`" - suggestion: ~ - fixable: false - location: - row: 19 - column: 7 - end_location: - row: 19 - column: 19 - fix: ~ - parent: ~ -- kind: - name: PathlibIsLink - body: "`os.path.islink()` should be replaced by `Path.is_symlink()`" - suggestion: ~ - fixable: false - location: - row: 20 - column: 8 - end_location: - row: 20 - column: 20 - fix: ~ - parent: ~ -- kind: - name: PathlibReadlink - body: "`os.readlink()` should be replaced by `Path.readlink()`" - suggestion: ~ - fixable: false - location: - row: 21 - column: 0 - end_location: - row: 21 - column: 12 - fix: ~ - parent: ~ -- kind: - name: PathlibStat - body: "`os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()`" - suggestion: ~ - fixable: false - location: - row: 22 - column: 0 - end_location: - row: 22 - column: 8 - fix: ~ - parent: ~ -- kind: - name: PathlibIsAbs - body: "`os.path.isabs()` should be replaced by `Path.is_absolute()`" - suggestion: ~ - fixable: false - location: - row: 23 - column: 0 - end_location: - row: 23 - column: 11 - fix: ~ - parent: ~ -- kind: - name: PathlibJoin - body: "`os.path.join()` should be replaced by `Path` with `/` operator" - suggestion: ~ - fixable: false - location: - row: 24 - column: 0 - end_location: - row: 24 - column: 10 - fix: ~ - parent: ~ -- kind: - name: PathlibBasename - body: "`os.path.basename()` should be replaced by `Path.name`" - suggestion: ~ - fixable: false - location: - row: 25 - column: 0 - end_location: - row: 25 - column: 14 - fix: ~ - parent: ~ -- kind: - name: PathlibDirname - body: "`os.path.dirname()` should be replaced by `Path.parent`" - suggestion: ~ - fixable: false - location: - row: 26 - column: 0 - end_location: - row: 26 - column: 13 - fix: ~ - parent: ~ -- kind: - name: PathlibSamefile - body: "`os.path.samefile()` should be replaced by `Path.samefile()`" - suggestion: ~ - fixable: false - location: - row: 27 - column: 0 - end_location: - row: 27 - column: 14 - fix: ~ - parent: ~ -- kind: - name: PathlibSplitext - body: "`os.path.splitext()` should be replaced by `Path.suffix`" - suggestion: ~ - fixable: false - location: - row: 28 - column: 0 - end_location: - row: 28 - column: 14 - fix: ~ - parent: ~ +- - kind: + name: PathlibAbspath + body: "`os.path.abspath()` should be replaced by `Path.resolve()`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 4 + end_location: + row: 6 + column: 17 + fix: ~ + parent: ~ + - kind: + name: PathlibChmod + body: "`os.chmod()` should be replaced by `Path.chmod()`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 5 + end_location: + row: 7 + column: 14 + fix: ~ + parent: ~ + - kind: + name: PathlibMkdir + body: "`os.mkdir()` should be replaced by `Path.mkdir()`" + suggestion: ~ + fixable: false + location: + row: 8 + column: 6 + end_location: + row: 8 + column: 15 + fix: ~ + parent: ~ + - kind: + name: PathlibMakedirs + body: "`os.makedirs()` should be replaced by `Path.mkdir(parents=True)`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 12 + fix: ~ + parent: ~ + - kind: + name: PathlibRename + body: "`os.rename()` should be replaced by `Path.rename()`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 10 + fix: ~ + parent: ~ + - kind: + name: PathlibReplace + body: "`os.replace()` should be replaced by `Path.replace()`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 11 + fix: ~ + parent: ~ + - kind: + name: PathlibRmdir + body: "`os.rmdir()` should be replaced by `Path.rmdir()`" + suggestion: ~ + fixable: false + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 9 + fix: ~ + parent: ~ + - kind: + name: PathlibRemove + body: "`os.remove()` should be replaced by `Path.unlink()`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 10 + fix: ~ + parent: ~ + - kind: + name: PathlibUnlink + body: "`os.unlink()` should be replaced by `Path.unlink()`" + suggestion: ~ + fixable: false + location: + row: 14 + column: 0 + end_location: + row: 14 + column: 10 + fix: ~ + parent: ~ + - kind: + name: PathlibGetcwd + body: "`os.getcwd()` should be replaced by `Path.cwd()`" + suggestion: ~ + fixable: false + location: + row: 15 + column: 0 + end_location: + row: 15 + column: 10 + fix: ~ + parent: ~ + - kind: + name: PathlibExists + body: "`os.path.exists()` should be replaced by `Path.exists()`" + suggestion: ~ + fixable: false + location: + row: 16 + column: 4 + end_location: + row: 16 + column: 16 + fix: ~ + parent: ~ + - kind: + name: PathlibExpanduser + body: "`os.path.expanduser()` should be replaced by `Path.expanduser()`" + suggestion: ~ + fixable: false + location: + row: 17 + column: 5 + end_location: + row: 17 + column: 21 + fix: ~ + parent: ~ + - kind: + name: PathlibIsDir + body: "`os.path.isdir()` should be replaced by `Path.is_dir()`" + suggestion: ~ + fixable: false + location: + row: 18 + column: 6 + end_location: + row: 18 + column: 17 + fix: ~ + parent: ~ + - kind: + name: PathlibIsFile + body: "`os.path.isfile()` should be replaced by `Path.is_file()`" + suggestion: ~ + fixable: false + location: + row: 19 + column: 7 + end_location: + row: 19 + column: 19 + fix: ~ + parent: ~ + - kind: + name: PathlibIsLink + body: "`os.path.islink()` should be replaced by `Path.is_symlink()`" + suggestion: ~ + fixable: false + location: + row: 20 + column: 8 + end_location: + row: 20 + column: 20 + fix: ~ + parent: ~ + - kind: + name: PathlibReadlink + body: "`os.readlink()` should be replaced by `Path.readlink()`" + suggestion: ~ + fixable: false + location: + row: 21 + column: 0 + end_location: + row: 21 + column: 12 + fix: ~ + parent: ~ + - kind: + name: PathlibStat + body: "`os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()`" + suggestion: ~ + fixable: false + location: + row: 22 + column: 0 + end_location: + row: 22 + column: 8 + fix: ~ + parent: ~ + - kind: + name: PathlibIsAbs + body: "`os.path.isabs()` should be replaced by `Path.is_absolute()`" + suggestion: ~ + fixable: false + location: + row: 23 + column: 0 + end_location: + row: 23 + column: 11 + fix: ~ + parent: ~ + - kind: + name: PathlibJoin + body: "`os.path.join()` should be replaced by `Path` with `/` operator" + suggestion: ~ + fixable: false + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 10 + fix: ~ + parent: ~ + - kind: + name: PathlibBasename + body: "`os.path.basename()` should be replaced by `Path.name`" + suggestion: ~ + fixable: false + location: + row: 25 + column: 0 + end_location: + row: 25 + column: 14 + fix: ~ + parent: ~ + - kind: + name: PathlibDirname + body: "`os.path.dirname()` should be replaced by `Path.parent`" + suggestion: ~ + fixable: false + location: + row: 26 + column: 0 + end_location: + row: 26 + column: 13 + fix: ~ + parent: ~ + - kind: + name: PathlibSamefile + body: "`os.path.samefile()` should be replaced by `Path.samefile()`" + suggestion: ~ + fixable: false + location: + row: 27 + column: 0 + end_location: + row: 27 + column: 14 + fix: ~ + parent: ~ + - kind: + name: PathlibSplitext + body: "`os.path.splitext()` should be replaced by `Path.suffix`" + suggestion: ~ + fixable: false + location: + row: 28 + column: 0 + end_location: + row: 28 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from.py.snap index 541fd2c703bbd2..16b82a8edcc68b 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from.py.snap @@ -2,329 +2,329 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs expression: diagnostics --- -- kind: - name: PathlibAbspath - body: "`os.path.abspath()` should be replaced by `Path.resolve()`" - suggestion: ~ - fixable: false - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 11 - fix: ~ - parent: ~ -- kind: - name: PathlibChmod - body: "`os.chmod()` should be replaced by `Path.chmod()`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 5 - end_location: - row: 9 - column: 10 - fix: ~ - parent: ~ -- kind: - name: PathlibMkdir - body: "`os.mkdir()` should be replaced by `Path.mkdir()`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 6 - end_location: - row: 10 - column: 11 - fix: ~ - parent: ~ -- kind: - name: PathlibMakedirs - body: "`os.makedirs()` should be replaced by `Path.mkdir(parents=True)`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 8 - fix: ~ - parent: ~ -- kind: - name: PathlibRename - body: "`os.rename()` should be replaced by `Path.rename()`" - suggestion: ~ - fixable: false - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 6 - fix: ~ - parent: ~ -- kind: - name: PathlibReplace - body: "`os.replace()` should be replaced by `Path.replace()`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 7 - fix: ~ - parent: ~ -- kind: - name: PathlibRmdir - body: "`os.rmdir()` should be replaced by `Path.rmdir()`" - suggestion: ~ - fixable: false - location: - row: 14 - column: 0 - end_location: - row: 14 - column: 5 - fix: ~ - parent: ~ -- kind: - name: PathlibRemove - body: "`os.remove()` should be replaced by `Path.unlink()`" - suggestion: ~ - fixable: false - location: - row: 15 - column: 0 - end_location: - row: 15 - column: 6 - fix: ~ - parent: ~ -- kind: - name: PathlibUnlink - body: "`os.unlink()` should be replaced by `Path.unlink()`" - suggestion: ~ - fixable: false - location: - row: 16 - column: 0 - end_location: - row: 16 - column: 6 - fix: ~ - parent: ~ -- kind: - name: PathlibGetcwd - body: "`os.getcwd()` should be replaced by `Path.cwd()`" - suggestion: ~ - fixable: false - location: - row: 17 - column: 0 - end_location: - row: 17 - column: 6 - fix: ~ - parent: ~ -- kind: - name: PathlibExists - body: "`os.path.exists()` should be replaced by `Path.exists()`" - suggestion: ~ - fixable: false - location: - row: 18 - column: 4 - end_location: - row: 18 - column: 10 - fix: ~ - parent: ~ -- kind: - name: PathlibExpanduser - body: "`os.path.expanduser()` should be replaced by `Path.expanduser()`" - suggestion: ~ - fixable: false - location: - row: 19 - column: 5 - end_location: - row: 19 - column: 15 - fix: ~ - parent: ~ -- kind: - name: PathlibIsDir - body: "`os.path.isdir()` should be replaced by `Path.is_dir()`" - suggestion: ~ - fixable: false - location: - row: 20 - column: 6 - end_location: - row: 20 - column: 11 - fix: ~ - parent: ~ -- kind: - name: PathlibIsFile - body: "`os.path.isfile()` should be replaced by `Path.is_file()`" - suggestion: ~ - fixable: false - location: - row: 21 - column: 7 - end_location: - row: 21 - column: 13 - fix: ~ - parent: ~ -- kind: - name: PathlibIsLink - body: "`os.path.islink()` should be replaced by `Path.is_symlink()`" - suggestion: ~ - fixable: false - location: - row: 22 - column: 8 - end_location: - row: 22 - column: 14 - fix: ~ - parent: ~ -- kind: - name: PathlibReadlink - body: "`os.readlink()` should be replaced by `Path.readlink()`" - suggestion: ~ - fixable: false - location: - row: 23 - column: 0 - end_location: - row: 23 - column: 8 - fix: ~ - parent: ~ -- kind: - name: PathlibStat - body: "`os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()`" - suggestion: ~ - fixable: false - location: - row: 24 - column: 0 - end_location: - row: 24 - column: 4 - fix: ~ - parent: ~ -- kind: - name: PathlibIsAbs - body: "`os.path.isabs()` should be replaced by `Path.is_absolute()`" - suggestion: ~ - fixable: false - location: - row: 25 - column: 0 - end_location: - row: 25 - column: 5 - fix: ~ - parent: ~ -- kind: - name: PathlibJoin - body: "`os.path.join()` should be replaced by `Path` with `/` operator" - suggestion: ~ - fixable: false - location: - row: 26 - column: 0 - end_location: - row: 26 - column: 4 - fix: ~ - parent: ~ -- kind: - name: PathlibBasename - body: "`os.path.basename()` should be replaced by `Path.name`" - suggestion: ~ - fixable: false - location: - row: 27 - column: 0 - end_location: - row: 27 - column: 8 - fix: ~ - parent: ~ -- kind: - name: PathlibDirname - body: "`os.path.dirname()` should be replaced by `Path.parent`" - suggestion: ~ - fixable: false - location: - row: 28 - column: 0 - end_location: - row: 28 - column: 7 - fix: ~ - parent: ~ -- kind: - name: PathlibSamefile - body: "`os.path.samefile()` should be replaced by `Path.samefile()`" - suggestion: ~ - fixable: false - location: - row: 29 - column: 0 - end_location: - row: 29 - column: 8 - fix: ~ - parent: ~ -- kind: - name: PathlibSplitext - body: "`os.path.splitext()` should be replaced by `Path.suffix`" - suggestion: ~ - fixable: false - location: - row: 30 - column: 0 - end_location: - row: 30 - column: 8 - fix: ~ - parent: ~ -- kind: - name: PathlibOpen - body: "`open()` should be replaced by `Path.open()`" - suggestion: ~ - fixable: false - location: - row: 31 - column: 5 - end_location: - row: 31 - column: 9 - fix: ~ - parent: ~ -- kind: - name: PathlibOpen - body: "`open()` should be replaced by `Path.open()`" - suggestion: ~ - fixable: false - location: - row: 33 - column: 0 - end_location: - row: 33 - column: 4 - fix: ~ - parent: ~ +- - kind: + name: PathlibAbspath + body: "`os.path.abspath()` should be replaced by `Path.resolve()`" + suggestion: ~ + fixable: false + location: + row: 8 + column: 4 + end_location: + row: 8 + column: 11 + fix: ~ + parent: ~ + - kind: + name: PathlibChmod + body: "`os.chmod()` should be replaced by `Path.chmod()`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 5 + end_location: + row: 9 + column: 10 + fix: ~ + parent: ~ + - kind: + name: PathlibMkdir + body: "`os.mkdir()` should be replaced by `Path.mkdir()`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 6 + end_location: + row: 10 + column: 11 + fix: ~ + parent: ~ + - kind: + name: PathlibMakedirs + body: "`os.makedirs()` should be replaced by `Path.mkdir(parents=True)`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 8 + fix: ~ + parent: ~ + - kind: + name: PathlibRename + body: "`os.rename()` should be replaced by `Path.rename()`" + suggestion: ~ + fixable: false + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 6 + fix: ~ + parent: ~ + - kind: + name: PathlibReplace + body: "`os.replace()` should be replaced by `Path.replace()`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 7 + fix: ~ + parent: ~ + - kind: + name: PathlibRmdir + body: "`os.rmdir()` should be replaced by `Path.rmdir()`" + suggestion: ~ + fixable: false + location: + row: 14 + column: 0 + end_location: + row: 14 + column: 5 + fix: ~ + parent: ~ + - kind: + name: PathlibRemove + body: "`os.remove()` should be replaced by `Path.unlink()`" + suggestion: ~ + fixable: false + location: + row: 15 + column: 0 + end_location: + row: 15 + column: 6 + fix: ~ + parent: ~ + - kind: + name: PathlibUnlink + body: "`os.unlink()` should be replaced by `Path.unlink()`" + suggestion: ~ + fixable: false + location: + row: 16 + column: 0 + end_location: + row: 16 + column: 6 + fix: ~ + parent: ~ + - kind: + name: PathlibGetcwd + body: "`os.getcwd()` should be replaced by `Path.cwd()`" + suggestion: ~ + fixable: false + location: + row: 17 + column: 0 + end_location: + row: 17 + column: 6 + fix: ~ + parent: ~ + - kind: + name: PathlibExists + body: "`os.path.exists()` should be replaced by `Path.exists()`" + suggestion: ~ + fixable: false + location: + row: 18 + column: 4 + end_location: + row: 18 + column: 10 + fix: ~ + parent: ~ + - kind: + name: PathlibExpanduser + body: "`os.path.expanduser()` should be replaced by `Path.expanduser()`" + suggestion: ~ + fixable: false + location: + row: 19 + column: 5 + end_location: + row: 19 + column: 15 + fix: ~ + parent: ~ + - kind: + name: PathlibIsDir + body: "`os.path.isdir()` should be replaced by `Path.is_dir()`" + suggestion: ~ + fixable: false + location: + row: 20 + column: 6 + end_location: + row: 20 + column: 11 + fix: ~ + parent: ~ + - kind: + name: PathlibIsFile + body: "`os.path.isfile()` should be replaced by `Path.is_file()`" + suggestion: ~ + fixable: false + location: + row: 21 + column: 7 + end_location: + row: 21 + column: 13 + fix: ~ + parent: ~ + - kind: + name: PathlibIsLink + body: "`os.path.islink()` should be replaced by `Path.is_symlink()`" + suggestion: ~ + fixable: false + location: + row: 22 + column: 8 + end_location: + row: 22 + column: 14 + fix: ~ + parent: ~ + - kind: + name: PathlibReadlink + body: "`os.readlink()` should be replaced by `Path.readlink()`" + suggestion: ~ + fixable: false + location: + row: 23 + column: 0 + end_location: + row: 23 + column: 8 + fix: ~ + parent: ~ + - kind: + name: PathlibStat + body: "`os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()`" + suggestion: ~ + fixable: false + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 4 + fix: ~ + parent: ~ + - kind: + name: PathlibIsAbs + body: "`os.path.isabs()` should be replaced by `Path.is_absolute()`" + suggestion: ~ + fixable: false + location: + row: 25 + column: 0 + end_location: + row: 25 + column: 5 + fix: ~ + parent: ~ + - kind: + name: PathlibJoin + body: "`os.path.join()` should be replaced by `Path` with `/` operator" + suggestion: ~ + fixable: false + location: + row: 26 + column: 0 + end_location: + row: 26 + column: 4 + fix: ~ + parent: ~ + - kind: + name: PathlibBasename + body: "`os.path.basename()` should be replaced by `Path.name`" + suggestion: ~ + fixable: false + location: + row: 27 + column: 0 + end_location: + row: 27 + column: 8 + fix: ~ + parent: ~ + - kind: + name: PathlibDirname + body: "`os.path.dirname()` should be replaced by `Path.parent`" + suggestion: ~ + fixable: false + location: + row: 28 + column: 0 + end_location: + row: 28 + column: 7 + fix: ~ + parent: ~ + - kind: + name: PathlibSamefile + body: "`os.path.samefile()` should be replaced by `Path.samefile()`" + suggestion: ~ + fixable: false + location: + row: 29 + column: 0 + end_location: + row: 29 + column: 8 + fix: ~ + parent: ~ + - kind: + name: PathlibSplitext + body: "`os.path.splitext()` should be replaced by `Path.suffix`" + suggestion: ~ + fixable: false + location: + row: 30 + column: 0 + end_location: + row: 30 + column: 8 + fix: ~ + parent: ~ + - kind: + name: PathlibOpen + body: "`open()` should be replaced by `Path.open()`" + suggestion: ~ + fixable: false + location: + row: 31 + column: 5 + end_location: + row: 31 + column: 9 + fix: ~ + parent: ~ + - kind: + name: PathlibOpen + body: "`open()` should be replaced by `Path.open()`" + suggestion: ~ + fixable: false + location: + row: 33 + column: 0 + end_location: + row: 33 + column: 4 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from_as.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from_as.py.snap index ea0848b8b37e4a..48c8cf1bde2842 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from_as.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from_as.py.snap @@ -2,303 +2,303 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs expression: diagnostics --- -- kind: - name: PathlibAbspath - body: "`os.path.abspath()` should be replaced by `Path.resolve()`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 4 - end_location: - row: 13 - column: 12 - fix: ~ - parent: ~ -- kind: - name: PathlibChmod - body: "`os.chmod()` should be replaced by `Path.chmod()`" - suggestion: ~ - fixable: false - location: - row: 14 - column: 5 - end_location: - row: 14 - column: 11 - fix: ~ - parent: ~ -- kind: - name: PathlibMkdir - body: "`os.mkdir()` should be replaced by `Path.mkdir()`" - suggestion: ~ - fixable: false - location: - row: 15 - column: 6 - end_location: - row: 15 - column: 12 - fix: ~ - parent: ~ -- kind: - name: PathlibMakedirs - body: "`os.makedirs()` should be replaced by `Path.mkdir(parents=True)`" - suggestion: ~ - fixable: false - location: - row: 16 - column: 0 - end_location: - row: 16 - column: 9 - fix: ~ - parent: ~ -- kind: - name: PathlibRename - body: "`os.rename()` should be replaced by `Path.rename()`" - suggestion: ~ - fixable: false - location: - row: 17 - column: 0 - end_location: - row: 17 - column: 7 - fix: ~ - parent: ~ -- kind: - name: PathlibReplace - body: "`os.replace()` should be replaced by `Path.replace()`" - suggestion: ~ - fixable: false - location: - row: 18 - column: 0 - end_location: - row: 18 - column: 8 - fix: ~ - parent: ~ -- kind: - name: PathlibRmdir - body: "`os.rmdir()` should be replaced by `Path.rmdir()`" - suggestion: ~ - fixable: false - location: - row: 19 - column: 0 - end_location: - row: 19 - column: 6 - fix: ~ - parent: ~ -- kind: - name: PathlibRemove - body: "`os.remove()` should be replaced by `Path.unlink()`" - suggestion: ~ - fixable: false - location: - row: 20 - column: 0 - end_location: - row: 20 - column: 7 - fix: ~ - parent: ~ -- kind: - name: PathlibUnlink - body: "`os.unlink()` should be replaced by `Path.unlink()`" - suggestion: ~ - fixable: false - location: - row: 21 - column: 0 - end_location: - row: 21 - column: 7 - fix: ~ - parent: ~ -- kind: - name: PathlibGetcwd - body: "`os.getcwd()` should be replaced by `Path.cwd()`" - suggestion: ~ - fixable: false - location: - row: 22 - column: 0 - end_location: - row: 22 - column: 7 - fix: ~ - parent: ~ -- kind: - name: PathlibExists - body: "`os.path.exists()` should be replaced by `Path.exists()`" - suggestion: ~ - fixable: false - location: - row: 23 - column: 4 - end_location: - row: 23 - column: 11 - fix: ~ - parent: ~ -- kind: - name: PathlibExpanduser - body: "`os.path.expanduser()` should be replaced by `Path.expanduser()`" - suggestion: ~ - fixable: false - location: - row: 24 - column: 5 - end_location: - row: 24 - column: 16 - fix: ~ - parent: ~ -- kind: - name: PathlibIsDir - body: "`os.path.isdir()` should be replaced by `Path.is_dir()`" - suggestion: ~ - fixable: false - location: - row: 25 - column: 6 - end_location: - row: 25 - column: 12 - fix: ~ - parent: ~ -- kind: - name: PathlibIsFile - body: "`os.path.isfile()` should be replaced by `Path.is_file()`" - suggestion: ~ - fixable: false - location: - row: 26 - column: 7 - end_location: - row: 26 - column: 14 - fix: ~ - parent: ~ -- kind: - name: PathlibIsLink - body: "`os.path.islink()` should be replaced by `Path.is_symlink()`" - suggestion: ~ - fixable: false - location: - row: 27 - column: 8 - end_location: - row: 27 - column: 15 - fix: ~ - parent: ~ -- kind: - name: PathlibReadlink - body: "`os.readlink()` should be replaced by `Path.readlink()`" - suggestion: ~ - fixable: false - location: - row: 28 - column: 0 - end_location: - row: 28 - column: 9 - fix: ~ - parent: ~ -- kind: - name: PathlibStat - body: "`os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()`" - suggestion: ~ - fixable: false - location: - row: 29 - column: 0 - end_location: - row: 29 - column: 5 - fix: ~ - parent: ~ -- kind: - name: PathlibIsAbs - body: "`os.path.isabs()` should be replaced by `Path.is_absolute()`" - suggestion: ~ - fixable: false - location: - row: 30 - column: 0 - end_location: - row: 30 - column: 6 - fix: ~ - parent: ~ -- kind: - name: PathlibJoin - body: "`os.path.join()` should be replaced by `Path` with `/` operator" - suggestion: ~ - fixable: false - location: - row: 31 - column: 0 - end_location: - row: 31 - column: 5 - fix: ~ - parent: ~ -- kind: - name: PathlibBasename - body: "`os.path.basename()` should be replaced by `Path.name`" - suggestion: ~ - fixable: false - location: - row: 32 - column: 0 - end_location: - row: 32 - column: 9 - fix: ~ - parent: ~ -- kind: - name: PathlibDirname - body: "`os.path.dirname()` should be replaced by `Path.parent`" - suggestion: ~ - fixable: false - location: - row: 33 - column: 0 - end_location: - row: 33 - column: 8 - fix: ~ - parent: ~ -- kind: - name: PathlibSamefile - body: "`os.path.samefile()` should be replaced by `Path.samefile()`" - suggestion: ~ - fixable: false - location: - row: 34 - column: 0 - end_location: - row: 34 - column: 9 - fix: ~ - parent: ~ -- kind: - name: PathlibSplitext - body: "`os.path.splitext()` should be replaced by `Path.suffix`" - suggestion: ~ - fixable: false - location: - row: 35 - column: 0 - end_location: - row: 35 - column: 9 - fix: ~ - parent: ~ +- - kind: + name: PathlibAbspath + body: "`os.path.abspath()` should be replaced by `Path.resolve()`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 4 + end_location: + row: 13 + column: 12 + fix: ~ + parent: ~ + - kind: + name: PathlibChmod + body: "`os.chmod()` should be replaced by `Path.chmod()`" + suggestion: ~ + fixable: false + location: + row: 14 + column: 5 + end_location: + row: 14 + column: 11 + fix: ~ + parent: ~ + - kind: + name: PathlibMkdir + body: "`os.mkdir()` should be replaced by `Path.mkdir()`" + suggestion: ~ + fixable: false + location: + row: 15 + column: 6 + end_location: + row: 15 + column: 12 + fix: ~ + parent: ~ + - kind: + name: PathlibMakedirs + body: "`os.makedirs()` should be replaced by `Path.mkdir(parents=True)`" + suggestion: ~ + fixable: false + location: + row: 16 + column: 0 + end_location: + row: 16 + column: 9 + fix: ~ + parent: ~ + - kind: + name: PathlibRename + body: "`os.rename()` should be replaced by `Path.rename()`" + suggestion: ~ + fixable: false + location: + row: 17 + column: 0 + end_location: + row: 17 + column: 7 + fix: ~ + parent: ~ + - kind: + name: PathlibReplace + body: "`os.replace()` should be replaced by `Path.replace()`" + suggestion: ~ + fixable: false + location: + row: 18 + column: 0 + end_location: + row: 18 + column: 8 + fix: ~ + parent: ~ + - kind: + name: PathlibRmdir + body: "`os.rmdir()` should be replaced by `Path.rmdir()`" + suggestion: ~ + fixable: false + location: + row: 19 + column: 0 + end_location: + row: 19 + column: 6 + fix: ~ + parent: ~ + - kind: + name: PathlibRemove + body: "`os.remove()` should be replaced by `Path.unlink()`" + suggestion: ~ + fixable: false + location: + row: 20 + column: 0 + end_location: + row: 20 + column: 7 + fix: ~ + parent: ~ + - kind: + name: PathlibUnlink + body: "`os.unlink()` should be replaced by `Path.unlink()`" + suggestion: ~ + fixable: false + location: + row: 21 + column: 0 + end_location: + row: 21 + column: 7 + fix: ~ + parent: ~ + - kind: + name: PathlibGetcwd + body: "`os.getcwd()` should be replaced by `Path.cwd()`" + suggestion: ~ + fixable: false + location: + row: 22 + column: 0 + end_location: + row: 22 + column: 7 + fix: ~ + parent: ~ + - kind: + name: PathlibExists + body: "`os.path.exists()` should be replaced by `Path.exists()`" + suggestion: ~ + fixable: false + location: + row: 23 + column: 4 + end_location: + row: 23 + column: 11 + fix: ~ + parent: ~ + - kind: + name: PathlibExpanduser + body: "`os.path.expanduser()` should be replaced by `Path.expanduser()`" + suggestion: ~ + fixable: false + location: + row: 24 + column: 5 + end_location: + row: 24 + column: 16 + fix: ~ + parent: ~ + - kind: + name: PathlibIsDir + body: "`os.path.isdir()` should be replaced by `Path.is_dir()`" + suggestion: ~ + fixable: false + location: + row: 25 + column: 6 + end_location: + row: 25 + column: 12 + fix: ~ + parent: ~ + - kind: + name: PathlibIsFile + body: "`os.path.isfile()` should be replaced by `Path.is_file()`" + suggestion: ~ + fixable: false + location: + row: 26 + column: 7 + end_location: + row: 26 + column: 14 + fix: ~ + parent: ~ + - kind: + name: PathlibIsLink + body: "`os.path.islink()` should be replaced by `Path.is_symlink()`" + suggestion: ~ + fixable: false + location: + row: 27 + column: 8 + end_location: + row: 27 + column: 15 + fix: ~ + parent: ~ + - kind: + name: PathlibReadlink + body: "`os.readlink()` should be replaced by `Path.readlink()`" + suggestion: ~ + fixable: false + location: + row: 28 + column: 0 + end_location: + row: 28 + column: 9 + fix: ~ + parent: ~ + - kind: + name: PathlibStat + body: "`os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()`" + suggestion: ~ + fixable: false + location: + row: 29 + column: 0 + end_location: + row: 29 + column: 5 + fix: ~ + parent: ~ + - kind: + name: PathlibIsAbs + body: "`os.path.isabs()` should be replaced by `Path.is_absolute()`" + suggestion: ~ + fixable: false + location: + row: 30 + column: 0 + end_location: + row: 30 + column: 6 + fix: ~ + parent: ~ + - kind: + name: PathlibJoin + body: "`os.path.join()` should be replaced by `Path` with `/` operator" + suggestion: ~ + fixable: false + location: + row: 31 + column: 0 + end_location: + row: 31 + column: 5 + fix: ~ + parent: ~ + - kind: + name: PathlibBasename + body: "`os.path.basename()` should be replaced by `Path.name`" + suggestion: ~ + fixable: false + location: + row: 32 + column: 0 + end_location: + row: 32 + column: 9 + fix: ~ + parent: ~ + - kind: + name: PathlibDirname + body: "`os.path.dirname()` should be replaced by `Path.parent`" + suggestion: ~ + fixable: false + location: + row: 33 + column: 0 + end_location: + row: 33 + column: 8 + fix: ~ + parent: ~ + - kind: + name: PathlibSamefile + body: "`os.path.samefile()` should be replaced by `Path.samefile()`" + suggestion: ~ + fixable: false + location: + row: 34 + column: 0 + end_location: + row: 34 + column: 9 + fix: ~ + parent: ~ + - kind: + name: PathlibSplitext + body: "`os.path.splitext()` should be replaced by `Path.suffix`" + suggestion: ~ + fixable: false + location: + row: 35 + column: 0 + end_location: + row: 35 + column: 9 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__use_pathlib.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__use_pathlib.py.snap index 359d76f726403c..03e7a8a78377d7 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__use_pathlib.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__use_pathlib.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/flake8_use_pathlib/mod.rs +source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/isort/mod.rs b/crates/ruff/src/rules/isort/mod.rs index 411f91058e37b5..f831a1e0bd5dd7 100644 --- a/crates/ruff/src/rules/isort/mod.rs +++ b/crates/ruff/src/rules/isort/mod.rs @@ -555,7 +555,7 @@ mod tests { #[test_case(Path::new("order_by_type.py"))] fn order_by_type(path: &Path) -> Result<()> { let snapshot = format!("order_by_type_false_{}", path.to_string_lossy()); - let mut diagnostics = test_path( + let diagnostics = test_path( Path::new("isort").join(path).as_path(), &Settings { isort: super::settings::Settings { @@ -566,7 +566,6 @@ mod tests { ..Settings::for_rule(Rule::UnsortedImports) }, )?; - diagnostics.sort_by_key(|diagnostic| diagnostic.location); assert_yaml_snapshot!(snapshot, diagnostics); Ok(()) } @@ -577,7 +576,7 @@ mod tests { "order_by_type_with_custom_classes_{}", path.to_string_lossy() ); - let mut diagnostics = test_path( + let diagnostics = test_path( Path::new("isort").join(path).as_path(), &Settings { isort: super::settings::Settings { @@ -594,7 +593,6 @@ mod tests { ..Settings::for_rule(Rule::UnsortedImports) }, )?; - diagnostics.sort_by_key(|diagnostic| diagnostic.location); assert_yaml_snapshot!(snapshot, diagnostics); Ok(()) } @@ -605,7 +603,7 @@ mod tests { "order_by_type_with_custom_constants_{}", path.to_string_lossy() ); - let mut diagnostics = test_path( + let diagnostics = test_path( Path::new("isort").join(path).as_path(), &Settings { isort: super::settings::Settings { @@ -624,7 +622,6 @@ mod tests { ..Settings::for_rule(Rule::UnsortedImports) }, )?; - diagnostics.sort_by_key(|diagnostic| diagnostic.location); assert_yaml_snapshot!(snapshot, diagnostics); Ok(()) } @@ -635,7 +632,7 @@ mod tests { "order_by_type_with_custom_variables_{}", path.to_string_lossy() ); - let mut diagnostics = test_path( + let diagnostics = test_path( Path::new("isort").join(path).as_path(), &Settings { isort: super::settings::Settings { @@ -652,7 +649,6 @@ mod tests { ..Settings::for_rule(Rule::UnsortedImports) }, )?; - diagnostics.sort_by_key(|diagnostic| diagnostic.location); assert_yaml_snapshot!(snapshot, diagnostics); Ok(()) } @@ -660,7 +656,7 @@ mod tests { #[test_case(Path::new("force_sort_within_sections.py"))] fn force_sort_within_sections(path: &Path) -> Result<()> { let snapshot = format!("force_sort_within_sections_{}", path.to_string_lossy()); - let mut diagnostics = test_path( + let diagnostics = test_path( Path::new("isort").join(path).as_path(), &Settings { isort: super::settings::Settings { @@ -671,7 +667,6 @@ mod tests { ..Settings::for_rule(Rule::UnsortedImports) }, )?; - diagnostics.sort_by_key(|diagnostic| diagnostic.location); assert_yaml_snapshot!(snapshot, diagnostics); Ok(()) } @@ -785,7 +780,7 @@ mod tests { #[test_case(Path::new("no_lines_before.py"))] fn no_lines_before(path: &Path) -> Result<()> { let snapshot = format!("no_lines_before.py_{}", path.to_string_lossy()); - let mut diagnostics = test_path( + let diagnostics = test_path( Path::new("isort").join(path).as_path(), &Settings { isort: super::settings::Settings { @@ -802,7 +797,6 @@ mod tests { ..Settings::for_rule(Rule::UnsortedImports) }, )?; - diagnostics.sort_by_key(|diagnostic| diagnostic.location); assert_yaml_snapshot!(snapshot, diagnostics); Ok(()) } @@ -813,7 +807,7 @@ mod tests { "no_lines_before_with_empty_sections.py_{}", path.to_string_lossy() ); - let mut diagnostics = test_path( + let diagnostics = test_path( Path::new("isort").join(path).as_path(), &Settings { isort: super::settings::Settings { @@ -827,7 +821,6 @@ mod tests { ..Settings::for_rule(Rule::UnsortedImports) }, )?; - diagnostics.sort_by_key(|diagnostic| diagnostic.location); assert_yaml_snapshot!(snapshot, diagnostics); Ok(()) } @@ -837,7 +830,7 @@ mod tests { #[test_case(Path::new("lines_after_imports_class_after.py"))] fn lines_after_imports(path: &Path) -> Result<()> { let snapshot = format!("lines_after_imports_{}", path.to_string_lossy()); - let mut diagnostics = test_path( + let diagnostics = test_path( Path::new("isort").join(path).as_path(), &Settings { isort: super::settings::Settings { @@ -848,7 +841,6 @@ mod tests { ..Settings::for_rule(Rule::UnsortedImports) }, )?; - diagnostics.sort_by_key(|diagnostic| diagnostic.location); assert_yaml_snapshot!(snapshot, diagnostics); Ok(()) } @@ -856,7 +848,7 @@ mod tests { #[test_case(Path::new("lines_between_types.py"))] fn lines_between_types(path: &Path) -> Result<()> { let snapshot = format!("lines_between_types{}", path.to_string_lossy()); - let mut diagnostics = test_path( + let diagnostics = test_path( Path::new("isort").join(path).as_path(), &Settings { isort: super::settings::Settings { @@ -867,7 +859,6 @@ mod tests { ..Settings::for_rule(Rule::UnsortedImports) }, )?; - diagnostics.sort_by_key(|diagnostic| diagnostic.location); assert_yaml_snapshot!(snapshot, diagnostics); Ok(()) } diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__add_newline_before_comments.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__add_newline_before_comments.py.snap index a1b39e4471397f..c8769bf1fe4c78 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__add_newline_before_comments.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__add_newline_before_comments.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 8 - column: 0 - fix: - content: "import os\n\n# This is a comment in the same section, so we need to add one newline.\nimport sys\n\nimport numpy as np\n\n# This is a comment, but it starts a new section, so we don't need to add a newline\n# before it.\nimport leading_prefix\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 8 column: 0 - parent: ~ + fix: + content: "import os\n\n# This is a comment in the same section, so we need to add one newline.\nimport sys\n\nimport numpy as np\n\n# This is a comment, but it starts a new section, so we don't need to add a newline\n# before it.\nimport leading_prefix\n" + location: + row: 1 + column: 0 + end_location: + row: 8 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__as_imports_comments.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__as_imports_comments.py.snap index f4353cf7724440..c0caa74f23ebcc 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__as_imports_comments.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__as_imports_comments.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 16 - column: 0 - fix: - content: "from bar import ( # Comment on `bar`\n Member, # Comment on `Member`\n)\nfrom baz import Member as Alias # Comment on `Alias` # Comment on `baz`\nfrom bop import Member # Comment on `Member` # Comment on `bop`\nfrom foo import ( # Comment on `foo`\n Member as Alias, # Comment on `Alias`\n)\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 16 column: 0 - parent: ~ + fix: + content: "from bar import ( # Comment on `bar`\n Member, # Comment on `Member`\n)\nfrom baz import Member as Alias # Comment on `Alias` # Comment on `baz`\nfrom bop import Member # Comment on `Member` # Comment on `bop`\nfrom foo import ( # Comment on `foo`\n Member as Alias, # Comment on `Alias`\n)\n" + location: + row: 1 + column: 0 + end_location: + row: 16 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap index 98464f291b8fc4..4b623ad0fba99a 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 4 - column: 0 - fix: - content: "from . import c\nfrom .. import b\nfrom ... import a\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 4 column: 0 - parent: ~ + fix: + content: "from . import c\nfrom .. import b\nfrom ... import a\n" + location: + row: 1 + column: 0 + end_location: + row: 4 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports.py.snap index f1caf4b9833db8..f88b116f75a3f1 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 5 - column: 0 - fix: - content: "from module import CONSTANT, function\nfrom module import Class as C\nfrom module import function as f\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 5 column: 0 - parent: ~ + fix: + content: "from module import CONSTANT, function\nfrom module import Class as C\nfrom module import function as f\n" + location: + row: 1 + column: 0 + end_location: + row: 5 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap index 4dc45aee49c711..b4f4963a0f42b5 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 5 - column: 0 - fix: - content: "from module import CONSTANT, Class as C, function, function as f\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 5 column: 0 - parent: ~ + fix: + content: "from module import CONSTANT, Class as C, function, function as f\n" + location: + row: 1 + column: 0 + end_location: + row: 5 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_import_from.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_import_from.py.snap index e13ed1c74b507d..c9aabcbe9463ac 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_import_from.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_import_from.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 6 - column: 0 - fix: - content: "from collections import (\n AsyncIterable,\n Awaitable,\n ChainMap,\n Collection,\n MutableMapping,\n MutableSequence,\n)\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 6 column: 0 - parent: ~ + fix: + content: "from collections import (\n AsyncIterable,\n Awaitable,\n ChainMap,\n Collection,\n MutableMapping,\n MutableSequence,\n)\n" + location: + row: 1 + column: 0 + end_location: + row: 6 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring.py.snap index 6a5287e9869aec..bb71949335002f 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: MissingRequiredImport - body: "Missing required import: `from __future__ import annotations`" - suggestion: "Insert required import: `from __future__ import annotations`" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: - content: "\nfrom __future__ import annotations" +- - kind: + name: MissingRequiredImport + body: "Missing required import: `from __future__ import annotations`" + suggestion: "Insert required import: `from __future__ import annotations`" + fixable: true location: row: 1 - column: 19 + column: 0 end_location: row: 1 - column: 19 - parent: ~ -- kind: - name: MissingRequiredImport - body: "Missing required import: `from __future__ import generator_stop`" - suggestion: "Insert required import: `from __future__ import generator_stop`" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: - content: "\nfrom __future__ import generator_stop" + column: 0 + fix: + content: "\nfrom __future__ import annotations" + location: + row: 1 + column: 19 + end_location: + row: 1 + column: 19 + parent: ~ + - kind: + name: MissingRequiredImport + body: "Missing required import: `from __future__ import generator_stop`" + suggestion: "Insert required import: `from __future__ import generator_stop`" + fixable: true location: row: 1 - column: 19 + column: 0 end_location: row: 1 - column: 19 - parent: ~ + column: 0 + fix: + content: "\nfrom __future__ import generator_stop" + location: + row: 1 + column: 19 + end_location: + row: 1 + column: 19 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring_only.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring_only.py.snap index 40d8799b1084f5..e3580a5edd08a0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring_only.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring_only.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/isort/mod.rs +source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_empty.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_empty.py.snap index 40d8799b1084f5..e3580a5edd08a0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_empty.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_empty.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/isort/mod.rs +source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__comments.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__comments.py.snap index 39308e98063f34..812af920b271bb 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__comments.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__comments.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 34 - column: 0 - fix: - content: "import B # Comment 4\n\n# Comment 3a\n# Comment 3b\nimport C\nimport D\n\n# Comment 5\n# Comment 6\nfrom A import (\n a, # Comment 7 # Comment 9\n b, # Comment 10\n c, # Comment 8 # Comment 11\n)\nfrom D import (\n a_long_name_to_force_multiple_lines, # Comment 12\n another_long_name_to_force_multiple_lines, # Comment 13\n)\nfrom E import a # Comment 1\nfrom F import (\n a, # Comment 1\n b,\n)\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 3 column: 0 end_location: row: 34 column: 0 - parent: ~ + fix: + content: "import B # Comment 4\n\n# Comment 3a\n# Comment 3b\nimport C\nimport D\n\n# Comment 5\n# Comment 6\nfrom A import (\n a, # Comment 7 # Comment 9\n b, # Comment 10\n c, # Comment 8 # Comment 11\n)\nfrom D import (\n a_long_name_to_force_multiple_lines, # Comment 12\n another_long_name_to_force_multiple_lines, # Comment 13\n)\nfrom E import a # Comment 1\nfrom F import (\n a, # Comment 1\n b,\n)\n" + location: + row: 3 + column: 0 + end_location: + row: 34 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__deduplicate_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__deduplicate_imports.py.snap index 852b7f6a85ce5f..407e34c3232315 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__deduplicate_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__deduplicate_imports.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 5 - column: 0 - fix: - content: "import os\nimport os as os1\nimport os as os2\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 5 column: 0 - parent: ~ + fix: + content: "import os\nimport os as os1\nimport os as os2\n" + location: + row: 1 + column: 0 + end_location: + row: 5 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length.py.snap index a541b88fd53b08..9f53fb054c2c6f 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 7 - column: 0 - end_location: - row: 15 - column: 0 - fix: - content: " from line_with_88 import aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n from line_with_89 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n from line_with_90 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n from line_with_91 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n from line_with_92 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n from line_with_93 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 7 column: 0 end_location: row: 15 column: 0 - parent: ~ + fix: + content: " from line_with_88 import aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n from line_with_89 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n from line_with_90 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n from line_with_91 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n from line_with_92 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n from line_with_93 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n" + location: + row: 7 + column: 0 + end_location: + row: 15 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length_comment.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length_comment.py.snap index 1bc356bea00298..56a20285813250 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length_comment.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length_comment.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 5 - column: 0 - fix: - content: "import a\n\n# Don't take this comment into account when determining whether the next import can fit on one line.\nfrom b import c\nfrom d import (\n e, # Do take this comment into account when determining whether the next import can fit on one line.\n)\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 5 column: 0 - parent: ~ + fix: + content: "import a\n\n# Don't take this comment into account when determining whether the next import can fit on one line.\nfrom b import c\nfrom d import (\n e, # Do take this comment into account when determining whether the next import can fit on one line.\n)\n" + location: + row: 1 + column: 0 + end_location: + row: 5 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_single_line_force_single_line.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_single_line_force_single_line.py.snap index d846e63bbadc92..4a72957bb54b9f 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_single_line_force_single_line.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_single_line_force_single_line.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 25 - column: 0 - fix: - content: "import math\nimport sys\nfrom json import detect_encoding\nfrom json import dump\nfrom json import dumps as json_dumps\nfrom json import load\nfrom json import loads as json_loads\nfrom logging.handlers import FileHandler, StreamHandler\nfrom os import path, uname\n\n# comment 6\nfrom bar import a # comment 7\nfrom bar import b # comment 8\nfrom foo import bar # comment 3\nfrom foo2 import bar2 # comment 4\nfrom foo3 import bar3 # comment 5\nfrom foo3 import baz3 # comment 5\n\n# comment 1\n# comment 2\nfrom third_party import lib1\nfrom third_party import lib2\nfrom third_party import lib3\nfrom third_party import lib4\nfrom third_party import lib5\nfrom third_party import lib6\nfrom third_party import lib7\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 25 column: 0 - parent: ~ + fix: + content: "import math\nimport sys\nfrom json import detect_encoding\nfrom json import dump\nfrom json import dumps as json_dumps\nfrom json import load\nfrom json import loads as json_loads\nfrom logging.handlers import FileHandler, StreamHandler\nfrom os import path, uname\n\n# comment 6\nfrom bar import a # comment 7\nfrom bar import b # comment 8\nfrom foo import bar # comment 3\nfrom foo2 import bar2 # comment 4\nfrom foo3 import bar3 # comment 5\nfrom foo3 import baz3 # comment 5\n\n# comment 1\n# comment 2\nfrom third_party import lib1\nfrom third_party import lib2\nfrom third_party import lib3\nfrom third_party import lib4\nfrom third_party import lib5\nfrom third_party import lib6\nfrom third_party import lib7\n" + location: + row: 1 + column: 0 + end_location: + row: 25 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections.py.snap index 51d77ed4c19a2d..8a0fa2ae594425 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 12 - column: 0 - fix: - content: "import a # import\nimport b as b1 # import_as\nimport c.d\nfrom a import a1 # import_from\nfrom c import * # import_from_star\n\nfrom ...grandparent import fn3\nfrom ..parent import *\nfrom . import my\nfrom .my import fn\nfrom .my.nested import fn2\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 12 column: 0 - parent: ~ + fix: + content: "import a # import\nimport b as b1 # import_as\nimport c.d\nfrom a import a1 # import_from\nfrom c import * # import_from_star\n\nfrom ...grandparent import fn3\nfrom ..parent import *\nfrom . import my\nfrom .my import fn\nfrom .my.nested import fn2\n" + location: + row: 1 + column: 0 + end_location: + row: 12 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap index e73e9874cb6a79..f36aed339d512b 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 12 - column: 0 - fix: - content: "import a # import\nfrom a import a1 # import_from\nimport b as b1 # import_as\nfrom c import * # import_from_star\nimport c.d\n\nfrom ...grandparent import fn3\nfrom ..parent import *\nfrom . import my\nfrom .my import fn\nfrom .my.nested import fn2\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 12 column: 0 - parent: ~ + fix: + content: "import a # import\nfrom a import a1 # import_from\nimport b as b1 # import_as\nfrom c import * # import_from_star\nimport c.d\n\nfrom ...grandparent import fn3\nfrom ..parent import *\nfrom . import my\nfrom .my import fn\nfrom .my.nested import fn2\n" + location: + row: 1 + column: 0 + end_location: + row: 12 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top.py.snap index b2b2f90eef5f5c..2f0c6d724ea13c 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 24 - column: 0 - fix: - content: "import foo\nimport lib1\nimport lib2\nimport lib3\nimport lib3.lib4\nimport lib3.lib4.lib5\nimport lib4\nimport lib5\nimport lib6\nimport z\nfrom foo import bar\nfrom foo.lib1.bar import baz\nfrom lib1 import foo\nfrom lib1.lib2 import foo\nfrom lib2 import foo\nfrom lib3.lib4 import foo\nfrom lib3.lib4.lib5 import foo\nfrom lib4 import lib1, lib2\nfrom lib5 import lib1, lib2\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 24 column: 0 - parent: ~ + fix: + content: "import foo\nimport lib1\nimport lib2\nimport lib3\nimport lib3.lib4\nimport lib3.lib4.lib5\nimport lib4\nimport lib5\nimport lib6\nimport z\nfrom foo import bar\nfrom foo.lib1.bar import baz\nfrom lib1 import foo\nfrom lib1.lib2 import foo\nfrom lib2 import foo\nfrom lib3.lib4 import foo\nfrom lib3.lib4.lib5 import foo\nfrom lib4 import lib1, lib2\nfrom lib5 import lib1, lib2\n" + location: + row: 1 + column: 0 + end_location: + row: 24 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top_force_to_top.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top_force_to_top.py.snap index 4d72a109e9af7a..570d8107b33523 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top_force_to_top.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top_force_to_top.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 24 - column: 0 - fix: - content: "import lib1\nimport lib3\nimport lib3.lib4\nimport lib5\nimport z\nimport foo\nimport lib2\nimport lib3.lib4.lib5\nimport lib4\nimport lib6\nfrom lib1 import foo\nfrom lib3.lib4 import foo\nfrom lib5 import lib1, lib2\nfrom foo import bar\nfrom foo.lib1.bar import baz\nfrom lib1.lib2 import foo\nfrom lib2 import foo\nfrom lib3.lib4.lib5 import foo\nfrom lib4 import lib1, lib2\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 24 column: 0 - parent: ~ + fix: + content: "import lib1\nimport lib3\nimport lib3.lib4\nimport lib5\nimport z\nimport foo\nimport lib2\nimport lib3.lib4.lib5\nimport lib4\nimport lib6\nfrom lib1 import foo\nfrom lib3.lib4 import foo\nfrom lib5 import lib1, lib2\nfrom foo import bar\nfrom foo.lib1.bar import baz\nfrom lib1.lib2 import foo\nfrom lib2 import foo\nfrom lib3.lib4.lib5 import foo\nfrom lib4 import lib1, lib2\n" + location: + row: 1 + column: 0 + end_location: + row: 24 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases.py.snap index 4f03dec774f06c..3135f1161b1b40 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 4 - column: 0 - fix: - content: "from .a import a1 as a1\nfrom .a import a2 as a2\nfrom .b import b1 as b1\nfrom .c import c1\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 4 column: 0 - parent: ~ + fix: + content: "from .a import a1 as a1\nfrom .a import a2 as a2\nfrom .b import b1 as b1\nfrom .c import c1\n" + location: + row: 1 + column: 0 + end_location: + row: 4 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap index dd5abaf5b3fe55..9d60e99619bc23 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 4 - column: 0 - fix: - content: "from .a import (\n a1 as a1,\n a2 as a2,\n)\nfrom .b import b1 as b1\nfrom .c import c1\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 4 column: 0 - parent: ~ + fix: + content: "from .a import (\n a1 as a1,\n a2 as a2,\n)\nfrom .b import b1 as b1\nfrom .c import c1\n" + location: + row: 1 + column: 0 + end_location: + row: 4 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__forced_separate.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__forced_separate.py.snap index 38b34ae88688b1..442ba0985792e9 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__forced_separate.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__forced_separate.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 9 - column: 0 - fix: - content: "from office_helper.assistants import entity_registry as er\nfrom office_helper.core import CoreState\n\nimport tests.common.foo as tcf\nfrom tests.common import async_mock_service\n\nfrom experiments.starry import *\nfrom experiments.weird import varieties\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 3 column: 0 end_location: row: 9 column: 0 - parent: ~ + fix: + content: "from office_helper.assistants import entity_registry as er\nfrom office_helper.core import CoreState\n\nimport tests.common.foo as tcf\nfrom tests.common import async_mock_service\n\nfrom experiments.starry import *\nfrom experiments.weird import varieties\n" + location: + row: 3 + column: 0 + end_location: + row: 9 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__import_from_after_import.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__import_from_after_import.py.snap index 98bc17023569e0..8dc61cc21350e1 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__import_from_after_import.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__import_from_after_import.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 3 - column: 0 - fix: - content: "import os\nfrom collections import Collection\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 3 column: 0 - parent: ~ + fix: + content: "import os\nfrom collections import Collection\n" + location: + row: 1 + column: 0 + end_location: + row: 3 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__inline_comments.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__inline_comments.py.snap index 154c67dc3bce68..926f6d911d9b80 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__inline_comments.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__inline_comments.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 12 - column: 0 - fix: - content: "from a.prometheus.metrics import ( # type:ignore[attr-defined]\n TERMINAL_CURRENTLY_RUNNING_TOTAL,\n)\nfrom b.prometheus.metrics import (\n TERMINAL_CURRENTLY_RUNNING_TOTAL, # type:ignore[attr-defined]\n)\nfrom c.prometheus.metrics import (\n TERMINAL_CURRENTLY_RUNNING_TOTAL, # type:ignore[attr-defined]\n)\nfrom d.prometheus.metrics import ( # type:ignore[attr-defined]\n OTHER_RUNNING_TOTAL,\n TERMINAL_CURRENTLY_RUNNING_TOTAL,\n)\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 12 column: 0 - parent: ~ + fix: + content: "from a.prometheus.metrics import ( # type:ignore[attr-defined]\n TERMINAL_CURRENTLY_RUNNING_TOTAL,\n)\nfrom b.prometheus.metrics import (\n TERMINAL_CURRENTLY_RUNNING_TOTAL, # type:ignore[attr-defined]\n)\nfrom c.prometheus.metrics import (\n TERMINAL_CURRENTLY_RUNNING_TOTAL, # type:ignore[attr-defined]\n)\nfrom d.prometheus.metrics import ( # type:ignore[attr-defined]\n OTHER_RUNNING_TOTAL,\n TERMINAL_CURRENTLY_RUNNING_TOTAL,\n)\n" + location: + row: 1 + column: 0 + end_location: + row: 12 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.py.snap index a1a964fc7dcf1e..14d5ba0c31ae05 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 3 - column: 0 - fix: - content: "import a\nimport b\n\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 3 column: 0 - parent: ~ -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 6 - column: 0 - fix: - content: "import os\nimport sys\n\n\n" + fix: + content: "import a\nimport b\n\n" + location: + row: 1 + column: 0 + end_location: + row: 3 + column: 0 + parent: ~ + - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 4 column: 0 end_location: row: 6 column: 0 - parent: ~ -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 14 - column: 0 - end_location: - row: 16 - column: 0 - fix: - content: "import os\nimport sys\n\n" + fix: + content: "import os\nimport sys\n\n\n" + location: + row: 4 + column: 0 + end_location: + row: 6 + column: 0 + parent: ~ + - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 14 column: 0 end_location: row: 16 column: 0 - parent: ~ -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 52 - column: 0 - end_location: - row: 54 - column: 0 - fix: - content: "import os\n\n\n" + fix: + content: "import os\nimport sys\n\n" + location: + row: 14 + column: 0 + end_location: + row: 16 + column: 0 + parent: ~ + - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 52 column: 0 end_location: row: 54 column: 0 - parent: ~ + fix: + content: "import os\n\n\n" + location: + row: 52 + column: 0 + end_location: + row: 54 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.pyi.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.pyi.snap index a327a66c49fde6..5a00512c3b771c 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.pyi.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.pyi.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 3 - column: 0 - fix: - content: "import a\nimport b\n\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 3 column: 0 - parent: ~ -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 6 - column: 0 - fix: - content: "import os\nimport sys\n\n" + fix: + content: "import a\nimport b\n\n" + location: + row: 1 + column: 0 + end_location: + row: 3 + column: 0 + parent: ~ + - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 4 column: 0 end_location: row: 6 column: 0 - parent: ~ -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 14 - column: 0 - end_location: - row: 16 - column: 0 - fix: - content: "import os\nimport sys\n\n" + fix: + content: "import os\nimport sys\n\n" + location: + row: 4 + column: 0 + end_location: + row: 6 + column: 0 + parent: ~ + - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 14 column: 0 end_location: row: 16 column: 0 - parent: ~ + fix: + content: "import os\nimport sys\n\n" + location: + row: 14 + column: 0 + end_location: + row: 16 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__isort_skip_file.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__isort_skip_file.py.snap index caa019cc6cd90d..e3580a5edd08a0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__isort_skip_file.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__isort_skip_file.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap index 7a9ac9f80157b2..651c81d17475d0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 6 - column: 0 - fix: - content: "import os\nimport sys\n\nimport leading_prefix\n\nimport ruff\nfrom . import leading_prefix\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 6 column: 0 - parent: ~ + fix: + content: "import os\nimport sys\n\nimport leading_prefix\n\nimport ruff\nfrom . import leading_prefix\n" + location: + row: 1 + column: 0 + end_location: + row: 6 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__leading_prefix.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__leading_prefix.py.snap index 27d02ea78c679d..232a7d41f77017 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__leading_prefix.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__leading_prefix.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 7 - end_location: - row: 2 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 5 - column: 11 - end_location: - row: 6 - column: 13 - fix: ~ - parent: ~ -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 10 - column: 8 - end_location: - row: 10 - column: 17 - fix: ~ - parent: ~ -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 9 - fix: ~ - parent: ~ +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true + location: + row: 1 + column: 7 + end_location: + row: 2 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true + location: + row: 5 + column: 11 + end_location: + row: 6 + column: 13 + fix: ~ + parent: ~ + - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true + location: + row: 10 + column: 8 + end_location: + row: 10 + column: 17 + fix: ~ + parent: ~ + - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 9 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap index 6e6ef0d25a5932..44036cf7a323b8 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 10 - column: 0 - fix: - content: "from __future__ import annotations\n\nfrom typing import Any\n\nfrom my_first_party import my_first_party_object\nfrom requests import Session\n\nfrom . import my_local_folder_object\n\n\n\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 10 column: 0 - parent: ~ + fix: + content: "from __future__ import annotations\n\nfrom typing import Any\n\nfrom my_first_party import my_first_party_object\nfrom requests import Session\n\nfrom . import my_local_folder_object\n\n\n\n" + location: + row: 1 + column: 0 + end_location: + row: 10 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap index 1498413113f1fb..0ebd4a03f0cfd8 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 21 - column: 0 - fix: - content: "from __future__ import annotations\n\nfrom typing import Any\n\nfrom my_first_party import my_first_party_object\nfrom requests import Session\n\nfrom . import my_local_folder_object\n\n\n\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 21 column: 0 - parent: ~ + fix: + content: "from __future__ import annotations\n\nfrom typing import Any\n\nfrom my_first_party import my_first_party_object\nfrom requests import Session\n\nfrom . import my_local_folder_object\n\n\n\n" + location: + row: 1 + column: 0 + end_location: + row: 21 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap index 0404d02bcedcfc..c63a90cd25b051 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 10 - column: 0 - fix: - content: "from __future__ import annotations\n\nfrom typing import Any\n\nfrom my_first_party import my_first_party_object\nfrom requests import Session\n\nfrom . import my_local_folder_object\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 10 column: 0 - parent: ~ + fix: + content: "from __future__ import annotations\n\nfrom typing import Any\n\nfrom my_first_party import my_first_party_object\nfrom requests import Session\n\nfrom . import my_local_folder_object\n" + location: + row: 1 + column: 0 + end_location: + row: 10 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_between_typeslines_between_types.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_between_typeslines_between_types.py.snap index fea0aaedc4dcbf..5e044b64fbf0f1 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_between_typeslines_between_types.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_between_typeslines_between_types.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 17 - column: 0 - fix: - content: "from __future__ import annotations\n\nimport datetime\nimport json\n\n\nfrom binascii import hexlify\n\nimport requests\n\n\nfrom loguru import Logger\nfrom sanic import Sanic\n\nfrom . import config\nfrom .data import Data\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 17 column: 0 - parent: ~ + fix: + content: "from __future__ import annotations\n\nimport datetime\nimport json\n\n\nfrom binascii import hexlify\n\nimport requests\n\n\nfrom loguru import Logger\nfrom sanic import Sanic\n\nfrom . import config\nfrom .data import Data\n" + location: + row: 1 + column: 0 + end_location: + row: 17 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__magic_trailing_comma.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__magic_trailing_comma.py.snap index aca8152f77e70e..d37a17d00d3dd8 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__magic_trailing_comma.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__magic_trailing_comma.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 39 - column: 0 - fix: - content: "from glob import (\n escape, # Ends with a comment, should still treat as magic trailing comma.\n glob,\n iglob,\n)\n\n# No magic comma, this will be rolled into one line.\nfrom os import environ, execl, execv, path\nfrom sys import (\n argv,\n exit,\n stderr,\n stdout,\n)\n\n# These will be combined, but without a trailing comma.\nfrom foo import bar, baz\n\n# These will be combined, _with_ a trailing comma.\nfrom module1 import (\n member1,\n member2,\n member3,\n)\n\n# These will be combined, _with_ a trailing comma.\nfrom module2 import (\n member1,\n member2,\n member3,\n)\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 2 column: 0 end_location: row: 39 column: 0 - parent: ~ + fix: + content: "from glob import (\n escape, # Ends with a comment, should still treat as magic trailing comma.\n glob,\n iglob,\n)\n\n# No magic comma, this will be rolled into one line.\nfrom os import environ, execl, execv, path\nfrom sys import (\n argv,\n exit,\n stderr,\n stdout,\n)\n\n# These will be combined, but without a trailing comma.\nfrom foo import bar, baz\n\n# These will be combined, _with_ a trailing comma.\nfrom module1 import (\n member1,\n member2,\n member3,\n)\n\n# These will be combined, _with_ a trailing comma.\nfrom module2 import (\n member1,\n member2,\n member3,\n)\n" + location: + row: 2 + column: 0 + end_location: + row: 39 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__natural_order.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__natural_order.py.snap index d33c2710f61386..c66172c80c77ea 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__natural_order.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__natural_order.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 17 - column: 0 - fix: - content: "import numpy1\nimport numpy2\nimport numpy10\nfrom numpy import (\n cos,\n int8,\n int16,\n int32,\n int64,\n sin,\n tan,\n uint8,\n uint16,\n uint32,\n uint64,\n)\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 17 column: 0 - parent: ~ + fix: + content: "import numpy1\nimport numpy2\nimport numpy10\nfrom numpy import (\n cos,\n int8,\n int16,\n int32,\n int64,\n sin,\n tan,\n uint8,\n uint16,\n uint32,\n uint64,\n)\n" + location: + row: 1 + column: 0 + end_location: + row: 17 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py.snap index 0404d02bcedcfc..c63a90cd25b051 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 10 - column: 0 - fix: - content: "from __future__ import annotations\n\nfrom typing import Any\n\nfrom my_first_party import my_first_party_object\nfrom requests import Session\n\nfrom . import my_local_folder_object\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 10 column: 0 - parent: ~ + fix: + content: "from __future__ import annotations\n\nfrom typing import Any\n\nfrom my_first_party import my_first_party_object\nfrom requests import Session\n\nfrom . import my_local_folder_object\n" + location: + row: 1 + column: 0 + end_location: + row: 10 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap index 77417890bdc6f8..71c22cfe32cea5 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 10 - column: 0 - fix: - content: "from __future__ import annotations\nfrom typing import Any\nfrom my_first_party import my_first_party_object\nfrom requests import Session\nfrom . import my_local_folder_object\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 10 column: 0 - parent: ~ + fix: + content: "from __future__ import annotations\nfrom typing import Any\nfrom my_first_party import my_first_party_object\nfrom requests import Session\nfrom . import my_local_folder_object\n" + location: + row: 1 + column: 0 + end_location: + row: 10 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap index 30a906989062ea..8ca1f568126a60 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 4 - column: 0 - fix: - content: "from __future__ import annotations\nfrom typing import Any\n\nfrom . import my_local_folder_object\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 4 column: 0 - parent: ~ + fix: + content: "from __future__ import annotations\nfrom typing import Any\n\nfrom . import my_local_folder_object\n" + location: + row: 1 + column: 0 + end_location: + row: 4 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_reorder_within_section.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_reorder_within_section.py.snap index 40d8799b1084f5..e3580a5edd08a0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_reorder_within_section.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_reorder_within_section.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/isort/mod.rs +source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_wrap_star.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_wrap_star.py.snap index a7b4c8bb227efd..07e066cef34a2f 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_wrap_star.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_wrap_star.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 2 - column: 0 - fix: - content: "from .subscription import * # type: ignore # some very long comment explaining why this needs a type ignore\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 2 column: 0 - parent: ~ + fix: + content: "from .subscription import * # type: ignore # some very long comment explaining why this needs a type ignore\n" + location: + row: 1 + column: 0 + end_location: + row: 2 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type.py.snap index 1cf89cf57098d0..4fa5be615e7113 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 13 - column: 0 - fix: - content: "import glob\nimport os\nimport shutil\nimport tempfile\nimport time\nfrom subprocess import PIPE, STDOUT, Popen\n\nimport BAR\nimport bar\nimport FOO\nimport foo\nimport StringIO\nfrom module import BASIC, CONSTANT, Apple, Class, function\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 13 column: 0 - parent: ~ + fix: + content: "import glob\nimport os\nimport shutil\nimport tempfile\nimport time\nfrom subprocess import PIPE, STDOUT, Popen\n\nimport BAR\nimport bar\nimport FOO\nimport foo\nimport StringIO\nfrom module import BASIC, CONSTANT, Apple, Class, function\n" + location: + row: 1 + column: 0 + end_location: + row: 13 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_false_order_by_type.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_false_order_by_type.py.snap index abd8a9e191530a..0ef1f4ce82646a 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_false_order_by_type.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_false_order_by_type.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 13 - column: 0 - fix: - content: "import glob\nimport os\nimport shutil\nimport tempfile\nimport time\nfrom subprocess import PIPE, Popen, STDOUT\n\nimport BAR\nimport bar\nimport FOO\nimport foo\nimport StringIO\nfrom module import Apple, BASIC, Class, CONSTANT, function\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 13 column: 0 - parent: ~ + fix: + content: "import glob\nimport os\nimport shutil\nimport tempfile\nimport time\nfrom subprocess import PIPE, Popen, STDOUT\n\nimport BAR\nimport bar\nimport FOO\nimport foo\nimport StringIO\nfrom module import Apple, BASIC, Class, CONSTANT, function\n" + location: + row: 1 + column: 0 + end_location: + row: 13 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes.py.snap index 0cd678ee64d3a1..26cc7e97a220a7 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 5 - column: 0 - fix: - content: "from subprocess import N_CLASS, PIPE, STDOUT, Popen\n\nfrom module import BASIC, CLASS, CONSTANT, Apple, Class, function\nfrom sklearn.svm import CONST, SVC, Klass, func\nfrom torch.nn import A_CONSTANT, SELU, AClass\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 5 column: 0 - parent: ~ + fix: + content: "from subprocess import N_CLASS, PIPE, STDOUT, Popen\n\nfrom module import BASIC, CLASS, CONSTANT, Apple, Class, function\nfrom sklearn.svm import CONST, SVC, Klass, func\nfrom torch.nn import A_CONSTANT, SELU, AClass\n" + location: + row: 1 + column: 0 + end_location: + row: 5 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap index b3d0b144d5cddf..7e3fd7adac0801 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 5 - column: 0 - fix: - content: "from subprocess import PIPE, STDOUT, N_CLASS, Popen\n\nfrom module import BASIC, CONSTANT, Apple, CLASS, Class, function\nfrom sklearn.svm import CONST, Klass, SVC, func\nfrom torch.nn import A_CONSTANT, AClass, SELU\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 5 column: 0 - parent: ~ + fix: + content: "from subprocess import PIPE, STDOUT, N_CLASS, Popen\n\nfrom module import BASIC, CONSTANT, Apple, CLASS, Class, function\nfrom sklearn.svm import CONST, Klass, SVC, func\nfrom torch.nn import A_CONSTANT, AClass, SELU\n" + location: + row: 1 + column: 0 + end_location: + row: 5 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants.py.snap index 6175ce33329fc3..0ca788df83bc11 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 3 - column: 0 - fix: - content: "from subprocess import STDOUT, A_constant, Class, First, Last, func, konst, var\n\nfrom sklearn.svm import XYZ, Const, Klass, constant, func, variable\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 3 column: 0 - parent: ~ + fix: + content: "from subprocess import STDOUT, A_constant, Class, First, Last, func, konst, var\n\nfrom sklearn.svm import XYZ, Const, Klass, constant, func, variable\n" + location: + row: 1 + column: 0 + end_location: + row: 3 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap index 40c754134e9f40..cb9056a0b1faed 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 3 - column: 0 - fix: - content: "from subprocess import A_constant, First, konst, Last, STDOUT, Class, func, var\n\nfrom sklearn.svm import Const, constant, XYZ, Klass, func, variable\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 3 column: 0 - parent: ~ + fix: + content: "from subprocess import A_constant, First, konst, Last, STDOUT, Class, func, var\n\nfrom sklearn.svm import Const, constant, XYZ, Klass, func, variable\n" + location: + row: 1 + column: 0 + end_location: + row: 3 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables.py.snap index c10a7709413f6c..a6a2c78b776de1 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 3 - column: 0 - fix: - content: "from subprocess import CONSTANT, Klass, Variable, exe, utils, var_ABC\n\nfrom sklearn.svm import CONST, VAR, Class, MyVar, abc\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 3 column: 0 - parent: ~ + fix: + content: "from subprocess import CONSTANT, Klass, Variable, exe, utils, var_ABC\n\nfrom sklearn.svm import CONST, VAR, Class, MyVar, abc\n" + location: + row: 1 + column: 0 + end_location: + row: 3 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap index d2648d75c7df4c..b3c3dad4612c4a 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 3 - column: 0 - fix: - content: "from subprocess import CONSTANT, Klass, exe, utils, var_ABC, Variable\n\nfrom sklearn.svm import CONST, Class, abc, MyVar, VAR\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 3 column: 0 - parent: ~ + fix: + content: "from subprocess import CONSTANT, Klass, exe, utils, var_ABC, Variable\n\nfrom sklearn.svm import CONST, Class, abc, MyVar, VAR\n" + location: + row: 1 + column: 0 + end_location: + row: 3 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_relative_imports_by_level.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_relative_imports_by_level.py.snap index aab70a9a82e277..738a8df3f40107 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_relative_imports_by_level.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_relative_imports_by_level.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 5 - column: 0 - fix: - content: "from ..a import a\nfrom ..b import a\nfrom .a import a\nfrom .b import a\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 5 column: 0 - parent: ~ + fix: + content: "from ..a import a\nfrom ..b import a\nfrom .a import a\nfrom .b import a\n" + location: + row: 1 + column: 0 + end_location: + row: 5 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_comment_order.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_comment_order.py.snap index e0f1dc9635a194..8c42e1e6ec40d8 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_comment_order.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_comment_order.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 12 - column: 0 - fix: - content: "import abc\nimport io\n\n# Old MacDonald had a farm,\n# EIEIO\n# And on his farm he had a cow,\n# EIEIO\n# With a moo-moo here and a moo-moo there\n# Here a moo, there a moo, everywhere moo-moo\n# Old MacDonald had a farm,\n# EIEIO\nfrom errno import EIO\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 12 column: 0 - parent: ~ + fix: + content: "import abc\nimport io\n\n# Old MacDonald had a farm,\n# EIEIO\n# And on his farm he had a cow,\n# EIEIO\n# With a moo-moo here and a moo-moo there\n# Here a moo, there a moo, everywhere moo-moo\n# Old MacDonald had a farm,\n# EIEIO\nfrom errno import EIO\n" + location: + row: 1 + column: 0 + end_location: + row: 12 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_import_star.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_import_star.py.snap index 6b5939cb1eebe6..2310beb13bade6 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_import_star.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_import_star.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 7 - column: 0 - fix: - content: "# Above\nfrom some_module import * # Aside\n\n# Above\nfrom some_module import some_class # Aside\nfrom some_other_module import *\nfrom some_other_module import some_class\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 7 column: 0 - parent: ~ + fix: + content: "# Above\nfrom some_module import * # Aside\n\n# Above\nfrom some_module import some_class # Aside\nfrom some_other_module import *\nfrom some_other_module import some_class\n" + location: + row: 1 + column: 0 + end_location: + row: 7 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_indentation.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_indentation.py.snap index 029088a601af9c..098a30632df027 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_indentation.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_indentation.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 4 - column: 0 - fix: - content: " import os\n import sys\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 2 column: 0 end_location: row: 4 column: 0 - parent: ~ -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 7 - column: 0 - fix: - content: " import os\n import sys\n" + fix: + content: " import os\n import sys\n" + location: + row: 2 + column: 0 + end_location: + row: 4 + column: 0 + parent: ~ + - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 5 column: 0 end_location: row: 7 column: 0 - parent: ~ + fix: + content: " import os\n import sys\n" + location: + row: 5 + column: 0 + end_location: + row: 7 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_tabs.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_tabs.py.snap index 40d8799b1084f5..e3580a5edd08a0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_tabs.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_tabs.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/isort/mod.rs +source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_tabs_2.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_tabs_2.py.snap index 40d8799b1084f5..e3580a5edd08a0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_tabs_2.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_tabs_2.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/isort/mod.rs +source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__relative_imports_order.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__relative_imports_order.py.snap index 40d8799b1084f5..e3580a5edd08a0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__relative_imports_order.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__relative_imports_order.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/isort/mod.rs +source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__reorder_within_section.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__reorder_within_section.py.snap index b74879c500dad0..1c5fbfd09754bc 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__reorder_within_section.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__reorder_within_section.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 3 - column: 0 - fix: - content: "import os\nimport sys\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 3 column: 0 - parent: ~ + fix: + content: "import os\nimport sys\n" + location: + row: 1 + column: 0 + end_location: + row: 3 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring.py.snap index fe04b11b2d6d99..e20e8f067d44d2 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: MissingRequiredImport - body: "Missing required import: `from __future__ import annotations`" - suggestion: "Insert required import: `from __future__ import annotations`" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: - content: "\nfrom __future__ import annotations" +- - kind: + name: MissingRequiredImport + body: "Missing required import: `from __future__ import annotations`" + suggestion: "Insert required import: `from __future__ import annotations`" + fixable: true location: row: 1 - column: 19 + column: 0 end_location: row: 1 - column: 19 - parent: ~ + column: 0 + fix: + content: "\nfrom __future__ import annotations" + location: + row: 1 + column: 19 + end_location: + row: 1 + column: 19 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring_only.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring_only.py.snap index 40d8799b1084f5..e3580a5edd08a0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring_only.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring_only.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/isort/mod.rs +source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_empty.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_empty.py.snap index 40d8799b1084f5..e3580a5edd08a0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_empty.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_empty.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/isort/mod.rs +source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_multiline_docstring.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_multiline_docstring.py.snap index 96d0fd49d85377..96857b1cd297e0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_multiline_docstring.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_multiline_docstring.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: MissingRequiredImport - body: "Missing required import: `from __future__ import annotations`" - suggestion: "Insert required import: `from __future__ import annotations`" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: - content: "\nfrom __future__ import annotations" +- - kind: + name: MissingRequiredImport + body: "Missing required import: `from __future__ import annotations`" + suggestion: "Insert required import: `from __future__ import annotations`" + fixable: true location: - row: 3 - column: 3 + row: 1 + column: 0 end_location: - row: 3 - column: 3 - parent: ~ + row: 1 + column: 0 + fix: + content: "\nfrom __future__ import annotations" + location: + row: 3 + column: 3 + end_location: + row: 3 + column: 3 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring.py.snap index 6a5287e9869aec..bb71949335002f 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: MissingRequiredImport - body: "Missing required import: `from __future__ import annotations`" - suggestion: "Insert required import: `from __future__ import annotations`" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: - content: "\nfrom __future__ import annotations" +- - kind: + name: MissingRequiredImport + body: "Missing required import: `from __future__ import annotations`" + suggestion: "Insert required import: `from __future__ import annotations`" + fixable: true location: row: 1 - column: 19 + column: 0 end_location: row: 1 - column: 19 - parent: ~ -- kind: - name: MissingRequiredImport - body: "Missing required import: `from __future__ import generator_stop`" - suggestion: "Insert required import: `from __future__ import generator_stop`" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: - content: "\nfrom __future__ import generator_stop" + column: 0 + fix: + content: "\nfrom __future__ import annotations" + location: + row: 1 + column: 19 + end_location: + row: 1 + column: 19 + parent: ~ + - kind: + name: MissingRequiredImport + body: "Missing required import: `from __future__ import generator_stop`" + suggestion: "Insert required import: `from __future__ import generator_stop`" + fixable: true location: row: 1 - column: 19 + column: 0 end_location: row: 1 - column: 19 - parent: ~ + column: 0 + fix: + content: "\nfrom __future__ import generator_stop" + location: + row: 1 + column: 19 + end_location: + row: 1 + column: 19 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring_only.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring_only.py.snap index 40d8799b1084f5..e3580a5edd08a0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring_only.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring_only.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/isort/mod.rs +source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_empty.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_empty.py.snap index 40d8799b1084f5..e3580a5edd08a0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_empty.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_empty.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/isort/mod.rs +source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__ruff_skip_file.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__ruff_skip_file.py.snap index caa019cc6cd90d..e3580a5edd08a0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__ruff_skip_file.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__ruff_skip_file.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_first_party_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_first_party_imports.py.snap index f1ba2170cef0cd..7fb864405cca58 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_first_party_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_first_party_imports.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 6 - column: 0 - fix: - content: "import os\nimport sys\n\nimport numpy as np\n\nimport leading_prefix\nfrom leading_prefix import Class\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 6 column: 0 - parent: ~ + fix: + content: "import os\nimport sys\n\nimport numpy as np\n\nimport leading_prefix\nfrom leading_prefix import Class\n" + location: + row: 1 + column: 0 + end_location: + row: 6 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_future_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_future_imports.py.snap index 3a80b84e273d32..1d751c30e9ccce 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_future_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_future_imports.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 4 - column: 0 - fix: - content: "from __future__ import annotations\n\nimport os\nimport sys\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 4 column: 0 - parent: ~ + fix: + content: "from __future__ import annotations\n\nimport os\nimport sys\n" + location: + row: 1 + column: 0 + end_location: + row: 4 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_local_folder_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_local_folder_imports.py.snap index fcaae105385dea..fec2957a0f8898 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_local_folder_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_local_folder_imports.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 6 - column: 0 - fix: - content: "import os\nimport sys\n\nimport ruff\n\nimport leading_prefix\n\nfrom . import leading_prefix\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 6 column: 0 - parent: ~ + fix: + content: "import os\nimport sys\n\nimport ruff\n\nimport leading_prefix\n\nfrom . import leading_prefix\n" + location: + row: 1 + column: 0 + end_location: + row: 6 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_third_party_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_third_party_imports.py.snap index 46f078ffe12b7c..9138adc958fd87 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_third_party_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_third_party_imports.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 5 - column: 0 - fix: - content: "import os\nimport sys\n\nimport numpy as np\nimport pandas as pd\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 5 column: 0 - parent: ~ + fix: + content: "import os\nimport sys\n\nimport numpy as np\nimport pandas as pd\n" + location: + row: 1 + column: 0 + end_location: + row: 5 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__skip.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__skip.py.snap index 98ba47763bc6fc..d19e6193427ba1 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__skip.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__skip.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 20 - column: 0 - end_location: - row: 22 - column: 0 - fix: - content: " import abc\n import collections\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 20 column: 0 end_location: row: 22 column: 0 - parent: ~ -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 27 - column: 0 - end_location: - row: 29 - column: 0 - fix: - content: " import abc\n import collections\n" + fix: + content: " import abc\n import collections\n" + location: + row: 20 + column: 0 + end_location: + row: 22 + column: 0 + parent: ~ + - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 27 column: 0 end_location: row: 29 column: 0 - parent: ~ + fix: + content: " import abc\n import collections\n" + location: + row: 27 + column: 0 + end_location: + row: 29 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__sort_similar_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__sort_similar_imports.py.snap index b41a82c0414f1a..bfcfea37a12a67 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__sort_similar_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__sort_similar_imports.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 27 - column: 0 - fix: - content: "import A\nimport a\nimport B\nimport b\nimport x\nimport x as A\nimport x as Y\nimport x as a\nimport x as y\nfrom a import BAD as DEF\nfrom a import B, b\nfrom a import B as A\nfrom a import B as Abc\nfrom a import B as DEF\nfrom a import Boo as DEF\nfrom a import b as a\nfrom a import b as c\nfrom a import b as d\nfrom a import b as x\nfrom a import b as y\nfrom b import C, c\nfrom b import c as d\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 27 column: 0 - parent: ~ + fix: + content: "import A\nimport a\nimport B\nimport b\nimport x\nimport x as A\nimport x as Y\nimport x as a\nimport x as y\nfrom a import BAD as DEF\nfrom a import B, b\nfrom a import B as A\nfrom a import B as Abc\nfrom a import B as DEF\nfrom a import Boo as DEF\nfrom a import b as a\nfrom a import b as c\nfrom a import b as d\nfrom a import b as x\nfrom a import b as y\nfrom b import C, c\nfrom b import c as d\n" + location: + row: 1 + column: 0 + end_location: + row: 27 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__split.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__split.py.snap index 40d8799b1084f5..e3580a5edd08a0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__split.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__split.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/isort/mod.rs +source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap index c5ea1a0b6f8ec1..de011fb8c1dca2 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 39 - column: 0 - fix: - content: "from glob import (\n escape, # Ends with a comment, should still treat as magic trailing comma.\n glob,\n iglob,\n)\n\n# No magic comma, this will be rolled into one line.\nfrom os import environ, execl, execv, path\nfrom sys import argv, exit, stderr, stdout\n\n# These will be combined, but without a trailing comma.\nfrom foo import bar, baz\n\n# These will be combined, _with_ a trailing comma.\nfrom module1 import member1, member2, member3\n\n# These will be combined, _with_ a trailing comma.\nfrom module2 import member1, member2, member3\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 2 column: 0 end_location: row: 39 column: 0 - parent: ~ + fix: + content: "from glob import (\n escape, # Ends with a comment, should still treat as magic trailing comma.\n glob,\n iglob,\n)\n\n# No magic comma, this will be rolled into one line.\nfrom os import environ, execl, execv, path\nfrom sys import argv, exit, stderr, stdout\n\n# These will be combined, but without a trailing comma.\nfrom foo import bar, baz\n\n# These will be combined, _with_ a trailing comma.\nfrom module1 import member1, member2, member3\n\n# These will be combined, _with_ a trailing comma.\nfrom module2 import member1, member2, member3\n" + location: + row: 2 + column: 0 + end_location: + row: 39 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__star_before_others.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__star_before_others.py.snap index b431fa88aa9dcd..dc0ef0256d0e62 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__star_before_others.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__star_before_others.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 4 - column: 0 - fix: - content: "from .logging import config_logging\nfrom .settings import *\nfrom .settings import ENV\n" +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true location: row: 1 column: 0 end_location: row: 4 column: 0 - parent: ~ + fix: + content: "from .logging import config_logging\nfrom .settings import *\nfrom .settings import ENV\n" + location: + row: 1 + column: 0 + end_location: + row: 4 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring.py.snap index b6da84cc164738..6cbb595d79afa9 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: MissingRequiredImport - body: "Missing required import: `import os`" - suggestion: "Insert required import: `import os`" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: - content: "\nimport os" +- - kind: + name: MissingRequiredImport + body: "Missing required import: `import os`" + suggestion: "Insert required import: `import os`" + fixable: true location: row: 1 - column: 19 + column: 0 end_location: row: 1 - column: 19 - parent: ~ + column: 0 + fix: + content: "\nimport os" + location: + row: 1 + column: 19 + end_location: + row: 1 + column: 19 + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring_only.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring_only.py.snap index 40d8799b1084f5..e3580a5edd08a0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring_only.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring_only.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/isort/mod.rs +source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_empty.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_empty.py.snap index 40d8799b1084f5..e3580a5edd08a0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_empty.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_empty.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/isort/mod.rs +source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__trailing_suffix.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__trailing_suffix.py.snap index 23615f0bf6e248..6edc8f75347877 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__trailing_suffix.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__trailing_suffix.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 2 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UnsortedImports - body: Import block is un-sorted or un-formatted - suggestion: Organize imports - fixable: true - location: - row: 5 - column: 4 - end_location: - row: 6 - column: 13 - fix: ~ - parent: ~ +- - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true + location: + row: 1 + column: 0 + end_location: + row: 2 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UnsortedImports + body: Import block is un-sorted or un-formatted + suggestion: Organize imports + fixable: true + location: + row: 5 + column: 4 + end_location: + row: 6 + column: 13 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__type_comments.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__type_comments.py.snap index 40d8799b1084f5..e3580a5edd08a0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__type_comments.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__type_comments.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/isort/mod.rs +source: crates/ruff/src/rules/isort/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_0.snap b/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_0.snap index 9a1351878d41f9..f5db030979e189 100644 --- a/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_0.snap +++ b/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_0.snap @@ -2,290 +2,290 @@ source: crates/ruff/src/rules/mccabe/mod.rs expression: diagnostics --- -- kind: - name: ComplexStructure - body: "`trivial` is too complex (1 > 0)" - suggestion: ~ - fixable: false - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 11 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`expr_as_statement` is too complex (1 > 0)" - suggestion: ~ - fixable: false - location: - row: 7 - column: 4 - end_location: - row: 7 - column: 21 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`sequential` is too complex (1 > 0)" - suggestion: ~ - fixable: false - location: - row: 12 - column: 4 - end_location: - row: 12 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`if_elif_else_dead_path` is too complex (3 > 0)" - suggestion: ~ - fixable: false - location: - row: 19 - column: 4 - end_location: - row: 19 - column: 26 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`nested_ifs` is too complex (3 > 0)" - suggestion: ~ - fixable: false - location: - row: 29 - column: 4 - end_location: - row: 29 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`for_loop` is too complex (2 > 0)" - suggestion: ~ - fixable: false - location: - row: 40 - column: 4 - end_location: - row: 40 - column: 12 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`for_else` is too complex (2 > 0)" - suggestion: ~ - fixable: false - location: - row: 46 - column: 4 - end_location: - row: 46 - column: 12 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`recursive` is too complex (2 > 0)" - suggestion: ~ - fixable: false - location: - row: 54 - column: 4 - end_location: - row: 54 - column: 13 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`nested_functions` is too complex (3 > 0)" - suggestion: ~ - fixable: false - location: - row: 62 - column: 4 - end_location: - row: 62 - column: 20 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`a` is too complex (2 > 0)" - suggestion: ~ - fixable: false - location: - row: 63 - column: 8 - end_location: - row: 63 - column: 9 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`b` is too complex (1 > 0)" - suggestion: ~ - fixable: false - location: - row: 64 - column: 12 - end_location: - row: 64 - column: 13 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`try_else` is too complex (4 > 0)" - suggestion: ~ - fixable: false - location: - row: 73 - column: 4 - end_location: - row: 73 - column: 12 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`nested_try_finally` is too complex (1 > 0)" - suggestion: ~ - fixable: false - location: - row: 85 - column: 4 - end_location: - row: 85 - column: 22 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`foobar` is too complex (3 > 0)" - suggestion: ~ - fixable: false - location: - row: 96 - column: 10 - end_location: - row: 96 - column: 16 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`annotated_assign` is too complex (1 > 0)" - suggestion: ~ - fixable: false - location: - row: 107 - column: 4 - end_location: - row: 107 - column: 20 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`handle` is too complex (9 > 0)" - suggestion: ~ - fixable: false - location: - row: 113 - column: 8 - end_location: - row: 113 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`a` is too complex (1 > 0)" - suggestion: ~ - fixable: false - location: - row: 118 - column: 16 - end_location: - row: 118 - column: 17 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`b` is too complex (2 > 0)" - suggestion: ~ - fixable: false - location: - row: 121 - column: 16 - end_location: - row: 121 - column: 17 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`c` is too complex (1 > 0)" - suggestion: ~ - fixable: false - location: - row: 126 - column: 16 - end_location: - row: 126 - column: 17 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`error` is too complex (1 > 0)" - suggestion: ~ - fixable: false - location: - row: 129 - column: 16 - end_location: - row: 129 - column: 21 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`info` is too complex (1 > 0)" - suggestion: ~ - fixable: false - location: - row: 132 - column: 16 - end_location: - row: 132 - column: 20 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`exception` is too complex (1 > 0)" - suggestion: ~ - fixable: false - location: - row: 135 - column: 16 - end_location: - row: 135 - column: 25 - fix: ~ - parent: ~ +- - kind: + name: ComplexStructure + body: "`trivial` is too complex (1 > 0)" + suggestion: ~ + fixable: false + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 11 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`expr_as_statement` is too complex (1 > 0)" + suggestion: ~ + fixable: false + location: + row: 7 + column: 4 + end_location: + row: 7 + column: 21 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`sequential` is too complex (1 > 0)" + suggestion: ~ + fixable: false + location: + row: 12 + column: 4 + end_location: + row: 12 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`if_elif_else_dead_path` is too complex (3 > 0)" + suggestion: ~ + fixable: false + location: + row: 19 + column: 4 + end_location: + row: 19 + column: 26 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`nested_ifs` is too complex (3 > 0)" + suggestion: ~ + fixable: false + location: + row: 29 + column: 4 + end_location: + row: 29 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`for_loop` is too complex (2 > 0)" + suggestion: ~ + fixable: false + location: + row: 40 + column: 4 + end_location: + row: 40 + column: 12 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`for_else` is too complex (2 > 0)" + suggestion: ~ + fixable: false + location: + row: 46 + column: 4 + end_location: + row: 46 + column: 12 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`recursive` is too complex (2 > 0)" + suggestion: ~ + fixable: false + location: + row: 54 + column: 4 + end_location: + row: 54 + column: 13 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`nested_functions` is too complex (3 > 0)" + suggestion: ~ + fixable: false + location: + row: 62 + column: 4 + end_location: + row: 62 + column: 20 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`a` is too complex (2 > 0)" + suggestion: ~ + fixable: false + location: + row: 63 + column: 8 + end_location: + row: 63 + column: 9 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`b` is too complex (1 > 0)" + suggestion: ~ + fixable: false + location: + row: 64 + column: 12 + end_location: + row: 64 + column: 13 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`try_else` is too complex (4 > 0)" + suggestion: ~ + fixable: false + location: + row: 73 + column: 4 + end_location: + row: 73 + column: 12 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`nested_try_finally` is too complex (1 > 0)" + suggestion: ~ + fixable: false + location: + row: 85 + column: 4 + end_location: + row: 85 + column: 22 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`foobar` is too complex (3 > 0)" + suggestion: ~ + fixable: false + location: + row: 96 + column: 10 + end_location: + row: 96 + column: 16 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`annotated_assign` is too complex (1 > 0)" + suggestion: ~ + fixable: false + location: + row: 107 + column: 4 + end_location: + row: 107 + column: 20 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`handle` is too complex (9 > 0)" + suggestion: ~ + fixable: false + location: + row: 113 + column: 8 + end_location: + row: 113 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`a` is too complex (1 > 0)" + suggestion: ~ + fixable: false + location: + row: 118 + column: 16 + end_location: + row: 118 + column: 17 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`b` is too complex (2 > 0)" + suggestion: ~ + fixable: false + location: + row: 121 + column: 16 + end_location: + row: 121 + column: 17 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`c` is too complex (1 > 0)" + suggestion: ~ + fixable: false + location: + row: 126 + column: 16 + end_location: + row: 126 + column: 17 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`error` is too complex (1 > 0)" + suggestion: ~ + fixable: false + location: + row: 129 + column: 16 + end_location: + row: 129 + column: 21 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`info` is too complex (1 > 0)" + suggestion: ~ + fixable: false + location: + row: 132 + column: 16 + end_location: + row: 132 + column: 20 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`exception` is too complex (1 > 0)" + suggestion: ~ + fixable: false + location: + row: 135 + column: 16 + end_location: + row: 135 + column: 25 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_10.snap b/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_10.snap index 3b58f1e34d5175..3e486152346b3c 100644 --- a/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_10.snap +++ b/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_10.snap @@ -1,6 +1,6 @@ --- -source: src/rules/mccabe/mod.rs +source: crates/ruff/src/rules/mccabe/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_3.snap b/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_3.snap index 5bcea57845be26..a46de570d4e02e 100644 --- a/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_3.snap +++ b/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_3.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/mccabe/mod.rs expression: diagnostics --- -- kind: - name: ComplexStructure - body: "`try_else` is too complex (4 > 3)" - suggestion: ~ - fixable: false - location: - row: 73 - column: 4 - end_location: - row: 73 - column: 12 - fix: ~ - parent: ~ -- kind: - name: ComplexStructure - body: "`handle` is too complex (9 > 3)" - suggestion: ~ - fixable: false - location: - row: 113 - column: 8 - end_location: - row: 113 - column: 14 - fix: ~ - parent: ~ +- - kind: + name: ComplexStructure + body: "`try_else` is too complex (4 > 3)" + suggestion: ~ + fixable: false + location: + row: 73 + column: 4 + end_location: + row: 73 + column: 12 + fix: ~ + parent: ~ + - kind: + name: ComplexStructure + body: "`handle` is too complex (9 > 3)" + suggestion: ~ + fixable: false + location: + row: 113 + column: 8 + end_location: + row: 113 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap b/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap index 4252601d2fc195..453222c7d376b5 100644 --- a/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap +++ b/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap @@ -2,144 +2,144 @@ source: crates/ruff/src/rules/numpy/mod.rs expression: diagnostics --- -- kind: - name: NumpyDeprecatedTypeAlias - body: "Type alias `np.bool` is deprecated, replace with builtin type" - suggestion: "Replace `np.bool` with builtin type" - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 8 - fix: - content: bool +- - kind: + name: NumpyDeprecatedTypeAlias + body: "Type alias `np.bool` is deprecated, replace with builtin type" + suggestion: "Replace `np.bool` with builtin type" + fixable: true location: row: 6 column: 0 end_location: row: 6 column: 8 - parent: ~ -- kind: - name: NumpyDeprecatedTypeAlias - body: "Type alias `np.int` is deprecated, replace with builtin type" - suggestion: "Replace `np.int` with builtin type" - fixable: true - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 7 - fix: - content: int + fix: + content: bool + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 8 + parent: ~ + - kind: + name: NumpyDeprecatedTypeAlias + body: "Type alias `np.int` is deprecated, replace with builtin type" + suggestion: "Replace `np.int` with builtin type" + fixable: true location: row: 7 column: 0 end_location: row: 7 column: 7 - parent: ~ -- kind: - name: NumpyDeprecatedTypeAlias - body: "Type alias `np.object` is deprecated, replace with builtin type" - suggestion: "Replace `np.object` with builtin type" - fixable: true - location: - row: 9 - column: 12 - end_location: - row: 9 - column: 21 - fix: - content: object + fix: + content: int + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 7 + parent: ~ + - kind: + name: NumpyDeprecatedTypeAlias + body: "Type alias `np.object` is deprecated, replace with builtin type" + suggestion: "Replace `np.object` with builtin type" + fixable: true location: row: 9 column: 12 end_location: row: 9 column: 21 - parent: ~ -- kind: - name: NumpyDeprecatedTypeAlias - body: "Type alias `np.int` is deprecated, replace with builtin type" - suggestion: "Replace `np.int` with builtin type" - fixable: true - location: - row: 12 - column: 71 - end_location: - row: 12 - column: 77 - fix: - content: int + fix: + content: object + location: + row: 9 + column: 12 + end_location: + row: 9 + column: 21 + parent: ~ + - kind: + name: NumpyDeprecatedTypeAlias + body: "Type alias `np.int` is deprecated, replace with builtin type" + suggestion: "Replace `np.int` with builtin type" + fixable: true location: row: 12 column: 71 end_location: row: 12 column: 77 - parent: ~ -- kind: - name: NumpyDeprecatedTypeAlias - body: "Type alias `np.long` is deprecated, replace with builtin type" - suggestion: "Replace `np.long` with builtin type" - fixable: true - location: - row: 12 - column: 79 - end_location: - row: 12 - column: 86 - fix: - content: int + fix: + content: int + location: + row: 12 + column: 71 + end_location: + row: 12 + column: 77 + parent: ~ + - kind: + name: NumpyDeprecatedTypeAlias + body: "Type alias `np.long` is deprecated, replace with builtin type" + suggestion: "Replace `np.long` with builtin type" + fixable: true location: row: 12 column: 79 end_location: row: 12 column: 86 - parent: ~ -- kind: - name: NumpyDeprecatedTypeAlias - body: "Type alias `np.object` is deprecated, replace with builtin type" - suggestion: "Replace `np.object` with builtin type" - fixable: true - location: - row: 17 - column: 10 - end_location: - row: 17 - column: 22 - fix: - content: object + fix: + content: int + location: + row: 12 + column: 79 + end_location: + row: 12 + column: 86 + parent: ~ + - kind: + name: NumpyDeprecatedTypeAlias + body: "Type alias `np.object` is deprecated, replace with builtin type" + suggestion: "Replace `np.object` with builtin type" + fixable: true location: row: 17 column: 10 end_location: row: 17 column: 22 - parent: ~ -- kind: - name: NumpyDeprecatedTypeAlias - body: "Type alias `np.int` is deprecated, replace with builtin type" - suggestion: "Replace `np.int` with builtin type" - fixable: true - location: - row: 20 - column: 15 - end_location: - row: 20 - column: 21 - fix: - content: int + fix: + content: object + location: + row: 17 + column: 10 + end_location: + row: 17 + column: 22 + parent: ~ + - kind: + name: NumpyDeprecatedTypeAlias + body: "Type alias `np.int` is deprecated, replace with builtin type" + suggestion: "Replace `np.int` with builtin type" + fixable: true location: row: 20 column: 15 end_location: row: 20 column: 21 - parent: ~ + fix: + content: int + location: + row: 20 + column: 15 + end_location: + row: 20 + column: 21 + parent: ~ diff --git a/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-legacy-random_NPY002.py.snap b/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-legacy-random_NPY002.py.snap index 02dce193cf3fb7..222fbfa204f728 100644 --- a/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-legacy-random_NPY002.py.snap +++ b/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-legacy-random_NPY002.py.snap @@ -2,654 +2,654 @@ source: crates/ruff/src/rules/numpy/mod.rs expression: diagnostics --- -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.standard_normal` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 7 - end_location: - row: 10 - column: 29 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.standard_normal` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 12 - end_location: - row: 11 - column: 34 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.seed` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 15 - column: 0 - end_location: - row: 15 - column: 17 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.get_state` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 16 - column: 0 - end_location: - row: 16 - column: 22 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.set_state` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 17 - column: 0 - end_location: - row: 17 - column: 22 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.rand` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 18 - column: 0 - end_location: - row: 18 - column: 17 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.randn` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 19 - column: 0 - end_location: - row: 19 - column: 18 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.randint` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 20 - column: 0 - end_location: - row: 20 - column: 20 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.random_integers` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 21 - column: 0 - end_location: - row: 21 - column: 28 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.random_sample` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 22 - column: 0 - end_location: - row: 22 - column: 26 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.choice` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 23 - column: 0 - end_location: - row: 23 - column: 19 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.bytes` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 24 - column: 0 - end_location: - row: 24 - column: 18 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.shuffle` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 25 - column: 0 - end_location: - row: 25 - column: 20 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.permutation` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 26 - column: 0 - end_location: - row: 26 - column: 24 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.beta` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 27 - column: 0 - end_location: - row: 27 - column: 17 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.binomial` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 28 - column: 0 - end_location: - row: 28 - column: 21 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.chisquare` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 29 - column: 0 - end_location: - row: 29 - column: 22 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.dirichlet` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 30 - column: 0 - end_location: - row: 30 - column: 22 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.exponential` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 31 - column: 0 - end_location: - row: 31 - column: 24 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.f` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 32 - column: 0 - end_location: - row: 32 - column: 14 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.gamma` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 33 - column: 0 - end_location: - row: 33 - column: 18 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.geometric` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 34 - column: 0 - end_location: - row: 34 - column: 22 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.get_state` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 35 - column: 0 - end_location: - row: 35 - column: 22 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.gumbel` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 36 - column: 0 - end_location: - row: 36 - column: 19 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.hypergeometric` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 37 - column: 0 - end_location: - row: 37 - column: 27 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.laplace` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 38 - column: 0 - end_location: - row: 38 - column: 20 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.logistic` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 39 - column: 0 - end_location: - row: 39 - column: 21 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.lognormal` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 40 - column: 0 - end_location: - row: 40 - column: 22 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.logseries` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 41 - column: 0 - end_location: - row: 41 - column: 22 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.multinomial` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 42 - column: 0 - end_location: - row: 42 - column: 24 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.multivariate_normal` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 43 - column: 0 - end_location: - row: 43 - column: 32 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.negative_binomial` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 44 - column: 0 - end_location: - row: 44 - column: 30 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.noncentral_chisquare` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 45 - column: 0 - end_location: - row: 45 - column: 33 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.noncentral_f` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 46 - column: 0 - end_location: - row: 46 - column: 25 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.normal` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 47 - column: 0 - end_location: - row: 47 - column: 19 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.pareto` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 48 - column: 0 - end_location: - row: 48 - column: 19 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.poisson` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 49 - column: 0 - end_location: - row: 49 - column: 20 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.power` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 50 - column: 0 - end_location: - row: 50 - column: 18 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.rayleigh` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 51 - column: 0 - end_location: - row: 51 - column: 21 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.standard_cauchy` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 52 - column: 0 - end_location: - row: 52 - column: 28 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.standard_exponential` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 53 - column: 0 - end_location: - row: 53 - column: 33 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.standard_gamma` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 54 - column: 0 - end_location: - row: 54 - column: 27 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.standard_normal` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 55 - column: 0 - end_location: - row: 55 - column: 28 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.standard_t` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 56 - column: 0 - end_location: - row: 56 - column: 23 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.triangular` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 57 - column: 0 - end_location: - row: 57 - column: 23 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.uniform` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 58 - column: 0 - end_location: - row: 58 - column: 20 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.vonmises` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 59 - column: 0 - end_location: - row: 59 - column: 21 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.wald` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 60 - column: 0 - end_location: - row: 60 - column: 17 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.weibull` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 61 - column: 0 - end_location: - row: 61 - column: 20 - fix: ~ - parent: ~ -- kind: - name: NumpyLegacyRandom - body: "Replace legacy `np.random.zipf` call with `np.random.Generator`" - suggestion: ~ - fixable: false - location: - row: 62 - column: 0 - end_location: - row: 62 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.standard_normal` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 7 + end_location: + row: 10 + column: 29 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.standard_normal` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 12 + end_location: + row: 11 + column: 34 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.seed` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 15 + column: 0 + end_location: + row: 15 + column: 17 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.get_state` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 16 + column: 0 + end_location: + row: 16 + column: 22 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.set_state` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 17 + column: 0 + end_location: + row: 17 + column: 22 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.rand` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 18 + column: 0 + end_location: + row: 18 + column: 17 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.randn` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 19 + column: 0 + end_location: + row: 19 + column: 18 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.randint` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 20 + column: 0 + end_location: + row: 20 + column: 20 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.random_integers` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 21 + column: 0 + end_location: + row: 21 + column: 28 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.random_sample` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 22 + column: 0 + end_location: + row: 22 + column: 26 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.choice` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 23 + column: 0 + end_location: + row: 23 + column: 19 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.bytes` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 18 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.shuffle` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 25 + column: 0 + end_location: + row: 25 + column: 20 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.permutation` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 26 + column: 0 + end_location: + row: 26 + column: 24 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.beta` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 27 + column: 0 + end_location: + row: 27 + column: 17 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.binomial` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 28 + column: 0 + end_location: + row: 28 + column: 21 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.chisquare` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 29 + column: 0 + end_location: + row: 29 + column: 22 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.dirichlet` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 30 + column: 0 + end_location: + row: 30 + column: 22 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.exponential` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 31 + column: 0 + end_location: + row: 31 + column: 24 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.f` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 32 + column: 0 + end_location: + row: 32 + column: 14 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.gamma` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 33 + column: 0 + end_location: + row: 33 + column: 18 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.geometric` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 34 + column: 0 + end_location: + row: 34 + column: 22 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.get_state` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 35 + column: 0 + end_location: + row: 35 + column: 22 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.gumbel` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 36 + column: 0 + end_location: + row: 36 + column: 19 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.hypergeometric` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 37 + column: 0 + end_location: + row: 37 + column: 27 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.laplace` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 38 + column: 0 + end_location: + row: 38 + column: 20 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.logistic` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 39 + column: 0 + end_location: + row: 39 + column: 21 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.lognormal` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 40 + column: 0 + end_location: + row: 40 + column: 22 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.logseries` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 41 + column: 0 + end_location: + row: 41 + column: 22 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.multinomial` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 42 + column: 0 + end_location: + row: 42 + column: 24 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.multivariate_normal` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 43 + column: 0 + end_location: + row: 43 + column: 32 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.negative_binomial` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 44 + column: 0 + end_location: + row: 44 + column: 30 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.noncentral_chisquare` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 45 + column: 0 + end_location: + row: 45 + column: 33 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.noncentral_f` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 46 + column: 0 + end_location: + row: 46 + column: 25 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.normal` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 47 + column: 0 + end_location: + row: 47 + column: 19 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.pareto` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 48 + column: 0 + end_location: + row: 48 + column: 19 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.poisson` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 49 + column: 0 + end_location: + row: 49 + column: 20 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.power` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 50 + column: 0 + end_location: + row: 50 + column: 18 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.rayleigh` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 51 + column: 0 + end_location: + row: 51 + column: 21 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.standard_cauchy` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 52 + column: 0 + end_location: + row: 52 + column: 28 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.standard_exponential` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 53 + column: 0 + end_location: + row: 53 + column: 33 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.standard_gamma` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 54 + column: 0 + end_location: + row: 54 + column: 27 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.standard_normal` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 55 + column: 0 + end_location: + row: 55 + column: 28 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.standard_t` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 56 + column: 0 + end_location: + row: 56 + column: 23 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.triangular` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 57 + column: 0 + end_location: + row: 57 + column: 23 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.uniform` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 58 + column: 0 + end_location: + row: 58 + column: 20 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.vonmises` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 59 + column: 0 + end_location: + row: 59 + column: 21 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.wald` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 60 + column: 0 + end_location: + row: 60 + column: 17 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.weibull` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 61 + column: 0 + end_location: + row: 61 + column: 20 + fix: ~ + parent: ~ + - kind: + name: NumpyLegacyRandom + body: "Replace legacy `np.random.zipf` call with `np.random.Generator`" + suggestion: ~ + fixable: false + location: + row: 62 + column: 0 + end_location: + row: 62 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pandas_vet/snapshots/ruff__rules__pandas_vet__tests__PD002_PD002.py.snap b/crates/ruff/src/rules/pandas_vet/snapshots/ruff__rules__pandas_vet__tests__PD002_PD002.py.snap index 559681b05617e7..6fe8fa737f22e5 100644 --- a/crates/ruff/src/rules/pandas_vet/snapshots/ruff__rules__pandas_vet__tests__PD002_PD002.py.snap +++ b/crates/ruff/src/rules/pandas_vet/snapshots/ruff__rules__pandas_vet__tests__PD002_PD002.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pandas_vet/mod.rs expression: diagnostics --- -- kind: - name: UseOfInplaceArgument - body: "`inplace=True` should be avoided; it has inconsistent behavior" - suggestion: "Assign to variable; remove `inplace` arg" - fixable: true - location: - row: 5 - column: 22 - end_location: - row: 5 - column: 34 - fix: - content: "x = x.drop([\"a\"], axis=1)" +- - kind: + name: UseOfInplaceArgument + body: "`inplace=True` should be avoided; it has inconsistent behavior" + suggestion: "Assign to variable; remove `inplace` arg" + fixable: true location: row: 5 - column: 0 + column: 22 end_location: row: 5 - column: 35 - parent: ~ -- kind: - name: UseOfInplaceArgument - body: "`inplace=True` should be avoided; it has inconsistent behavior" - suggestion: "Assign to variable; remove `inplace` arg" - fixable: true - location: - row: 7 - column: 22 - end_location: - row: 7 - column: 34 - fix: - content: "x = x.drop([\"a\"], axis=1)" + column: 34 + fix: + content: "x = x.drop([\"a\"], axis=1)" + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 35 + parent: ~ + - kind: + name: UseOfInplaceArgument + body: "`inplace=True` should be avoided; it has inconsistent behavior" + suggestion: "Assign to variable; remove `inplace` arg" + fixable: true location: row: 7 - column: 0 + column: 22 end_location: row: 7 - column: 35 - parent: ~ -- kind: - name: UseOfInplaceArgument - body: "`inplace=True` should be avoided; it has inconsistent behavior" - suggestion: "Assign to variable; remove `inplace` arg" - fixable: true - location: - row: 10 - column: 4 - end_location: - row: 10 - column: 16 - fix: - content: "x = x.drop(\n columns=[\"a\"],\n axis=1,\n)" + column: 34 + fix: + content: "x = x.drop([\"a\"], axis=1)" + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 35 + parent: ~ + - kind: + name: UseOfInplaceArgument + body: "`inplace=True` should be avoided; it has inconsistent behavior" + suggestion: "Assign to variable; remove `inplace` arg" + fixable: true location: - row: 9 - column: 0 + row: 10 + column: 4 end_location: - row: 13 - column: 1 - parent: ~ -- kind: - name: UseOfInplaceArgument - body: "`inplace=True` should be avoided; it has inconsistent behavior" - suggestion: "Assign to variable; remove `inplace` arg" - fixable: true - location: - row: 17 - column: 8 - end_location: - row: 17 - column: 20 - fix: - content: "x = x.drop(\n columns=[\"a\"],\n axis=1,\n )" + row: 10 + column: 16 + fix: + content: "x = x.drop(\n columns=[\"a\"],\n axis=1,\n)" + location: + row: 9 + column: 0 + end_location: + row: 13 + column: 1 + parent: ~ + - kind: + name: UseOfInplaceArgument + body: "`inplace=True` should be avoided; it has inconsistent behavior" + suggestion: "Assign to variable; remove `inplace` arg" + fixable: true location: - row: 16 - column: 4 + row: 17 + column: 8 end_location: - row: 20 - column: 5 - parent: ~ + row: 17 + column: 20 + fix: + content: "x = x.drop(\n columns=[\"a\"],\n axis=1,\n )" + location: + row: 16 + column: 4 + end_location: + row: 20 + column: 5 + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N801_N801.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N801_N801.py.snap index b81323f63f6605..ff85382f976d6c 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N801_N801.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N801_N801.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: InvalidClassName - body: "Class name `bad` should use CapWords convention " - suggestion: ~ - fixable: false - location: - row: 1 - column: 6 - end_location: - row: 1 - column: 9 - fix: ~ - parent: ~ -- kind: - name: InvalidClassName - body: "Class name `_bad` should use CapWords convention " - suggestion: ~ - fixable: false - location: - row: 5 - column: 6 - end_location: - row: 5 - column: 10 - fix: ~ - parent: ~ -- kind: - name: InvalidClassName - body: "Class name `bad_class` should use CapWords convention " - suggestion: ~ - fixable: false - location: - row: 9 - column: 6 - end_location: - row: 9 - column: 15 - fix: ~ - parent: ~ -- kind: - name: InvalidClassName - body: "Class name `Bad_Class` should use CapWords convention " - suggestion: ~ - fixable: false - location: - row: 13 - column: 6 - end_location: - row: 13 - column: 15 - fix: ~ - parent: ~ -- kind: - name: InvalidClassName - body: "Class name `BAD_CLASS` should use CapWords convention " - suggestion: ~ - fixable: false - location: - row: 17 - column: 6 - end_location: - row: 17 - column: 15 - fix: ~ - parent: ~ +- - kind: + name: InvalidClassName + body: "Class name `bad` should use CapWords convention " + suggestion: ~ + fixable: false + location: + row: 1 + column: 6 + end_location: + row: 1 + column: 9 + fix: ~ + parent: ~ + - kind: + name: InvalidClassName + body: "Class name `_bad` should use CapWords convention " + suggestion: ~ + fixable: false + location: + row: 5 + column: 6 + end_location: + row: 5 + column: 10 + fix: ~ + parent: ~ + - kind: + name: InvalidClassName + body: "Class name `bad_class` should use CapWords convention " + suggestion: ~ + fixable: false + location: + row: 9 + column: 6 + end_location: + row: 9 + column: 15 + fix: ~ + parent: ~ + - kind: + name: InvalidClassName + body: "Class name `Bad_Class` should use CapWords convention " + suggestion: ~ + fixable: false + location: + row: 13 + column: 6 + end_location: + row: 13 + column: 15 + fix: ~ + parent: ~ + - kind: + name: InvalidClassName + body: "Class name `BAD_CLASS` should use CapWords convention " + suggestion: ~ + fixable: false + location: + row: 17 + column: 6 + end_location: + row: 17 + column: 15 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N802_N802.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N802_N802.py.snap index 0cb9d70798937d..73bd4d17be057d 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N802_N802.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N802_N802.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: InvalidFunctionName - body: "Function name `Bad` should be lowercase" - suggestion: ~ - fixable: false - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 7 - fix: ~ - parent: ~ -- kind: - name: InvalidFunctionName - body: "Function name `_Bad` should be lowercase" - suggestion: ~ - fixable: false - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 8 - fix: ~ - parent: ~ -- kind: - name: InvalidFunctionName - body: "Function name `BAD` should be lowercase" - suggestion: ~ - fixable: false - location: - row: 12 - column: 4 - end_location: - row: 12 - column: 7 - fix: ~ - parent: ~ -- kind: - name: InvalidFunctionName - body: "Function name `BAD_FUNC` should be lowercase" - suggestion: ~ - fixable: false - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 12 - fix: ~ - parent: ~ -- kind: - name: InvalidFunctionName - body: "Function name `testTest` should be lowercase" - suggestion: ~ - fixable: false - location: - row: 40 - column: 8 - end_location: - row: 40 - column: 16 - fix: ~ - parent: ~ +- - kind: + name: InvalidFunctionName + body: "Function name `Bad` should be lowercase" + suggestion: ~ + fixable: false + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 7 + fix: ~ + parent: ~ + - kind: + name: InvalidFunctionName + body: "Function name `_Bad` should be lowercase" + suggestion: ~ + fixable: false + location: + row: 8 + column: 4 + end_location: + row: 8 + column: 8 + fix: ~ + parent: ~ + - kind: + name: InvalidFunctionName + body: "Function name `BAD` should be lowercase" + suggestion: ~ + fixable: false + location: + row: 12 + column: 4 + end_location: + row: 12 + column: 7 + fix: ~ + parent: ~ + - kind: + name: InvalidFunctionName + body: "Function name `BAD_FUNC` should be lowercase" + suggestion: ~ + fixable: false + location: + row: 16 + column: 4 + end_location: + row: 16 + column: 12 + fix: ~ + parent: ~ + - kind: + name: InvalidFunctionName + body: "Function name `testTest` should be lowercase" + suggestion: ~ + fixable: false + location: + row: 40 + column: 8 + end_location: + row: 40 + column: 16 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N803_N803.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N803_N803.py.snap index dca9c0dba27dda..aa4ff09360decf 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N803_N803.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N803_N803.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: InvalidArgumentName - body: "Argument name `A` should be lowercase" - suggestion: ~ - fixable: false - location: - row: 1 - column: 15 - end_location: - row: 1 - column: 16 - fix: ~ - parent: ~ -- kind: - name: InvalidArgumentName - body: "Argument name `A` should be lowercase" - suggestion: ~ - fixable: false - location: - row: 6 - column: 27 - end_location: - row: 6 - column: 28 - fix: ~ - parent: ~ +- - kind: + name: InvalidArgumentName + body: "Argument name `A` should be lowercase" + suggestion: ~ + fixable: false + location: + row: 1 + column: 15 + end_location: + row: 1 + column: 16 + fix: ~ + parent: ~ + - kind: + name: InvalidArgumentName + body: "Argument name `A` should be lowercase" + suggestion: ~ + fixable: false + location: + row: 6 + column: 27 + end_location: + row: 6 + column: 28 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N804_N804.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N804_N804.py.snap index cfc39d50be0c4b..954bb85a6c702b 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N804_N804.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N804_N804.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: InvalidFirstArgumentNameForClassMethod - body: "First argument of a class method should be named `cls`" - suggestion: ~ - fixable: false - location: - row: 30 - column: 26 - end_location: - row: 30 - column: 30 - fix: ~ - parent: ~ -- kind: - name: InvalidFirstArgumentNameForClassMethod - body: "First argument of a class method should be named `cls`" - suggestion: ~ - fixable: false - location: - row: 38 - column: 55 - end_location: - row: 38 - column: 59 - fix: ~ - parent: ~ -- kind: - name: InvalidFirstArgumentNameForClassMethod - body: "First argument of a class method should be named `cls`" - suggestion: ~ - fixable: false - location: - row: 43 - column: 19 - end_location: - row: 43 - column: 23 - fix: ~ - parent: ~ +- - kind: + name: InvalidFirstArgumentNameForClassMethod + body: "First argument of a class method should be named `cls`" + suggestion: ~ + fixable: false + location: + row: 30 + column: 26 + end_location: + row: 30 + column: 30 + fix: ~ + parent: ~ + - kind: + name: InvalidFirstArgumentNameForClassMethod + body: "First argument of a class method should be named `cls`" + suggestion: ~ + fixable: false + location: + row: 38 + column: 55 + end_location: + row: 38 + column: 59 + fix: ~ + parent: ~ + - kind: + name: InvalidFirstArgumentNameForClassMethod + body: "First argument of a class method should be named `cls`" + suggestion: ~ + fixable: false + location: + row: 43 + column: 19 + end_location: + row: 43 + column: 23 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N805_N805.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N805_N805.py.snap index 5c569e6bb1e44f..e2037a9d73c703 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N805_N805.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N805_N805.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: InvalidFirstArgumentNameForMethod - body: "First argument of a method should be named `self`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 19 - end_location: - row: 7 - column: 23 - fix: ~ - parent: ~ -- kind: - name: InvalidFirstArgumentNameForMethod - body: "First argument of a method should be named `self`" - suggestion: ~ - fixable: false - location: - row: 12 - column: 29 - end_location: - row: 12 - column: 33 - fix: ~ - parent: ~ -- kind: - name: InvalidFirstArgumentNameForMethod - body: "First argument of a method should be named `self`" - suggestion: ~ - fixable: false - location: - row: 27 - column: 14 - end_location: - row: 27 - column: 17 - fix: ~ - parent: ~ -- kind: - name: InvalidFirstArgumentNameForMethod - body: "First argument of a method should be named `self`" - suggestion: ~ - fixable: false - location: - row: 31 - column: 14 - end_location: - row: 31 - column: 17 - fix: ~ - parent: ~ -- kind: - name: InvalidFirstArgumentNameForMethod - body: "First argument of a method should be named `self`" - suggestion: ~ - fixable: false - location: - row: 60 - column: 28 - end_location: - row: 60 - column: 32 - fix: ~ - parent: ~ +- - kind: + name: InvalidFirstArgumentNameForMethod + body: "First argument of a method should be named `self`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 19 + end_location: + row: 7 + column: 23 + fix: ~ + parent: ~ + - kind: + name: InvalidFirstArgumentNameForMethod + body: "First argument of a method should be named `self`" + suggestion: ~ + fixable: false + location: + row: 12 + column: 29 + end_location: + row: 12 + column: 33 + fix: ~ + parent: ~ + - kind: + name: InvalidFirstArgumentNameForMethod + body: "First argument of a method should be named `self`" + suggestion: ~ + fixable: false + location: + row: 27 + column: 14 + end_location: + row: 27 + column: 17 + fix: ~ + parent: ~ + - kind: + name: InvalidFirstArgumentNameForMethod + body: "First argument of a method should be named `self`" + suggestion: ~ + fixable: false + location: + row: 31 + column: 14 + end_location: + row: 31 + column: 17 + fix: ~ + parent: ~ + - kind: + name: InvalidFirstArgumentNameForMethod + body: "First argument of a method should be named `self`" + suggestion: ~ + fixable: false + location: + row: 60 + column: 28 + end_location: + row: 60 + column: 32 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N806_N806.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N806_N806.py.snap index 844bb5cc0fc41b..ca18b4bde728c3 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N806_N806.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N806_N806.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: NonLowercaseVariableInFunction - body: "Variable `Camel` in function should be lowercase" - suggestion: ~ - fixable: false - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 9 - fix: ~ - parent: ~ -- kind: - name: NonLowercaseVariableInFunction - body: "Variable `CONSTANT` in function should be lowercase" - suggestion: ~ - fixable: false - location: - row: 15 - column: 4 - end_location: - row: 15 - column: 12 - fix: ~ - parent: ~ +- - kind: + name: NonLowercaseVariableInFunction + body: "Variable `Camel` in function should be lowercase" + suggestion: ~ + fixable: false + location: + row: 14 + column: 4 + end_location: + row: 14 + column: 9 + fix: ~ + parent: ~ + - kind: + name: NonLowercaseVariableInFunction + body: "Variable `CONSTANT` in function should be lowercase" + suggestion: ~ + fixable: false + location: + row: 15 + column: 4 + end_location: + row: 15 + column: 12 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N807_N807.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N807_N807.py.snap index d2b2e970f0dfd4..29e60215ee8bc3 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N807_N807.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N807_N807.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: DunderFunctionName - body: "Function name should not start and end with `__`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 4 - end_location: - row: 1 - column: 11 - fix: ~ - parent: ~ -- kind: - name: DunderFunctionName - body: "Function name should not start and end with `__`" - suggestion: ~ - fixable: false - location: - row: 14 - column: 8 - end_location: - row: 14 - column: 15 - fix: ~ - parent: ~ +- - kind: + name: DunderFunctionName + body: "Function name should not start and end with `__`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 4 + end_location: + row: 1 + column: 11 + fix: ~ + parent: ~ + - kind: + name: DunderFunctionName + body: "Function name should not start and end with `__`" + suggestion: ~ + fixable: false + location: + row: 14 + column: 8 + end_location: + row: 14 + column: 15 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N811_N811.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N811_N811.py.snap index 598c691a65fca2..28365793054dcb 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N811_N811.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N811_N811.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: ConstantImportedAsNonConstant - body: "Constant `CONST` imported as non-constant `const`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 25 - fix: ~ - parent: ~ -- kind: - name: ConstantImportedAsNonConstant - body: "Constant `CONSTANT` imported as non-constant `constant`" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 36 - fix: ~ - parent: ~ -- kind: - name: ConstantImportedAsNonConstant - body: "Constant `ANOTHER_CONSTANT` imported as non-constant `another_constant`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 52 - fix: ~ - parent: ~ +- - kind: + name: ConstantImportedAsNonConstant + body: "Constant `CONST` imported as non-constant `const`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 25 + fix: ~ + parent: ~ + - kind: + name: ConstantImportedAsNonConstant + body: "Constant `CONSTANT` imported as non-constant `constant`" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 36 + fix: ~ + parent: ~ + - kind: + name: ConstantImportedAsNonConstant + body: "Constant `ANOTHER_CONSTANT` imported as non-constant `another_constant`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 52 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N812_N812.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N812_N812.py.snap index 7296925d90247d..44f6e91c867852 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N812_N812.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N812_N812.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: LowercaseImportedAsNonLowercase - body: "Lowercase `lowercase` imported as non-lowercase `Lower`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 30 - fix: ~ - parent: ~ -- kind: - name: LowercaseImportedAsNonLowercase - body: "Lowercase `lowercase` imported as non-lowercase `Lowercase`" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 38 - fix: ~ - parent: ~ -- kind: - name: LowercaseImportedAsNonLowercase - body: "Lowercase `another_lowercase` imported as non-lowercase `AnotherLowercase`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 53 - fix: ~ - parent: ~ +- - kind: + name: LowercaseImportedAsNonLowercase + body: "Lowercase `lowercase` imported as non-lowercase `Lower`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 30 + fix: ~ + parent: ~ + - kind: + name: LowercaseImportedAsNonLowercase + body: "Lowercase `lowercase` imported as non-lowercase `Lowercase`" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 38 + fix: ~ + parent: ~ + - kind: + name: LowercaseImportedAsNonLowercase + body: "Lowercase `another_lowercase` imported as non-lowercase `AnotherLowercase`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 53 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N813_N813.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N813_N813.py.snap index e23b791b05dd16..207d0e21dc4ade 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N813_N813.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N813_N813.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: CamelcaseImportedAsLowercase - body: "Camelcase `Camel` imported as lowercase `camel`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 25 - fix: ~ - parent: ~ -- kind: - name: CamelcaseImportedAsLowercase - body: "Camelcase `CamelCase` imported as lowercase `camelcase`" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 38 - fix: ~ - parent: ~ -- kind: - name: CamelcaseImportedAsLowercase - body: "Camelcase `AnotherCamelCase` imported as lowercase `another_camelcase`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 53 - fix: ~ - parent: ~ +- - kind: + name: CamelcaseImportedAsLowercase + body: "Camelcase `Camel` imported as lowercase `camel`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 25 + fix: ~ + parent: ~ + - kind: + name: CamelcaseImportedAsLowercase + body: "Camelcase `CamelCase` imported as lowercase `camelcase`" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 38 + fix: ~ + parent: ~ + - kind: + name: CamelcaseImportedAsLowercase + body: "Camelcase `AnotherCamelCase` imported as lowercase `another_camelcase`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 53 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N814_N814.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N814_N814.py.snap index 1ac4bea0c97def..76389ef5bc77e4 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N814_N814.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N814_N814.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: CamelcaseImportedAsConstant - body: "Camelcase `Camel` imported as constant `CAMEL`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 25 - fix: ~ - parent: ~ -- kind: - name: CamelcaseImportedAsConstant - body: "Camelcase `CamelCase` imported as constant `CAMELCASE`" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 38 - fix: ~ - parent: ~ -- kind: - name: CamelcaseImportedAsConstant - body: "Camelcase `AnotherCamelCase` imported as constant `ANOTHER_CAMELCASE`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 53 - fix: ~ - parent: ~ +- - kind: + name: CamelcaseImportedAsConstant + body: "Camelcase `Camel` imported as constant `CAMEL`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 25 + fix: ~ + parent: ~ + - kind: + name: CamelcaseImportedAsConstant + body: "Camelcase `CamelCase` imported as constant `CAMELCASE`" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 38 + fix: ~ + parent: ~ + - kind: + name: CamelcaseImportedAsConstant + body: "Camelcase `AnotherCamelCase` imported as constant `ANOTHER_CAMELCASE`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 53 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N815_N815.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N815_N815.py.snap index d0b4bf17717708..7ff167e40b187c 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N815_N815.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N815_N815.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: MixedCaseVariableInClassScope - body: "Variable `mixedCase` in class scope should not be mixedCase" - suggestion: ~ - fixable: false - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 13 - fix: ~ - parent: ~ -- kind: - name: MixedCaseVariableInClassScope - body: "Variable `_mixedCase` in class scope should not be mixedCase" - suggestion: ~ - fixable: false - location: - row: 10 - column: 4 - end_location: - row: 10 - column: 14 - fix: ~ - parent: ~ -- kind: - name: MixedCaseVariableInClassScope - body: "Variable `mixed_Case` in class scope should not be mixedCase" - suggestion: ~ - fixable: false - location: - row: 11 - column: 4 - end_location: - row: 11 - column: 14 - fix: ~ - parent: ~ +- - kind: + name: MixedCaseVariableInClassScope + body: "Variable `mixedCase` in class scope should not be mixedCase" + suggestion: ~ + fixable: false + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 13 + fix: ~ + parent: ~ + - kind: + name: MixedCaseVariableInClassScope + body: "Variable `_mixedCase` in class scope should not be mixedCase" + suggestion: ~ + fixable: false + location: + row: 10 + column: 4 + end_location: + row: 10 + column: 14 + fix: ~ + parent: ~ + - kind: + name: MixedCaseVariableInClassScope + body: "Variable `mixed_Case` in class scope should not be mixedCase" + suggestion: ~ + fixable: false + location: + row: 11 + column: 4 + end_location: + row: 11 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N816_N816.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N816_N816.py.snap index 150e631192ef33..9866c0905213f0 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N816_N816.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N816_N816.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: MixedCaseVariableInGlobalScope - body: "Variable `mixedCase` in global scope should not be mixedCase" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 9 - fix: ~ - parent: ~ -- kind: - name: MixedCaseVariableInGlobalScope - body: "Variable `_mixedCase` in global scope should not be mixedCase" - suggestion: ~ - fixable: false - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 10 - fix: ~ - parent: ~ -- kind: - name: MixedCaseVariableInGlobalScope - body: "Variable `mixed_Case` in global scope should not be mixedCase" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 10 - fix: ~ - parent: ~ +- - kind: + name: MixedCaseVariableInGlobalScope + body: "Variable `mixedCase` in global scope should not be mixedCase" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 9 + fix: ~ + parent: ~ + - kind: + name: MixedCaseVariableInGlobalScope + body: "Variable `_mixedCase` in global scope should not be mixedCase" + suggestion: ~ + fixable: false + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 10 + fix: ~ + parent: ~ + - kind: + name: MixedCaseVariableInGlobalScope + body: "Variable `mixed_Case` in global scope should not be mixedCase" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 10 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N817_N817.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N817_N817.py.snap index 4827db12bbf080..59a053710cea2a 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N817_N817.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N817_N817.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: CamelcaseImportedAsAcronym - body: "CamelCase `CaMel` imported as acronym `CM`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 22 - fix: ~ - parent: ~ -- kind: - name: CamelcaseImportedAsAcronym - body: "CamelCase `CamelCase` imported as acronym `CC`" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 31 - fix: ~ - parent: ~ +- - kind: + name: CamelcaseImportedAsAcronym + body: "CamelCase `CaMel` imported as acronym `CM`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 22 + fix: ~ + parent: ~ + - kind: + name: CamelcaseImportedAsAcronym + body: "CamelCase `CamelCase` imported as acronym `CC`" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 31 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N818_N818.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N818_N818.py.snap index 73180ac59313d6..20bf95700cc48f 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N818_N818.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N818_N818.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: ErrorSuffixOnExceptionName - body: "Exception name `C` should be named with an Error suffix" - suggestion: ~ - fixable: false - location: - row: 9 - column: 6 - end_location: - row: 9 - column: 7 - fix: ~ - parent: ~ -- kind: - name: ErrorSuffixOnExceptionName - body: "Exception name `E` should be named with an Error suffix" - suggestion: ~ - fixable: false - location: - row: 17 - column: 6 - end_location: - row: 17 - column: 7 - fix: ~ - parent: ~ +- - kind: + name: ErrorSuffixOnExceptionName + body: "Exception name `C` should be named with an Error suffix" + suggestion: ~ + fixable: false + location: + row: 9 + column: 6 + end_location: + row: 9 + column: 7 + fix: ~ + parent: ~ + - kind: + name: ErrorSuffixOnExceptionName + body: "Exception name `E` should be named with an Error suffix" + suggestion: ~ + fixable: false + location: + row: 17 + column: 6 + end_location: + row: 17 + column: 7 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__MODULE____init__.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__MODULE____init__.py.snap index b01f97f813e2b0..01f2ccb6fb7dd8 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__MODULE____init__.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__MODULE____init__.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: InvalidModuleName - body: "Invalid module name: 'MODULE'" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: ~ - parent: ~ +- - kind: + name: InvalidModuleName + body: "Invalid module name: 'MODULE'" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 0 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__MODULE__file.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__MODULE__file.py.snap index b0a1ebbaaf500b..aee3292b897254 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__MODULE__file.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__MODULE__file.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__flake9____init__.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__flake9____init__.py.snap index b0a1ebbaaf500b..aee3292b897254 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__flake9____init__.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__flake9____init__.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod with spaces____init__.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod with spaces____init__.py.snap index 95ca07921596ea..dda062d7098039 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod with spaces____init__.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod with spaces____init__.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: InvalidModuleName - body: "Invalid module name: 'mod with spaces'" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: ~ - parent: ~ +- - kind: + name: InvalidModuleName + body: "Invalid module name: 'mod with spaces'" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 0 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod with spaces__file.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod with spaces__file.py.snap index b0a1ebbaaf500b..aee3292b897254 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod with spaces__file.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod with spaces__file.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod-with-dashes____init__.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod-with-dashes____init__.py.snap index d495bdd3bde334..dbba3c649b6b7d 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod-with-dashes____init__.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod-with-dashes____init__.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: InvalidModuleName - body: "Invalid module name: 'mod-with-dashes'" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: ~ - parent: ~ +- - kind: + name: InvalidModuleName + body: "Invalid module name: 'mod-with-dashes'" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 0 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__no_module__test.txt.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__no_module__test.txt.snap index b0a1ebbaaf500b..aee3292b897254 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__no_module__test.txt.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__no_module__test.txt.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__0001_initial.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__0001_initial.py.snap index b0a1ebbaaf500b..aee3292b897254 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__0001_initial.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__0001_initial.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name____init__.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name____init__.py.snap index b0a1ebbaaf500b..aee3292b897254 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name____init__.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name____init__.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name____main__.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name____main__.py.snap index b0a1ebbaaf500b..aee3292b897254 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name____main__.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name____main__.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name____setup__.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name____setup__.py.snap index b0a1ebbaaf500b..aee3292b897254 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name____setup__.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name____setup__.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.py.snap index 7fa347eafebeec..acccf4b23f24de 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: InvalidModuleName - body: "Invalid module name: 'file-with-dashes'" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: ~ - parent: ~ +- - kind: + name: InvalidModuleName + body: "Invalid module name: 'file-with-dashes'" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 0 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.snap index b0a1ebbaaf500b..aee3292b897254 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__classmethod_decorators.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__classmethod_decorators.snap index eab4d724723466..f17229bc2891c2 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__classmethod_decorators.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__classmethod_decorators.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs expression: diagnostics --- -- kind: - name: InvalidFirstArgumentNameForMethod - body: "First argument of a method should be named `self`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 19 - end_location: - row: 7 - column: 23 - fix: ~ - parent: ~ -- kind: - name: InvalidFirstArgumentNameForMethod - body: "First argument of a method should be named `self`" - suggestion: ~ - fixable: false - location: - row: 12 - column: 29 - end_location: - row: 12 - column: 33 - fix: ~ - parent: ~ -- kind: - name: InvalidFirstArgumentNameForMethod - body: "First argument of a method should be named `self`" - suggestion: ~ - fixable: false - location: - row: 60 - column: 28 - end_location: - row: 60 - column: 32 - fix: ~ - parent: ~ +- - kind: + name: InvalidFirstArgumentNameForMethod + body: "First argument of a method should be named `self`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 19 + end_location: + row: 7 + column: 23 + fix: ~ + parent: ~ + - kind: + name: InvalidFirstArgumentNameForMethod + body: "First argument of a method should be named `self`" + suggestion: ~ + fixable: false + location: + row: 12 + column: 29 + end_location: + row: 12 + column: 33 + fix: ~ + parent: ~ + - kind: + name: InvalidFirstArgumentNameForMethod + body: "First argument of a method should be named `self`" + suggestion: ~ + fixable: false + location: + row: 60 + column: 28 + end_location: + row: 60 + column: 32 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E101_E101.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E101_E101.py.snap index 16bb87d985a499..71a191efa77268 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E101_E101.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E101_E101.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: MixedSpacesAndTabs - body: Indentation contains mixed spaces and tabs - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 3 - fix: ~ - parent: ~ -- kind: - name: MixedSpacesAndTabs - body: Indentation contains mixed spaces and tabs - suggestion: ~ - fixable: false - location: - row: 15 - column: 0 - end_location: - row: 15 - column: 11 - fix: ~ - parent: ~ -- kind: - name: MixedSpacesAndTabs - body: Indentation contains mixed spaces and tabs - suggestion: ~ - fixable: false - location: - row: 19 - column: 0 - end_location: - row: 19 - column: 4 - fix: ~ - parent: ~ +- - kind: + name: MixedSpacesAndTabs + body: Indentation contains mixed spaces and tabs + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 3 + fix: ~ + parent: ~ + - kind: + name: MixedSpacesAndTabs + body: Indentation contains mixed spaces and tabs + suggestion: ~ + fixable: false + location: + row: 15 + column: 0 + end_location: + row: 15 + column: 11 + fix: ~ + parent: ~ + - kind: + name: MixedSpacesAndTabs + body: Indentation contains mixed spaces and tabs + suggestion: ~ + fixable: false + location: + row: 19 + column: 0 + end_location: + row: 19 + column: 4 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E401_E40.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E401_E40.py.snap index 79062d249e14d8..d302860c9c3e45 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E401_E40.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E401_E40.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: MultipleImportsOnOneLine - body: Multiple imports on one line - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 14 - fix: ~ - parent: ~ +- - kind: + name: MultipleImportsOnOneLine + body: Multiple imports on one line + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E40.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E40.py.snap index 68a149557733fc..6d9196409c5f14 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E40.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E40.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: ModuleImportNotAtTopOfFile - body: Module level import not at top of file - suggestion: ~ - fixable: false - location: - row: 55 - column: 0 - end_location: - row: 55 - column: 10 - fix: ~ - parent: ~ -- kind: - name: ModuleImportNotAtTopOfFile - body: Module level import not at top of file - suggestion: ~ - fixable: false - location: - row: 57 - column: 0 - end_location: - row: 57 - column: 10 - fix: ~ - parent: ~ -- kind: - name: ModuleImportNotAtTopOfFile - body: Module level import not at top of file - suggestion: ~ - fixable: false - location: - row: 61 - column: 0 - end_location: - row: 61 - column: 10 - fix: ~ - parent: ~ +- - kind: + name: ModuleImportNotAtTopOfFile + body: Module level import not at top of file + suggestion: ~ + fixable: false + location: + row: 55 + column: 0 + end_location: + row: 55 + column: 10 + fix: ~ + parent: ~ + - kind: + name: ModuleImportNotAtTopOfFile + body: Module level import not at top of file + suggestion: ~ + fixable: false + location: + row: 57 + column: 0 + end_location: + row: 57 + column: 10 + fix: ~ + parent: ~ + - kind: + name: ModuleImportNotAtTopOfFile + body: Module level import not at top of file + suggestion: ~ + fixable: false + location: + row: 61 + column: 0 + end_location: + row: 61 + column: 10 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E402.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E402.py.snap index f1b375520c82ac..30f79a86fd15ab 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E402.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E402.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: ModuleImportNotAtTopOfFile - body: Module level import not at top of file - suggestion: ~ - fixable: false - location: - row: 24 - column: 0 - end_location: - row: 24 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: ModuleImportNotAtTopOfFile + body: Module level import not at top of file + suggestion: ~ + fixable: false + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E501_E501.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E501_E501.py.snap index 82fe82bbf1cced..ea6179d567ea8c 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E501_E501.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E501_E501.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: LineTooLong - body: Line too long (123 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 5 - column: 88 - end_location: - row: 5 - column: 123 - fix: ~ - parent: ~ -- kind: - name: LineTooLong - body: Line too long (127 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 25 - column: 88 - end_location: - row: 25 - column: 127 - fix: ~ - parent: ~ -- kind: - name: LineTooLong - body: Line too long (132 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 40 - column: 88 - end_location: - row: 40 - column: 132 - fix: ~ - parent: ~ -- kind: - name: LineTooLong - body: Line too long (105 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 43 - column: 88 - end_location: - row: 43 - column: 105 - fix: ~ - parent: ~ -- kind: - name: LineTooLong - body: Line too long (129 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 61 - column: 88 - end_location: - row: 61 - column: 129 - fix: ~ - parent: ~ +- - kind: + name: LineTooLong + body: Line too long (123 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 5 + column: 88 + end_location: + row: 5 + column: 123 + fix: ~ + parent: ~ + - kind: + name: LineTooLong + body: Line too long (127 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 25 + column: 88 + end_location: + row: 25 + column: 127 + fix: ~ + parent: ~ + - kind: + name: LineTooLong + body: Line too long (132 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 40 + column: 88 + end_location: + row: 40 + column: 132 + fix: ~ + parent: ~ + - kind: + name: LineTooLong + body: Line too long (105 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 43 + column: 88 + end_location: + row: 43 + column: 105 + fix: ~ + parent: ~ + - kind: + name: LineTooLong + body: Line too long (129 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 61 + column: 88 + end_location: + row: 61 + column: 129 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E701_E70.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E701_E70.py.snap index 92078afc95a6a6..43bc4f5da0e362 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E701_E70.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E701_E70.py.snap @@ -2,186 +2,186 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: MultipleStatementsOnOneLineColon - body: Multiple statements on one line (colon) - suggestion: ~ - fixable: false - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineColon - body: Multiple statements on one line (colon) - suggestion: ~ - fixable: false - location: - row: 4 - column: 39 - end_location: - row: 4 - column: 40 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineColon - body: Multiple statements on one line (colon) - suggestion: ~ - fixable: false - location: - row: 25 - column: 7 - end_location: - row: 25 - column: 8 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineColon - body: Multiple statements on one line (colon) - suggestion: ~ - fixable: false - location: - row: 27 - column: 7 - end_location: - row: 27 - column: 8 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineColon - body: Multiple statements on one line (colon) - suggestion: ~ - fixable: false - location: - row: 29 - column: 9 - end_location: - row: 29 - column: 10 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineColon - body: Multiple statements on one line (colon) - suggestion: ~ - fixable: false - location: - row: 31 - column: 3 - end_location: - row: 31 - column: 4 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineColon - body: Multiple statements on one line (colon) - suggestion: ~ - fixable: false - location: - row: 32 - column: 17 - end_location: - row: 32 - column: 18 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineColon - body: Multiple statements on one line (colon) - suggestion: ~ - fixable: false - location: - row: 33 - column: 7 - end_location: - row: 33 - column: 8 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineColon - body: Multiple statements on one line (colon) - suggestion: ~ - fixable: false - location: - row: 35 - column: 7 - end_location: - row: 35 - column: 8 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineColon - body: Multiple statements on one line (colon) - suggestion: ~ - fixable: false - location: - row: 37 - column: 8 - end_location: - row: 37 - column: 9 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineColon - body: Multiple statements on one line (colon) - suggestion: ~ - fixable: false - location: - row: 39 - column: 14 - end_location: - row: 39 - column: 15 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineColon - body: Multiple statements on one line (colon) - suggestion: ~ - fixable: false - location: - row: 54 - column: 7 - end_location: - row: 54 - column: 8 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineColon - body: Multiple statements on one line (colon) - suggestion: ~ - fixable: false - location: - row: 56 - column: 7 - end_location: - row: 56 - column: 8 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineColon - body: Multiple statements on one line (colon) - suggestion: ~ - fixable: false - location: - row: 59 - column: 11 - end_location: - row: 59 - column: 12 - fix: ~ - parent: ~ +- - kind: + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + suggestion: ~ + fixable: false + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + suggestion: ~ + fixable: false + location: + row: 4 + column: 39 + end_location: + row: 4 + column: 40 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + suggestion: ~ + fixable: false + location: + row: 25 + column: 7 + end_location: + row: 25 + column: 8 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + suggestion: ~ + fixable: false + location: + row: 27 + column: 7 + end_location: + row: 27 + column: 8 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + suggestion: ~ + fixable: false + location: + row: 29 + column: 9 + end_location: + row: 29 + column: 10 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + suggestion: ~ + fixable: false + location: + row: 31 + column: 3 + end_location: + row: 31 + column: 4 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + suggestion: ~ + fixable: false + location: + row: 32 + column: 17 + end_location: + row: 32 + column: 18 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + suggestion: ~ + fixable: false + location: + row: 33 + column: 7 + end_location: + row: 33 + column: 8 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + suggestion: ~ + fixable: false + location: + row: 35 + column: 7 + end_location: + row: 35 + column: 8 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + suggestion: ~ + fixable: false + location: + row: 37 + column: 8 + end_location: + row: 37 + column: 9 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + suggestion: ~ + fixable: false + location: + row: 39 + column: 14 + end_location: + row: 39 + column: 15 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + suggestion: ~ + fixable: false + location: + row: 54 + column: 7 + end_location: + row: 54 + column: 8 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + suggestion: ~ + fixable: false + location: + row: 56 + column: 7 + end_location: + row: 56 + column: 8 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineColon + body: Multiple statements on one line (colon) + suggestion: ~ + fixable: false + location: + row: 59 + column: 11 + end_location: + row: 59 + column: 12 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E702_E70.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E702_E70.py.snap index 90c9d6187c6c3a..191330c636a5bd 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E702_E70.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E702_E70.py.snap @@ -2,82 +2,82 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: MultipleStatementsOnOneLineSemicolon - body: Multiple statements on one line (semicolon) - suggestion: ~ - fixable: false - location: - row: 6 - column: 9 - end_location: - row: 6 - column: 10 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineSemicolon - body: Multiple statements on one line (semicolon) - suggestion: ~ - fixable: false - location: - row: 8 - column: 16 - end_location: - row: 8 - column: 17 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineSemicolon - body: Multiple statements on one line (semicolon) - suggestion: ~ - fixable: false - location: - row: 12 - column: 8 - end_location: - row: 12 - column: 9 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineSemicolon - body: Multiple statements on one line (semicolon) - suggestion: ~ - fixable: false - location: - row: 25 - column: 10 - end_location: - row: 25 - column: 11 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineSemicolon - body: Multiple statements on one line (semicolon) - suggestion: ~ - fixable: false - location: - row: 54 - column: 12 - end_location: - row: 54 - column: 13 - fix: ~ - parent: ~ -- kind: - name: MultipleStatementsOnOneLineSemicolon - body: Multiple statements on one line (semicolon) - suggestion: ~ - fixable: false - location: - row: 56 - column: 12 - end_location: - row: 56 - column: 13 - fix: ~ - parent: ~ +- - kind: + name: MultipleStatementsOnOneLineSemicolon + body: Multiple statements on one line (semicolon) + suggestion: ~ + fixable: false + location: + row: 6 + column: 9 + end_location: + row: 6 + column: 10 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineSemicolon + body: Multiple statements on one line (semicolon) + suggestion: ~ + fixable: false + location: + row: 8 + column: 16 + end_location: + row: 8 + column: 17 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineSemicolon + body: Multiple statements on one line (semicolon) + suggestion: ~ + fixable: false + location: + row: 12 + column: 8 + end_location: + row: 12 + column: 9 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineSemicolon + body: Multiple statements on one line (semicolon) + suggestion: ~ + fixable: false + location: + row: 25 + column: 10 + end_location: + row: 25 + column: 11 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineSemicolon + body: Multiple statements on one line (semicolon) + suggestion: ~ + fixable: false + location: + row: 54 + column: 12 + end_location: + row: 54 + column: 13 + fix: ~ + parent: ~ + - kind: + name: MultipleStatementsOnOneLineSemicolon + body: Multiple statements on one line (semicolon) + suggestion: ~ + fixable: false + location: + row: 56 + column: 12 + end_location: + row: 56 + column: 13 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E703_E70.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E703_E70.py.snap index 0875111d2f84f2..4173cae7de66bc 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E703_E70.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E703_E70.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: UselessSemicolon - body: Statement ends with an unnecessary semicolon - suggestion: Remove unnecessary semicolon - fixable: true - location: - row: 10 - column: 12 - end_location: - row: 10 - column: 13 - fix: - content: "" +- - kind: + name: UselessSemicolon + body: Statement ends with an unnecessary semicolon + suggestion: Remove unnecessary semicolon + fixable: true location: row: 10 column: 12 end_location: row: 10 column: 13 - parent: ~ -- kind: - name: UselessSemicolon - body: Statement ends with an unnecessary semicolon - suggestion: Remove unnecessary semicolon - fixable: true - location: - row: 12 - column: 22 - end_location: - row: 12 - column: 23 - fix: - content: "" + fix: + content: "" + location: + row: 10 + column: 12 + end_location: + row: 10 + column: 13 + parent: ~ + - kind: + name: UselessSemicolon + body: Statement ends with an unnecessary semicolon + suggestion: Remove unnecessary semicolon + fixable: true location: row: 12 column: 22 end_location: row: 12 column: 23 - parent: ~ -- kind: - name: UselessSemicolon - body: Statement ends with an unnecessary semicolon - suggestion: Remove unnecessary semicolon - fixable: true - location: - row: 25 - column: 13 - end_location: - row: 25 - column: 14 - fix: - content: "" + fix: + content: "" + location: + row: 12 + column: 22 + end_location: + row: 12 + column: 23 + parent: ~ + - kind: + name: UselessSemicolon + body: Statement ends with an unnecessary semicolon + suggestion: Remove unnecessary semicolon + fixable: true location: row: 25 column: 13 end_location: row: 25 column: 14 - parent: ~ + fix: + content: "" + location: + row: 25 + column: 13 + end_location: + row: 25 + column: 14 + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E711_E711.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E711_E711.py.snap index 669846981b9959..86a11d282f4640 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E711_E711.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E711_E711.py.snap @@ -2,204 +2,204 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: NoneComparison - body: "Comparison to `None` should be `cond is None`" - suggestion: "Replace with `cond is None`" - fixable: true - location: - row: 2 - column: 10 - end_location: - row: 2 - column: 14 - fix: - content: res is None +- - kind: + name: NoneComparison + body: "Comparison to `None` should be `cond is None`" + suggestion: "Replace with `cond is None`" + fixable: true location: row: 2 - column: 3 + column: 10 end_location: row: 2 column: 14 - parent: ~ -- kind: - name: NoneComparison - body: "Comparison to `None` should be `cond is not None`" - suggestion: "Replace with `cond is not None`" - fixable: true - location: - row: 5 - column: 10 - end_location: - row: 5 - column: 14 - fix: - content: res is not None + fix: + content: res is None + location: + row: 2 + column: 3 + end_location: + row: 2 + column: 14 + parent: ~ + - kind: + name: NoneComparison + body: "Comparison to `None` should be `cond is not None`" + suggestion: "Replace with `cond is not None`" + fixable: true location: row: 5 - column: 3 + column: 10 end_location: row: 5 column: 14 - parent: ~ -- kind: - name: NoneComparison - body: "Comparison to `None` should be `cond is None`" - suggestion: "Replace with `cond is None`" - fixable: true - location: - row: 8 - column: 3 - end_location: - row: 8 - column: 7 - fix: - content: None is res + fix: + content: res is not None + location: + row: 5 + column: 3 + end_location: + row: 5 + column: 14 + parent: ~ + - kind: + name: NoneComparison + body: "Comparison to `None` should be `cond is None`" + suggestion: "Replace with `cond is None`" + fixable: true location: row: 8 column: 3 end_location: row: 8 - column: 14 - parent: ~ -- kind: - name: NoneComparison - body: "Comparison to `None` should be `cond is not None`" - suggestion: "Replace with `cond is not None`" - fixable: true - location: - row: 11 - column: 3 - end_location: - row: 11 - column: 7 - fix: - content: None is not res + column: 7 + fix: + content: None is res + location: + row: 8 + column: 3 + end_location: + row: 8 + column: 14 + parent: ~ + - kind: + name: NoneComparison + body: "Comparison to `None` should be `cond is not None`" + suggestion: "Replace with `cond is not None`" + fixable: true location: row: 11 column: 3 end_location: row: 11 - column: 14 - parent: ~ -- kind: - name: NoneComparison - body: "Comparison to `None` should be `cond is None`" - suggestion: "Replace with `cond is None`" - fixable: true - location: - row: 14 - column: 13 - end_location: - row: 14 - column: 17 - fix: - content: "res[1] is None" + column: 7 + fix: + content: None is not res + location: + row: 11 + column: 3 + end_location: + row: 11 + column: 14 + parent: ~ + - kind: + name: NoneComparison + body: "Comparison to `None` should be `cond is None`" + suggestion: "Replace with `cond is None`" + fixable: true location: row: 14 - column: 3 + column: 13 end_location: row: 14 column: 17 - parent: ~ -- kind: - name: NoneComparison - body: "Comparison to `None` should be `cond is not None`" - suggestion: "Replace with `cond is not None`" - fixable: true - location: - row: 17 - column: 13 - end_location: - row: 17 - column: 17 - fix: - content: "res[1] is not None" + fix: + content: "res[1] is None" + location: + row: 14 + column: 3 + end_location: + row: 14 + column: 17 + parent: ~ + - kind: + name: NoneComparison + body: "Comparison to `None` should be `cond is not None`" + suggestion: "Replace with `cond is not None`" + fixable: true location: row: 17 - column: 3 + column: 13 end_location: row: 17 column: 17 - parent: ~ -- kind: - name: NoneComparison - body: "Comparison to `None` should be `cond is not None`" - suggestion: "Replace with `cond is not None`" - fixable: true - location: - row: 20 - column: 3 - end_location: - row: 20 - column: 7 - fix: - content: "None is not res[1]" + fix: + content: "res[1] is not None" + location: + row: 17 + column: 3 + end_location: + row: 17 + column: 17 + parent: ~ + - kind: + name: NoneComparison + body: "Comparison to `None` should be `cond is not None`" + suggestion: "Replace with `cond is not None`" + fixable: true location: row: 20 column: 3 end_location: row: 20 - column: 17 - parent: ~ -- kind: - name: NoneComparison - body: "Comparison to `None` should be `cond is None`" - suggestion: "Replace with `cond is None`" - fixable: true - location: - row: 23 - column: 3 - end_location: - row: 23 - column: 7 - fix: - content: "None is res[1]" + column: 7 + fix: + content: "None is not res[1]" + location: + row: 20 + column: 3 + end_location: + row: 20 + column: 17 + parent: ~ + - kind: + name: NoneComparison + body: "Comparison to `None` should be `cond is None`" + suggestion: "Replace with `cond is None`" + fixable: true location: row: 23 column: 3 end_location: row: 23 - column: 17 - parent: ~ -- kind: - name: NoneComparison - body: "Comparison to `None` should be `cond is None`" - suggestion: "Replace with `cond is None`" - fixable: true - location: - row: 26 - column: 8 - end_location: - row: 26 - column: 12 - fix: - content: x is None is not None + column: 7 + fix: + content: "None is res[1]" + location: + row: 23 + column: 3 + end_location: + row: 23 + column: 17 + parent: ~ + - kind: + name: NoneComparison + body: "Comparison to `None` should be `cond is None`" + suggestion: "Replace with `cond is None`" + fixable: true location: row: 26 - column: 3 + column: 8 end_location: row: 26 - column: 20 - parent: ~ -- kind: - name: NoneComparison - body: "Comparison to `None` should be `cond is not None`" - suggestion: "Replace with `cond is not None`" - fixable: true - location: - row: 26 - column: 16 - end_location: - row: 26 - column: 20 - fix: - content: x is None is not None + column: 12 + fix: + content: x is None is not None + location: + row: 26 + column: 3 + end_location: + row: 26 + column: 20 + parent: ~ + - kind: + name: NoneComparison + body: "Comparison to `None` should be `cond is not None`" + suggestion: "Replace with `cond is not None`" + fixable: true location: row: 26 - column: 3 + column: 16 end_location: row: 26 column: 20 - parent: ~ + fix: + content: x is None is not None + location: + row: 26 + column: 3 + end_location: + row: 26 + column: 20 + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E712_E712.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E712_E712.py.snap index c7315385fc55b7..075ab53286dda2 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E712_E712.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E712_E712.py.snap @@ -2,224 +2,224 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: TrueFalseComparison - body: "Comparison to `True` should be `cond is True`" - suggestion: "Replace with `cond is True`" - fixable: true - location: - row: 2 - column: 10 - end_location: - row: 2 - column: 14 - fix: - content: res is True +- - kind: + name: TrueFalseComparison + body: "Comparison to `True` should be `cond is True`" + suggestion: "Replace with `cond is True`" + fixable: true location: row: 2 - column: 3 + column: 10 end_location: row: 2 column: 14 - parent: ~ -- kind: - name: TrueFalseComparison - body: "Comparison to `False` should be `cond is not False`" - suggestion: "Replace with `cond is not False`" - fixable: true - location: - row: 5 - column: 10 - end_location: - row: 5 - column: 15 - fix: - content: res is not False + fix: + content: res is True + location: + row: 2 + column: 3 + end_location: + row: 2 + column: 14 + parent: ~ + - kind: + name: TrueFalseComparison + body: "Comparison to `False` should be `cond is not False`" + suggestion: "Replace with `cond is not False`" + fixable: true location: row: 5 - column: 3 + column: 10 end_location: row: 5 column: 15 - parent: ~ -- kind: - name: TrueFalseComparison - body: "Comparison to `True` should be `cond is not True`" - suggestion: "Replace with `cond is not True`" - fixable: true - location: - row: 8 - column: 3 - end_location: - row: 8 - column: 7 - fix: - content: True is not res + fix: + content: res is not False + location: + row: 5 + column: 3 + end_location: + row: 5 + column: 15 + parent: ~ + - kind: + name: TrueFalseComparison + body: "Comparison to `True` should be `cond is not True`" + suggestion: "Replace with `cond is not True`" + fixable: true location: row: 8 column: 3 end_location: row: 8 - column: 14 - parent: ~ -- kind: - name: TrueFalseComparison - body: "Comparison to `False` should be `cond is False`" - suggestion: "Replace with `cond is False`" - fixable: true - location: - row: 11 - column: 3 - end_location: - row: 11 - column: 8 - fix: - content: False is res + column: 7 + fix: + content: True is not res + location: + row: 8 + column: 3 + end_location: + row: 8 + column: 14 + parent: ~ + - kind: + name: TrueFalseComparison + body: "Comparison to `False` should be `cond is False`" + suggestion: "Replace with `cond is False`" + fixable: true location: row: 11 column: 3 end_location: row: 11 - column: 15 - parent: ~ -- kind: - name: TrueFalseComparison - body: "Comparison to `True` should be `cond is True`" - suggestion: "Replace with `cond is True`" - fixable: true - location: - row: 14 - column: 13 - end_location: - row: 14 - column: 17 - fix: - content: "res[1] is True" + column: 8 + fix: + content: False is res + location: + row: 11 + column: 3 + end_location: + row: 11 + column: 15 + parent: ~ + - kind: + name: TrueFalseComparison + body: "Comparison to `True` should be `cond is True`" + suggestion: "Replace with `cond is True`" + fixable: true location: row: 14 - column: 3 + column: 13 end_location: row: 14 column: 17 - parent: ~ -- kind: - name: TrueFalseComparison - body: "Comparison to `False` should be `cond is not False`" - suggestion: "Replace with `cond is not False`" - fixable: true - location: - row: 17 - column: 13 - end_location: - row: 17 - column: 18 - fix: - content: "res[1] is not False" + fix: + content: "res[1] is True" + location: + row: 14 + column: 3 + end_location: + row: 14 + column: 17 + parent: ~ + - kind: + name: TrueFalseComparison + body: "Comparison to `False` should be `cond is not False`" + suggestion: "Replace with `cond is not False`" + fixable: true location: row: 17 - column: 3 + column: 13 end_location: row: 17 column: 18 - parent: ~ -- kind: - name: TrueFalseComparison - body: "Comparison to `True` should be `cond is True`" - suggestion: "Replace with `cond is True`" - fixable: true - location: - row: 20 - column: 19 - end_location: - row: 20 - column: 23 - fix: - content: cond is True + fix: + content: "res[1] is not False" + location: + row: 17 + column: 3 + end_location: + row: 17 + column: 18 + parent: ~ + - kind: + name: TrueFalseComparison + body: "Comparison to `True` should be `cond is True`" + suggestion: "Replace with `cond is True`" + fixable: true location: row: 20 - column: 11 + column: 19 end_location: row: 20 column: 23 - parent: ~ -- kind: - name: TrueFalseComparison - body: "Comparison to `False` should be `cond is False`" - suggestion: "Replace with `cond is False`" - fixable: true - location: - row: 20 - column: 43 - end_location: - row: 20 - column: 48 - fix: - content: cond is False + fix: + content: cond is True + location: + row: 20 + column: 11 + end_location: + row: 20 + column: 23 + parent: ~ + - kind: + name: TrueFalseComparison + body: "Comparison to `False` should be `cond is False`" + suggestion: "Replace with `cond is False`" + fixable: true location: row: 20 - column: 35 + column: 43 end_location: row: 20 column: 48 - parent: ~ -- kind: - name: TrueFalseComparison - body: "Comparison to `True` should be `cond is True`" - suggestion: "Replace with `cond is True`" - fixable: true - location: - row: 22 - column: 4 - end_location: - row: 22 - column: 8 - fix: - content: True is TrueElement + fix: + content: cond is False + location: + row: 20 + column: 35 + end_location: + row: 20 + column: 48 + parent: ~ + - kind: + name: TrueFalseComparison + body: "Comparison to `True` should be `cond is True`" + suggestion: "Replace with `cond is True`" + fixable: true location: row: 22 - column: 3 + column: 4 end_location: row: 22 - column: 24 - parent: ~ -- kind: - name: TrueFalseComparison - body: "Comparison to `True` should be `cond is True`" - suggestion: "Replace with `cond is True`" - fixable: true - location: - row: 25 - column: 10 - end_location: - row: 25 - column: 14 - fix: - content: res is True is not False + column: 8 + fix: + content: True is TrueElement + location: + row: 22 + column: 3 + end_location: + row: 22 + column: 24 + parent: ~ + - kind: + name: TrueFalseComparison + body: "Comparison to `True` should be `cond is True`" + suggestion: "Replace with `cond is True`" + fixable: true location: row: 25 - column: 3 + column: 10 end_location: row: 25 - column: 23 - parent: ~ -- kind: - name: TrueFalseComparison - body: "Comparison to `False` should be `cond is not False`" - suggestion: "Replace with `cond is not False`" - fixable: true - location: - row: 25 - column: 18 - end_location: - row: 25 - column: 23 - fix: - content: res is True is not False + column: 14 + fix: + content: res is True is not False + location: + row: 25 + column: 3 + end_location: + row: 25 + column: 23 + parent: ~ + - kind: + name: TrueFalseComparison + body: "Comparison to `False` should be `cond is not False`" + suggestion: "Replace with `cond is not False`" + fixable: true location: row: 25 - column: 3 + column: 18 end_location: row: 25 column: 23 - parent: ~ + fix: + content: res is True is not False + location: + row: 25 + column: 3 + end_location: + row: 25 + column: 23 + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E713_E713.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E713_E713.py.snap index bb8b35b7bdfd56..a837f8dbc391e2 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E713_E713.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E713_E713.py.snap @@ -2,104 +2,104 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: NotInTest - body: "Test for membership should be `not in`" - suggestion: "Convert to `not in`" - fixable: true - location: - row: 2 - column: 7 - end_location: - row: 2 - column: 13 - fix: - content: X not in Y +- - kind: + name: NotInTest + body: "Test for membership should be `not in`" + suggestion: "Convert to `not in`" + fixable: true location: row: 2 - column: 3 + column: 7 end_location: row: 2 column: 13 - parent: ~ -- kind: - name: NotInTest - body: "Test for membership should be `not in`" - suggestion: "Convert to `not in`" - fixable: true - location: - row: 5 - column: 7 - end_location: - row: 5 - column: 15 - fix: - content: X.B not in Y + fix: + content: X not in Y + location: + row: 2 + column: 3 + end_location: + row: 2 + column: 13 + parent: ~ + - kind: + name: NotInTest + body: "Test for membership should be `not in`" + suggestion: "Convert to `not in`" + fixable: true location: row: 5 - column: 3 + column: 7 end_location: row: 5 column: 15 - parent: ~ -- kind: - name: NotInTest - body: "Test for membership should be `not in`" - suggestion: "Convert to `not in`" - fixable: true - location: - row: 8 - column: 7 - end_location: - row: 8 - column: 13 - fix: - content: X not in Y + fix: + content: X.B not in Y + location: + row: 5 + column: 3 + end_location: + row: 5 + column: 15 + parent: ~ + - kind: + name: NotInTest + body: "Test for membership should be `not in`" + suggestion: "Convert to `not in`" + fixable: true location: row: 8 - column: 3 + column: 7 end_location: row: 8 column: 13 - parent: ~ -- kind: - name: NotInTest - body: "Test for membership should be `not in`" - suggestion: "Convert to `not in`" - fixable: true - location: - row: 11 - column: 22 - end_location: - row: 11 - column: 28 - fix: - content: Y not in Z + fix: + content: X not in Y + location: + row: 8 + column: 3 + end_location: + row: 8 + column: 13 + parent: ~ + - kind: + name: NotInTest + body: "Test for membership should be `not in`" + suggestion: "Convert to `not in`" + fixable: true location: row: 11 - column: 18 + column: 22 end_location: row: 11 column: 28 - parent: ~ -- kind: - name: NotInTest - body: "Test for membership should be `not in`" - suggestion: "Convert to `not in`" - fixable: true - location: - row: 14 - column: 8 - end_location: - row: 14 - column: 14 - fix: - content: X not in Y + fix: + content: Y not in Z + location: + row: 11 + column: 18 + end_location: + row: 11 + column: 28 + parent: ~ + - kind: + name: NotInTest + body: "Test for membership should be `not in`" + suggestion: "Convert to `not in`" + fixable: true location: row: 14 - column: 3 + column: 8 end_location: row: 14 - column: 15 - parent: ~ + column: 14 + fix: + content: X not in Y + location: + row: 14 + column: 3 + end_location: + row: 14 + column: 15 + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E714_E714.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E714_E714.py.snap index e9243cd78d6ba8..3061429f352321 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E714_E714.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E714_E714.py.snap @@ -2,57 +2,57 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: NotIsTest - body: "Test for object identity should be `is not`" - suggestion: "Convert to `is not`" - fixable: true - location: - row: 2 - column: 7 - end_location: - row: 2 - column: 13 - fix: - content: X is not Y +- - kind: + name: NotIsTest + body: "Test for object identity should be `is not`" + suggestion: "Convert to `is not`" + fixable: true location: row: 2 - column: 3 + column: 7 end_location: row: 2 column: 13 - parent: ~ -- kind: - name: NotIsTest - body: "Test for object identity should be `is not`" - suggestion: "Convert to `is not`" - fixable: true - location: - row: 5 - column: 7 - end_location: - row: 5 - column: 15 - fix: - content: X.B is not Y + fix: + content: X is not Y + location: + row: 2 + column: 3 + end_location: + row: 2 + column: 13 + parent: ~ + - kind: + name: NotIsTest + body: "Test for object identity should be `is not`" + suggestion: "Convert to `is not`" + fixable: true location: row: 5 - column: 3 + column: 7 end_location: row: 5 column: 15 - parent: ~ -- kind: - name: NotIsTest - body: "Test for object identity should be `is not`" - suggestion: "Convert to `is not`" - fixable: true - location: - row: 8 - column: 7 - end_location: - row: 8 - column: 22 - fix: ~ - parent: ~ + fix: + content: X.B is not Y + location: + row: 5 + column: 3 + end_location: + row: 5 + column: 15 + parent: ~ + - kind: + name: NotIsTest + body: "Test for object identity should be `is not`" + suggestion: "Convert to `is not`" + fixable: true + location: + row: 8 + column: 7 + end_location: + row: 8 + column: 22 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E721_E721.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E721_E721.py.snap index 76acba3c0a0c21..653e6e2085bd9d 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E721_E721.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E721_E721.py.snap @@ -2,199 +2,199 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: TypeComparison - body: "Do not compare types, use `isinstance()`" - suggestion: ~ - fixable: false - location: - row: 2 - column: 3 - end_location: - row: 2 - column: 24 - fix: ~ - parent: ~ -- kind: - name: TypeComparison - body: "Do not compare types, use `isinstance()`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 3 - end_location: - row: 5 - column: 24 - fix: ~ - parent: ~ -- kind: - name: TypeComparison - body: "Do not compare types, use `isinstance()`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 3 - end_location: - row: 10 - column: 23 - fix: ~ - parent: ~ -- kind: - name: TypeComparison - body: "Do not compare types, use `isinstance()`" - suggestion: ~ - fixable: false - location: - row: 15 - column: 3 - end_location: - row: 15 - column: 34 - fix: ~ - parent: ~ -- kind: - name: TypeComparison - body: "Do not compare types, use `isinstance()`" - suggestion: ~ - fixable: false - location: - row: 18 - column: 7 - end_location: - row: 18 - column: 31 - fix: ~ - parent: ~ -- kind: - name: TypeComparison - body: "Do not compare types, use `isinstance()`" - suggestion: ~ - fixable: false - location: - row: 20 - column: 7 - end_location: - row: 20 - column: 28 - fix: ~ - parent: ~ -- kind: - name: TypeComparison - body: "Do not compare types, use `isinstance()`" - suggestion: ~ - fixable: false - location: - row: 22 - column: 7 - end_location: - row: 22 - column: 28 - fix: ~ - parent: ~ -- kind: - name: TypeComparison - body: "Do not compare types, use `isinstance()`" - suggestion: ~ - fixable: false - location: - row: 24 - column: 7 - end_location: - row: 24 - column: 30 - fix: ~ - parent: ~ -- kind: - name: TypeComparison - body: "Do not compare types, use `isinstance()`" - suggestion: ~ - fixable: false - location: - row: 26 - column: 7 - end_location: - row: 26 - column: 29 - fix: ~ - parent: ~ -- kind: - name: TypeComparison - body: "Do not compare types, use `isinstance()`" - suggestion: ~ - fixable: false - location: - row: 28 - column: 7 - end_location: - row: 28 - column: 30 - fix: ~ - parent: ~ -- kind: - name: TypeComparison - body: "Do not compare types, use `isinstance()`" - suggestion: ~ - fixable: false - location: - row: 30 - column: 7 - end_location: - row: 30 - column: 30 - fix: ~ - parent: ~ -- kind: - name: TypeComparison - body: "Do not compare types, use `isinstance()`" - suggestion: ~ - fixable: false - location: - row: 32 - column: 7 - end_location: - row: 32 - column: 34 - fix: ~ - parent: ~ -- kind: - name: TypeComparison - body: "Do not compare types, use `isinstance()`" - suggestion: ~ - fixable: false - location: - row: 34 - column: 7 - end_location: - row: 38 - column: 1 - fix: ~ - parent: ~ -- kind: - name: TypeComparison - body: "Do not compare types, use `isinstance()`" - suggestion: ~ - fixable: false - location: - row: 40 - column: 7 - end_location: - row: 40 - column: 28 - fix: ~ - parent: ~ -- kind: - name: TypeComparison - body: "Do not compare types, use `isinstance()`" - suggestion: ~ - fixable: false - location: - row: 42 - column: 7 - end_location: - row: 42 - column: 30 - fix: ~ - parent: ~ +- - kind: + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + suggestion: ~ + fixable: false + location: + row: 2 + column: 3 + end_location: + row: 2 + column: 24 + fix: ~ + parent: ~ + - kind: + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 3 + end_location: + row: 5 + column: 24 + fix: ~ + parent: ~ + - kind: + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 3 + end_location: + row: 10 + column: 23 + fix: ~ + parent: ~ + - kind: + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + suggestion: ~ + fixable: false + location: + row: 15 + column: 3 + end_location: + row: 15 + column: 34 + fix: ~ + parent: ~ + - kind: + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + suggestion: ~ + fixable: false + location: + row: 18 + column: 7 + end_location: + row: 18 + column: 31 + fix: ~ + parent: ~ + - kind: + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + suggestion: ~ + fixable: false + location: + row: 20 + column: 7 + end_location: + row: 20 + column: 28 + fix: ~ + parent: ~ + - kind: + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + suggestion: ~ + fixable: false + location: + row: 22 + column: 7 + end_location: + row: 22 + column: 28 + fix: ~ + parent: ~ + - kind: + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + suggestion: ~ + fixable: false + location: + row: 24 + column: 7 + end_location: + row: 24 + column: 30 + fix: ~ + parent: ~ + - kind: + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + suggestion: ~ + fixable: false + location: + row: 26 + column: 7 + end_location: + row: 26 + column: 29 + fix: ~ + parent: ~ + - kind: + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + suggestion: ~ + fixable: false + location: + row: 28 + column: 7 + end_location: + row: 28 + column: 30 + fix: ~ + parent: ~ + - kind: + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + suggestion: ~ + fixable: false + location: + row: 30 + column: 7 + end_location: + row: 30 + column: 30 + fix: ~ + parent: ~ + - kind: + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + suggestion: ~ + fixable: false + location: + row: 32 + column: 7 + end_location: + row: 32 + column: 34 + fix: ~ + parent: ~ + - kind: + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + suggestion: ~ + fixable: false + location: + row: 34 + column: 7 + end_location: + row: 38 + column: 1 + fix: ~ + parent: ~ + - kind: + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + suggestion: ~ + fixable: false + location: + row: 40 + column: 7 + end_location: + row: 40 + column: 28 + fix: ~ + parent: ~ + - kind: + name: TypeComparison + body: "Do not compare types, use `isinstance()`" + suggestion: ~ + fixable: false + location: + row: 42 + column: 7 + end_location: + row: 42 + column: 30 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E722_E722.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E722_E722.py.snap index 8fcc439ef739a6..de660286971af3 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E722_E722.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E722_E722.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: BareExcept - body: "Do not use bare `except`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 6 - fix: ~ - parent: ~ -- kind: - name: BareExcept - body: "Do not use bare `except`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 6 - fix: ~ - parent: ~ -- kind: - name: BareExcept - body: "Do not use bare `except`" - suggestion: ~ - fixable: false - location: - row: 16 - column: 0 - end_location: - row: 16 - column: 6 - fix: ~ - parent: ~ +- - kind: + name: BareExcept + body: "Do not use bare `except`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 6 + fix: ~ + parent: ~ + - kind: + name: BareExcept + body: "Do not use bare `except`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 6 + fix: ~ + parent: ~ + - kind: + name: BareExcept + body: "Do not use bare `except`" + suggestion: ~ + fixable: false + location: + row: 16 + column: 0 + end_location: + row: 16 + column: 6 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E731_E731.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E731_E731.py.snap index 406852d7d25441..cfb2840455505e 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E731_E731.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E731_E731.py.snap @@ -2,130 +2,130 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: LambdaAssignment - body: "Do not assign a `lambda` expression, use a `def`" - suggestion: "Rewrite `f` as a `def`" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 19 - fix: - content: "def f(x):\n return 2 * x" +- - kind: + name: LambdaAssignment + body: "Do not assign a `lambda` expression, use a `def`" + suggestion: "Rewrite `f` as a `def`" + fixable: true location: row: 2 column: 0 end_location: row: 2 column: 19 - parent: ~ -- kind: - name: LambdaAssignment - body: "Do not assign a `lambda` expression, use a `def`" - suggestion: "Rewrite `f` as a `def`" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 19 - fix: - content: "def f(x):\n return 2 * x" + fix: + content: "def f(x):\n return 2 * x" + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 19 + parent: ~ + - kind: + name: LambdaAssignment + body: "Do not assign a `lambda` expression, use a `def`" + suggestion: "Rewrite `f` as a `def`" + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 19 - parent: ~ -- kind: - name: LambdaAssignment - body: "Do not assign a `lambda` expression, use a `def`" - suggestion: "Rewrite `this` as a `def`" - fixable: true - location: - row: 7 - column: 4 - end_location: - row: 7 - column: 29 - fix: - content: "def this(y, z):\n return 2 * x" + fix: + content: "def f(x):\n return 2 * x" + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 19 + parent: ~ + - kind: + name: LambdaAssignment + body: "Do not assign a `lambda` expression, use a `def`" + suggestion: "Rewrite `this` as a `def`" + fixable: true location: row: 7 column: 4 end_location: row: 7 column: 29 - parent: ~ -- kind: - name: LambdaAssignment - body: "Do not assign a `lambda` expression, use a `def`" - suggestion: "Rewrite `f` as a `def`" - fixable: true - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 21 - fix: - content: "def f():\n return (yield 1)" + fix: + content: "def this(y, z):\n return 2 * x" + location: + row: 7 + column: 4 + end_location: + row: 7 + column: 29 + parent: ~ + - kind: + name: LambdaAssignment + body: "Do not assign a `lambda` expression, use a `def`" + suggestion: "Rewrite `f` as a `def`" + fixable: true location: row: 9 column: 0 end_location: row: 9 column: 21 - parent: ~ -- kind: - name: LambdaAssignment - body: "Do not assign a `lambda` expression, use a `def`" - suggestion: "Rewrite `f` as a `def`" - fixable: true - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 28 - fix: - content: "def f():\n return (yield from g())" + fix: + content: "def f():\n return (yield 1)" + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 21 + parent: ~ + - kind: + name: LambdaAssignment + body: "Do not assign a `lambda` expression, use a `def`" + suggestion: "Rewrite `f` as a `def`" + fixable: true location: row: 11 column: 0 end_location: row: 11 column: 28 - parent: ~ -- kind: - name: LambdaAssignment - body: "Do not assign a `lambda` expression, use a `def`" - suggestion: ~ - fixable: false - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 23 - fix: ~ - parent: ~ -- kind: - name: LambdaAssignment - body: "Do not assign a `lambda` expression, use a `def`" - suggestion: ~ - fixable: false - location: - row: 19 - column: 4 - end_location: - row: 19 - column: 23 - fix: ~ - parent: ~ + fix: + content: "def f():\n return (yield from g())" + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 28 + parent: ~ + - kind: + name: LambdaAssignment + body: "Do not assign a `lambda` expression, use a `def`" + suggestion: ~ + fixable: false + location: + row: 14 + column: 4 + end_location: + row: 14 + column: 23 + fix: ~ + parent: ~ +- - kind: + name: LambdaAssignment + body: "Do not assign a `lambda` expression, use a `def`" + suggestion: ~ + fixable: false + location: + row: 19 + column: 4 + end_location: + row: 19 + column: 23 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E741_E741.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E741_E741.py.snap index 0dd1d1ba295010..c28de5a8a5c34f 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E741_E741.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E741_E741.py.snap @@ -2,329 +2,329 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 1 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `I`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 1 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `O`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 1 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 1 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 8 - column: 3 - end_location: - row: 8 - column: 4 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 5 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 4 - end_location: - row: 10 - column: 5 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 4 - end_location: - row: 11 - column: 5 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 5 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 20 - column: 7 - end_location: - row: 20 - column: 8 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 25 - column: 11 - end_location: - row: 25 - column: 12 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 26 - column: 4 - end_location: - row: 26 - column: 5 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 30 - column: 4 - end_location: - row: 30 - column: 5 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 33 - column: 17 - end_location: - row: 33 - column: 18 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 34 - column: 8 - end_location: - row: 34 - column: 9 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 40 - column: 7 - end_location: - row: 40 - column: 8 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `I`" - suggestion: ~ - fixable: false - location: - row: 40 - column: 13 - end_location: - row: 40 - column: 14 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 44 - column: 7 - end_location: - row: 44 - column: 8 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `I`" - suggestion: ~ - fixable: false - location: - row: 44 - column: 15 - end_location: - row: 44 - column: 16 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 48 - column: 8 - end_location: - row: 48 - column: 9 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `I`" - suggestion: ~ - fixable: false - location: - row: 48 - column: 13 - end_location: - row: 48 - column: 14 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 57 - column: 15 - end_location: - row: 57 - column: 16 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 66 - column: 19 - end_location: - row: 66 - column: 20 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 71 - column: 21 - end_location: - row: 71 - column: 22 - fix: ~ - parent: ~ -- kind: - name: AmbiguousVariableName - body: "Ambiguous variable name: `l`" - suggestion: ~ - fixable: false - location: - row: 74 - column: 4 - end_location: - row: 74 - column: 5 - fix: ~ - parent: ~ +- - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 1 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `I`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 1 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `O`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 1 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 1 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 8 + column: 3 + end_location: + row: 8 + column: 4 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 5 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 4 + end_location: + row: 10 + column: 5 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 4 + end_location: + row: 11 + column: 5 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 16 + column: 4 + end_location: + row: 16 + column: 5 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 20 + column: 7 + end_location: + row: 20 + column: 8 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 25 + column: 11 + end_location: + row: 25 + column: 12 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 26 + column: 4 + end_location: + row: 26 + column: 5 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 30 + column: 4 + end_location: + row: 30 + column: 5 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 33 + column: 17 + end_location: + row: 33 + column: 18 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 34 + column: 8 + end_location: + row: 34 + column: 9 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 40 + column: 7 + end_location: + row: 40 + column: 8 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `I`" + suggestion: ~ + fixable: false + location: + row: 40 + column: 13 + end_location: + row: 40 + column: 14 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 44 + column: 7 + end_location: + row: 44 + column: 8 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `I`" + suggestion: ~ + fixable: false + location: + row: 44 + column: 15 + end_location: + row: 44 + column: 16 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 48 + column: 8 + end_location: + row: 48 + column: 9 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `I`" + suggestion: ~ + fixable: false + location: + row: 48 + column: 13 + end_location: + row: 48 + column: 14 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 57 + column: 15 + end_location: + row: 57 + column: 16 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 66 + column: 19 + end_location: + row: 66 + column: 20 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 71 + column: 21 + end_location: + row: 71 + column: 22 + fix: ~ + parent: ~ + - kind: + name: AmbiguousVariableName + body: "Ambiguous variable name: `l`" + suggestion: ~ + fixable: false + location: + row: 74 + column: 4 + end_location: + row: 74 + column: 5 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E742_E742.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E742_E742.py.snap index e73bcfe6c8a2ba..983cbe3696381a 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E742_E742.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E742_E742.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: AmbiguousClassName - body: "Ambiguous class name: `l`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 6 - end_location: - row: 1 - column: 7 - fix: ~ - parent: ~ -- kind: - name: AmbiguousClassName - body: "Ambiguous class name: `I`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 6 - end_location: - row: 5 - column: 7 - fix: ~ - parent: ~ -- kind: - name: AmbiguousClassName - body: "Ambiguous class name: `O`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 6 - end_location: - row: 9 - column: 7 - fix: ~ - parent: ~ +- - kind: + name: AmbiguousClassName + body: "Ambiguous class name: `l`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 6 + end_location: + row: 1 + column: 7 + fix: ~ + parent: ~ + - kind: + name: AmbiguousClassName + body: "Ambiguous class name: `I`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 6 + end_location: + row: 5 + column: 7 + fix: ~ + parent: ~ + - kind: + name: AmbiguousClassName + body: "Ambiguous class name: `O`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 6 + end_location: + row: 9 + column: 7 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E743_E743.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E743_E743.py.snap index 39eb0714deb25b..becb61fef5241d 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E743_E743.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E743_E743.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: AmbiguousFunctionName - body: "Ambiguous function name: `l`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 4 - end_location: - row: 1 - column: 5 - fix: ~ - parent: ~ -- kind: - name: AmbiguousFunctionName - body: "Ambiguous function name: `I`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 4 - end_location: - row: 5 - column: 5 - fix: ~ - parent: ~ -- kind: - name: AmbiguousFunctionName - body: "Ambiguous function name: `O`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 8 - end_location: - row: 10 - column: 9 - fix: ~ - parent: ~ +- - kind: + name: AmbiguousFunctionName + body: "Ambiguous function name: `l`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 4 + end_location: + row: 1 + column: 5 + fix: ~ + parent: ~ + - kind: + name: AmbiguousFunctionName + body: "Ambiguous function name: `I`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 4 + end_location: + row: 5 + column: 5 + fix: ~ + parent: ~ + - kind: + name: AmbiguousFunctionName + body: "Ambiguous function name: `O`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 8 + end_location: + row: 10 + column: 9 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E999_E999.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E999_E999.py.snap index ba2b5f9fd3d05e..1a1f551482fdcc 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E999_E999.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E999_E999.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: SyntaxError - body: "SyntaxError: unindent does not match any outer indentation level" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 0 - fix: ~ - parent: ~ +- - kind: + name: SyntaxError + body: "SyntaxError: unindent does not match any outer indentation level" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 0 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W191_W19.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W191_W19.py.snap index 65727ee37c9e20..fe539a21d604b1 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W191_W19.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W191_W19.py.snap @@ -2,498 +2,498 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 16 - column: 0 - end_location: - row: 16 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 21 - column: 0 - end_location: - row: 21 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 26 - column: 0 - end_location: - row: 26 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 32 - column: 0 - end_location: - row: 32 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 38 - column: 0 - end_location: - row: 38 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 44 - column: 0 - end_location: - row: 44 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 45 - column: 0 - end_location: - row: 45 - column: 9 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 54 - column: 0 - end_location: - row: 54 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 58 - column: 0 - end_location: - row: 58 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 61 - column: 0 - end_location: - row: 61 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 62 - column: 0 - end_location: - row: 62 - column: 5 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 63 - column: 0 - end_location: - row: 63 - column: 5 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 64 - column: 0 - end_location: - row: 64 - column: 5 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 65 - column: 0 - end_location: - row: 65 - column: 5 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 66 - column: 0 - end_location: - row: 66 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 73 - column: 0 - end_location: - row: 73 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 78 - column: 0 - end_location: - row: 78 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 83 - column: 0 - end_location: - row: 83 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 88 - column: 0 - end_location: - row: 88 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 91 - column: 0 - end_location: - row: 91 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 92 - column: 0 - end_location: - row: 92 - column: 5 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 98 - column: 0 - end_location: - row: 98 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 99 - column: 0 - end_location: - row: 99 - column: 8 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 102 - column: 0 - end_location: - row: 102 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 105 - column: 0 - end_location: - row: 105 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 110 - column: 0 - end_location: - row: 110 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 125 - column: 0 - end_location: - row: 125 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 131 - column: 0 - end_location: - row: 131 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 132 - column: 0 - end_location: - row: 132 - column: 2 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 133 - column: 0 - end_location: - row: 133 - column: 2 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 136 - column: 0 - end_location: - row: 136 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 137 - column: 0 - end_location: - row: 137 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 138 - column: 0 - end_location: - row: 138 - column: 2 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 139 - column: 0 - end_location: - row: 139 - column: 2 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 140 - column: 0 - end_location: - row: 140 - column: 1 - fix: ~ - parent: ~ -- kind: - name: IndentationContainsTabs - body: Indentation contains tabs - suggestion: ~ - fixable: false - location: - row: 143 - column: 0 - end_location: - row: 143 - column: 1 - fix: ~ - parent: ~ +- - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 16 + column: 0 + end_location: + row: 16 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 21 + column: 0 + end_location: + row: 21 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 26 + column: 0 + end_location: + row: 26 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 32 + column: 0 + end_location: + row: 32 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 38 + column: 0 + end_location: + row: 38 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 44 + column: 0 + end_location: + row: 44 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 45 + column: 0 + end_location: + row: 45 + column: 9 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 54 + column: 0 + end_location: + row: 54 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 58 + column: 0 + end_location: + row: 58 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 61 + column: 0 + end_location: + row: 61 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 62 + column: 0 + end_location: + row: 62 + column: 5 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 63 + column: 0 + end_location: + row: 63 + column: 5 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 64 + column: 0 + end_location: + row: 64 + column: 5 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 65 + column: 0 + end_location: + row: 65 + column: 5 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 66 + column: 0 + end_location: + row: 66 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 73 + column: 0 + end_location: + row: 73 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 78 + column: 0 + end_location: + row: 78 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 83 + column: 0 + end_location: + row: 83 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 88 + column: 0 + end_location: + row: 88 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 91 + column: 0 + end_location: + row: 91 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 92 + column: 0 + end_location: + row: 92 + column: 5 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 98 + column: 0 + end_location: + row: 98 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 99 + column: 0 + end_location: + row: 99 + column: 8 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 102 + column: 0 + end_location: + row: 102 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 105 + column: 0 + end_location: + row: 105 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 110 + column: 0 + end_location: + row: 110 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 125 + column: 0 + end_location: + row: 125 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 131 + column: 0 + end_location: + row: 131 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 132 + column: 0 + end_location: + row: 132 + column: 2 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 133 + column: 0 + end_location: + row: 133 + column: 2 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 136 + column: 0 + end_location: + row: 136 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 137 + column: 0 + end_location: + row: 137 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 138 + column: 0 + end_location: + row: 138 + column: 2 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 139 + column: 0 + end_location: + row: 139 + column: 2 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 140 + column: 0 + end_location: + row: 140 + column: 1 + fix: ~ + parent: ~ + - kind: + name: IndentationContainsTabs + body: Indentation contains tabs + suggestion: ~ + fixable: false + location: + row: 143 + column: 0 + end_location: + row: 143 + column: 1 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W291_W29.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W291_W29.py.snap index 613528f7933708..a528de96b0d9b1 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W291_W29.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W291_W29.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: TrailingWhitespace - body: Trailing whitespace - suggestion: Remove trailing whitespace - fixable: true - location: - row: 4 - column: 5 - end_location: - row: 4 - column: 6 - fix: - content: "" +- - kind: + name: TrailingWhitespace + body: Trailing whitespace + suggestion: Remove trailing whitespace + fixable: true location: row: 4 column: 5 end_location: row: 4 column: 6 - parent: ~ -- kind: - name: TrailingWhitespace - body: Trailing whitespace - suggestion: Remove trailing whitespace - fixable: true - location: - row: 11 - column: 34 - end_location: - row: 11 - column: 37 - fix: - content: "" + fix: + content: "" + location: + row: 4 + column: 5 + end_location: + row: 4 + column: 6 + parent: ~ + - kind: + name: TrailingWhitespace + body: Trailing whitespace + suggestion: Remove trailing whitespace + fixable: true location: row: 11 column: 34 end_location: row: 11 column: 37 - parent: ~ -- kind: - name: TrailingWhitespace - body: Trailing whitespace - suggestion: Remove trailing whitespace - fixable: true - location: - row: 13 - column: 5 - end_location: - row: 13 - column: 8 - fix: - content: "" + fix: + content: "" + location: + row: 11 + column: 34 + end_location: + row: 11 + column: 37 + parent: ~ + - kind: + name: TrailingWhitespace + body: Trailing whitespace + suggestion: Remove trailing whitespace + fixable: true location: row: 13 column: 5 end_location: row: 13 column: 8 - parent: ~ + fix: + content: "" + location: + row: 13 + column: 5 + end_location: + row: 13 + column: 8 + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_0.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_0.py.snap index d213ac67c37ae5..51d0fb650e86dc 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_0.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_0.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: NoNewLineAtEndOfFile - body: No newline at end of file - suggestion: Add trailing newline - fixable: true - location: - row: 2 - column: 8 - end_location: - row: 2 - column: 8 - fix: - content: "\n" +- - kind: + name: NoNewLineAtEndOfFile + body: No newline at end of file + suggestion: Add trailing newline + fixable: true location: row: 2 column: 8 end_location: row: 2 column: 8 - parent: ~ + fix: + content: "\n" + location: + row: 2 + column: 8 + end_location: + row: 2 + column: 8 + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_1.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_1.py.snap index ff4244b62924fe..acb50de1ef6c81 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_1.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_1.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pycodestyle/mod.rs +source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_2.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_2.py.snap index ff4244b62924fe..acb50de1ef6c81 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_2.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_2.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pycodestyle/mod.rs +source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_3.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_3.py.snap index ff4244b62924fe..acb50de1ef6c81 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_3.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_3.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pycodestyle/mod.rs +source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W293_W29.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W293_W29.py.snap index 4456d6890c87eb..3c9f864cd37ffe 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W293_W29.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W293_W29.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: BlankLineContainsWhitespace - body: Blank line contains whitespace - suggestion: Remove whitespace from blank line - fixable: true - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 4 - fix: - content: "" +- - kind: + name: BlankLineContainsWhitespace + body: Blank line contains whitespace + suggestion: Remove whitespace from blank line + fixable: true location: row: 7 column: 0 end_location: row: 7 column: 4 - parent: ~ + fix: + content: "" + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 4 + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_0.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_0.py.snap index e645cf838c09b3..634ac6c90a9c37 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_0.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_0.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: InvalidEscapeSequence - body: "Invalid escape sequence: `\\.`" - suggestion: Add backslash to escape sequence - fixable: true - location: - row: 2 - column: 9 - end_location: - row: 2 - column: 11 - fix: - content: "\\" +- - kind: + name: InvalidEscapeSequence + body: "Invalid escape sequence: `\\.`" + suggestion: Add backslash to escape sequence + fixable: true location: row: 2 column: 9 end_location: row: 2 - column: 9 - parent: ~ -- kind: - name: InvalidEscapeSequence - body: "Invalid escape sequence: `\\.`" - suggestion: Add backslash to escape sequence - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 2 - fix: - content: "\\" + column: 11 + fix: + content: "\\" + location: + row: 2 + column: 9 + end_location: + row: 2 + column: 9 + parent: ~ + - kind: + name: InvalidEscapeSequence + body: "Invalid escape sequence: `\\.`" + suggestion: Add backslash to escape sequence + fixable: true location: row: 6 column: 0 end_location: row: 6 - column: 0 - parent: ~ -- kind: - name: InvalidEscapeSequence - body: "Invalid escape sequence: `\\_`" - suggestion: Add backslash to escape sequence - fixable: true - location: - row: 11 - column: 5 - end_location: - row: 11 - column: 7 - fix: - content: "\\" + column: 2 + fix: + content: "\\" + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 0 + parent: ~ + - kind: + name: InvalidEscapeSequence + body: "Invalid escape sequence: `\\_`" + suggestion: Add backslash to escape sequence + fixable: true location: row: 11 column: 5 end_location: row: 11 - column: 5 - parent: ~ -- kind: - name: InvalidEscapeSequence - body: "Invalid escape sequence: `\\_`" - suggestion: Add backslash to escape sequence - fixable: true - location: - row: 18 - column: 5 - end_location: - row: 18 - column: 7 - fix: - content: "\\" + column: 7 + fix: + content: "\\" + location: + row: 11 + column: 5 + end_location: + row: 11 + column: 5 + parent: ~ + - kind: + name: InvalidEscapeSequence + body: "Invalid escape sequence: `\\_`" + suggestion: Add backslash to escape sequence + fixable: true location: row: 18 column: 5 end_location: row: 18 - column: 5 - parent: ~ + column: 7 + fix: + content: "\\" + location: + row: 18 + column: 5 + end_location: + row: 18 + column: 5 + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_1.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_1.py.snap index e645cf838c09b3..634ac6c90a9c37 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_1.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_1.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: InvalidEscapeSequence - body: "Invalid escape sequence: `\\.`" - suggestion: Add backslash to escape sequence - fixable: true - location: - row: 2 - column: 9 - end_location: - row: 2 - column: 11 - fix: - content: "\\" +- - kind: + name: InvalidEscapeSequence + body: "Invalid escape sequence: `\\.`" + suggestion: Add backslash to escape sequence + fixable: true location: row: 2 column: 9 end_location: row: 2 - column: 9 - parent: ~ -- kind: - name: InvalidEscapeSequence - body: "Invalid escape sequence: `\\.`" - suggestion: Add backslash to escape sequence - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 2 - fix: - content: "\\" + column: 11 + fix: + content: "\\" + location: + row: 2 + column: 9 + end_location: + row: 2 + column: 9 + parent: ~ + - kind: + name: InvalidEscapeSequence + body: "Invalid escape sequence: `\\.`" + suggestion: Add backslash to escape sequence + fixable: true location: row: 6 column: 0 end_location: row: 6 - column: 0 - parent: ~ -- kind: - name: InvalidEscapeSequence - body: "Invalid escape sequence: `\\_`" - suggestion: Add backslash to escape sequence - fixable: true - location: - row: 11 - column: 5 - end_location: - row: 11 - column: 7 - fix: - content: "\\" + column: 2 + fix: + content: "\\" + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 0 + parent: ~ + - kind: + name: InvalidEscapeSequence + body: "Invalid escape sequence: `\\_`" + suggestion: Add backslash to escape sequence + fixable: true location: row: 11 column: 5 end_location: row: 11 - column: 5 - parent: ~ -- kind: - name: InvalidEscapeSequence - body: "Invalid escape sequence: `\\_`" - suggestion: Add backslash to escape sequence - fixable: true - location: - row: 18 - column: 5 - end_location: - row: 18 - column: 7 - fix: - content: "\\" + column: 7 + fix: + content: "\\" + location: + row: 11 + column: 5 + end_location: + row: 11 + column: 5 + parent: ~ + - kind: + name: InvalidEscapeSequence + body: "Invalid escape sequence: `\\_`" + suggestion: Add backslash to escape sequence + fixable: true location: row: 18 column: 5 end_location: row: 18 - column: 5 - parent: ~ + column: 7 + fix: + content: "\\" + location: + row: 18 + column: 5 + end_location: + row: 18 + column: 5 + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__constant_literals.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__constant_literals.snap index 10aa6714e39f00..51910089dd9e33 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__constant_literals.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__constant_literals.snap @@ -2,184 +2,184 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: IsLiteral - body: "Use `==` to compare constant literals" - suggestion: "Replace `is` with `==`" - fixable: true - location: - row: 4 - column: 3 - end_location: - row: 4 - column: 17 - fix: - content: "==" +- - kind: + name: IsLiteral + body: "Use `==` to compare constant literals" + suggestion: "Replace `is` with `==`" + fixable: true location: row: 4 - column: 9 + column: 3 end_location: row: 4 - column: 11 - parent: ~ -- kind: - name: IsLiteral - body: "Use `==` to compare constant literals" - suggestion: "Replace `is` with `==`" - fixable: true - location: - row: 6 - column: 3 - end_location: - row: 6 - column: 16 - fix: - content: "==" + column: 17 + fix: + content: "==" + location: + row: 4 + column: 9 + end_location: + row: 4 + column: 11 + parent: ~ + - kind: + name: IsLiteral + body: "Use `==` to compare constant literals" + suggestion: "Replace `is` with `==`" + fixable: true location: row: 6 - column: 9 + column: 3 end_location: row: 6 - column: 11 - parent: ~ -- kind: - name: IsLiteral - body: "Use `==` to compare constant literals" - suggestion: "Replace `is` with `==`" - fixable: true - location: - row: 8 - column: 3 - end_location: - row: 8 - column: 16 - fix: - content: "==" + column: 16 + fix: + content: "==" + location: + row: 6 + column: 9 + end_location: + row: 6 + column: 11 + parent: ~ + - kind: + name: IsLiteral + body: "Use `==` to compare constant literals" + suggestion: "Replace `is` with `==`" + fixable: true location: row: 8 - column: 8 + column: 3 end_location: row: 8 - column: 10 - parent: ~ -- kind: - name: IsLiteral - body: "Use `==` to compare constant literals" - suggestion: "Replace `is` with `==`" - fixable: true - location: - row: 10 - column: 3 - end_location: - row: 10 - column: 17 - fix: - content: "==" + column: 16 + fix: + content: "==" + location: + row: 8 + column: 8 + end_location: + row: 8 + column: 10 + parent: ~ + - kind: + name: IsLiteral + body: "Use `==` to compare constant literals" + suggestion: "Replace `is` with `==`" + fixable: true location: row: 10 - column: 9 + column: 3 end_location: row: 10 - column: 11 - parent: ~ -- kind: - name: IsLiteral - body: "Use `==` to compare constant literals" - suggestion: "Replace `is` with `==`" - fixable: true - location: - row: 12 - column: 3 - end_location: - row: 12 - column: 17 - fix: - content: "==" + column: 17 + fix: + content: "==" + location: + row: 10 + column: 9 + end_location: + row: 10 + column: 11 + parent: ~ + - kind: + name: IsLiteral + body: "Use `==` to compare constant literals" + suggestion: "Replace `is` with `==`" + fixable: true location: row: 12 - column: 9 + column: 3 end_location: row: 12 - column: 11 - parent: ~ -- kind: - name: TrueFalseComparison - body: "Comparison to `False` should be `cond is False`" - suggestion: "Replace with `cond is False`" - fixable: true - location: - row: 14 - column: 3 - end_location: - row: 14 - column: 8 - fix: - content: False is None + column: 17 + fix: + content: "==" + location: + row: 12 + column: 9 + end_location: + row: 12 + column: 11 + parent: ~ + - kind: + name: TrueFalseComparison + body: "Comparison to `False` should be `cond is False`" + suggestion: "Replace with `cond is False`" + fixable: true location: row: 14 column: 3 end_location: row: 14 - column: 16 - parent: ~ -- kind: - name: NoneComparison - body: "Comparison to `None` should be `cond is None`" - suggestion: "Replace with `cond is None`" - fixable: true - location: - row: 14 - column: 12 - end_location: - row: 14 - column: 16 - fix: - content: False is None + column: 8 + fix: + content: False is None + location: + row: 14 + column: 3 + end_location: + row: 14 + column: 16 + parent: ~ + - kind: + name: NoneComparison + body: "Comparison to `None` should be `cond is None`" + suggestion: "Replace with `cond is None`" + fixable: true location: row: 14 - column: 3 + column: 12 end_location: row: 14 column: 16 - parent: ~ -- kind: - name: NoneComparison - body: "Comparison to `None` should be `cond is None`" - suggestion: "Replace with `cond is None`" - fixable: true - location: - row: 16 - column: 3 - end_location: - row: 16 - column: 7 - fix: - content: None is False + fix: + content: False is None + location: + row: 14 + column: 3 + end_location: + row: 14 + column: 16 + parent: ~ + - kind: + name: NoneComparison + body: "Comparison to `None` should be `cond is None`" + suggestion: "Replace with `cond is None`" + fixable: true location: row: 16 column: 3 end_location: row: 16 - column: 16 - parent: ~ -- kind: - name: TrueFalseComparison - body: "Comparison to `False` should be `cond is False`" - suggestion: "Replace with `cond is False`" - fixable: true - location: - row: 16 - column: 11 - end_location: - row: 16 - column: 16 - fix: - content: None is False + column: 7 + fix: + content: None is False + location: + row: 16 + column: 3 + end_location: + row: 16 + column: 16 + parent: ~ + - kind: + name: TrueFalseComparison + body: "Comparison to `False` should be `cond is False`" + suggestion: "Replace with `cond is False`" + fixable: true location: row: 16 - column: 3 + column: 11 end_location: row: 16 column: 16 - parent: ~ + fix: + content: None is False + location: + row: 16 + column: 3 + end_location: + row: 16 + column: 16 + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__max_doc_length.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__max_doc_length.snap index 872113aac2c4a1..bb1f1557ca5a53 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__max_doc_length.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__max_doc_length.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: DocLineTooLong - body: Doc line too long (57 > 50 characters) - suggestion: ~ - fixable: false - location: - row: 2 - column: 50 - end_location: - row: 2 - column: 57 - fix: ~ - parent: ~ -- kind: - name: DocLineTooLong - body: Doc line too long (56 > 50 characters) - suggestion: ~ - fixable: false - location: - row: 6 - column: 50 - end_location: - row: 6 - column: 56 - fix: ~ - parent: ~ -- kind: - name: DocLineTooLong - body: Doc line too long (56 > 50 characters) - suggestion: ~ - fixable: false - location: - row: 10 - column: 50 - end_location: - row: 10 - column: 56 - fix: ~ - parent: ~ -- kind: - name: DocLineTooLong - body: Doc line too long (61 > 50 characters) - suggestion: ~ - fixable: false - location: - row: 15 - column: 50 - end_location: - row: 15 - column: 61 - fix: ~ - parent: ~ +- - kind: + name: DocLineTooLong + body: Doc line too long (57 > 50 characters) + suggestion: ~ + fixable: false + location: + row: 2 + column: 50 + end_location: + row: 2 + column: 57 + fix: ~ + parent: ~ + - kind: + name: DocLineTooLong + body: Doc line too long (56 > 50 characters) + suggestion: ~ + fixable: false + location: + row: 6 + column: 50 + end_location: + row: 6 + column: 56 + fix: ~ + parent: ~ + - kind: + name: DocLineTooLong + body: Doc line too long (56 > 50 characters) + suggestion: ~ + fixable: false + location: + row: 10 + column: 50 + end_location: + row: 10 + column: 56 + fix: ~ + parent: ~ + - kind: + name: DocLineTooLong + body: Doc line too long (61 > 50 characters) + suggestion: ~ + fixable: false + location: + row: 15 + column: 50 + end_location: + row: 15 + column: 61 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__task_tags_false.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__task_tags_false.snap index 49025e4cd68ebb..a13c0123988814 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__task_tags_false.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__task_tags_false.snap @@ -2,82 +2,82 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: LineTooLong - body: Line too long (149 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 1 - column: 88 - end_location: - row: 1 - column: 149 - fix: ~ - parent: ~ -- kind: - name: LineTooLong - body: Line too long (148 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 2 - column: 88 - end_location: - row: 2 - column: 148 - fix: ~ - parent: ~ -- kind: - name: LineTooLong - body: Line too long (155 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 3 - column: 88 - end_location: - row: 3 - column: 155 - fix: ~ - parent: ~ -- kind: - name: LineTooLong - body: Line too long (150 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 4 - column: 88 - end_location: - row: 4 - column: 150 - fix: ~ - parent: ~ -- kind: - name: LineTooLong - body: Line too long (149 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 5 - column: 88 - end_location: - row: 5 - column: 149 - fix: ~ - parent: ~ -- kind: - name: LineTooLong - body: Line too long (156 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 6 - column: 88 - end_location: - row: 6 - column: 156 - fix: ~ - parent: ~ +- - kind: + name: LineTooLong + body: Line too long (149 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 1 + column: 88 + end_location: + row: 1 + column: 149 + fix: ~ + parent: ~ + - kind: + name: LineTooLong + body: Line too long (148 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 2 + column: 88 + end_location: + row: 2 + column: 148 + fix: ~ + parent: ~ + - kind: + name: LineTooLong + body: Line too long (155 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 3 + column: 88 + end_location: + row: 3 + column: 155 + fix: ~ + parent: ~ + - kind: + name: LineTooLong + body: Line too long (150 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 4 + column: 88 + end_location: + row: 4 + column: 150 + fix: ~ + parent: ~ + - kind: + name: LineTooLong + body: Line too long (149 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 5 + column: 88 + end_location: + row: 5 + column: 149 + fix: ~ + parent: ~ + - kind: + name: LineTooLong + body: Line too long (156 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 6 + column: 88 + end_location: + row: 6 + column: 156 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__task_tags_true.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__task_tags_true.snap index ff4244b62924fe..acb50de1ef6c81 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__task_tags_true.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__task_tags_true.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pycodestyle/mod.rs +source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__w292_4.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__w292_4.snap index 7f65408075b9fa..6a2ef0ed070c03 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__w292_4.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__w292_4.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs expression: diagnostics --- -- kind: - name: NoNewLineAtEndOfFile - body: No newline at end of file - suggestion: Add trailing newline - fixable: true - location: - row: 1 - column: 1 - end_location: - row: 1 - column: 1 - fix: - content: "" +- - kind: + name: NoNewLineAtEndOfFile + body: No newline at end of file + suggestion: Add trailing newline + fixable: true location: row: 1 column: 1 end_location: row: 1 column: 1 - parent: ~ + fix: + content: "\n" + location: + row: 1 + column: 1 + end_location: + row: 1 + column: 1 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D100_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D100_D.py.snap index 6465c3fe6f1ca5..b74faf7e1e4eb4 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D100_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D100_D.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: PublicModule - body: Missing docstring in public module - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: ~ - parent: ~ +- - kind: + name: PublicModule + body: Missing docstring in public module + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 0 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D101_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D101_D.py.snap index a8cd118adf6485..671758435b6cfb 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D101_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D101_D.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: PublicClass - body: Missing docstring in public class - suggestion: ~ - fixable: false - location: - row: 15 - column: 6 - end_location: - row: 15 - column: 12 - fix: ~ - parent: ~ +- - kind: + name: PublicClass + body: Missing docstring in public class + suggestion: ~ + fixable: false + location: + row: 15 + column: 6 + end_location: + row: 15 + column: 12 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_D.py.snap index 6df4195b5d159d..39b677d82e0c6b 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_D.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: PublicMethod - body: Missing docstring in public method - suggestion: ~ - fixable: false - location: - row: 23 - column: 8 - end_location: - row: 23 - column: 14 - fix: ~ - parent: ~ -- kind: - name: PublicMethod - body: Missing docstring in public method - suggestion: ~ - fixable: false - location: - row: 56 - column: 8 - end_location: - row: 56 - column: 15 - fix: ~ - parent: ~ -- kind: - name: PublicMethod - body: Missing docstring in public method - suggestion: ~ - fixable: false - location: - row: 68 - column: 8 - end_location: - row: 68 - column: 16 - fix: ~ - parent: ~ +- - kind: + name: PublicMethod + body: Missing docstring in public method + suggestion: ~ + fixable: false + location: + row: 23 + column: 8 + end_location: + row: 23 + column: 14 + fix: ~ + parent: ~ + - kind: + name: PublicMethod + body: Missing docstring in public method + suggestion: ~ + fixable: false + location: + row: 56 + column: 8 + end_location: + row: 56 + column: 15 + fix: ~ + parent: ~ + - kind: + name: PublicMethod + body: Missing docstring in public method + suggestion: ~ + fixable: false + location: + row: 68 + column: 8 + end_location: + row: 68 + column: 16 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_setter.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_setter.py.snap index c6a4b7dbc0873a..2b73197cdfe556 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_setter.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_setter.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: PublicMethod - body: Missing docstring in public method - suggestion: ~ - fixable: false - location: - row: 16 - column: 8 - end_location: - row: 16 - column: 11 - fix: ~ - parent: ~ +- - kind: + name: PublicMethod + body: Missing docstring in public method + suggestion: ~ + fixable: false + location: + row: 16 + column: 8 + end_location: + row: 16 + column: 11 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D103_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D103_D.py.snap index dcbac5146bb945..cce71a3394760b 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D103_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D103_D.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: PublicFunction - body: Missing docstring in public function - suggestion: ~ - fixable: false - location: - row: 400 - column: 4 - end_location: - row: 400 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: PublicFunction + body: Missing docstring in public function + suggestion: ~ + fixable: false + location: + row: 400 + column: 4 + end_location: + row: 400 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D104_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D104_D.py.snap index 9c3ea66b0e726d..685cba6bf6c9ea 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D104_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D104_D.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D104_D104____init__.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D104_D104____init__.py.snap index 8367b199df0a42..0f6dd6118ea281 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D104_D104____init__.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D104_D104____init__.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: PublicPackage - body: Missing docstring in public package - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 0 - fix: ~ - parent: ~ +- - kind: + name: PublicPackage + body: Missing docstring in public package + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 0 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D105_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D105_D.py.snap index 94128ea80665aa..0e593f6e18c76c 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D105_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D105_D.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: MagicMethod - body: Missing docstring in magic method - suggestion: ~ - fixable: false - location: - row: 64 - column: 8 - end_location: - row: 64 - column: 15 - fix: ~ - parent: ~ +- - kind: + name: MagicMethod + body: Missing docstring in magic method + suggestion: ~ + fixable: false + location: + row: 64 + column: 8 + end_location: + row: 64 + column: 15 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D106_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D106_D.py.snap index 9c3ea66b0e726d..685cba6bf6c9ea 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D106_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D106_D.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D107_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D107_D.py.snap index 1d1f8137c26bff..fb9943714c06d0 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D107_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D107_D.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: PublicInit - body: "Missing docstring in `__init__`" - suggestion: ~ - fixable: false - location: - row: 60 - column: 8 - end_location: - row: 60 - column: 16 - fix: ~ - parent: ~ -- kind: - name: PublicInit - body: "Missing docstring in `__init__`" - suggestion: ~ - fixable: false - location: - row: 534 - column: 8 - end_location: - row: 534 - column: 16 - fix: ~ - parent: ~ +- - kind: + name: PublicInit + body: "Missing docstring in `__init__`" + suggestion: ~ + fixable: false + location: + row: 60 + column: 8 + end_location: + row: 60 + column: 16 + fix: ~ + parent: ~ + - kind: + name: PublicInit + body: "Missing docstring in `__init__`" + suggestion: ~ + fixable: false + location: + row: 534 + column: 8 + end_location: + row: 534 + column: 16 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D200_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D200_D.py.snap index 44be96b8a1da9d..8a343156161e54 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D200_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D200_D.py.snap @@ -2,116 +2,116 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: FitsOnOneLine - body: One-line docstring should fit on one line - suggestion: Reformat to one line - fixable: true - location: - row: 129 - column: 4 - end_location: - row: 131 - column: 7 - fix: - content: "\"\"\"Wrong.\"\"\"" +- - kind: + name: FitsOnOneLine + body: One-line docstring should fit on one line + suggestion: Reformat to one line + fixable: true location: row: 129 column: 4 end_location: row: 131 column: 7 - parent: ~ -- kind: - name: FitsOnOneLine - body: One-line docstring should fit on one line - suggestion: Reformat to one line - fixable: true - location: - row: 597 - column: 4 - end_location: - row: 599 - column: 13 - fix: - content: "\"\"\"Wrong.\"\"\"" + fix: + content: "\"\"\"Wrong.\"\"\"" + location: + row: 129 + column: 4 + end_location: + row: 131 + column: 7 + parent: ~ + - kind: + name: FitsOnOneLine + body: One-line docstring should fit on one line + suggestion: Reformat to one line + fixable: true location: row: 597 column: 4 end_location: row: 599 column: 13 - parent: ~ -- kind: - name: FitsOnOneLine - body: One-line docstring should fit on one line - suggestion: Reformat to one line - fixable: true - location: - row: 606 - column: 4 - end_location: - row: 608 - column: 7 - fix: - content: "r\"\"\"Wrong.\"\"\"" + fix: + content: "\"\"\"Wrong.\"\"\"" + location: + row: 597 + column: 4 + end_location: + row: 599 + column: 13 + parent: ~ + - kind: + name: FitsOnOneLine + body: One-line docstring should fit on one line + suggestion: Reformat to one line + fixable: true location: row: 606 column: 4 end_location: row: 608 column: 7 - parent: ~ -- kind: - name: FitsOnOneLine - body: One-line docstring should fit on one line - suggestion: Reformat to one line - fixable: true - location: - row: 609 - column: 4 - end_location: - row: 611 - column: 7 - fix: ~ - parent: ~ -- kind: - name: FitsOnOneLine - body: One-line docstring should fit on one line - suggestion: Reformat to one line - fixable: true - location: - row: 615 - column: 4 - end_location: - row: 617 - column: 7 - fix: ~ - parent: ~ -- kind: - name: FitsOnOneLine - body: One-line docstring should fit on one line - suggestion: Reformat to one line - fixable: true - location: - row: 618 - column: 4 - end_location: - row: 620 - column: 14 - fix: ~ - parent: ~ -- kind: - name: FitsOnOneLine - body: One-line docstring should fit on one line - suggestion: Reformat to one line - fixable: true - location: - row: 624 - column: 4 - end_location: - row: 626 - column: 14 - fix: ~ - parent: ~ + fix: + content: "r\"\"\"Wrong.\"\"\"" + location: + row: 606 + column: 4 + end_location: + row: 608 + column: 7 + parent: ~ + - kind: + name: FitsOnOneLine + body: One-line docstring should fit on one line + suggestion: Reformat to one line + fixable: true + location: + row: 615 + column: 4 + end_location: + row: 617 + column: 7 + fix: ~ + parent: ~ + - kind: + name: FitsOnOneLine + body: One-line docstring should fit on one line + suggestion: Reformat to one line + fixable: true + location: + row: 624 + column: 4 + end_location: + row: 626 + column: 14 + fix: ~ + parent: ~ +- - kind: + name: FitsOnOneLine + body: One-line docstring should fit on one line + suggestion: Reformat to one line + fixable: true + location: + row: 609 + column: 4 + end_location: + row: 611 + column: 7 + fix: ~ + parent: ~ + - kind: + name: FitsOnOneLine + body: One-line docstring should fit on one line + suggestion: Reformat to one line + fixable: true + location: + row: 618 + column: 4 + end_location: + row: 620 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D201_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D201_D.py.snap index bc09e4cc2f59d5..7a9d18da0ece30 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D201_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D201_D.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: NoBlankLineBeforeFunction - body: No blank lines allowed before function docstring (found 1) - suggestion: Remove blank line(s) before function docstring - fixable: true - location: - row: 137 - column: 4 - end_location: - row: 137 - column: 24 - fix: - content: "" +- - kind: + name: NoBlankLineBeforeFunction + body: No blank lines allowed before function docstring (found 1) + suggestion: Remove blank line(s) before function docstring + fixable: true location: - row: 136 - column: 0 + row: 137 + column: 4 end_location: row: 137 - column: 0 - parent: ~ -- kind: - name: NoBlankLineBeforeFunction - body: No blank lines allowed before function docstring (found 1) - suggestion: Remove blank line(s) before function docstring - fixable: true - location: - row: 151 - column: 4 - end_location: - row: 151 - column: 37 - fix: - content: "" + column: 24 + fix: + content: "" + location: + row: 136 + column: 0 + end_location: + row: 137 + column: 0 + parent: ~ + - kind: + name: NoBlankLineBeforeFunction + body: No blank lines allowed before function docstring (found 1) + suggestion: Remove blank line(s) before function docstring + fixable: true location: - row: 150 - column: 0 + row: 151 + column: 4 end_location: row: 151 - column: 0 - parent: ~ -- kind: - name: NoBlankLineBeforeFunction - body: No blank lines allowed before function docstring (found 1) - suggestion: Remove blank line(s) before function docstring - fixable: true - location: - row: 546 - column: 4 - end_location: - row: 549 - column: 7 - fix: - content: "" + column: 37 + fix: + content: "" + location: + row: 150 + column: 0 + end_location: + row: 151 + column: 0 + parent: ~ + - kind: + name: NoBlankLineBeforeFunction + body: No blank lines allowed before function docstring (found 1) + suggestion: Remove blank line(s) before function docstring + fixable: true location: - row: 545 - column: 0 - end_location: row: 546 - column: 0 - parent: ~ -- kind: - name: NoBlankLineBeforeFunction - body: No blank lines allowed before function docstring (found 1) - suggestion: Remove blank line(s) before function docstring - fixable: true - location: - row: 568 - column: 4 - end_location: - row: 571 - column: 7 - fix: - content: "" - location: - row: 567 - column: 0 + column: 4 end_location: + row: 549 + column: 7 + fix: + content: "" + location: + row: 545 + column: 0 + end_location: + row: 546 + column: 0 + parent: ~ + - kind: + name: NoBlankLineBeforeFunction + body: No blank lines allowed before function docstring (found 1) + suggestion: Remove blank line(s) before function docstring + fixable: true + location: row: 568 - column: 0 - parent: ~ + column: 4 + end_location: + row: 571 + column: 7 + fix: + content: "" + location: + row: 567 + column: 0 + end_location: + row: 568 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D.py.snap index ca7fae4133af29..7e46136f513702 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: NoBlankLineAfterFunction - body: No blank lines allowed after function docstring (found 1) - suggestion: Remove blank line(s) after function docstring - fixable: true - location: - row: 142 - column: 4 - end_location: - row: 142 - column: 24 - fix: - content: "" +- - kind: + name: NoBlankLineAfterFunction + body: No blank lines allowed after function docstring (found 1) + suggestion: Remove blank line(s) after function docstring + fixable: true location: - row: 143 - column: 0 + row: 142 + column: 4 end_location: - row: 144 - column: 0 - parent: ~ -- kind: - name: NoBlankLineAfterFunction - body: No blank lines allowed after function docstring (found 1) - suggestion: Remove blank line(s) after function docstring - fixable: true - location: - row: 151 - column: 4 - end_location: - row: 151 - column: 37 - fix: - content: "" + row: 142 + column: 24 + fix: + content: "" + location: + row: 143 + column: 0 + end_location: + row: 144 + column: 0 + parent: ~ + - kind: + name: NoBlankLineAfterFunction + body: No blank lines allowed after function docstring (found 1) + suggestion: Remove blank line(s) after function docstring + fixable: true location: - row: 152 - column: 0 + row: 151 + column: 4 end_location: - row: 153 - column: 0 - parent: ~ -- kind: - name: NoBlankLineAfterFunction - body: No blank lines allowed after function docstring (found 1) - suggestion: Remove blank line(s) after function docstring - fixable: true - location: - row: 555 - column: 4 - end_location: - row: 558 - column: 7 - fix: - content: "" + row: 151 + column: 37 + fix: + content: "" + location: + row: 152 + column: 0 + end_location: + row: 153 + column: 0 + parent: ~ + - kind: + name: NoBlankLineAfterFunction + body: No blank lines allowed after function docstring (found 1) + suggestion: Remove blank line(s) after function docstring + fixable: true location: - row: 559 - column: 0 + row: 555 + column: 4 end_location: - row: 560 - column: 0 - parent: ~ -- kind: - name: NoBlankLineAfterFunction - body: No blank lines allowed after function docstring (found 1) - suggestion: Remove blank line(s) after function docstring - fixable: true - location: - row: 568 - column: 4 - end_location: - row: 571 - column: 7 - fix: - content: "" + row: 558 + column: 7 + fix: + content: "" + location: + row: 559 + column: 0 + end_location: + row: 560 + column: 0 + parent: ~ + - kind: + name: NoBlankLineAfterFunction + body: No blank lines allowed after function docstring (found 1) + suggestion: Remove blank line(s) after function docstring + fixable: true location: - row: 572 - column: 0 + row: 568 + column: 4 end_location: - row: 573 - column: 0 - parent: ~ + row: 571 + column: 7 + fix: + content: "" + location: + row: 572 + column: 0 + end_location: + row: 573 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D202.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D202.py.snap index 645410db17cc8b..fbdcff56e8007f 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D202.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D202.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: NoBlankLineAfterFunction - body: No blank lines allowed after function docstring (found 2) - suggestion: Remove blank line(s) after function docstring - fixable: true - location: - row: 57 - column: 4 - end_location: - row: 57 - column: 30 - fix: - content: "" +- - kind: + name: NoBlankLineAfterFunction + body: No blank lines allowed after function docstring (found 2) + suggestion: Remove blank line(s) after function docstring + fixable: true location: - row: 58 - column: 0 + row: 57 + column: 4 end_location: - row: 60 - column: 0 - parent: ~ -- kind: - name: NoBlankLineAfterFunction - body: No blank lines allowed after function docstring (found 2) - suggestion: Remove blank line(s) after function docstring - fixable: true - location: - row: 68 - column: 4 - end_location: - row: 68 - column: 30 - fix: - content: "" + row: 57 + column: 30 + fix: + content: "" + location: + row: 58 + column: 0 + end_location: + row: 60 + column: 0 + parent: ~ + - kind: + name: NoBlankLineAfterFunction + body: No blank lines allowed after function docstring (found 2) + suggestion: Remove blank line(s) after function docstring + fixable: true location: - row: 69 - column: 0 + row: 68 + column: 4 end_location: - row: 71 - column: 0 - parent: ~ -- kind: - name: NoBlankLineAfterFunction - body: No blank lines allowed after function docstring (found 1) - suggestion: Remove blank line(s) after function docstring - fixable: true - location: - row: 80 - column: 4 - end_location: - row: 80 - column: 30 - fix: - content: "" + row: 68 + column: 30 + fix: + content: "" + location: + row: 69 + column: 0 + end_location: + row: 71 + column: 0 + parent: ~ + - kind: + name: NoBlankLineAfterFunction + body: No blank lines allowed after function docstring (found 1) + suggestion: Remove blank line(s) after function docstring + fixable: true location: - row: 81 - column: 0 + row: 80 + column: 4 end_location: - row: 82 - column: 0 - parent: ~ + row: 80 + column: 30 + fix: + content: "" + location: + row: 81 + column: 0 + end_location: + row: 82 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D203_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D203_D.py.snap index 0de8a25b741c5e..f2cedd8865e2c6 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D203_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D203_D.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: OneBlankLineBeforeClass - body: 1 blank line required before class docstring - suggestion: Insert 1 blank line before class docstring - fixable: true - location: - row: 161 - column: 4 - end_location: - row: 161 - column: 32 - fix: - content: "\n" +- - kind: + name: OneBlankLineBeforeClass + body: 1 blank line required before class docstring + suggestion: Insert 1 blank line before class docstring + fixable: true location: row: 161 - column: 0 + column: 4 end_location: row: 161 - column: 0 - parent: ~ -- kind: - name: OneBlankLineBeforeClass - body: 1 blank line required before class docstring - suggestion: Insert 1 blank line before class docstring - fixable: true - location: - row: 192 - column: 4 - end_location: - row: 192 - column: 45 - fix: - content: "\n" + column: 32 + fix: + content: "\n" + location: + row: 161 + column: 0 + end_location: + row: 161 + column: 0 + parent: ~ + - kind: + name: OneBlankLineBeforeClass + body: 1 blank line required before class docstring + suggestion: Insert 1 blank line before class docstring + fixable: true location: row: 192 - column: 0 + column: 4 end_location: row: 192 - column: 0 - parent: ~ -- kind: - name: OneBlankLineBeforeClass - body: 1 blank line required before class docstring - suggestion: Insert 1 blank line before class docstring - fixable: true - location: - row: 526 - column: 4 - end_location: - row: 532 - column: 7 - fix: - content: "\n" + column: 45 + fix: + content: "\n" + location: + row: 192 + column: 0 + end_location: + row: 192 + column: 0 + parent: ~ + - kind: + name: OneBlankLineBeforeClass + body: 1 blank line required before class docstring + suggestion: Insert 1 blank line before class docstring + fixable: true location: row: 526 - column: 0 + column: 4 end_location: - row: 526 - column: 0 - parent: ~ + row: 532 + column: 7 + fix: + content: "\n" + location: + row: 526 + column: 0 + end_location: + row: 526 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D204_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D204_D.py.snap index 2723279843b42b..0ac2275e10bb66 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D204_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D204_D.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: OneBlankLineAfterClass - body: 1 blank line required after class docstring - suggestion: Insert 1 blank line after class docstring - fixable: true - location: - row: 181 - column: 4 - end_location: - row: 181 - column: 24 - fix: - content: "\n" +- - kind: + name: OneBlankLineAfterClass + body: 1 blank line required after class docstring + suggestion: Insert 1 blank line after class docstring + fixable: true location: - row: 182 - column: 0 + row: 181 + column: 4 end_location: - row: 182 - column: 0 - parent: ~ -- kind: - name: OneBlankLineAfterClass - body: 1 blank line required after class docstring - suggestion: Insert 1 blank line after class docstring - fixable: true - location: - row: 192 - column: 4 - end_location: - row: 192 - column: 45 - fix: - content: "\n" + row: 181 + column: 24 + fix: + content: "\n" + location: + row: 182 + column: 0 + end_location: + row: 182 + column: 0 + parent: ~ + - kind: + name: OneBlankLineAfterClass + body: 1 blank line required after class docstring + suggestion: Insert 1 blank line after class docstring + fixable: true location: - row: 193 - column: 0 + row: 192 + column: 4 end_location: - row: 193 - column: 0 - parent: ~ + row: 192 + column: 45 + fix: + content: "\n" + location: + row: 193 + column: 0 + end_location: + row: 193 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D205_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D205_D.py.snap index c643c7bff9a432..d7a34f065fcc5b 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D205_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D205_D.py.snap @@ -2,37 +2,37 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: BlankLineAfterSummary - body: 1 blank line required between summary line and description - suggestion: ~ - fixable: false - location: - row: 200 - column: 4 - end_location: - row: 203 - column: 7 - fix: ~ - parent: ~ -- kind: - name: BlankLineAfterSummary - body: 1 blank line required between summary line and description (found 2) - suggestion: Insert single blank line - fixable: true - location: - row: 210 - column: 4 - end_location: - row: 215 - column: 7 - fix: - content: "\n" +- - kind: + name: BlankLineAfterSummary + body: 1 blank line required between summary line and description + suggestion: ~ + fixable: false location: - row: 211 - column: 0 + row: 200 + column: 4 end_location: - row: 213 - column: 0 - parent: ~ + row: 203 + column: 7 + fix: ~ + parent: ~ + - kind: + name: BlankLineAfterSummary + body: 1 blank line required between summary line and description (found 2) + suggestion: Insert single blank line + fixable: true + location: + row: 210 + column: 4 + end_location: + row: 215 + column: 7 + fix: + content: "\n" + location: + row: 211 + column: 0 + end_location: + row: 213 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D206_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D206_D.py.snap index 9c3ea66b0e726d..685cba6bf6c9ea 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D206_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D206_D.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D207_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D207_D.py.snap index 7469e805a1512e..8e613ce8b442fc 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D207_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D207_D.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: NoUnderIndentation - body: Docstring is under-indented - suggestion: Increase indentation - fixable: true - location: - row: 232 - column: 0 - end_location: - row: 232 - column: 0 - fix: - content: " " +- - kind: + name: NoUnderIndentation + body: Docstring is under-indented + suggestion: Increase indentation + fixable: true location: row: 232 column: 0 end_location: row: 232 column: 0 - parent: ~ -- kind: - name: NoUnderIndentation - body: Docstring is under-indented - suggestion: Increase indentation - fixable: true - location: - row: 244 - column: 0 - end_location: - row: 244 - column: 0 - fix: - content: " " + fix: + content: " " + location: + row: 232 + column: 0 + end_location: + row: 232 + column: 0 + parent: ~ + - kind: + name: NoUnderIndentation + body: Docstring is under-indented + suggestion: Increase indentation + fixable: true location: row: 244 column: 0 end_location: row: 244 column: 0 - parent: ~ -- kind: - name: NoUnderIndentation - body: Docstring is under-indented - suggestion: Increase indentation - fixable: true - location: - row: 440 - column: 0 - end_location: - row: 440 - column: 0 - fix: - content: " " + fix: + content: " " + location: + row: 244 + column: 0 + end_location: + row: 244 + column: 0 + parent: ~ + - kind: + name: NoUnderIndentation + body: Docstring is under-indented + suggestion: Increase indentation + fixable: true location: row: 440 column: 0 end_location: row: 440 - column: 4 - parent: ~ -- kind: - name: NoUnderIndentation - body: Docstring is under-indented - suggestion: Increase indentation - fixable: true - location: - row: 441 - column: 0 - end_location: - row: 441 - column: 0 - fix: - content: " " + column: 0 + fix: + content: " " + location: + row: 440 + column: 0 + end_location: + row: 440 + column: 4 + parent: ~ + - kind: + name: NoUnderIndentation + body: Docstring is under-indented + suggestion: Increase indentation + fixable: true location: row: 441 column: 0 end_location: row: 441 - column: 4 - parent: ~ + column: 0 + fix: + content: " " + location: + row: 441 + column: 0 + end_location: + row: 441 + column: 4 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D208_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D208_D.py.snap index 7fcf0008239b84..77fd7e4cec4d7a 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D208_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D208_D.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: NoOverIndentation - body: Docstring is over-indented - suggestion: Remove over-indentation - fixable: true - location: - row: 252 - column: 0 - end_location: - row: 252 - column: 0 - fix: - content: " " +- - kind: + name: NoOverIndentation + body: Docstring is over-indented + suggestion: Remove over-indentation + fixable: true location: row: 252 column: 0 end_location: row: 252 - column: 7 - parent: ~ -- kind: - name: NoOverIndentation - body: Docstring is over-indented - suggestion: Remove over-indentation - fixable: true - location: - row: 264 - column: 0 - end_location: - row: 264 - column: 0 - fix: - content: " " + column: 0 + fix: + content: " " + location: + row: 252 + column: 0 + end_location: + row: 252 + column: 7 + parent: ~ + - kind: + name: NoOverIndentation + body: Docstring is over-indented + suggestion: Remove over-indentation + fixable: true location: row: 264 column: 0 end_location: row: 264 - column: 8 - parent: ~ -- kind: - name: NoOverIndentation - body: Docstring is over-indented - suggestion: Remove over-indentation - fixable: true - location: - row: 272 - column: 0 - end_location: - row: 272 - column: 0 - fix: - content: " " + column: 0 + fix: + content: " " + location: + row: 264 + column: 0 + end_location: + row: 264 + column: 8 + parent: ~ + - kind: + name: NoOverIndentation + body: Docstring is over-indented + suggestion: Remove over-indentation + fixable: true location: row: 272 column: 0 end_location: row: 272 - column: 8 - parent: ~ + column: 0 + fix: + content: " " + location: + row: 272 + column: 0 + end_location: + row: 272 + column: 8 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D209_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D209_D.py.snap index e33af346c321f9..90b1456f331c3e 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D209_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D209_D.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: NewLineAfterLastParagraph - body: Multi-line docstring closing quotes should be on a separate line - suggestion: Move closing quotes to new line - fixable: true - location: - row: 281 - column: 4 - end_location: - row: 283 - column: 19 - fix: - content: "\n " +- - kind: + name: NewLineAfterLastParagraph + body: Multi-line docstring closing quotes should be on a separate line + suggestion: Move closing quotes to new line + fixable: true location: - row: 283 - column: 16 + row: 281 + column: 4 end_location: row: 283 - column: 16 - parent: ~ -- kind: - name: NewLineAfterLastParagraph - body: Multi-line docstring closing quotes should be on a separate line - suggestion: Move closing quotes to new line - fixable: true - location: - row: 588 - column: 4 - end_location: - row: 590 - column: 21 - fix: - content: "\n " + column: 19 + fix: + content: "\n " + location: + row: 283 + column: 16 + end_location: + row: 283 + column: 16 + parent: ~ + - kind: + name: NewLineAfterLastParagraph + body: Multi-line docstring closing quotes should be on a separate line + suggestion: Move closing quotes to new line + fixable: true location: - row: 590 - column: 16 + row: 588 + column: 4 end_location: row: 590 - column: 18 - parent: ~ + column: 21 + fix: + content: "\n " + location: + row: 590 + column: 16 + end_location: + row: 590 + column: 18 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D210_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D210_D.py.snap index 1869a6c80cff9e..0258af50cf7e8a 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D210_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D210_D.py.snap @@ -2,77 +2,77 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: NoSurroundingWhitespace - body: No whitespaces allowed surrounding docstring text - suggestion: Trim surrounding whitespace - fixable: true - location: - row: 288 - column: 4 - end_location: - row: 288 - column: 33 - fix: - content: Whitespace at the end. +- - kind: + name: NoSurroundingWhitespace + body: No whitespaces allowed surrounding docstring text + suggestion: Trim surrounding whitespace + fixable: true location: row: 288 - column: 7 + column: 4 end_location: row: 288 - column: 30 - parent: ~ -- kind: - name: NoSurroundingWhitespace - body: No whitespaces allowed surrounding docstring text - suggestion: Trim surrounding whitespace - fixable: true - location: - row: 293 - column: 4 - end_location: - row: 293 - column: 37 - fix: - content: Whitespace at everywhere. + column: 33 + fix: + content: Whitespace at the end. + location: + row: 288 + column: 7 + end_location: + row: 288 + column: 30 + parent: ~ + - kind: + name: NoSurroundingWhitespace + body: No whitespaces allowed surrounding docstring text + suggestion: Trim surrounding whitespace + fixable: true location: row: 293 - column: 7 + column: 4 end_location: row: 293 - column: 34 - parent: ~ -- kind: - name: NoSurroundingWhitespace - body: No whitespaces allowed surrounding docstring text - suggestion: Trim surrounding whitespace - fixable: true - location: - row: 299 - column: 4 - end_location: - row: 302 - column: 7 - fix: - content: Whitespace at the beginning. + column: 37 + fix: + content: Whitespace at everywhere. + location: + row: 293 + column: 7 + end_location: + row: 293 + column: 34 + parent: ~ + - kind: + name: NoSurroundingWhitespace + body: No whitespaces allowed surrounding docstring text + suggestion: Trim surrounding whitespace + fixable: true location: row: 299 + column: 4 + end_location: + row: 302 column: 7 + fix: + content: Whitespace at the beginning. + location: + row: 299 + column: 7 + end_location: + row: 299 + column: 36 + parent: ~ + - kind: + name: NoSurroundingWhitespace + body: No whitespaces allowed surrounding docstring text + suggestion: Trim surrounding whitespace + fixable: true + location: + row: 581 + column: 4 end_location: - row: 299 - column: 36 - parent: ~ -- kind: - name: NoSurroundingWhitespace - body: No whitespaces allowed surrounding docstring text - suggestion: Trim surrounding whitespace - fixable: true - location: - row: 581 - column: 4 - end_location: - row: 581 - column: 51 - fix: ~ - parent: ~ + row: 581 + column: 51 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D211_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D211_D.py.snap index b491fc6cd89f39..0f155b67fb8f86 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D211_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D211_D.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: NoBlankLineBeforeClass - body: No blank lines allowed before class docstring - suggestion: Remove blank line(s) before class docstring - fixable: true - location: - row: 170 - column: 4 - end_location: - row: 170 - column: 29 - fix: - content: "" +- - kind: + name: NoBlankLineBeforeClass + body: No blank lines allowed before class docstring + suggestion: Remove blank line(s) before class docstring + fixable: true location: - row: 169 - column: 0 + row: 170 + column: 4 end_location: row: 170 - column: 0 - parent: ~ -- kind: - name: NoBlankLineBeforeClass - body: No blank lines allowed before class docstring - suggestion: Remove blank line(s) before class docstring - fixable: true - location: - row: 181 - column: 4 - end_location: - row: 181 - column: 24 - fix: - content: "" + column: 29 + fix: + content: "" + location: + row: 169 + column: 0 + end_location: + row: 170 + column: 0 + parent: ~ + - kind: + name: NoBlankLineBeforeClass + body: No blank lines allowed before class docstring + suggestion: Remove blank line(s) before class docstring + fixable: true location: - row: 180 - column: 0 + row: 181 + column: 4 end_location: row: 181 - column: 0 - parent: ~ + column: 24 + fix: + content: "" + location: + row: 180 + column: 0 + end_location: + row: 181 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D212_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D212_D.py.snap index 9c70c0e88fdab4..18b2544a0b7216 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D212_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D212_D.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: MultiLineSummaryFirstLine - body: Multi-line docstring summary should start at the first line - suggestion: Remove whitespace after opening quotes - fixable: true - location: - row: 129 - column: 4 - end_location: - row: 131 - column: 7 - fix: - content: "" +- - kind: + name: MultiLineSummaryFirstLine + body: Multi-line docstring summary should start at the first line + suggestion: Remove whitespace after opening quotes + fixable: true location: row: 129 - column: 7 - end_location: - row: 130 column: 4 - parent: ~ -- kind: - name: MultiLineSummaryFirstLine - body: Multi-line docstring summary should start at the first line - suggestion: Remove whitespace after opening quotes - fixable: true - location: - row: 597 - column: 4 - end_location: - row: 599 - column: 13 - fix: - content: "" + end_location: + row: 131 + column: 7 + fix: + content: "" + location: + row: 129 + column: 7 + end_location: + row: 130 + column: 4 + parent: ~ + - kind: + name: MultiLineSummaryFirstLine + body: Multi-line docstring summary should start at the first line + suggestion: Remove whitespace after opening quotes + fixable: true location: row: 597 - column: 7 + column: 4 end_location: row: 599 - column: 4 - parent: ~ -- kind: - name: MultiLineSummaryFirstLine - body: Multi-line docstring summary should start at the first line - suggestion: Remove whitespace after opening quotes - fixable: true - location: - row: 624 - column: 4 - end_location: - row: 626 - column: 14 - fix: - content: "" + column: 13 + fix: + content: "" + location: + row: 597 + column: 7 + end_location: + row: 599 + column: 4 + parent: ~ + - kind: + name: MultiLineSummaryFirstLine + body: Multi-line docstring summary should start at the first line + suggestion: Remove whitespace after opening quotes + fixable: true location: row: 624 - column: 7 + column: 4 end_location: row: 626 - column: 4 - parent: ~ + column: 14 + fix: + content: "" + location: + row: 624 + column: 7 + end_location: + row: 626 + column: 4 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D213_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D213_D.py.snap index f2db70d3655623..ea1ce30e8c491f 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D213_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D213_D.py.snap @@ -2,444 +2,444 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 200 - column: 4 - end_location: - row: 203 - column: 7 - fix: - content: "\n Summary." +- - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 200 - column: 7 + column: 4 end_location: - row: 200 - column: 15 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 210 - column: 4 - end_location: - row: 215 - column: 7 - fix: - content: "\n Summary." + row: 203 + column: 7 + fix: + content: "\n Summary." + location: + row: 200 + column: 7 + end_location: + row: 200 + column: 15 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 210 - column: 7 + column: 4 end_location: - row: 210 - column: 15 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 220 - column: 4 - end_location: - row: 224 - column: 7 - fix: - content: "\n Summary." + row: 215 + column: 7 + fix: + content: "\n Summary." + location: + row: 210 + column: 7 + end_location: + row: 210 + column: 15 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 220 - column: 7 + column: 4 end_location: - row: 220 - column: 15 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 230 - column: 4 - end_location: - row: 234 - column: 7 - fix: - content: "\n Summary." + row: 224 + column: 7 + fix: + content: "\n Summary." + location: + row: 220 + column: 7 + end_location: + row: 220 + column: 15 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 230 - column: 7 + column: 4 end_location: - row: 230 - column: 15 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 240 - column: 4 - end_location: - row: 244 - column: 3 - fix: - content: "\n Summary." + row: 234 + column: 7 + fix: + content: "\n Summary." + location: + row: 230 + column: 7 + end_location: + row: 230 + column: 15 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 240 - column: 7 + column: 4 end_location: - row: 240 - column: 15 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 250 - column: 4 - end_location: - row: 254 - column: 7 - fix: - content: "\n Summary." + row: 244 + column: 3 + fix: + content: "\n Summary." + location: + row: 240 + column: 7 + end_location: + row: 240 + column: 15 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 250 - column: 7 + column: 4 end_location: - row: 250 - column: 15 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 260 - column: 4 - end_location: - row: 264 - column: 11 - fix: - content: "\n Summary." + row: 254 + column: 7 + fix: + content: "\n Summary." + location: + row: 250 + column: 7 + end_location: + row: 250 + column: 15 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 260 - column: 7 + column: 4 end_location: - row: 260 - column: 15 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 270 - column: 4 - end_location: - row: 274 - column: 7 - fix: - content: "\n Summary." + row: 264 + column: 11 + fix: + content: "\n Summary." + location: + row: 260 + column: 7 + end_location: + row: 260 + column: 15 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 270 - column: 7 + column: 4 end_location: - row: 270 - column: 15 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 281 - column: 4 - end_location: - row: 283 - column: 19 - fix: - content: "\n Summary." + row: 274 + column: 7 + fix: + content: "\n Summary." + location: + row: 270 + column: 7 + end_location: + row: 270 + column: 15 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 281 - column: 7 + column: 4 end_location: - row: 281 - column: 15 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 299 - column: 4 - end_location: - row: 302 - column: 7 - fix: - content: "\n Whitespace at the beginning." + row: 283 + column: 19 + fix: + content: "\n Summary." + location: + row: 281 + column: 7 + end_location: + row: 281 + column: 15 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 299 - column: 7 + column: 4 end_location: - row: 299 - column: 36 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 343 - column: 4 - end_location: - row: 348 - column: 7 - fix: - content: "\n Exclude some backslashes from D301." + row: 302 + column: 7 + fix: + content: "\n Whitespace at the beginning." + location: + row: 299 + column: 7 + end_location: + row: 299 + column: 36 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 343 - column: 7 + column: 4 end_location: - row: 343 - column: 42 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 383 - column: 4 - end_location: - row: 386 - column: 7 - fix: - content: "\n First line." + row: 348 + column: 7 + fix: + content: "\n Exclude some backslashes from D301." + location: + row: 343 + column: 7 + end_location: + row: 343 + column: 42 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 383 - column: 7 + column: 4 end_location: - row: 383 - column: 18 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 392 - column: 4 - end_location: - row: 396 - column: 7 - fix: - content: "\n One liner." + row: 386 + column: 7 + fix: + content: "\n First line." + location: + row: 383 + column: 7 + end_location: + row: 383 + column: 18 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 392 - column: 7 + column: 4 end_location: - row: 392 - column: 17 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 438 - column: 36 - end_location: - row: 441 - column: 7 - fix: - content: "\n First Line." + row: 396 + column: 7 + fix: + content: "\n One liner." + location: + row: 392 + column: 7 + end_location: + row: 392 + column: 17 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 438 - column: 39 + column: 36 end_location: - row: 438 - column: 50 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 450 - column: 4 - end_location: - row: 454 - column: 7 - fix: - content: "\n Check for a bug where the previous function caused an assertion." + row: 441 + column: 7 + fix: + content: "\n First Line." + location: + row: 438 + column: 39 + end_location: + row: 438 + column: 50 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 450 - column: 7 + column: 4 end_location: - row: 450 - column: 71 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 526 - column: 4 - end_location: - row: 532 - column: 7 - fix: - content: "\n A Blah." + row: 454 + column: 7 + fix: + content: "\n Check for a bug where the previous function caused an assertion." + location: + row: 450 + column: 7 + end_location: + row: 450 + column: 71 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 526 - column: 7 + column: 4 end_location: - row: 526 - column: 14 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 546 - column: 4 - end_location: - row: 549 - column: 7 - fix: - content: "\n Leading space." + row: 532 + column: 7 + fix: + content: "\n A Blah." + location: + row: 526 + column: 7 + end_location: + row: 526 + column: 14 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 546 - column: 7 + column: 4 end_location: - row: 546 - column: 21 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 555 - column: 4 - end_location: - row: 558 - column: 7 - fix: - content: "\n Leading space." + row: 549 + column: 7 + fix: + content: "\n Leading space." + location: + row: 546 + column: 7 + end_location: + row: 546 + column: 21 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 555 - column: 7 + column: 4 end_location: - row: 555 - column: 21 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 568 - column: 4 - end_location: - row: 571 - column: 7 - fix: - content: "\n Trailing and leading space." + row: 558 + column: 7 + fix: + content: "\n Leading space." + location: + row: 555 + column: 7 + end_location: + row: 555 + column: 21 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 568 - column: 7 + column: 4 end_location: - row: 568 - column: 34 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 588 - column: 4 - end_location: - row: 590 - column: 21 - fix: - content: "\n Summary." + row: 571 + column: 7 + fix: + content: "\n Trailing and leading space." + location: + row: 568 + column: 7 + end_location: + row: 568 + column: 34 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 588 - column: 7 + column: 4 end_location: - row: 588 - column: 15 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 606 - column: 4 - end_location: - row: 608 - column: 7 - fix: - content: "\n Wrong." + row: 590 + column: 21 + fix: + content: "\n Summary." + location: + row: 588 + column: 7 + end_location: + row: 588 + column: 15 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 606 - column: 8 + column: 4 end_location: - row: 606 - column: 14 - parent: ~ -- kind: - name: MultiLineSummarySecondLine - body: Multi-line docstring summary should start at the second line - suggestion: Insert line break and indentation after opening quotes - fixable: true - location: - row: 615 - column: 4 - end_location: - row: 617 - column: 7 - fix: - content: "\n Wrong.\"" + row: 608 + column: 7 + fix: + content: "\n Wrong." + location: + row: 606 + column: 8 + end_location: + row: 606 + column: 14 + parent: ~ + - kind: + name: MultiLineSummarySecondLine + body: Multi-line docstring summary should start at the second line + suggestion: Insert line break and indentation after opening quotes + fixable: true location: row: 615 - column: 7 + column: 4 end_location: - row: 615 - column: 14 - parent: ~ + row: 617 + column: 7 + fix: + content: "\n Wrong.\"" + location: + row: 615 + column: 7 + end_location: + row: 615 + column: 14 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D214_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D214_sections.py.snap index 8dcab2b97fd7ae..99669bbd66a09b 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D214_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D214_sections.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: SectionNotOverIndented - body: "Section is over-indented (\"Returns\")" - suggestion: "Remove over-indentation from \"Returns\"" - fixable: true - location: - row: 135 - column: 4 - end_location: - row: 141 - column: 7 - fix: - content: " " +- - kind: + name: SectionNotOverIndented + body: "Section is over-indented (\"Returns\")" + suggestion: "Remove over-indentation from \"Returns\"" + fixable: true location: - row: 137 - column: 0 + row: 135 + column: 4 end_location: - row: 137 - column: 8 - parent: ~ + row: 141 + column: 7 + fix: + content: " " + location: + row: 137 + column: 0 + end_location: + row: 137 + column: 8 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D215_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D215_sections.py.snap index 400dbe7e934ff7..b4ffd680f51055 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D215_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D215_sections.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: SectionUnderlineNotOverIndented - body: "Section underline is over-indented (\"Returns\")" - suggestion: "Remove over-indentation from \"Returns\" underline" - fixable: true - location: - row: 147 - column: 4 - end_location: - row: 153 - column: 7 - fix: - content: " " +- - kind: + name: SectionUnderlineNotOverIndented + body: "Section underline is over-indented (\"Returns\")" + suggestion: "Remove over-indentation from \"Returns\" underline" + fixable: true location: - row: 150 - column: 0 + row: 147 + column: 4 end_location: - row: 150 - column: 9 - parent: ~ -- kind: - name: SectionUnderlineNotOverIndented - body: "Section underline is over-indented (\"Returns\")" - suggestion: "Remove over-indentation from \"Returns\" underline" - fixable: true - location: - row: 161 - column: 4 - end_location: - row: 165 - column: 7 - fix: - content: " " + row: 153 + column: 7 + fix: + content: " " + location: + row: 150 + column: 0 + end_location: + row: 150 + column: 9 + parent: ~ + - kind: + name: SectionUnderlineNotOverIndented + body: "Section underline is over-indented (\"Returns\")" + suggestion: "Remove over-indentation from \"Returns\" underline" + fixable: true location: - row: 164 - column: 0 + row: 161 + column: 4 end_location: - row: 164 - column: 9 - parent: ~ + row: 165 + column: 7 + fix: + content: " " + location: + row: 164 + column: 0 + end_location: + row: 164 + column: 9 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D300_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D300_D.py.snap index 4dc287cba5a3b4..da394eb55e87c0 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D300_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D300_D.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: TripleSingleQuotes - body: "Use triple double quotes `\"\"\"`" - suggestion: ~ - fixable: false - location: - row: 307 - column: 4 - end_location: - row: 307 - column: 19 - fix: ~ - parent: ~ -- kind: - name: TripleSingleQuotes - body: "Use triple double quotes `\"\"\"`" - suggestion: ~ - fixable: false - location: - row: 312 - column: 4 - end_location: - row: 312 - column: 19 - fix: ~ - parent: ~ -- kind: - name: TripleSingleQuotes - body: "Use triple double quotes `\"\"\"`" - suggestion: ~ - fixable: false - location: - row: 317 - column: 4 - end_location: - row: 317 - column: 15 - fix: ~ - parent: ~ -- kind: - name: TripleSingleQuotes - body: "Use triple double quotes `\"\"\"`" - suggestion: ~ - fixable: false - location: - row: 322 - column: 4 - end_location: - row: 322 - column: 15 - fix: ~ - parent: ~ -- kind: - name: TripleSingleQuotes - body: "Use triple double quotes `\"\"\"`" - suggestion: ~ - fixable: false - location: - row: 328 - column: 4 - end_location: - row: 328 - column: 16 - fix: ~ - parent: ~ +- - kind: + name: TripleSingleQuotes + body: "Use triple double quotes `\"\"\"`" + suggestion: ~ + fixable: false + location: + row: 307 + column: 4 + end_location: + row: 307 + column: 19 + fix: ~ + parent: ~ + - kind: + name: TripleSingleQuotes + body: "Use triple double quotes `\"\"\"`" + suggestion: ~ + fixable: false + location: + row: 312 + column: 4 + end_location: + row: 312 + column: 19 + fix: ~ + parent: ~ + - kind: + name: TripleSingleQuotes + body: "Use triple double quotes `\"\"\"`" + suggestion: ~ + fixable: false + location: + row: 317 + column: 4 + end_location: + row: 317 + column: 15 + fix: ~ + parent: ~ + - kind: + name: TripleSingleQuotes + body: "Use triple double quotes `\"\"\"`" + suggestion: ~ + fixable: false + location: + row: 322 + column: 4 + end_location: + row: 322 + column: 15 + fix: ~ + parent: ~ + - kind: + name: TripleSingleQuotes + body: "Use triple double quotes `\"\"\"`" + suggestion: ~ + fixable: false + location: + row: 328 + column: 4 + end_location: + row: 328 + column: 16 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D301_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D301_D.py.snap index e6f3d1a621373f..88438763b1f067 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D301_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D301_D.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: EscapeSequenceInDocstring - body: "Use `r\"\"\"` if any backslashes in a docstring" - suggestion: ~ - fixable: false - location: - row: 328 - column: 4 - end_location: - row: 328 - column: 16 - fix: ~ - parent: ~ -- kind: - name: EscapeSequenceInDocstring - body: "Use `r\"\"\"` if any backslashes in a docstring" - suggestion: ~ - fixable: false - location: - row: 333 - column: 4 - end_location: - row: 333 - column: 20 - fix: ~ - parent: ~ -- kind: - name: EscapeSequenceInDocstring - body: "Use `r\"\"\"` if any backslashes in a docstring" - suggestion: ~ - fixable: false - location: - row: 338 - column: 4 - end_location: - row: 338 - column: 21 - fix: ~ - parent: ~ +- - kind: + name: EscapeSequenceInDocstring + body: "Use `r\"\"\"` if any backslashes in a docstring" + suggestion: ~ + fixable: false + location: + row: 328 + column: 4 + end_location: + row: 328 + column: 16 + fix: ~ + parent: ~ + - kind: + name: EscapeSequenceInDocstring + body: "Use `r\"\"\"` if any backslashes in a docstring" + suggestion: ~ + fixable: false + location: + row: 333 + column: 4 + end_location: + row: 333 + column: 20 + fix: ~ + parent: ~ + - kind: + name: EscapeSequenceInDocstring + body: "Use `r\"\"\"` if any backslashes in a docstring" + suggestion: ~ + fixable: false + location: + row: 338 + column: 4 + end_location: + row: 338 + column: 21 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D.py.snap index bd473c0ef6b524..19f802229181ca 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D.py.snap @@ -2,284 +2,284 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 355 - column: 4 - end_location: - row: 355 - column: 17 - fix: - content: "." +- - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 355 - column: 14 + column: 4 end_location: row: 355 - column: 14 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 406 - column: 24 - end_location: - row: 406 - column: 39 - fix: - content: "." + column: 17 + fix: + content: "." + location: + row: 355 + column: 14 + end_location: + row: 355 + column: 14 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 406 - column: 36 + column: 24 end_location: row: 406 - column: 36 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 410 - column: 4 - end_location: - row: 410 - column: 24 - fix: - content: "." + column: 39 + fix: + content: "." + location: + row: 406 + column: 36 + end_location: + row: 406 + column: 36 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 410 - column: 21 + column: 4 end_location: row: 410 - column: 21 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 416 - column: 4 - end_location: - row: 416 - column: 24 - fix: - content: "." + column: 24 + fix: + content: "." + location: + row: 410 + column: 21 + end_location: + row: 410 + column: 21 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 416 - column: 21 + column: 4 end_location: row: 416 - column: 21 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 422 - column: 34 - end_location: - row: 422 - column: 49 - fix: - content: "." + column: 24 + fix: + content: "." + location: + row: 416 + column: 21 + end_location: + row: 416 + column: 21 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 422 - column: 46 + column: 34 end_location: row: 422 - column: 46 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 429 - column: 48 - end_location: - row: 429 - column: 63 - fix: - content: "." + column: 49 + fix: + content: "." + location: + row: 422 + column: 46 + end_location: + row: 422 + column: 46 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 429 - column: 60 + column: 48 end_location: row: 429 - column: 60 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 470 - column: 4 - end_location: - row: 470 - column: 24 - fix: - content: "." + column: 63 + fix: + content: "." + location: + row: 429 + column: 60 + end_location: + row: 429 + column: 60 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 470 - column: 21 + column: 4 end_location: row: 470 - column: 21 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 475 - column: 4 - end_location: - row: 475 - column: 24 - fix: - content: "." + column: 24 + fix: + content: "." + location: + row: 470 + column: 21 + end_location: + row: 470 + column: 21 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 475 - column: 21 + column: 4 end_location: row: 475 - column: 21 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 480 - column: 4 - end_location: - row: 480 - column: 24 - fix: - content: "." + column: 24 + fix: + content: "." + location: + row: 475 + column: 21 + end_location: + row: 475 + column: 21 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 480 - column: 21 + column: 4 end_location: row: 480 - column: 21 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 487 - column: 4 - end_location: - row: 487 - column: 24 - fix: - content: "." + column: 24 + fix: + content: "." + location: + row: 480 + column: 21 + end_location: + row: 480 + column: 21 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 487 - column: 21 + column: 4 end_location: row: 487 - column: 21 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 514 - column: 4 - end_location: - row: 514 - column: 33 - fix: - content: "." + column: 24 + fix: + content: "." + location: + row: 487 + column: 21 + end_location: + row: 487 + column: 21 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 514 - column: 30 + column: 4 end_location: row: 514 - column: 30 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 520 - column: 4 - end_location: - row: 520 - column: 32 - fix: - content: "." + column: 33 + fix: + content: "." + location: + row: 514 + column: 30 + end_location: + row: 514 + column: 30 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 520 - column: 29 + column: 4 end_location: row: 520 - column: 29 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 581 - column: 4 - end_location: - row: 581 - column: 51 - fix: - content: "." + column: 32 + fix: + content: "." + location: + row: 520 + column: 29 + end_location: + row: 520 + column: 29 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 581 - column: 47 + column: 4 end_location: row: 581 - column: 47 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 615 - column: 4 - end_location: - row: 617 - column: 7 - fix: - content: "." + column: 51 + fix: + content: "." + location: + row: 581 + column: 47 + end_location: + row: 581 + column: 47 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 615 - column: 14 + column: 4 end_location: - row: 615 - column: 14 - parent: ~ + row: 617 + column: 7 + fix: + content: "." + location: + row: 615 + column: 14 + end_location: + row: 615 + column: 14 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D400.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D400.py.snap index 008ea1efa6bdc1..bf5d55a927dbf1 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D400.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D400.py.snap @@ -2,244 +2,244 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 36 - fix: - content: "." +- - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 2 - column: 35 + column: 4 end_location: row: 2 - column: 35 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 7 - column: 4 - end_location: - row: 7 - column: 40 - fix: - content: "." + column: 36 + fix: + content: "." + location: + row: 2 + column: 35 + end_location: + row: 2 + column: 35 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 7 - column: 37 + column: 4 end_location: row: 7 - column: 37 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 12 - column: 4 - end_location: - row: 15 - column: 7 - fix: - content: "." + column: 40 + fix: + content: "." + location: + row: 7 + column: 37 + end_location: + row: 7 + column: 37 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: - row: 14 - column: 28 + row: 12 + column: 4 end_location: - row: 14 - column: 28 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 20 - column: 4 - end_location: - row: 20 - column: 40 - fix: - content: "." + row: 15 + column: 7 + fix: + content: "." + location: + row: 14 + column: 28 + end_location: + row: 14 + column: 28 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 20 - column: 37 + column: 4 end_location: row: 20 - column: 37 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 25 - column: 4 - end_location: - row: 27 - column: 31 - fix: - content: "." + column: 40 + fix: + content: "." + location: + row: 20 + column: 37 + end_location: + row: 20 + column: 37 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: - row: 27 - column: 28 + row: 25 + column: 4 end_location: row: 27 - column: 28 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 32 - column: 4 - end_location: - row: 34 - column: 52 - fix: - content: "." + column: 31 + fix: + content: "." + location: + row: 27 + column: 28 + end_location: + row: 27 + column: 28 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: - row: 34 - column: 48 + row: 32 + column: 4 end_location: row: 34 - column: 48 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 39 - column: 4 - end_location: - row: 39 - column: 37 - fix: - content: "." + column: 52 + fix: + content: "." + location: + row: 34 + column: 48 + end_location: + row: 34 + column: 48 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 39 - column: 36 + column: 4 end_location: row: 39 - column: 36 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 44 - column: 4 - end_location: - row: 44 - column: 41 - fix: - content: "." + column: 37 + fix: + content: "." + location: + row: 39 + column: 36 + end_location: + row: 39 + column: 36 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 44 - column: 38 + column: 4 end_location: row: 44 - column: 38 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 49 - column: 4 - end_location: - row: 52 - column: 7 - fix: - content: "." + column: 41 + fix: + content: "." + location: + row: 44 + column: 38 + end_location: + row: 44 + column: 38 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: - row: 51 - column: 28 + row: 49 + column: 4 end_location: - row: 51 - column: 28 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 57 - column: 4 - end_location: - row: 57 - column: 41 - fix: - content: "." + row: 52 + column: 7 + fix: + content: "." + location: + row: 51 + column: 28 + end_location: + row: 51 + column: 28 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: row: 57 - column: 38 + column: 4 end_location: row: 57 - column: 38 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 62 - column: 4 - end_location: - row: 64 - column: 31 - fix: - content: "." + column: 41 + fix: + content: "." + location: + row: 57 + column: 38 + end_location: + row: 57 + column: 38 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: - row: 64 - column: 28 + row: 62 + column: 4 end_location: row: 64 - column: 28 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 69 - column: 4 - end_location: - row: 71 - column: 52 - fix: - content: "." + column: 31 + fix: + content: "." + location: + row: 64 + column: 28 + end_location: + row: 64 + column: 28 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: - row: 71 - column: 48 + row: 69 + column: 4 end_location: row: 71 - column: 48 - parent: ~ + column: 52 + fix: + content: "." + location: + row: 71 + column: 48 + end_location: + row: 71 + column: 48 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D401_D401.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D401_D401.py.snap index 909f9a8459f331..fd7fab3e811c61 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D401_D401.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D401_D401.py.snap @@ -2,95 +2,95 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: NonImperativeMood - body: "First line of docstring should be in imperative mood: \"Returns foo.\"" - suggestion: ~ - fixable: false - location: - row: 10 - column: 4 - end_location: - row: 10 - column: 22 - fix: ~ - parent: ~ -- kind: - name: NonImperativeMood - body: "First line of docstring should be in imperative mood: \"Constructor for a foo.\"" - suggestion: ~ - fixable: false - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 32 - fix: ~ - parent: ~ -- kind: - name: NonImperativeMood - body: "First line of docstring should be in imperative mood: \"Constructor for a boa.\"" - suggestion: ~ - fixable: false - location: - row: 18 - column: 4 - end_location: - row: 22 - column: 7 - fix: ~ - parent: ~ -- kind: - name: NonImperativeMood - body: "First line of docstring should be in imperative mood: \"Runs something\"" - suggestion: ~ - fixable: false - location: - row: 26 - column: 4 - end_location: - row: 26 - column: 24 - fix: ~ - parent: ~ -- kind: - name: NonImperativeMood - body: "First line of docstring should be in imperative mood: \"Runs other things, nested\"" - suggestion: ~ - fixable: false - location: - row: 29 - column: 8 - end_location: - row: 29 - column: 39 - fix: ~ - parent: ~ -- kind: - name: NonImperativeMood - body: "First line of docstring should be in imperative mood: \"Writes a logical line that\"" - suggestion: ~ - fixable: false - location: - row: 35 - column: 4 - end_location: - row: 37 - column: 7 - fix: ~ - parent: ~ -- kind: - name: NonImperativeMood - body: "First line of docstring should be in imperative mood: \"This method docstring should be written in imperative mood.\"" - suggestion: ~ - fixable: false - location: - row: 74 - column: 8 - end_location: - row: 74 - column: 73 - fix: ~ - parent: ~ +- - kind: + name: NonImperativeMood + body: "First line of docstring should be in imperative mood: \"Returns foo.\"" + suggestion: ~ + fixable: false + location: + row: 10 + column: 4 + end_location: + row: 10 + column: 22 + fix: ~ + parent: ~ + - kind: + name: NonImperativeMood + body: "First line of docstring should be in imperative mood: \"Constructor for a foo.\"" + suggestion: ~ + fixable: false + location: + row: 14 + column: 4 + end_location: + row: 14 + column: 32 + fix: ~ + parent: ~ + - kind: + name: NonImperativeMood + body: "First line of docstring should be in imperative mood: \"Constructor for a boa.\"" + suggestion: ~ + fixable: false + location: + row: 18 + column: 4 + end_location: + row: 22 + column: 7 + fix: ~ + parent: ~ + - kind: + name: NonImperativeMood + body: "First line of docstring should be in imperative mood: \"Runs something\"" + suggestion: ~ + fixable: false + location: + row: 26 + column: 4 + end_location: + row: 26 + column: 24 + fix: ~ + parent: ~ + - kind: + name: NonImperativeMood + body: "First line of docstring should be in imperative mood: \"Runs other things, nested\"" + suggestion: ~ + fixable: false + location: + row: 29 + column: 8 + end_location: + row: 29 + column: 39 + fix: ~ + parent: ~ + - kind: + name: NonImperativeMood + body: "First line of docstring should be in imperative mood: \"Writes a logical line that\"" + suggestion: ~ + fixable: false + location: + row: 35 + column: 4 + end_location: + row: 37 + column: 7 + fix: ~ + parent: ~ + - kind: + name: NonImperativeMood + body: "First line of docstring should be in imperative mood: \"This method docstring should be written in imperative mood.\"" + suggestion: ~ + fixable: false + location: + row: 74 + column: 8 + end_location: + row: 74 + column: 73 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D402_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D402_D.py.snap index 05afd64c732dfe..6a3070816551a7 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D402_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D402_D.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: NoSignature - body: "First line should not be the function's signature" - suggestion: ~ - fixable: false - location: - row: 378 - column: 4 - end_location: - row: 378 - column: 30 - fix: ~ - parent: ~ +- - kind: + name: NoSignature + body: "First line should not be the function's signature" + suggestion: ~ + fixable: false + location: + row: 378 + column: 4 + end_location: + row: 378 + column: 30 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D403_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D403_D.py.snap index 9c3ea66b0e726d..685cba6bf6c9ea 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D403_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D403_D.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D404_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D404_D.py.snap index c59cd817b7e4b5..87f8e8f8b7ffa5 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D404_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D404_D.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: DocstringStartsWithThis - body: "First word of the docstring should not be \"This\"" - suggestion: ~ - fixable: false - location: - row: 631 - column: 4 - end_location: - row: 631 - column: 30 - fix: ~ - parent: ~ -- kind: - name: DocstringStartsWithThis - body: "First word of the docstring should not be \"This\"" - suggestion: ~ - fixable: false - location: - row: 636 - column: 4 - end_location: - row: 636 - column: 56 - fix: ~ - parent: ~ +- - kind: + name: DocstringStartsWithThis + body: "First word of the docstring should not be \"This\"" + suggestion: ~ + fixable: false + location: + row: 631 + column: 4 + end_location: + row: 631 + column: 30 + fix: ~ + parent: ~ + - kind: + name: DocstringStartsWithThis + body: "First word of the docstring should not be \"This\"" + suggestion: ~ + fixable: false + location: + row: 636 + column: 4 + end_location: + row: 636 + column: 56 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D405_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D405_sections.py.snap index 3d4224a17d0f8c..6f8533f679c76c 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D405_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D405_sections.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: CapitalizeSectionName - body: "Section name should be properly capitalized (\"returns\")" - suggestion: "Capitalize \"returns\"" - fixable: true - location: - row: 17 - column: 4 - end_location: - row: 23 - column: 7 - fix: - content: Returns +- - kind: + name: CapitalizeSectionName + body: "Section name should be properly capitalized (\"returns\")" + suggestion: "Capitalize \"returns\"" + fixable: true location: - row: 19 + row: 17 column: 4 end_location: - row: 19 - column: 11 - parent: ~ -- kind: - name: CapitalizeSectionName - body: "Section name should be properly capitalized (\"Short summary\")" - suggestion: "Capitalize \"Short summary\"" - fixable: true - location: - row: 207 - column: 4 - end_location: - row: 221 - column: 7 - fix: - content: Short Summary + row: 23 + column: 7 + fix: + content: Returns + location: + row: 19 + column: 4 + end_location: + row: 19 + column: 11 + parent: ~ + - kind: + name: CapitalizeSectionName + body: "Section name should be properly capitalized (\"Short summary\")" + suggestion: "Capitalize \"Short summary\"" + fixable: true location: - row: 209 + row: 207 column: 4 end_location: - row: 209 - column: 17 - parent: ~ + row: 221 + column: 7 + fix: + content: Short Summary + location: + row: 209 + column: 4 + end_location: + row: 209 + column: 17 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D406_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D406_sections.py.snap index 481d691e17953d..22ebe2dc329e6d 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D406_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D406_sections.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: NewLineAfterSectionName - body: "Section name should end with a newline (\"Returns\")" - suggestion: "Add newline after \"Returns\"" - fixable: true - location: - row: 30 - column: 4 - end_location: - row: 36 - column: 7 - fix: - content: "" +- - kind: + name: NewLineAfterSectionName + body: "Section name should end with a newline (\"Returns\")" + suggestion: "Add newline after \"Returns\"" + fixable: true location: - row: 32 - column: 11 + row: 30 + column: 4 end_location: - row: 32 - column: 12 - parent: ~ -- kind: - name: NewLineAfterSectionName - body: "Section name should end with a newline (\"Raises\")" - suggestion: "Add newline after \"Raises\"" - fixable: true - location: - row: 207 - column: 4 - end_location: - row: 221 - column: 7 - fix: - content: "" + row: 36 + column: 7 + fix: + content: "" + location: + row: 32 + column: 11 + end_location: + row: 32 + column: 12 + parent: ~ + - kind: + name: NewLineAfterSectionName + body: "Section name should end with a newline (\"Raises\")" + suggestion: "Add newline after \"Raises\"" + fixable: true location: - row: 218 - column: 10 + row: 207 + column: 4 end_location: - row: 218 - column: 11 - parent: ~ + row: 221 + column: 7 + fix: + content: "" + location: + row: 218 + column: 10 + end_location: + row: 218 + column: 11 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D407_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D407_sections.py.snap index 3bd6dcca59bb32..af147eb8b6ae44 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D407_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D407_sections.py.snap @@ -2,324 +2,324 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: DashedUnderlineAfterSection - body: "Missing dashed underline after section (\"Returns\")" - suggestion: "Add dashed line under \"Returns\"" - fixable: true - location: - row: 42 - column: 4 - end_location: - row: 47 - column: 7 - fix: - content: " -------\n" +- - kind: + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Returns\")" + suggestion: "Add dashed line under \"Returns\"" + fixable: true location: - row: 45 - column: 0 + row: 42 + column: 4 end_location: - row: 45 - column: 0 - parent: ~ -- kind: - name: DashedUnderlineAfterSection - body: "Missing dashed underline after section (\"Returns\")" - suggestion: "Add dashed line under \"Returns\"" - fixable: true - location: - row: 54 - column: 4 - end_location: - row: 58 - column: 7 - fix: - content: " -------\n" + row: 47 + column: 7 + fix: + content: " -------\n" + location: + row: 45 + column: 0 + end_location: + row: 45 + column: 0 + parent: ~ + - kind: + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Returns\")" + suggestion: "Add dashed line under \"Returns\"" + fixable: true location: - row: 57 - column: 0 + row: 54 + column: 4 end_location: - row: 57 - column: 0 - parent: ~ -- kind: - name: DashedUnderlineAfterSection - body: "Missing dashed underline after section (\"Raises\")" - suggestion: "Add dashed line under \"Raises\"" - fixable: true - location: - row: 207 - column: 4 - end_location: - row: 221 - column: 7 - fix: - content: " ------\n" + row: 58 + column: 7 + fix: + content: " -------\n" + location: + row: 57 + column: 0 + end_location: + row: 57 + column: 0 + parent: ~ + - kind: + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Raises\")" + suggestion: "Add dashed line under \"Raises\"" + fixable: true location: - row: 219 - column: 0 + row: 207 + column: 4 end_location: - row: 219 - column: 0 - parent: ~ -- kind: - name: DashedUnderlineAfterSection - body: "Missing dashed underline after section (\"Args\")" - suggestion: "Add dashed line under \"Args\"" - fixable: true - location: - row: 252 - column: 4 - end_location: - row: 262 - column: 7 - fix: - content: " ----\n" + row: 221 + column: 7 + fix: + content: " ------\n" + location: + row: 219 + column: 0 + end_location: + row: 219 + column: 0 + parent: ~ + - kind: + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + suggestion: "Add dashed line under \"Args\"" + fixable: true location: - row: 255 - column: 0 + row: 252 + column: 4 end_location: - row: 255 - column: 0 - parent: ~ -- kind: - name: DashedUnderlineAfterSection - body: "Missing dashed underline after section (\"Returns\")" - suggestion: "Add dashed line under \"Returns\"" - fixable: true - location: - row: 252 - column: 4 - end_location: - row: 262 - column: 7 - fix: - content: " -------\n" + row: 262 + column: 7 + fix: + content: " ----\n" + location: + row: 255 + column: 0 + end_location: + row: 255 + column: 0 + parent: ~ + - kind: + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Returns\")" + suggestion: "Add dashed line under \"Returns\"" + fixable: true location: - row: 258 - column: 0 + row: 252 + column: 4 end_location: - row: 258 - column: 0 - parent: ~ -- kind: - name: DashedUnderlineAfterSection - body: "Missing dashed underline after section (\"Raises\")" - suggestion: "Add dashed line under \"Raises\"" - fixable: true - location: - row: 252 - column: 4 - end_location: - row: 262 - column: 7 - fix: - content: " ------\n" + row: 262 + column: 7 + fix: + content: " -------\n" + location: + row: 258 + column: 0 + end_location: + row: 258 + column: 0 + parent: ~ + - kind: + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Raises\")" + suggestion: "Add dashed line under \"Raises\"" + fixable: true location: - row: 260 - column: 0 + row: 252 + column: 4 end_location: - row: 260 - column: 0 - parent: ~ -- kind: - name: DashedUnderlineAfterSection - body: "Missing dashed underline after section (\"Args\")" - suggestion: "Add dashed line under \"Args\"" - fixable: true - location: - row: 269 - column: 4 - end_location: - row: 274 - column: 7 - fix: - content: " ----\n" + row: 262 + column: 7 + fix: + content: " ------\n" + location: + row: 260 + column: 0 + end_location: + row: 260 + column: 0 + parent: ~ + - kind: + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + suggestion: "Add dashed line under \"Args\"" + fixable: true location: - row: 272 - column: 0 + row: 269 + column: 4 end_location: - row: 272 - column: 0 - parent: ~ -- kind: - name: DashedUnderlineAfterSection - body: "Missing dashed underline after section (\"Args\")" - suggestion: "Add dashed line under \"Args\"" - fixable: true - location: - row: 284 - column: 8 - end_location: - row: 292 - column: 11 - fix: - content: " ----\n" + row: 274 + column: 7 + fix: + content: " ----\n" + location: + row: 272 + column: 0 + end_location: + row: 272 + column: 0 + parent: ~ + - kind: + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + suggestion: "Add dashed line under \"Args\"" + fixable: true location: - row: 289 - column: 0 + row: 284 + column: 8 end_location: - row: 289 - column: 0 - parent: ~ -- kind: - name: DashedUnderlineAfterSection - body: "Missing dashed underline after section (\"Args\")" - suggestion: "Add dashed line under \"Args\"" - fixable: true - location: - row: 301 - column: 4 - end_location: - row: 306 - column: 7 - fix: - content: " ----\n" + row: 292 + column: 11 + fix: + content: " ----\n" + location: + row: 289 + column: 0 + end_location: + row: 289 + column: 0 + parent: ~ + - kind: + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + suggestion: "Add dashed line under \"Args\"" + fixable: true location: - row: 304 - column: 0 + row: 301 + column: 4 end_location: - row: 304 - column: 0 - parent: ~ -- kind: - name: DashedUnderlineAfterSection - body: "Missing dashed underline after section (\"Args\")" - suggestion: "Add dashed line under \"Args\"" - fixable: true - location: - row: 313 - column: 8 - end_location: - row: 319 - column: 11 - fix: - content: " ----\n" + row: 306 + column: 7 + fix: + content: " ----\n" + location: + row: 304 + column: 0 + end_location: + row: 304 + column: 0 + parent: ~ + - kind: + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + suggestion: "Add dashed line under \"Args\"" + fixable: true location: - row: 316 - column: 0 + row: 313 + column: 8 end_location: - row: 316 - column: 0 - parent: ~ -- kind: - name: DashedUnderlineAfterSection - body: "Missing dashed underline after section (\"Args\")" - suggestion: "Add dashed line under \"Args\"" - fixable: true - location: - row: 325 - column: 8 - end_location: - row: 330 - column: 11 - fix: - content: " ----\n" + row: 319 + column: 11 + fix: + content: " ----\n" + location: + row: 316 + column: 0 + end_location: + row: 316 + column: 0 + parent: ~ + - kind: + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + suggestion: "Add dashed line under \"Args\"" + fixable: true location: - row: 328 - column: 0 + row: 325 + column: 8 end_location: - row: 328 - column: 0 - parent: ~ -- kind: - name: DashedUnderlineAfterSection - body: "Missing dashed underline after section (\"Args\")" - suggestion: "Add dashed line under \"Args\"" - fixable: true - location: - row: 337 - column: 8 - end_location: - row: 343 - column: 11 - fix: - content: " ----\n" + row: 330 + column: 11 + fix: + content: " ----\n" + location: + row: 328 + column: 0 + end_location: + row: 328 + column: 0 + parent: ~ + - kind: + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + suggestion: "Add dashed line under \"Args\"" + fixable: true location: - row: 340 - column: 0 + row: 337 + column: 8 end_location: - row: 340 - column: 0 - parent: ~ -- kind: - name: DashedUnderlineAfterSection - body: "Missing dashed underline after section (\"Args\")" - suggestion: "Add dashed line under \"Args\"" - fixable: true - location: - row: 350 - column: 8 - end_location: - row: 355 - column: 11 - fix: - content: " ----\n" + row: 343 + column: 11 + fix: + content: " ----\n" + location: + row: 340 + column: 0 + end_location: + row: 340 + column: 0 + parent: ~ + - kind: + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + suggestion: "Add dashed line under \"Args\"" + fixable: true location: - row: 353 - column: 0 + row: 350 + column: 8 end_location: - row: 353 - column: 0 - parent: ~ -- kind: - name: DashedUnderlineAfterSection - body: "Missing dashed underline after section (\"Args\")" - suggestion: "Add dashed line under \"Args\"" - fixable: true - location: - row: 362 - column: 8 - end_location: - row: 367 - column: 11 - fix: - content: " ----\n" + row: 355 + column: 11 + fix: + content: " ----\n" + location: + row: 353 + column: 0 + end_location: + row: 353 + column: 0 + parent: ~ + - kind: + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + suggestion: "Add dashed line under \"Args\"" + fixable: true location: - row: 365 - column: 0 + row: 362 + column: 8 end_location: - row: 365 - column: 0 - parent: ~ -- kind: - name: DashedUnderlineAfterSection - body: "Missing dashed underline after section (\"Args\")" - suggestion: "Add dashed line under \"Args\"" - fixable: true - location: - row: 371 - column: 8 - end_location: - row: 382 - column: 11 - fix: - content: " ----\n" + row: 367 + column: 11 + fix: + content: " ----\n" + location: + row: 365 + column: 0 + end_location: + row: 365 + column: 0 + parent: ~ + - kind: + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + suggestion: "Add dashed line under \"Args\"" + fixable: true location: - row: 374 - column: 0 + row: 371 + column: 8 end_location: - row: 374 - column: 0 - parent: ~ -- kind: - name: DashedUnderlineAfterSection - body: "Missing dashed underline after section (\"Args\")" - suggestion: "Add dashed line under \"Args\"" - fixable: true - location: - row: 490 - column: 8 - end_location: - row: 497 - column: 11 - fix: - content: " ----\n" + row: 382 + column: 11 + fix: + content: " ----\n" + location: + row: 374 + column: 0 + end_location: + row: 374 + column: 0 + parent: ~ + - kind: + name: DashedUnderlineAfterSection + body: "Missing dashed underline after section (\"Args\")" + suggestion: "Add dashed line under \"Args\"" + fixable: true location: - row: 495 - column: 0 + row: 490 + column: 8 end_location: - row: 495 - column: 0 - parent: ~ + row: 497 + column: 11 + fix: + content: " ----\n" + location: + row: 495 + column: 0 + end_location: + row: 495 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D408_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D408_sections.py.snap index 5b22ddd978b5b7..d8e81096221e5c 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D408_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D408_sections.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: SectionUnderlineAfterName - body: "Section underline should be in the line following the section's name (\"Returns\")" - suggestion: "Add underline to \"Returns\"" - fixable: true - location: - row: 85 - column: 4 - end_location: - row: 92 - column: 7 - fix: - content: "" +- - kind: + name: SectionUnderlineAfterName + body: "Section underline should be in the line following the section's name (\"Returns\")" + suggestion: "Add underline to \"Returns\"" + fixable: true location: - row: 88 - column: 0 + row: 85 + column: 4 end_location: - row: 89 - column: 0 - parent: ~ + row: 92 + column: 7 + fix: + content: "" + location: + row: 88 + column: 0 + end_location: + row: 89 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D409_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D409_sections.py.snap index 79114888565071..6b0e35ef34e883 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D409_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D409_sections.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: SectionUnderlineMatchesSectionLength - body: "Section underline should match the length of its name (\"Returns\")" - suggestion: "Adjust underline length to match \"Returns\"" - fixable: true - location: - row: 99 - column: 4 - end_location: - row: 105 - column: 7 - fix: - content: " -------\n" +- - kind: + name: SectionUnderlineMatchesSectionLength + body: "Section underline should match the length of its name (\"Returns\")" + suggestion: "Adjust underline length to match \"Returns\"" + fixable: true location: - row: 102 - column: 0 + row: 99 + column: 4 end_location: - row: 103 - column: 0 - parent: ~ -- kind: - name: SectionUnderlineMatchesSectionLength - body: "Section underline should match the length of its name (\"Returns\")" - suggestion: "Adjust underline length to match \"Returns\"" - fixable: true - location: - row: 207 - column: 4 - end_location: - row: 221 - column: 7 - fix: - content: " -------\n" + row: 105 + column: 7 + fix: + content: " -------\n" + location: + row: 102 + column: 0 + end_location: + row: 103 + column: 0 + parent: ~ + - kind: + name: SectionUnderlineMatchesSectionLength + body: "Section underline should match the length of its name (\"Returns\")" + suggestion: "Adjust underline length to match \"Returns\"" + fixable: true location: - row: 216 - column: 0 + row: 207 + column: 4 end_location: - row: 217 - column: 0 - parent: ~ + row: 221 + column: 7 + fix: + content: " -------\n" + location: + row: 216 + column: 0 + end_location: + row: 217 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D410_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D410_sections.py.snap index eb1033ce455951..2609fc72e7af0b 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D410_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D410_sections.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: BlankLineAfterSection - body: "Missing blank line after section (\"Returns\")" - suggestion: "Add blank line after \"Returns\"" - fixable: true - location: - row: 67 - column: 4 - end_location: - row: 78 - column: 7 - fix: - content: "\n" +- - kind: + name: BlankLineAfterSection + body: "Missing blank line after section (\"Returns\")" + suggestion: "Add blank line after \"Returns\"" + fixable: true location: - row: 71 - column: 0 + row: 67 + column: 4 end_location: - row: 71 - column: 0 - parent: ~ -- kind: - name: BlankLineAfterSection - body: "Missing blank line after section (\"Returns\")" - suggestion: "Add blank line after \"Returns\"" - fixable: true - location: - row: 207 - column: 4 - end_location: - row: 221 - column: 7 - fix: - content: "\n" + row: 78 + column: 7 + fix: + content: "\n" + location: + row: 71 + column: 0 + end_location: + row: 71 + column: 0 + parent: ~ + - kind: + name: BlankLineAfterSection + body: "Missing blank line after section (\"Returns\")" + suggestion: "Add blank line after \"Returns\"" + fixable: true location: - row: 218 - column: 0 + row: 207 + column: 4 end_location: - row: 218 - column: 0 - parent: ~ + row: 221 + column: 7 + fix: + content: "\n" + location: + row: 218 + column: 0 + end_location: + row: 218 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D411_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D411_sections.py.snap index c95cb8fd6ab9c2..08dd49bc9e06c3 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D411_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D411_sections.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: BlankLineBeforeSection - body: "Missing blank line before section (\"Yields\")" - suggestion: "Add blank line before \"Yields\"" - fixable: true - location: - row: 67 - column: 4 - end_location: - row: 78 - column: 7 - fix: - content: "\n" +- - kind: + name: BlankLineBeforeSection + body: "Missing blank line before section (\"Yields\")" + suggestion: "Add blank line before \"Yields\"" + fixable: true location: - row: 71 - column: 0 + row: 67 + column: 4 end_location: - row: 71 - column: 0 - parent: ~ -- kind: - name: BlankLineBeforeSection - body: "Missing blank line before section (\"Returns\")" - suggestion: "Add blank line before \"Returns\"" - fixable: true - location: - row: 122 - column: 4 - end_location: - row: 129 - column: 7 - fix: - content: "\n" + row: 78 + column: 7 + fix: + content: "\n" + location: + row: 71 + column: 0 + end_location: + row: 71 + column: 0 + parent: ~ + - kind: + name: BlankLineBeforeSection + body: "Missing blank line before section (\"Returns\")" + suggestion: "Add blank line before \"Returns\"" + fixable: true location: - row: 125 - column: 0 + row: 122 + column: 4 end_location: - row: 125 - column: 0 - parent: ~ -- kind: - name: BlankLineBeforeSection - body: "Missing blank line before section (\"Raises\")" - suggestion: "Add blank line before \"Raises\"" - fixable: true - location: - row: 207 - column: 4 - end_location: - row: 221 - column: 7 - fix: - content: "\n" + row: 129 + column: 7 + fix: + content: "\n" + location: + row: 125 + column: 0 + end_location: + row: 125 + column: 0 + parent: ~ + - kind: + name: BlankLineBeforeSection + body: "Missing blank line before section (\"Raises\")" + suggestion: "Add blank line before \"Raises\"" + fixable: true location: - row: 218 - column: 0 + row: 207 + column: 4 end_location: - row: 218 - column: 0 - parent: ~ + row: 221 + column: 7 + fix: + content: "\n" + location: + row: 218 + column: 0 + end_location: + row: 218 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D412_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D412_sections.py.snap index 0b79d1274993b4..b830e40cfeef41 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D412_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D412_sections.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: NoBlankLinesBetweenHeaderAndContent - body: "No blank lines allowed between a section header and its content (\"Short summary\")" - suggestion: Remove blank line(s) - fixable: true - location: - row: 207 - column: 4 - end_location: - row: 221 - column: 7 - fix: - content: "" +- - kind: + name: NoBlankLinesBetweenHeaderAndContent + body: "No blank lines allowed between a section header and its content (\"Short summary\")" + suggestion: Remove blank line(s) + fixable: true location: - row: 211 - column: 0 + row: 207 + column: 4 end_location: - row: 212 - column: 0 - parent: ~ + row: 221 + column: 7 + fix: + content: "" + location: + row: 211 + column: 0 + end_location: + row: 212 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D413_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D413_sections.py.snap index 9c3ea66b0e726d..685cba6bf6c9ea 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D413_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D413_sections.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D414_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D414_sections.py.snap index a08fe926ce8d7c..9f6bf7301f90af 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D414_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D414_sections.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: EmptyDocstringSection - body: "Section has no content (\"Returns\")" - suggestion: ~ - fixable: false - location: - row: 54 - column: 4 - end_location: - row: 58 - column: 7 - fix: ~ - parent: ~ -- kind: - name: EmptyDocstringSection - body: "Section has no content (\"Returns\")" - suggestion: ~ - fixable: false - location: - row: 67 - column: 4 - end_location: - row: 78 - column: 7 - fix: ~ - parent: ~ -- kind: - name: EmptyDocstringSection - body: "Section has no content (\"Yields\")" - suggestion: ~ - fixable: false - location: - row: 67 - column: 4 - end_location: - row: 78 - column: 7 - fix: ~ - parent: ~ -- kind: - name: EmptyDocstringSection - body: "Section has no content (\"Returns\")" - suggestion: ~ - fixable: false - location: - row: 161 - column: 4 - end_location: - row: 165 - column: 7 - fix: ~ - parent: ~ -- kind: - name: EmptyDocstringSection - body: "Section has no content (\"Returns\")" - suggestion: ~ - fixable: false - location: - row: 252 - column: 4 - end_location: - row: 262 - column: 7 - fix: ~ - parent: ~ +- - kind: + name: EmptyDocstringSection + body: "Section has no content (\"Returns\")" + suggestion: ~ + fixable: false + location: + row: 54 + column: 4 + end_location: + row: 58 + column: 7 + fix: ~ + parent: ~ + - kind: + name: EmptyDocstringSection + body: "Section has no content (\"Returns\")" + suggestion: ~ + fixable: false + location: + row: 67 + column: 4 + end_location: + row: 78 + column: 7 + fix: ~ + parent: ~ + - kind: + name: EmptyDocstringSection + body: "Section has no content (\"Yields\")" + suggestion: ~ + fixable: false + location: + row: 67 + column: 4 + end_location: + row: 78 + column: 7 + fix: ~ + parent: ~ + - kind: + name: EmptyDocstringSection + body: "Section has no content (\"Returns\")" + suggestion: ~ + fixable: false + location: + row: 161 + column: 4 + end_location: + row: 165 + column: 7 + fix: ~ + parent: ~ + - kind: + name: EmptyDocstringSection + body: "Section has no content (\"Returns\")" + suggestion: ~ + fixable: false + location: + row: 252 + column: 4 + end_location: + row: 262 + column: 7 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D415_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D415_D.py.snap index ae9b6e13301c42..f45baf99b3d385 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D415_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D415_D.py.snap @@ -2,264 +2,264 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: EndsInPunctuation - body: "First line should end with a period, question mark, or exclamation point" - suggestion: Add closing punctuation - fixable: true - location: - row: 355 - column: 4 - end_location: - row: 355 - column: 17 - fix: - content: "." +- - kind: + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + suggestion: Add closing punctuation + fixable: true location: row: 355 - column: 14 + column: 4 end_location: row: 355 - column: 14 - parent: ~ -- kind: - name: EndsInPunctuation - body: "First line should end with a period, question mark, or exclamation point" - suggestion: Add closing punctuation - fixable: true - location: - row: 406 - column: 24 - end_location: - row: 406 - column: 39 - fix: - content: "." + column: 17 + fix: + content: "." + location: + row: 355 + column: 14 + end_location: + row: 355 + column: 14 + parent: ~ + - kind: + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + suggestion: Add closing punctuation + fixable: true location: row: 406 - column: 36 + column: 24 end_location: row: 406 - column: 36 - parent: ~ -- kind: - name: EndsInPunctuation - body: "First line should end with a period, question mark, or exclamation point" - suggestion: Add closing punctuation - fixable: true - location: - row: 410 - column: 4 - end_location: - row: 410 - column: 24 - fix: - content: "." + column: 39 + fix: + content: "." + location: + row: 406 + column: 36 + end_location: + row: 406 + column: 36 + parent: ~ + - kind: + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + suggestion: Add closing punctuation + fixable: true location: row: 410 - column: 21 + column: 4 end_location: row: 410 - column: 21 - parent: ~ -- kind: - name: EndsInPunctuation - body: "First line should end with a period, question mark, or exclamation point" - suggestion: Add closing punctuation - fixable: true - location: - row: 416 - column: 4 - end_location: - row: 416 - column: 24 - fix: - content: "." + column: 24 + fix: + content: "." + location: + row: 410 + column: 21 + end_location: + row: 410 + column: 21 + parent: ~ + - kind: + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + suggestion: Add closing punctuation + fixable: true location: row: 416 - column: 21 + column: 4 end_location: row: 416 - column: 21 - parent: ~ -- kind: - name: EndsInPunctuation - body: "First line should end with a period, question mark, or exclamation point" - suggestion: Add closing punctuation - fixable: true - location: - row: 422 - column: 34 - end_location: - row: 422 - column: 49 - fix: - content: "." + column: 24 + fix: + content: "." + location: + row: 416 + column: 21 + end_location: + row: 416 + column: 21 + parent: ~ + - kind: + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + suggestion: Add closing punctuation + fixable: true location: row: 422 - column: 46 + column: 34 end_location: row: 422 - column: 46 - parent: ~ -- kind: - name: EndsInPunctuation - body: "First line should end with a period, question mark, or exclamation point" - suggestion: Add closing punctuation - fixable: true - location: - row: 429 - column: 48 - end_location: - row: 429 - column: 63 - fix: - content: "." + column: 49 + fix: + content: "." + location: + row: 422 + column: 46 + end_location: + row: 422 + column: 46 + parent: ~ + - kind: + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + suggestion: Add closing punctuation + fixable: true location: row: 429 - column: 60 + column: 48 end_location: row: 429 - column: 60 - parent: ~ -- kind: - name: EndsInPunctuation - body: "First line should end with a period, question mark, or exclamation point" - suggestion: Add closing punctuation - fixable: true - location: - row: 470 - column: 4 - end_location: - row: 470 - column: 24 - fix: - content: "." + column: 63 + fix: + content: "." + location: + row: 429 + column: 60 + end_location: + row: 429 + column: 60 + parent: ~ + - kind: + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + suggestion: Add closing punctuation + fixable: true location: row: 470 - column: 21 + column: 4 end_location: row: 470 - column: 21 - parent: ~ -- kind: - name: EndsInPunctuation - body: "First line should end with a period, question mark, or exclamation point" - suggestion: Add closing punctuation - fixable: true - location: - row: 475 - column: 4 - end_location: - row: 475 - column: 24 - fix: - content: "." + column: 24 + fix: + content: "." + location: + row: 470 + column: 21 + end_location: + row: 470 + column: 21 + parent: ~ + - kind: + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + suggestion: Add closing punctuation + fixable: true location: row: 475 - column: 21 + column: 4 end_location: row: 475 - column: 21 - parent: ~ -- kind: - name: EndsInPunctuation - body: "First line should end with a period, question mark, or exclamation point" - suggestion: Add closing punctuation - fixable: true - location: - row: 480 - column: 4 - end_location: - row: 480 - column: 24 - fix: - content: "." + column: 24 + fix: + content: "." + location: + row: 475 + column: 21 + end_location: + row: 475 + column: 21 + parent: ~ + - kind: + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + suggestion: Add closing punctuation + fixable: true location: row: 480 - column: 21 + column: 4 end_location: row: 480 - column: 21 - parent: ~ -- kind: - name: EndsInPunctuation - body: "First line should end with a period, question mark, or exclamation point" - suggestion: Add closing punctuation - fixable: true - location: - row: 487 - column: 4 - end_location: - row: 487 - column: 24 - fix: - content: "." + column: 24 + fix: + content: "." + location: + row: 480 + column: 21 + end_location: + row: 480 + column: 21 + parent: ~ + - kind: + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + suggestion: Add closing punctuation + fixable: true location: row: 487 - column: 21 + column: 4 end_location: row: 487 - column: 21 - parent: ~ -- kind: - name: EndsInPunctuation - body: "First line should end with a period, question mark, or exclamation point" - suggestion: Add closing punctuation - fixable: true - location: - row: 520 - column: 4 - end_location: - row: 520 - column: 32 - fix: - content: "." + column: 24 + fix: + content: "." + location: + row: 487 + column: 21 + end_location: + row: 487 + column: 21 + parent: ~ + - kind: + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + suggestion: Add closing punctuation + fixable: true location: row: 520 - column: 29 + column: 4 end_location: row: 520 - column: 29 - parent: ~ -- kind: - name: EndsInPunctuation - body: "First line should end with a period, question mark, or exclamation point" - suggestion: Add closing punctuation - fixable: true - location: - row: 581 - column: 4 - end_location: - row: 581 - column: 51 - fix: - content: "." + column: 32 + fix: + content: "." + location: + row: 520 + column: 29 + end_location: + row: 520 + column: 29 + parent: ~ + - kind: + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + suggestion: Add closing punctuation + fixable: true location: row: 581 - column: 47 + column: 4 end_location: row: 581 - column: 47 - parent: ~ -- kind: - name: EndsInPunctuation - body: "First line should end with a period, question mark, or exclamation point" - suggestion: Add closing punctuation - fixable: true - location: - row: 615 - column: 4 - end_location: - row: 617 - column: 7 - fix: - content: "." + column: 51 + fix: + content: "." + location: + row: 581 + column: 47 + end_location: + row: 581 + column: 47 + parent: ~ + - kind: + name: EndsInPunctuation + body: "First line should end with a period, question mark, or exclamation point" + suggestion: Add closing punctuation + fixable: true location: row: 615 - column: 14 + column: 4 end_location: - row: 615 - column: 14 - parent: ~ + row: 617 + column: 7 + fix: + content: "." + location: + row: 615 + column: 14 + end_location: + row: 615 + column: 14 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D416_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D416_D.py.snap index 9c3ea66b0e726d..685cba6bf6c9ea 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D416_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D416_D.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_canonical_google_examples.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_canonical_google_examples.py.snap index 9c3ea66b0e726d..685cba6bf6c9ea 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_canonical_google_examples.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_canonical_google_examples.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_canonical_numpy_examples.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_canonical_numpy_examples.py.snap index 9c3ea66b0e726d..685cba6bf6c9ea 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_canonical_numpy_examples.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_canonical_numpy_examples.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_sections.py.snap index b5acbbc86234af..19169da11d2bf7 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_sections.py.snap @@ -2,147 +2,147 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: UndocumentedParam - body: "Missing argument description in the docstring: `y`" - suggestion: ~ - fixable: false - location: - row: 283 - column: 8 - end_location: - row: 283 - column: 11 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument description in the docstring: `y`" - suggestion: ~ - fixable: false - location: - row: 300 - column: 4 - end_location: - row: 300 - column: 28 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument descriptions in the docstring: `test`, `y`, `z`" - suggestion: ~ - fixable: false - location: - row: 324 - column: 8 - end_location: - row: 324 - column: 25 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument descriptions in the docstring: `test`, `y`, `z`" - suggestion: ~ - fixable: false - location: - row: 336 - column: 8 - end_location: - row: 336 - column: 38 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument descriptions in the docstring: `a`, `y`, `z`" - suggestion: ~ - fixable: false - location: - row: 349 - column: 8 - end_location: - row: 349 - column: 39 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument descriptions in the docstring: `a`, `b`" - suggestion: ~ - fixable: false - location: - row: 361 - column: 8 - end_location: - row: 361 - column: 30 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument description in the docstring: `y`" - suggestion: ~ - fixable: false - location: - row: 389 - column: 4 - end_location: - row: 389 - column: 27 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument descriptions in the docstring: `test`, `y`, `z`" - suggestion: ~ - fixable: false - location: - row: 425 - column: 8 - end_location: - row: 425 - column: 25 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument descriptions in the docstring: `test`, `y`, `z`" - suggestion: ~ - fixable: false - location: - row: 440 - column: 8 - end_location: - row: 440 - column: 38 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument descriptions in the docstring: `a`, `z`" - suggestion: ~ - fixable: false - location: - row: 459 - column: 8 - end_location: - row: 459 - column: 39 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument description in the docstring: `y`" - suggestion: ~ - fixable: false - location: - row: 489 - column: 8 - end_location: - row: 489 - column: 29 - fix: ~ - parent: ~ +- - kind: + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + suggestion: ~ + fixable: false + location: + row: 283 + column: 8 + end_location: + row: 283 + column: 11 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + suggestion: ~ + fixable: false + location: + row: 300 + column: 4 + end_location: + row: 300 + column: 28 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `test`, `y`, `z`" + suggestion: ~ + fixable: false + location: + row: 324 + column: 8 + end_location: + row: 324 + column: 25 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `test`, `y`, `z`" + suggestion: ~ + fixable: false + location: + row: 336 + column: 8 + end_location: + row: 336 + column: 38 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `a`, `y`, `z`" + suggestion: ~ + fixable: false + location: + row: 349 + column: 8 + end_location: + row: 349 + column: 39 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `a`, `b`" + suggestion: ~ + fixable: false + location: + row: 361 + column: 8 + end_location: + row: 361 + column: 30 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + suggestion: ~ + fixable: false + location: + row: 389 + column: 4 + end_location: + row: 389 + column: 27 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `test`, `y`, `z`" + suggestion: ~ + fixable: false + location: + row: 425 + column: 8 + end_location: + row: 425 + column: 25 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `test`, `y`, `z`" + suggestion: ~ + fixable: false + location: + row: 440 + column: 8 + end_location: + row: 440 + column: 38 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `a`, `z`" + suggestion: ~ + fixable: false + location: + row: 459 + column: 8 + end_location: + row: 459 + column: 39 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + suggestion: ~ + fixable: false + location: + row: 489 + column: 8 + end_location: + row: 489 + column: 29 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D418_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D418_D.py.snap index 574d074691e214..7e5c1b3eeb7961 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D418_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D418_D.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: OverloadWithDocstring - body: "Function decorated with `@overload` shouldn't contain a docstring" - suggestion: ~ - fixable: false - location: - row: 34 - column: 8 - end_location: - row: 34 - column: 25 - fix: ~ - parent: ~ -- kind: - name: OverloadWithDocstring - body: "Function decorated with `@overload` shouldn't contain a docstring" - suggestion: ~ - fixable: false - location: - row: 90 - column: 8 - end_location: - row: 90 - column: 30 - fix: ~ - parent: ~ -- kind: - name: OverloadWithDocstring - body: "Function decorated with `@overload` shouldn't contain a docstring" - suggestion: ~ - fixable: false - location: - row: 110 - column: 4 - end_location: - row: 110 - column: 19 - fix: ~ - parent: ~ +- - kind: + name: OverloadWithDocstring + body: "Function decorated with `@overload` shouldn't contain a docstring" + suggestion: ~ + fixable: false + location: + row: 34 + column: 8 + end_location: + row: 34 + column: 25 + fix: ~ + parent: ~ + - kind: + name: OverloadWithDocstring + body: "Function decorated with `@overload` shouldn't contain a docstring" + suggestion: ~ + fixable: false + location: + row: 90 + column: 8 + end_location: + row: 90 + column: 30 + fix: ~ + parent: ~ + - kind: + name: OverloadWithDocstring + body: "Function decorated with `@overload` shouldn't contain a docstring" + suggestion: ~ + fixable: false + location: + row: 110 + column: 4 + end_location: + row: 110 + column: 19 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D419_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D419_D.py.snap index 3904d446a908fa..9173e11c3b403e 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D419_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D419_D.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: EmptyDocstring - body: Docstring is empty - suggestion: ~ - fixable: false - location: - row: 20 - column: 8 - end_location: - row: 20 - column: 14 - fix: ~ - parent: ~ -- kind: - name: EmptyDocstring - body: Docstring is empty - suggestion: ~ - fixable: false - location: - row: 74 - column: 4 - end_location: - row: 74 - column: 11 - fix: ~ - parent: ~ -- kind: - name: EmptyDocstring - body: Docstring is empty - suggestion: ~ - fixable: false - location: - row: 80 - column: 8 - end_location: - row: 80 - column: 10 - fix: ~ - parent: ~ +- - kind: + name: EmptyDocstring + body: Docstring is empty + suggestion: ~ + fixable: false + location: + row: 20 + column: 8 + end_location: + row: 20 + column: 14 + fix: ~ + parent: ~ + - kind: + name: EmptyDocstring + body: Docstring is empty + suggestion: ~ + fixable: false + location: + row: 74 + column: 4 + end_location: + row: 74 + column: 11 + fix: ~ + parent: ~ + - kind: + name: EmptyDocstring + body: Docstring is empty + suggestion: ~ + fixable: false + location: + row: 80 + column: 8 + end_location: + row: 80 + column: 10 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__bom.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__bom.snap index 87dedbc2c4190b..dcc58c620cff68 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__bom.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__bom.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: TripleSingleQuotes - body: "Use triple double quotes `\"\"\"`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 29 - fix: ~ - parent: ~ +- - kind: + name: TripleSingleQuotes + body: "Use triple double quotes `\"\"\"`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 29 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d209_d400.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d209_d400.snap index 01db548f2ac7c0..993c6458ffd934 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d209_d400.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d209_d400.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: NewLineAfterLastParagraph - body: Multi-line docstring closing quotes should be on a separate line - suggestion: Move closing quotes to new line - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 3 - column: 72 - fix: - content: "\n " +- - kind: + name: NewLineAfterLastParagraph + body: Multi-line docstring closing quotes should be on a separate line + suggestion: Move closing quotes to new line + fixable: true location: - row: 3 - column: 69 + row: 2 + column: 4 end_location: row: 3 - column: 69 - parent: ~ -- kind: - name: EndsInPeriod - body: First line should end with a period - suggestion: Add period - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 3 - column: 72 - fix: - content: "." + column: 72 + fix: + content: "\n " + location: + row: 3 + column: 69 + end_location: + row: 3 + column: 69 + parent: ~ + - kind: + name: EndsInPeriod + body: First line should end with a period + suggestion: Add period + fixable: true location: - row: 3 - column: 69 + row: 2 + column: 4 end_location: row: 3 - column: 69 - parent: ~ + column: 72 + fix: + content: "." + location: + row: 3 + column: 69 + end_location: + row: 3 + column: 69 + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_google.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_google.snap index 092c96dde8a487..e90afb861c364e 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_google.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_google.snap @@ -2,121 +2,121 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: UndocumentedParam - body: "Missing argument descriptions in the docstring: `y`, `z`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 4 - end_location: - row: 1 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument descriptions in the docstring: `y`, `z`" - suggestion: ~ - fixable: false - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument descriptions in the docstring: `y`, `z`" - suggestion: ~ - fixable: false - location: - row: 27 - column: 4 - end_location: - row: 27 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument descriptions in the docstring: `y`, `z`" - suggestion: ~ - fixable: false - location: - row: 39 - column: 4 - end_location: - row: 39 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument description in the docstring: `y`" - suggestion: ~ - fixable: false - location: - row: 52 - column: 4 - end_location: - row: 52 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument description in the docstring: `y`" - suggestion: ~ - fixable: false - location: - row: 65 - column: 4 - end_location: - row: 65 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument description in the docstring: `y`" - suggestion: ~ - fixable: false - location: - row: 77 - column: 4 - end_location: - row: 77 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument description in the docstring: `x`" - suggestion: ~ - fixable: false - location: - row: 98 - column: 4 - end_location: - row: 98 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument description in the docstring: `*args`" - suggestion: ~ - fixable: false - location: - row: 108 - column: 4 - end_location: - row: 108 - column: 5 - fix: ~ - parent: ~ +- - kind: + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `y`, `z`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 4 + end_location: + row: 1 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `y`, `z`" + suggestion: ~ + fixable: false + location: + row: 14 + column: 4 + end_location: + row: 14 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `y`, `z`" + suggestion: ~ + fixable: false + location: + row: 27 + column: 4 + end_location: + row: 27 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `y`, `z`" + suggestion: ~ + fixable: false + location: + row: 39 + column: 4 + end_location: + row: 39 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + suggestion: ~ + fixable: false + location: + row: 52 + column: 4 + end_location: + row: 52 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + suggestion: ~ + fixable: false + location: + row: 65 + column: 4 + end_location: + row: 65 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + suggestion: ~ + fixable: false + location: + row: 77 + column: 4 + end_location: + row: 77 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument description in the docstring: `x`" + suggestion: ~ + fixable: false + location: + row: 98 + column: 4 + end_location: + row: 98 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument description in the docstring: `*args`" + suggestion: ~ + fixable: false + location: + row: 108 + column: 4 + end_location: + row: 108 + column: 5 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_numpy.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_numpy.snap index 9c3ea66b0e726d..685cba6bf6c9ea 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_numpy.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_numpy.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pydocstyle/mod.rs +source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_unspecified.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_unspecified.snap index 092c96dde8a487..e90afb861c364e 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_unspecified.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_unspecified.snap @@ -2,121 +2,121 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs expression: diagnostics --- -- kind: - name: UndocumentedParam - body: "Missing argument descriptions in the docstring: `y`, `z`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 4 - end_location: - row: 1 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument descriptions in the docstring: `y`, `z`" - suggestion: ~ - fixable: false - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument descriptions in the docstring: `y`, `z`" - suggestion: ~ - fixable: false - location: - row: 27 - column: 4 - end_location: - row: 27 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument descriptions in the docstring: `y`, `z`" - suggestion: ~ - fixable: false - location: - row: 39 - column: 4 - end_location: - row: 39 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument description in the docstring: `y`" - suggestion: ~ - fixable: false - location: - row: 52 - column: 4 - end_location: - row: 52 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument description in the docstring: `y`" - suggestion: ~ - fixable: false - location: - row: 65 - column: 4 - end_location: - row: 65 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument description in the docstring: `y`" - suggestion: ~ - fixable: false - location: - row: 77 - column: 4 - end_location: - row: 77 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument description in the docstring: `x`" - suggestion: ~ - fixable: false - location: - row: 98 - column: 4 - end_location: - row: 98 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UndocumentedParam - body: "Missing argument description in the docstring: `*args`" - suggestion: ~ - fixable: false - location: - row: 108 - column: 4 - end_location: - row: 108 - column: 5 - fix: ~ - parent: ~ +- - kind: + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `y`, `z`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 4 + end_location: + row: 1 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `y`, `z`" + suggestion: ~ + fixable: false + location: + row: 14 + column: 4 + end_location: + row: 14 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `y`, `z`" + suggestion: ~ + fixable: false + location: + row: 27 + column: 4 + end_location: + row: 27 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument descriptions in the docstring: `y`, `z`" + suggestion: ~ + fixable: false + location: + row: 39 + column: 4 + end_location: + row: 39 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + suggestion: ~ + fixable: false + location: + row: 52 + column: 4 + end_location: + row: 52 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + suggestion: ~ + fixable: false + location: + row: 65 + column: 4 + end_location: + row: 65 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument description in the docstring: `y`" + suggestion: ~ + fixable: false + location: + row: 77 + column: 4 + end_location: + row: 77 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument description in the docstring: `x`" + suggestion: ~ + fixable: false + location: + row: 98 + column: 4 + end_location: + row: 98 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UndocumentedParam + body: "Missing argument description in the docstring: `*args`" + suggestion: ~ + fixable: false + location: + row: 108 + column: 4 + end_location: + row: 108 + column: 5 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_0.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_0.py.snap index d6d9df711e6f41..e76148f470479e 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_0.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_0.py.snap @@ -2,206 +2,206 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UnusedImport - body: "`functools` imported but unused" - suggestion: "Remove unused import: `functools`" - fixable: true - location: - row: 2 - column: 7 - end_location: - row: 2 - column: 16 - fix: - content: import os +- - kind: + name: UnusedImport + body: "`functools` imported but unused" + suggestion: "Remove unused import: `functools`" + fixable: true location: row: 2 - column: 0 + column: 7 end_location: row: 2 - column: 20 - parent: ~ -- kind: - name: UnusedImport - body: "`collections.OrderedDict` imported but unused" - suggestion: "Remove unused import: `collections.OrderedDict`" - fixable: true - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 15 - fix: - content: "from collections import (\n Counter,\n namedtuple,\n)" - location: - row: 4 - column: 0 - end_location: - row: 8 - column: 1 - parent: - row: 4 - column: 0 -- kind: - name: UnusedImport - body: "`logging.config` imported but unused" - suggestion: "Remove unused import: `logging.config`" - fixable: true - location: - row: 10 - column: 7 - end_location: - row: 10 - column: 21 - fix: - content: "" + column: 16 + fix: + content: import os + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 20 + parent: ~ + - kind: + name: UnusedImport + body: "`collections.OrderedDict` imported but unused" + suggestion: "Remove unused import: `collections.OrderedDict`" + fixable: true location: - row: 10 - column: 0 + row: 6 + column: 4 end_location: - row: 11 + row: 6 + column: 15 + fix: + content: "from collections import (\n Counter,\n namedtuple,\n)" + location: + row: 4 + column: 0 + end_location: + row: 8 + column: 1 + parent: + row: 4 column: 0 - parent: ~ -- kind: - name: UnusedImport - body: "`logging.handlers` imported but unused" - suggestion: "Remove unused import: `logging.handlers`" - fixable: true - location: - row: 12 - column: 7 - end_location: - row: 12 - column: 23 - fix: - content: "" + - kind: + name: UnusedImport + body: "`logging.handlers` imported but unused" + suggestion: "Remove unused import: `logging.handlers`" + fixable: true location: row: 12 - column: 0 + column: 7 end_location: - row: 13 - column: 0 - parent: ~ -- kind: - name: UnusedImport - body: "`shelve` imported but unused" - suggestion: "Remove unused import: `shelve`" - fixable: true - location: - row: 32 - column: 11 - end_location: - row: 32 - column: 17 - fix: - content: "" + row: 12 + column: 23 + fix: + content: "" + location: + row: 12 + column: 0 + end_location: + row: 13 + column: 0 + parent: ~ + - kind: + name: UnusedImport + body: "`shelve` imported but unused" + suggestion: "Remove unused import: `shelve`" + fixable: true location: row: 32 - column: 0 + column: 11 end_location: - row: 33 - column: 0 - parent: ~ -- kind: - name: UnusedImport - body: "`importlib` imported but unused" - suggestion: "Remove unused import: `importlib`" - fixable: true - location: - row: 33 - column: 11 - end_location: - row: 33 - column: 20 - fix: - content: pass + row: 32 + column: 17 + fix: + content: "" + location: + row: 32 + column: 0 + end_location: + row: 33 + column: 0 + parent: ~ + - kind: + name: UnusedImport + body: "`importlib` imported but unused" + suggestion: "Remove unused import: `importlib`" + fixable: true location: row: 33 - column: 4 + column: 11 end_location: row: 33 column: 20 - parent: ~ -- kind: - name: UnusedImport - body: "`pathlib` imported but unused" - suggestion: "Remove unused import: `pathlib`" - fixable: true - location: - row: 37 - column: 11 - end_location: - row: 37 - column: 18 - fix: - content: "" + fix: + content: pass + location: + row: 33 + column: 4 + end_location: + row: 33 + column: 20 + parent: ~ + - kind: + name: UnusedImport + body: "`pathlib` imported but unused" + suggestion: "Remove unused import: `pathlib`" + fixable: true location: row: 37 - column: 0 + column: 11 end_location: - row: 38 - column: 0 - parent: ~ -- kind: - name: UnusedImport - body: "`pickle` imported but unused" - suggestion: "Remove unused import: `pickle`" - fixable: true - location: - row: 52 - column: 15 - end_location: - row: 52 - column: 21 - fix: - content: pass + row: 37 + column: 18 + fix: + content: "" + location: + row: 37 + column: 0 + end_location: + row: 38 + column: 0 + parent: ~ + - kind: + name: UnusedImport + body: "`pickle` imported but unused" + suggestion: "Remove unused import: `pickle`" + fixable: true location: row: 52 - column: 8 + column: 15 end_location: row: 52 column: 21 - parent: ~ -- kind: - name: UnusedImport - body: "`x` imported but unused" - suggestion: "Remove unused import: `x`" - fixable: true - location: - row: 93 - column: 15 - end_location: - row: 93 - column: 16 - fix: - content: "" + fix: + content: pass + location: + row: 52 + column: 8 + end_location: + row: 52 + column: 21 + parent: ~ + - kind: + name: UnusedImport + body: "`x` imported but unused" + suggestion: "Remove unused import: `x`" + fixable: true location: row: 93 - column: 0 + column: 15 end_location: - row: 94 - column: 0 - parent: ~ -- kind: - name: UnusedImport - body: "`y` imported but unused" - suggestion: "Remove unused import: `y`" - fixable: true - location: - row: 94 - column: 15 - end_location: - row: 94 - column: 16 - fix: - content: pass + row: 93 + column: 16 + fix: + content: "" + location: + row: 93 + column: 0 + end_location: + row: 94 + column: 0 + parent: ~ + - kind: + name: UnusedImport + body: "`y` imported but unused" + suggestion: "Remove unused import: `y`" + fixable: true location: row: 94 - column: 8 + column: 15 end_location: row: 94 column: 16 - parent: ~ + fix: + content: pass + location: + row: 94 + column: 8 + end_location: + row: 94 + column: 16 + parent: ~ +- - kind: + name: UnusedImport + body: "`logging.config` imported but unused" + suggestion: "Remove unused import: `logging.config`" + fixable: true + location: + row: 10 + column: 7 + end_location: + row: 10 + column: 21 + fix: + content: "" + location: + row: 10 + column: 0 + end_location: + row: 11 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_1.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_1.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_1.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_1.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_10.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_10.py.snap index bd5537b631331b..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_10.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_10.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_2.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_2.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_2.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_2.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_3.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_3.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_3.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_3.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_4.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_4.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_4.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_4.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_5.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_5.py.snap index 996cba05d72aa2..ff2e9fd06f5e9b 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_5.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_5.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UnusedImport - body: "`a.b.c` imported but unused" - suggestion: "Remove unused import: `a.b.c`" - fixable: true - location: - row: 2 - column: 16 - end_location: - row: 2 - column: 17 - fix: - content: "" +- - kind: + name: UnusedImport + body: "`a.b.c` imported but unused" + suggestion: "Remove unused import: `a.b.c`" + fixable: true location: row: 2 - column: 0 + column: 16 end_location: - row: 3 - column: 0 - parent: ~ -- kind: - name: UnusedImport - body: "`d.e.f` imported but unused" - suggestion: "Remove unused import: `d.e.f`" - fixable: true - location: - row: 3 - column: 16 - end_location: - row: 3 - column: 22 - fix: - content: "" + row: 2 + column: 17 + fix: + content: "" + location: + row: 2 + column: 0 + end_location: + row: 3 + column: 0 + parent: ~ + - kind: + name: UnusedImport + body: "`d.e.f` imported but unused" + suggestion: "Remove unused import: `d.e.f`" + fixable: true location: row: 3 - column: 0 + column: 16 end_location: - row: 4 - column: 0 - parent: ~ -- kind: - name: UnusedImport - body: "`h.i` imported but unused" - suggestion: "Remove unused import: `h.i`" - fixable: true - location: - row: 4 - column: 7 - end_location: - row: 4 - column: 10 - fix: - content: "" + row: 3 + column: 22 + fix: + content: "" + location: + row: 3 + column: 0 + end_location: + row: 4 + column: 0 + parent: ~ + - kind: + name: UnusedImport + body: "`h.i` imported but unused" + suggestion: "Remove unused import: `h.i`" + fixable: true location: row: 4 - column: 0 + column: 7 end_location: - row: 5 - column: 0 - parent: ~ -- kind: - name: UnusedImport - body: "`j.k` imported but unused" - suggestion: "Remove unused import: `j.k`" - fixable: true - location: - row: 5 - column: 7 - end_location: - row: 5 - column: 15 - fix: - content: "" + row: 4 + column: 10 + fix: + content: "" + location: + row: 4 + column: 0 + end_location: + row: 5 + column: 0 + parent: ~ + - kind: + name: UnusedImport + body: "`j.k` imported but unused" + suggestion: "Remove unused import: `j.k`" + fixable: true location: row: 5 - column: 0 + column: 7 end_location: - row: 6 - column: 0 - parent: ~ + row: 5 + column: 15 + fix: + content: "" + location: + row: 5 + column: 0 + end_location: + row: 6 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_6.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_6.py.snap index 05cc93ce009492..c1128ecf5c6e50 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_6.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_6.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UnusedImport - body: "`.background.BackgroundTasks` imported but unused" - suggestion: "Remove unused import: `.background.BackgroundTasks`" - fixable: true - location: - row: 7 - column: 24 - end_location: - row: 7 - column: 39 - fix: - content: "" +- - kind: + name: UnusedImport + body: "`.background.BackgroundTasks` imported but unused" + suggestion: "Remove unused import: `.background.BackgroundTasks`" + fixable: true location: row: 7 - column: 0 + column: 24 end_location: - row: 8 - column: 0 - parent: ~ -- kind: - name: UnusedImport - body: "`.datastructures.UploadFile` imported but unused" - suggestion: "Remove unused import: `.datastructures.UploadFile`" - fixable: true - location: - row: 10 - column: 28 - end_location: - row: 10 - column: 52 - fix: - content: "" + row: 7 + column: 39 + fix: + content: "" + location: + row: 7 + column: 0 + end_location: + row: 8 + column: 0 + parent: ~ + - kind: + name: UnusedImport + body: "`.datastructures.UploadFile` imported but unused" + suggestion: "Remove unused import: `.datastructures.UploadFile`" + fixable: true location: row: 10 - column: 0 + column: 28 end_location: - row: 11 - column: 0 - parent: ~ -- kind: - name: UnusedImport - body: "`background` imported but unused" - suggestion: "Remove unused import: `background`" - fixable: true - location: - row: 16 - column: 7 - end_location: - row: 16 - column: 17 - fix: - content: "" + row: 10 + column: 52 + fix: + content: "" + location: + row: 10 + column: 0 + end_location: + row: 11 + column: 0 + parent: ~ + - kind: + name: UnusedImport + body: "`background` imported but unused" + suggestion: "Remove unused import: `background`" + fixable: true location: row: 16 - column: 0 + column: 7 end_location: - row: 17 - column: 0 - parent: ~ -- kind: - name: UnusedImport - body: "`datastructures` imported but unused" - suggestion: "Remove unused import: `datastructures`" - fixable: true - location: - row: 19 - column: 7 - end_location: - row: 19 - column: 35 - fix: - content: "" + row: 16 + column: 17 + fix: + content: "" + location: + row: 16 + column: 0 + end_location: + row: 17 + column: 0 + parent: ~ + - kind: + name: UnusedImport + body: "`datastructures` imported but unused" + suggestion: "Remove unused import: `datastructures`" + fixable: true location: row: 19 - column: 0 + column: 7 end_location: - row: 20 - column: 0 - parent: ~ + row: 19 + column: 35 + fix: + content: "" + location: + row: 19 + column: 0 + end_location: + row: 20 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_7.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_7.py.snap index d37c97c8d6b312..9a7f7b8ffde271 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_7.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_7.py.snap @@ -2,66 +2,66 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UnusedImport - body: "`typing.Union` imported but unused" - suggestion: "Remove unused import: `typing.Union`" - fixable: true - location: - row: 30 - column: 4 - end_location: - row: 30 - column: 9 - fix: - content: "from typing import (\n Mapping, # noqa: F401\n )" +- - kind: + name: UnusedImport + body: "`typing.Union` imported but unused" + suggestion: "Remove unused import: `typing.Union`" + fixable: true location: + row: 30 + column: 4 + end_location: + row: 30 + column: 9 + fix: + content: "from typing import (\n Mapping, # noqa: F401\n )" + location: + row: 28 + column: 0 + end_location: + row: 31 + column: 1 + parent: row: 28 column: 0 - end_location: - row: 31 - column: 1 - parent: - row: 28 - column: 0 -- kind: - name: UnusedImport - body: "`typing.Awaitable` imported but unused" - suggestion: Remove unused import - fixable: true - location: - row: 66 - column: 19 - end_location: - row: 66 - column: 28 - fix: - content: "" + - kind: + name: UnusedImport + body: "`typing.Awaitable` imported but unused" + suggestion: Remove unused import + fixable: true location: row: 66 - column: 0 + column: 19 end_location: - row: 67 - column: 0 - parent: ~ -- kind: - name: UnusedImport - body: "`typing.AwaitableGenerator` imported but unused" - suggestion: Remove unused import - fixable: true - location: - row: 66 - column: 30 - end_location: - row: 66 - column: 48 - fix: - content: "" + row: 66 + column: 28 + fix: + content: "" + location: + row: 66 + column: 0 + end_location: + row: 67 + column: 0 + parent: ~ + - kind: + name: UnusedImport + body: "`typing.AwaitableGenerator` imported but unused" + suggestion: Remove unused import + fixable: true location: row: 66 - column: 0 + column: 30 end_location: - row: 67 - column: 0 - parent: ~ + row: 66 + column: 48 + fix: + content: "" + location: + row: 66 + column: 0 + end_location: + row: 67 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_8.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_8.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_8.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_8.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_9.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_9.py.snap index 67906f90eaf753..7745796d375a33 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_9.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_9.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UnusedImport - body: "`foo.baz` imported but unused" - suggestion: "Remove unused import: `foo.baz`" - fixable: true - location: - row: 4 - column: 21 - end_location: - row: 4 - column: 24 - fix: - content: from foo import bar +- - kind: + name: UnusedImport + body: "`foo.baz` imported but unused" + suggestion: "Remove unused import: `foo.baz`" + fixable: true location: row: 4 - column: 0 + column: 21 end_location: row: 4 column: 24 - parent: ~ + fix: + content: from foo import bar + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 24 + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F402_F402.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F402_F402.py.snap index 46f5f7e9d0303a..ebbc7a74b04d8f 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F402_F402.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F402_F402.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: ImportShadowedByLoopVar - body: "Import `os` from line 1 shadowed by loop variable" - suggestion: ~ - fixable: false - location: - row: 5 - column: 4 - end_location: - row: 5 - column: 6 - fix: ~ - parent: ~ -- kind: - name: ImportShadowedByLoopVar - body: "Import `path` from line 2 shadowed by loop variable" - suggestion: ~ - fixable: false - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: ImportShadowedByLoopVar + body: "Import `os` from line 1 shadowed by loop variable" + suggestion: ~ + fixable: false + location: + row: 5 + column: 4 + end_location: + row: 5 + column: 6 + fix: ~ + parent: ~ + - kind: + name: ImportShadowedByLoopVar + body: "Import `path` from line 2 shadowed by loop variable" + suggestion: ~ + fixable: false + location: + row: 8 + column: 4 + end_location: + row: 8 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F403_F403.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F403_F403.py.snap index 97e57eefff763c..03cb8bb6088824 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F403_F403.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F403_F403.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: ImportStar - body: "`from F634 import *` used; unable to detect undefined names" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 18 - fix: ~ - parent: ~ -- kind: - name: ImportStar - body: "`from F634 import *` used; unable to detect undefined names" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 18 - fix: ~ - parent: ~ +- - kind: + name: ImportStar + body: "`from F634 import *` used; unable to detect undefined names" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 18 + fix: ~ + parent: ~ + - kind: + name: ImportStar + body: "`from F634 import *` used; unable to detect undefined names" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 18 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F404_F404.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F404_F404.py.snap index 00540ae80beaa3..d5e858ae2c420a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F404_F404.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F404_F404.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: LateFutureImport - body: "`from __future__` imports must occur at the beginning of the file" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 37 - fix: ~ - parent: ~ -- kind: - name: LateFutureImport - body: "`from __future__` imports must occur at the beginning of the file" - suggestion: ~ - fixable: false - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: LateFutureImport + body: "`from __future__` imports must occur at the beginning of the file" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 37 + fix: ~ + parent: ~ + - kind: + name: LateFutureImport + body: "`from __future__` imports must occur at the beginning of the file" + suggestion: ~ + fixable: false + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F405_F405.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F405_F405.py.snap index 1d657f1e639a60..5c6881a09d90fe 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F405_F405.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F405_F405.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: ImportStarUsage - body: "`name` may be undefined, or defined from star imports: `mymodule`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 10 - end_location: - row: 5 - column: 14 - fix: ~ - parent: ~ -- kind: - name: ImportStarUsage - body: "`a` may be undefined, or defined from star imports: `mymodule`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 7 - fix: ~ - parent: ~ +- - kind: + name: ImportStarUsage + body: "`name` may be undefined, or defined from star imports: `mymodule`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 10 + end_location: + row: 5 + column: 14 + fix: ~ + parent: ~ + - kind: + name: ImportStarUsage + body: "`a` may be undefined, or defined from star imports: `mymodule`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 7 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F406_F406.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F406_F406.py.snap index 4b08e944bc453d..bf25c6e58c2ac1 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F406_F406.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F406_F406.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: ImportStarNotPermitted - body: "`from F634 import *` only allowed at module level" - suggestion: ~ - fixable: false - location: - row: 5 - column: 4 - end_location: - row: 5 - column: 22 - fix: ~ - parent: ~ -- kind: - name: ImportStarNotPermitted - body: "`from F634 import *` only allowed at module level" - suggestion: ~ - fixable: false - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 22 - fix: ~ - parent: ~ +- - kind: + name: ImportStarNotPermitted + body: "`from F634 import *` only allowed at module level" + suggestion: ~ + fixable: false + location: + row: 5 + column: 4 + end_location: + row: 5 + column: 22 + fix: ~ + parent: ~ + - kind: + name: ImportStarNotPermitted + body: "`from F634 import *` only allowed at module level" + suggestion: ~ + fixable: false + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 22 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F407_F407.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F407_F407.py.snap index b09a80f9cce76a..510b9f2279314d 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F407_F407.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F407_F407.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: FutureFeatureNotDefined - body: "Future feature `non_existent_feature` is not defined" - suggestion: ~ - fixable: false - location: - row: 2 - column: 23 - end_location: - row: 2 - column: 43 - fix: ~ - parent: ~ +- - kind: + name: FutureFeatureNotDefined + body: "Future feature `non_existent_feature` is not defined" + suggestion: ~ + fixable: false + location: + row: 2 + column: 23 + end_location: + row: 2 + column: 43 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F501_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F501_F50x.py.snap index db23c4bbbf95de..b8a768f4de5067 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F501_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F501_F50x.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: PercentFormatInvalidFormat - body: "`%`-format string has invalid format string: incomplete format" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 25 - fix: ~ - parent: ~ +- - kind: + name: PercentFormatInvalidFormat + body: "`%`-format string has invalid format string: incomplete format" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 25 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F502.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F502.py.snap index 6a234ce4d6bd73..4aca2071760eb2 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F502.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F502.py.snap @@ -2,95 +2,95 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: PercentFormatExpectedMapping - body: "`%`-format string expected mapping but got sequence" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 19 - fix: ~ - parent: ~ -- kind: - name: PercentFormatExpectedMapping - body: "`%`-format string expected mapping but got sequence" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 20 - fix: ~ - parent: ~ -- kind: - name: PercentFormatExpectedMapping - body: "`%`-format string expected mapping but got sequence" - suggestion: ~ - fixable: false - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 19 - fix: ~ - parent: ~ -- kind: - name: PercentFormatExpectedMapping - body: "`%`-format string expected mapping but got sequence" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 22 - fix: ~ - parent: ~ -- kind: - name: PercentFormatExpectedMapping - body: "`%`-format string expected mapping but got sequence" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 37 - fix: ~ - parent: ~ -- kind: - name: PercentFormatExpectedMapping - body: "`%`-format string expected mapping but got sequence" - suggestion: ~ - fixable: false - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 37 - fix: ~ - parent: ~ -- kind: - name: PercentFormatExpectedMapping - body: "`%`-format string expected mapping but got sequence" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 37 - fix: ~ - parent: ~ +- - kind: + name: PercentFormatExpectedMapping + body: "`%`-format string expected mapping but got sequence" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 19 + fix: ~ + parent: ~ + - kind: + name: PercentFormatExpectedMapping + body: "`%`-format string expected mapping but got sequence" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 20 + fix: ~ + parent: ~ + - kind: + name: PercentFormatExpectedMapping + body: "`%`-format string expected mapping but got sequence" + suggestion: ~ + fixable: false + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 19 + fix: ~ + parent: ~ + - kind: + name: PercentFormatExpectedMapping + body: "`%`-format string expected mapping but got sequence" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 22 + fix: ~ + parent: ~ + - kind: + name: PercentFormatExpectedMapping + body: "`%`-format string expected mapping but got sequence" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 37 + fix: ~ + parent: ~ + - kind: + name: PercentFormatExpectedMapping + body: "`%`-format string expected mapping but got sequence" + suggestion: ~ + fixable: false + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 37 + fix: ~ + parent: ~ + - kind: + name: PercentFormatExpectedMapping + body: "`%`-format string expected mapping but got sequence" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 37 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F50x.py.snap index 5fbe4c9b6fcc22..43f08affbbbd19 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F50x.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: PercentFormatExpectedMapping - body: "`%`-format string expected mapping but got sequence" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 21 - fix: ~ - parent: ~ +- - kind: + name: PercentFormatExpectedMapping + body: "`%`-format string expected mapping but got sequence" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 21 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F503.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F503.py.snap index 8d90f66e443fb2..e323d1f5448166 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F503.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F503.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: PercentFormatExpectedSequence - body: "`%`-format string expected sequence but got mapping" - suggestion: ~ - fixable: false - location: - row: 17 - column: 0 - end_location: - row: 17 - column: 24 - fix: ~ - parent: ~ -- kind: - name: PercentFormatExpectedSequence - body: "`%`-format string expected sequence but got mapping" - suggestion: ~ - fixable: false - location: - row: 18 - column: 0 - end_location: - row: 18 - column: 28 - fix: ~ - parent: ~ -- kind: - name: PercentFormatExpectedSequence - body: "`%`-format string expected sequence but got mapping" - suggestion: ~ - fixable: false - location: - row: 23 - column: 0 - end_location: - row: 23 - column: 42 - fix: ~ - parent: ~ +- - kind: + name: PercentFormatExpectedSequence + body: "`%`-format string expected sequence but got mapping" + suggestion: ~ + fixable: false + location: + row: 17 + column: 0 + end_location: + row: 17 + column: 24 + fix: ~ + parent: ~ + - kind: + name: PercentFormatExpectedSequence + body: "`%`-format string expected sequence but got mapping" + suggestion: ~ + fixable: false + location: + row: 18 + column: 0 + end_location: + row: 18 + column: 28 + fix: ~ + parent: ~ + - kind: + name: PercentFormatExpectedSequence + body: "`%`-format string expected sequence but got mapping" + suggestion: ~ + fixable: false + location: + row: 23 + column: 0 + end_location: + row: 23 + column: 42 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F50x.py.snap index eb9482cd86e614..15cb6aeb8e1e20 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F50x.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: PercentFormatExpectedSequence - body: "`%`-format string expected sequence but got mapping" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 20 - fix: ~ - parent: ~ +- - kind: + name: PercentFormatExpectedSequence + body: "`%`-format string expected sequence but got mapping" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 20 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F504.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F504.py.snap index 4ce003bf45f3f8..eb57a7913209f6 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F504.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F504.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: PercentFormatExtraNamedArguments - body: "`%`-format string has unused named argument(s): b" - suggestion: "Remove extra named arguments: b" - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 34 - fix: - content: "{a: \"?\", }" +- - kind: + name: PercentFormatExtraNamedArguments + body: "`%`-format string has unused named argument(s): b" + suggestion: "Remove extra named arguments: b" + fixable: true location: row: 3 - column: 16 + column: 0 end_location: row: 3 column: 34 - parent: ~ -- kind: - name: PercentFormatExtraNamedArguments - body: "`%`-format string has unused named argument(s): b" - suggestion: "Remove extra named arguments: b" - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 29 - fix: - content: "{\"a\": 1, }" + fix: + content: "{a: \"?\", }" + location: + row: 3 + column: 16 + end_location: + row: 3 + column: 34 + parent: ~ + - kind: + name: PercentFormatExtraNamedArguments + body: "`%`-format string has unused named argument(s): b" + suggestion: "Remove extra named arguments: b" + fixable: true location: row: 8 - column: 10 + column: 0 end_location: row: 8 column: 29 - parent: ~ -- kind: - name: PercentFormatExtraNamedArguments - body: "`%`-format string has unused named argument(s): b" - suggestion: "Remove extra named arguments: b" - fixable: true - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 29 - fix: - content: "{'a': 1, }" + fix: + content: "{\"a\": 1, }" + location: + row: 8 + column: 10 + end_location: + row: 8 + column: 29 + parent: ~ + - kind: + name: PercentFormatExtraNamedArguments + body: "`%`-format string has unused named argument(s): b" + suggestion: "Remove extra named arguments: b" + fixable: true location: row: 9 - column: 10 + column: 0 end_location: row: 9 column: 29 - parent: ~ + fix: + content: "{'a': 1, }" + location: + row: 9 + column: 10 + end_location: + row: 9 + column: 29 + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F50x.py.snap index 478a4b27582315..ed93a91765bb0a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F50x.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: PercentFormatExtraNamedArguments - body: "`%`-format string has unused named argument(s): baz" - suggestion: "Remove extra named arguments: baz" - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 32 - fix: - content: "{'bar': 1, }" +- - kind: + name: PercentFormatExtraNamedArguments + body: "`%`-format string has unused named argument(s): baz" + suggestion: "Remove extra named arguments: baz" + fixable: true location: row: 8 - column: 12 + column: 0 end_location: row: 8 column: 32 - parent: ~ + fix: + content: "{'bar': 1, }" + location: + row: 8 + column: 12 + end_location: + row: 8 + column: 32 + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F505_F504.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F505_F504.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F505_F504.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F505_F504.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F505_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F505_F50x.py.snap index c17bd63ad361ab..f061ee798c6ff8 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F505_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F505_F50x.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: PercentFormatMissingArgument - body: "`%`-format string is missing argument(s) for placeholder(s): bar" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 14 - fix: ~ - parent: ~ +- - kind: + name: PercentFormatMissingArgument + body: "`%`-format string is missing argument(s) for placeholder(s): bar" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F506_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F506_F50x.py.snap index c0b03a36b927a3..b91c01d605cec3 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F506_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F506_F50x.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: PercentFormatMixedPositionalAndNamed - body: "`%`-format string has mixed positional and named placeholders" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 29 - fix: ~ - parent: ~ -- kind: - name: PercentFormatMixedPositionalAndNamed - body: "`%`-format string has mixed positional and named placeholders" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 29 - fix: ~ - parent: ~ -- kind: - name: PercentFormatMixedPositionalAndNamed - body: "`%`-format string has mixed positional and named placeholders" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 27 - fix: ~ - parent: ~ +- - kind: + name: PercentFormatMixedPositionalAndNamed + body: "`%`-format string has mixed positional and named placeholders" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 29 + fix: ~ + parent: ~ + - kind: + name: PercentFormatMixedPositionalAndNamed + body: "`%`-format string has mixed positional and named placeholders" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 29 + fix: ~ + parent: ~ + - kind: + name: PercentFormatMixedPositionalAndNamed + body: "`%`-format string has mixed positional and named placeholders" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 27 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F507_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F507_F50x.py.snap index 850e30d4344c9f..92be52f205b382 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F507_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F507_F50x.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: PercentFormatPositionalCountMismatch - body: "`%`-format string has 2 placeholder(s) but 1 substitution(s)" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 14 - fix: ~ - parent: ~ -- kind: - name: PercentFormatPositionalCountMismatch - body: "`%`-format string has 2 placeholder(s) but 3 substitution(s)" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 19 - fix: ~ - parent: ~ +- - kind: + name: PercentFormatPositionalCountMismatch + body: "`%`-format string has 2 placeholder(s) but 1 substitution(s)" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 14 + fix: ~ + parent: ~ + - kind: + name: PercentFormatPositionalCountMismatch + body: "`%`-format string has 2 placeholder(s) but 3 substitution(s)" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 19 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F508_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F508_F50x.py.snap index 7ec0566b8c3715..961924475965af 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F508_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F508_F50x.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: PercentFormatStarRequiresSequence - body: "`%`-format string `*` specifier requires sequence" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 27 - fix: ~ - parent: ~ +- - kind: + name: PercentFormatStarRequiresSequence + body: "`%`-format string `*` specifier requires sequence" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 27 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F509_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F509_F50x.py.snap index 119a6f27630080..12ed72be77a31f 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F509_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F509_F50x.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: PercentFormatUnsupportedFormatCharacter - body: "`%`-format string has unsupported format character `j`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 11 - fix: ~ - parent: ~ +- - kind: + name: PercentFormatUnsupportedFormatCharacter + body: "`%`-format string has unsupported format character `j`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 11 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F521_F521.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F521_F521.py.snap index 9cc98456441d7c..0aaaad7b49660d 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F521_F521.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F521_F521.py.snap @@ -2,95 +2,95 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: StringDotFormatInvalidFormat - body: "`.format` call has invalid format string: Single '{' encountered in format string" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 13 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatInvalidFormat - body: "`.format` call has invalid format string: Single '}' encountered in format string" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 13 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatInvalidFormat - body: "`.format` call has invalid format string: Expected '}' before end of string" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 22 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatInvalidFormat - body: "`.format` call has invalid format string: Max string recursion exceeded" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 26 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatInvalidFormat - body: "`.format` call has invalid format string: Empty attribute in format string" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 29 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatInvalidFormat - body: "`.format` call has invalid format string: Empty attribute in format string" - suggestion: ~ - fixable: false - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 23 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatInvalidFormat - body: "`.format` call has invalid format string: Empty attribute in format string" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 26 - fix: ~ - parent: ~ +- - kind: + name: StringDotFormatInvalidFormat + body: "`.format` call has invalid format string: Single '{' encountered in format string" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 13 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatInvalidFormat + body: "`.format` call has invalid format string: Single '}' encountered in format string" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 13 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatInvalidFormat + body: "`.format` call has invalid format string: Expected '}' before end of string" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 22 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatInvalidFormat + body: "`.format` call has invalid format string: Max string recursion exceeded" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 26 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatInvalidFormat + body: "`.format` call has invalid format string: Empty attribute in format string" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 29 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatInvalidFormat + body: "`.format` call has invalid format string: Empty attribute in format string" + suggestion: ~ + fixable: false + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 23 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatInvalidFormat + body: "`.format` call has invalid format string: Empty attribute in format string" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 26 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F522_F522.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F522_F522.py.snap index 3a5f720fceda06..c0f83bbfc836ad 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F522_F522.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F522_F522.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: StringDotFormatExtraNamedArguments - body: "`.format` call has unused named argument(s): bar" - suggestion: "Remove extra named arguments: bar" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 21 - fix: - content: "\"{}\".format(1, )" +- - kind: + name: StringDotFormatExtraNamedArguments + body: "`.format` call has unused named argument(s): bar" + suggestion: "Remove extra named arguments: bar" + fixable: true location: row: 1 column: 0 end_location: row: 1 column: 21 - parent: ~ -- kind: - name: StringDotFormatExtraNamedArguments - body: "`.format` call has unused named argument(s): spam" - suggestion: "Remove extra named arguments: spam" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 34 - fix: - content: "\"{bar}{}\".format(1, bar=2, )" + fix: + content: "\"{}\".format(1, )" + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 21 + parent: ~ + - kind: + name: StringDotFormatExtraNamedArguments + body: "`.format` call has unused named argument(s): spam" + suggestion: "Remove extra named arguments: spam" + fixable: true location: row: 2 column: 0 end_location: row: 2 column: 34 - parent: ~ -- kind: - name: StringDotFormatExtraNamedArguments - body: "`.format` call has unused named argument(s): eggs, ham" - suggestion: "Remove extra named arguments: eggs, ham" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 51 - fix: - content: "\"{bar:{spam}}\".format(bar=2, spam=3, )" + fix: + content: "\"{bar}{}\".format(1, bar=2, )" + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 34 + parent: ~ + - kind: + name: StringDotFormatExtraNamedArguments + body: "`.format` call has unused named argument(s): eggs, ham" + suggestion: "Remove extra named arguments: eggs, ham" + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 51 - parent: ~ + fix: + content: "\"{bar:{spam}}\".format(bar=2, spam=3, )" + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 51 + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F523_F523.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F523_F523.py.snap index 8d4b0172e3f5a4..0604068c0a911a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F523_F523.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F523_F523.py.snap @@ -2,95 +2,95 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: StringDotFormatExtraPositionalArguments - body: "`.format` call has unused arguments at position(s): 1" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 18 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatExtraPositionalArguments - body: "`.format` call has unused arguments at position(s): 0, 2" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 21 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatExtraPositionalArguments - body: "`.format` call has unused arguments at position(s): 2" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 25 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatExtraPositionalArguments - body: "`.format` call has unused arguments at position(s): 1" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 21 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatExtraPositionalArguments - body: "`.format` call has unused arguments at position(s): 1" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 17 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatExtraPositionalArguments - body: "`.format` call has unused arguments at position(s): 1, 2" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 20 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatExtraPositionalArguments - body: "`.format` call has unused arguments at position(s): 2" - suggestion: ~ - fixable: false - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 23 - fix: ~ - parent: ~ +- - kind: + name: StringDotFormatExtraPositionalArguments + body: "`.format` call has unused arguments at position(s): 1" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 18 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatExtraPositionalArguments + body: "`.format` call has unused arguments at position(s): 0, 2" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 21 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatExtraPositionalArguments + body: "`.format` call has unused arguments at position(s): 2" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 25 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatExtraPositionalArguments + body: "`.format` call has unused arguments at position(s): 1" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 21 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatExtraPositionalArguments + body: "`.format` call has unused arguments at position(s): 1" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 17 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatExtraPositionalArguments + body: "`.format` call has unused arguments at position(s): 1, 2" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 20 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatExtraPositionalArguments + body: "`.format` call has unused arguments at position(s): 2" + suggestion: ~ + fixable: false + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 23 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F524_F524.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F524_F524.py.snap index 223e944fa4f06d..9b8a8d445ff273 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F524_F524.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F524_F524.py.snap @@ -2,82 +2,82 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: StringDotFormatMissingArguments - body: "`.format` call is missing argument(s) for placeholder(s): 1" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 17 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatMissingArguments - body: "`.format` call is missing argument(s) for placeholder(s): 2" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 14 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatMissingArguments - body: "`.format` call is missing argument(s) for placeholder(s): bar" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 16 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatMissingArguments - body: "`.format` call is missing argument(s) for placeholder(s): bar" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 21 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatMissingArguments - body: "`.format` call is missing argument(s) for placeholder(s): 0, bar" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 20 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatMissingArguments - body: "`.format` call is missing argument(s) for placeholder(s): 0, bar" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 20 - fix: ~ - parent: ~ +- - kind: + name: StringDotFormatMissingArguments + body: "`.format` call is missing argument(s) for placeholder(s): 1" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 17 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatMissingArguments + body: "`.format` call is missing argument(s) for placeholder(s): 2" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 14 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatMissingArguments + body: "`.format` call is missing argument(s) for placeholder(s): bar" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 16 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatMissingArguments + body: "`.format` call is missing argument(s) for placeholder(s): bar" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 21 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatMissingArguments + body: "`.format` call is missing argument(s) for placeholder(s): 0, bar" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 20 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatMissingArguments + body: "`.format` call is missing argument(s) for placeholder(s): 0, bar" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 20 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F525_F525.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F525_F525.py.snap index 174646994ae849..bee61e6a2a1e1a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F525_F525.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F525_F525.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: StringDotFormatMixingAutomatic - body: "`.format` string mixes automatic and manual numbering" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 21 - fix: ~ - parent: ~ -- kind: - name: StringDotFormatMixingAutomatic - body: "`.format` string mixes automatic and manual numbering" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 21 - fix: ~ - parent: ~ +- - kind: + name: StringDotFormatMixingAutomatic + body: "`.format` string mixes automatic and manual numbering" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 21 + fix: ~ + parent: ~ + - kind: + name: StringDotFormatMixingAutomatic + body: "`.format` string mixes automatic and manual numbering" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 21 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F541_F541.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F541_F541.py.snap index 2b6686884f8442..c4b867035ed726 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F541_F541.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F541_F541.py.snap @@ -2,304 +2,304 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: FStringMissingPlaceholders - body: f-string without any placeholders - suggestion: "Remove extraneous `f` prefix" - fixable: true - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 10 - fix: - content: "\"def\"" +- - kind: + name: FStringMissingPlaceholders + body: f-string without any placeholders + suggestion: "Remove extraneous `f` prefix" + fixable: true location: row: 6 column: 4 end_location: row: 6 column: 10 - parent: ~ -- kind: - name: FStringMissingPlaceholders - body: f-string without any placeholders - suggestion: "Remove extraneous `f` prefix" - fixable: true - location: - row: 7 - column: 4 - end_location: - row: 7 - column: 10 - fix: - content: "\"def\"" + fix: + content: "\"def\"" + location: + row: 6 + column: 4 + end_location: + row: 6 + column: 10 + parent: ~ + - kind: + name: FStringMissingPlaceholders + body: f-string without any placeholders + suggestion: "Remove extraneous `f` prefix" + fixable: true location: row: 7 column: 4 end_location: row: 7 column: 10 - parent: ~ -- kind: - name: FStringMissingPlaceholders - body: f-string without any placeholders - suggestion: "Remove extraneous `f` prefix" - fixable: true - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 10 - fix: - content: "\"def\"" + fix: + content: "\"def\"" + location: + row: 7 + column: 4 + end_location: + row: 7 + column: 10 + parent: ~ + - kind: + name: FStringMissingPlaceholders + body: f-string without any placeholders + suggestion: "Remove extraneous `f` prefix" + fixable: true location: row: 9 column: 4 end_location: row: 9 column: 10 - parent: ~ -- kind: - name: FStringMissingPlaceholders - body: f-string without any placeholders - suggestion: "Remove extraneous `f` prefix" - fixable: true - location: - row: 13 - column: 4 - end_location: - row: 13 - column: 8 - fix: - content: "\"a\"" + fix: + content: "\"def\"" + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 10 + parent: ~ + - kind: + name: FStringMissingPlaceholders + body: f-string without any placeholders + suggestion: "Remove extraneous `f` prefix" + fixable: true location: row: 13 column: 4 end_location: row: 13 column: 8 - parent: ~ -- kind: - name: FStringMissingPlaceholders - body: f-string without any placeholders - suggestion: "Remove extraneous `f` prefix" - fixable: true - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 8 - fix: - content: "\"b\"" + fix: + content: "\"a\"" + location: + row: 13 + column: 4 + end_location: + row: 13 + column: 8 + parent: ~ + - kind: + name: FStringMissingPlaceholders + body: f-string without any placeholders + suggestion: "Remove extraneous `f` prefix" + fixable: true location: row: 14 column: 4 end_location: row: 14 column: 8 - parent: ~ -- kind: - name: FStringMissingPlaceholders - body: f-string without any placeholders - suggestion: "Remove extraneous `f` prefix" - fixable: true - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 9 - fix: - content: "\"d\"" + fix: + content: "\"b\"" + location: + row: 14 + column: 4 + end_location: + row: 14 + column: 8 + parent: ~ + - kind: + name: FStringMissingPlaceholders + body: f-string without any placeholders + suggestion: "Remove extraneous `f` prefix" + fixable: true location: row: 16 - column: 5 + column: 4 end_location: row: 16 column: 9 - parent: ~ -- kind: - name: FStringMissingPlaceholders - body: f-string without any placeholders - suggestion: "Remove extraneous `f` prefix" - fixable: true - location: - row: 17 - column: 4 - end_location: - row: 17 - column: 9 - fix: - content: "r\"e\"" + fix: + content: "\"d\"" + location: + row: 16 + column: 5 + end_location: + row: 16 + column: 9 + parent: ~ + - kind: + name: FStringMissingPlaceholders + body: f-string without any placeholders + suggestion: "Remove extraneous `f` prefix" + fixable: true location: row: 17 column: 4 end_location: row: 17 column: 9 - parent: ~ -- kind: - name: FStringMissingPlaceholders - body: f-string without any placeholders - suggestion: "Remove extraneous `f` prefix" - fixable: true - location: - row: 19 - column: 4 - end_location: - row: 19 - column: 7 - fix: - content: "\"\"" + fix: + content: "r\"e\"" + location: + row: 17 + column: 4 + end_location: + row: 17 + column: 9 + parent: ~ + - kind: + name: FStringMissingPlaceholders + body: f-string without any placeholders + suggestion: "Remove extraneous `f` prefix" + fixable: true location: row: 19 column: 4 end_location: row: 19 column: 7 - parent: ~ -- kind: - name: FStringMissingPlaceholders - body: f-string without any placeholders - suggestion: "Remove extraneous `f` prefix" - fixable: true - location: - row: 25 - column: 12 - end_location: - row: 25 - column: 16 - fix: - content: "\"z\"" + fix: + content: "\"\"" + location: + row: 19 + column: 4 + end_location: + row: 19 + column: 7 + parent: ~ + - kind: + name: FStringMissingPlaceholders + body: f-string without any placeholders + suggestion: "Remove extraneous `f` prefix" + fixable: true location: row: 25 column: 12 end_location: row: 25 column: 16 - parent: ~ -- kind: - name: FStringMissingPlaceholders - body: f-string without any placeholders - suggestion: "Remove extraneous `f` prefix" - fixable: true - location: - row: 34 - column: 6 - end_location: - row: 34 - column: 13 - fix: - content: "'0.2f'" + fix: + content: "\"z\"" + location: + row: 25 + column: 12 + end_location: + row: 25 + column: 16 + parent: ~ + - kind: + name: FStringMissingPlaceholders + body: f-string without any placeholders + suggestion: "Remove extraneous `f` prefix" + fixable: true location: row: 34 column: 6 end_location: row: 34 column: 13 - parent: ~ -- kind: - name: FStringMissingPlaceholders - body: f-string without any placeholders - suggestion: "Remove extraneous `f` prefix" - fixable: true - location: - row: 35 - column: 3 - end_location: - row: 35 - column: 6 - fix: - content: "''" + fix: + content: "'0.2f'" + location: + row: 34 + column: 6 + end_location: + row: 34 + column: 13 + parent: ~ + - kind: + name: FStringMissingPlaceholders + body: f-string without any placeholders + suggestion: "Remove extraneous `f` prefix" + fixable: true location: row: 35 column: 3 end_location: row: 35 column: 6 - parent: ~ -- kind: - name: FStringMissingPlaceholders - body: f-string without any placeholders - suggestion: "Remove extraneous `f` prefix" - fixable: true - location: - row: 36 - column: 0 - end_location: - row: 36 - column: 11 - fix: - content: "\"{test}\"" + fix: + content: "''" + location: + row: 35 + column: 3 + end_location: + row: 35 + column: 6 + parent: ~ + - kind: + name: FStringMissingPlaceholders + body: f-string without any placeholders + suggestion: "Remove extraneous `f` prefix" + fixable: true location: row: 36 column: 0 end_location: row: 36 column: 11 - parent: ~ -- kind: - name: FStringMissingPlaceholders - body: f-string without any placeholders - suggestion: "Remove extraneous `f` prefix" - fixable: true - location: - row: 37 - column: 0 - end_location: - row: 37 - column: 11 - fix: - content: "'{ 40 }'" + fix: + content: "\"{test}\"" + location: + row: 36 + column: 0 + end_location: + row: 36 + column: 11 + parent: ~ + - kind: + name: FStringMissingPlaceholders + body: f-string without any placeholders + suggestion: "Remove extraneous `f` prefix" + fixable: true location: row: 37 column: 0 end_location: row: 37 column: 11 - parent: ~ -- kind: - name: FStringMissingPlaceholders - body: f-string without any placeholders - suggestion: "Remove extraneous `f` prefix" - fixable: true - location: - row: 38 - column: 0 - end_location: - row: 38 - column: 12 - fix: - content: "\"{a {x}\"" + fix: + content: "'{ 40 }'" + location: + row: 37 + column: 0 + end_location: + row: 37 + column: 11 + parent: ~ + - kind: + name: FStringMissingPlaceholders + body: f-string without any placeholders + suggestion: "Remove extraneous `f` prefix" + fixable: true location: row: 38 column: 0 end_location: row: 38 column: 12 - parent: ~ -- kind: - name: FStringMissingPlaceholders - body: f-string without any placeholders - suggestion: "Remove extraneous `f` prefix" - fixable: true - location: - row: 39 - column: 0 - end_location: - row: 39 - column: 12 - fix: - content: "\"{{x}}\"" + fix: + content: "\"{a {x}\"" + location: + row: 38 + column: 0 + end_location: + row: 38 + column: 12 + parent: ~ + - kind: + name: FStringMissingPlaceholders + body: f-string without any placeholders + suggestion: "Remove extraneous `f` prefix" + fixable: true location: row: 39 column: 0 end_location: row: 39 column: 12 - parent: ~ + fix: + content: "\"{{x}}\"" + location: + row: 39 + column: 0 + end_location: + row: 39 + column: 12 + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F601_F601.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F601_F601.py.snap index f8875fae5de5fe..7e387dec7baa3e 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F601_F601.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F601_F601.py.snap @@ -2,371 +2,371 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `1` repeated" - suggestion: ~ - fixable: false - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `b\"123\"` repeated" - suggestion: ~ - fixable: false - location: - row: 11 - column: 4 - end_location: - row: 11 - column: 10 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 17 - column: 4 - end_location: - row: 17 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: "Remove repeated key literal `\"a\"`" - fixable: true - location: - row: 18 - column: 4 - end_location: - row: 18 - column: 7 - fix: - content: "" +- - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false location: - row: 17 + row: 3 + column: 4 + end_location: + row: 3 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `1` repeated" + suggestion: ~ + fixable: false + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `b\"123\"` repeated" + suggestion: ~ + fixable: false + location: + row: 11 + column: 4 + end_location: + row: 11 column: 10 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false + location: + row: 16 + column: 4 end_location: + row: 16 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false + location: + row: 17 + column: 4 + end_location: + row: 17 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: "Remove repeated key literal `\"a\"`" + fixable: true + location: row: 18 - column: 10 - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 22 - column: 4 - end_location: - row: 22 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 23 - column: 4 - end_location: - row: 23 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 24 - column: 4 - end_location: - row: 24 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: "Remove repeated key literal `\"a\"`" - fixable: true - location: - row: 25 - column: 4 - end_location: - row: 25 - column: 7 - fix: - content: "" + column: 4 + end_location: + row: 18 + column: 7 + fix: + content: "" + location: + row: 17 + column: 10 + end_location: + row: 18 + column: 10 + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false + location: + row: 23 + column: 4 + end_location: + row: 23 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false location: row: 24 - column: 10 + column: 4 end_location: + row: 24 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: "Remove repeated key literal `\"a\"`" + fixable: true + location: row: 25 - column: 10 - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 26 - column: 4 - end_location: - row: 26 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 29 - column: 4 - end_location: - row: 29 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 30 - column: 4 - end_location: - row: 30 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: "Remove repeated key literal `\"a\"`" - fixable: true - location: - row: 31 - column: 4 - end_location: - row: 31 - column: 7 - fix: - content: "" + column: 4 + end_location: + row: 25 + column: 7 + fix: + content: "" + location: + row: 24 + column: 10 + end_location: + row: 25 + column: 10 + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false location: - row: 30 - column: 10 + row: 26 + column: 4 end_location: + row: 26 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: "Remove repeated key literal `\"a\"`" + fixable: true + location: row: 31 - column: 10 - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 31 - column: 4 - end_location: - row: 31 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 32 - column: 4 - end_location: - row: 32 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 33 - column: 4 - end_location: - row: 33 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 34 - column: 4 - end_location: - row: 34 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 38 - column: 4 - end_location: - row: 38 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 40 - column: 4 - end_location: - row: 40 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 41 - column: 4 - end_location: - row: 41 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: ~ - fixable: false - location: - row: 43 - column: 4 - end_location: - row: 43 - column: 7 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: "Remove repeated key literal `\"a\"`" - fixable: true - location: - row: 45 - column: 4 - end_location: - row: 45 - column: 7 - fix: - content: "" + column: 4 + end_location: + row: 31 + column: 7 + fix: + content: "" + location: + row: 30 + column: 10 + end_location: + row: 31 + column: 10 + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false location: - row: 44 - column: 8 + row: 32 + column: 4 end_location: + row: 32 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false + location: + row: 33 + column: 4 + end_location: + row: 33 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false + location: + row: 34 + column: 4 + end_location: + row: 34 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false + location: + row: 41 + column: 4 + end_location: + row: 41 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false + location: + row: 43 + column: 4 + end_location: + row: 43 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: "Remove repeated key literal `\"a\"`" + fixable: true + location: row: 45 - column: 10 - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: "Remove repeated key literal `\"a\"`" - fixable: true - location: - row: 49 - column: 13 - end_location: - row: 49 - column: 16 - fix: - content: "" + column: 4 + end_location: + row: 45 + column: 7 + fix: + content: "" + location: + row: 44 + column: 8 + end_location: + row: 45 + column: 10 + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: "Remove repeated key literal `\"a\"`" + fixable: true location: row: 49 - column: 11 + column: 13 end_location: row: 49 - column: 19 - parent: ~ -- kind: - name: MultiValueRepeatedKeyLiteral - body: "Dictionary key literal `\"a\"` repeated" - suggestion: "Remove repeated key literal `\"a\"`" - fixable: true - location: - row: 50 - column: 21 - end_location: - row: 50 - column: 24 - fix: - content: "" + column: 16 + fix: + content: "" + location: + row: 49 + column: 11 + end_location: + row: 49 + column: 19 + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: "Remove repeated key literal `\"a\"`" + fixable: true location: row: 50 - column: 19 + column: 21 end_location: row: 50 - column: 27 - parent: ~ + column: 24 + fix: + content: "" + location: + row: 50 + column: 19 + end_location: + row: 50 + column: 27 + parent: ~ +- - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false + location: + row: 22 + column: 4 + end_location: + row: 22 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false + location: + row: 29 + column: 4 + end_location: + row: 29 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false + location: + row: 30 + column: 4 + end_location: + row: 30 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false + location: + row: 31 + column: 4 + end_location: + row: 31 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false + location: + row: 38 + column: 4 + end_location: + row: 38 + column: 7 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyLiteral + body: "Dictionary key literal `\"a\"` repeated" + suggestion: ~ + fixable: false + location: + row: 40 + column: 4 + end_location: + row: 40 + column: 7 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F602_F602.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F602_F602.py.snap index 67fc7d01b5a082..537ebaf1e33553 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F602_F602.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F602_F602.py.snap @@ -2,358 +2,358 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 5 - column: 4 - end_location: - row: 5 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 11 - column: 4 - end_location: - row: 11 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 12 - column: 4 - end_location: - row: 12 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: "Remove repeated key `a`" - fixable: true - location: - row: 13 - column: 4 - end_location: - row: 13 - column: 5 - fix: - content: "" +- - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false + location: + row: 5 + column: 4 + end_location: + row: 5 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false + location: + row: 11 + column: 4 + end_location: + row: 11 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false location: row: 12 - column: 8 + column: 4 end_location: + row: 12 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: "Remove repeated key `a`" + fixable: true + location: row: 13 - column: 8 - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 17 - column: 4 - end_location: - row: 17 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 18 - column: 4 - end_location: - row: 18 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 19 - column: 4 - end_location: - row: 19 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: "Remove repeated key `a`" - fixable: true - location: - row: 20 - column: 4 - end_location: - row: 20 - column: 5 - fix: - content: "" + column: 4 + end_location: + row: 13 + column: 5 + fix: + content: "" + location: + row: 12 + column: 8 + end_location: + row: 13 + column: 8 + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false + location: + row: 18 + column: 4 + end_location: + row: 18 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false location: row: 19 - column: 8 + column: 4 end_location: + row: 19 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: "Remove repeated key `a`" + fixable: true + location: row: 20 - column: 8 - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 21 - column: 4 - end_location: - row: 21 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 24 - column: 4 - end_location: - row: 24 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 25 - column: 4 - end_location: - row: 25 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: "Remove repeated key `a`" - fixable: true - location: - row: 26 - column: 4 - end_location: - row: 26 - column: 5 - fix: - content: "" + column: 4 + end_location: + row: 20 + column: 5 + fix: + content: "" + location: + row: 19 + column: 8 + end_location: + row: 20 + column: 8 + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false location: - row: 25 - column: 8 + row: 21 + column: 4 + end_location: + row: 21 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: "Remove repeated key `a`" + fixable: true + location: + row: 26 + column: 4 end_location: row: 26 - column: 8 - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 26 - column: 4 - end_location: - row: 26 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 27 - column: 4 - end_location: - row: 27 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 28 - column: 4 - end_location: - row: 28 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 29 - column: 4 - end_location: - row: 29 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 33 - column: 4 - end_location: - row: 33 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: "Remove repeated key `a`" - fixable: true - location: - row: 35 - column: 4 - end_location: - row: 35 - column: 5 - fix: - content: "" + column: 5 + fix: + content: "" + location: + row: 25 + column: 8 + end_location: + row: 26 + column: 8 + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false + location: + row: 27 + column: 4 + end_location: + row: 27 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false + location: + row: 28 + column: 4 + end_location: + row: 28 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false location: - row: 34 - column: 10 + row: 29 + column: 4 + end_location: + row: 29 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: "Remove repeated key `a`" + fixable: true + location: + row: 35 + column: 4 end_location: row: 35 - column: 8 - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 35 - column: 4 - end_location: - row: 35 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 37 - column: 4 - end_location: - row: 37 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 39 - column: 4 - end_location: - row: 39 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: ~ - fixable: false - location: - row: 41 - column: 4 - end_location: - row: 41 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: "Remove repeated key `a`" - fixable: true - location: - row: 44 - column: 11 - end_location: - row: 44 - column: 12 - fix: - content: "" + column: 5 + fix: + content: "" + location: + row: 34 + column: 10 + end_location: + row: 35 + column: 8 + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false + location: + row: 37 + column: 4 + end_location: + row: 37 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false + location: + row: 39 + column: 4 + end_location: + row: 39 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false + location: + row: 41 + column: 4 + end_location: + row: 41 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: "Remove repeated key `a`" + fixable: true location: row: 44 - column: 9 + column: 11 end_location: row: 44 - column: 15 - parent: ~ -- kind: - name: MultiValueRepeatedKeyVariable - body: "Dictionary key `a` repeated" - suggestion: "Remove repeated key `a`" - fixable: true - location: - row: 45 - column: 17 - end_location: - row: 45 - column: 18 - fix: - content: "" + column: 12 + fix: + content: "" + location: + row: 44 + column: 9 + end_location: + row: 44 + column: 15 + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: "Remove repeated key `a`" + fixable: true location: row: 45 - column: 15 + column: 17 end_location: row: 45 - column: 21 - parent: ~ + column: 18 + fix: + content: "" + location: + row: 45 + column: 15 + end_location: + row: 45 + column: 21 + parent: ~ +- - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false + location: + row: 17 + column: 4 + end_location: + row: 17 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false + location: + row: 24 + column: 4 + end_location: + row: 24 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false + location: + row: 25 + column: 4 + end_location: + row: 25 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false + location: + row: 26 + column: 4 + end_location: + row: 26 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false + location: + row: 33 + column: 4 + end_location: + row: 33 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MultiValueRepeatedKeyVariable + body: "Dictionary key `a` repeated" + suggestion: ~ + fixable: false + location: + row: 35 + column: 4 + end_location: + row: 35 + column: 5 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F622_F622.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F622_F622.py.snap index 0766a78568751f..685863dbbe6967 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F622_F622.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F622_F622.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: TwoStarredExpressions - body: Two starred expressions in assignment - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 9 - fix: ~ - parent: ~ +- - kind: + name: TwoStarredExpressions + body: Two starred expressions in assignment + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 9 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F631_F631.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F631_F631.py.snap index 658a30b929bdb0..41eaf7f77482fb 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F631_F631.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F631_F631.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: AssertTuple - body: "Assert test is a non-empty tuple, which is always `True`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 19 - fix: ~ - parent: ~ -- kind: - name: AssertTuple - body: "Assert test is a non-empty tuple, which is always `True`" - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 15 - fix: ~ - parent: ~ +- - kind: + name: AssertTuple + body: "Assert test is a non-empty tuple, which is always `True`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 19 + fix: ~ + parent: ~ + - kind: + name: AssertTuple + body: "Assert test is a non-empty tuple, which is always `True`" + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 15 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F632_F632.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F632_F632.py.snap index ca090efb58787f..31eea807771aaa 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F632_F632.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F632_F632.py.snap @@ -2,144 +2,144 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: IsLiteral - body: "Use `==` to compare constant literals" - suggestion: "Replace `is` with `==`" - fixable: true - location: - row: 1 - column: 3 - end_location: - row: 1 - column: 13 - fix: - content: "==" +- - kind: + name: IsLiteral + body: "Use `==` to compare constant literals" + suggestion: "Replace `is` with `==`" + fixable: true location: row: 1 - column: 5 + column: 3 end_location: row: 1 - column: 7 - parent: ~ -- kind: - name: IsLiteral - body: "Use `!=` to compare constant literals" - suggestion: "Replace `is not` with `!=`" - fixable: true - location: - row: 4 - column: 3 - end_location: - row: 4 - column: 15 - fix: - content: "!=" + column: 13 + fix: + content: "==" + location: + row: 1 + column: 5 + end_location: + row: 1 + column: 7 + parent: ~ + - kind: + name: IsLiteral + body: "Use `!=` to compare constant literals" + suggestion: "Replace `is not` with `!=`" + fixable: true location: row: 4 - column: 7 + column: 3 end_location: row: 4 - column: 13 - parent: ~ -- kind: - name: IsLiteral - body: "Use `!=` to compare constant literals" - suggestion: "Replace `is not` with `!=`" - fixable: true - location: - row: 7 - column: 3 - end_location: - row: 8 - column: 13 - fix: - content: "!=" + column: 15 + fix: + content: "!=" + location: + row: 4 + column: 7 + end_location: + row: 4 + column: 13 + parent: ~ + - kind: + name: IsLiteral + body: "Use `!=` to compare constant literals" + suggestion: "Replace `is not` with `!=`" + fixable: true location: row: 7 - column: 7 + column: 3 end_location: row: 8 - column: 11 - parent: ~ -- kind: - name: IsLiteral - body: "Use `==` to compare constant literals" - suggestion: "Replace `is` with `==`" - fixable: true - location: - row: 11 - column: 3 - end_location: - row: 11 - column: 17 - fix: - content: "==" + column: 13 + fix: + content: "!=" + location: + row: 7 + column: 7 + end_location: + row: 8 + column: 11 + parent: ~ + - kind: + name: IsLiteral + body: "Use `==` to compare constant literals" + suggestion: "Replace `is` with `==`" + fixable: true location: row: 11 - column: 9 + column: 3 end_location: row: 11 - column: 11 - parent: ~ -- kind: - name: IsLiteral - body: "Use `==` to compare constant literals" - suggestion: "Replace `is` with `==`" - fixable: true - location: - row: 14 - column: 3 - end_location: - row: 14 - column: 18 - fix: - content: "==" + column: 17 + fix: + content: "==" + location: + row: 11 + column: 9 + end_location: + row: 11 + column: 11 + parent: ~ + - kind: + name: IsLiteral + body: "Use `==` to compare constant literals" + suggestion: "Replace `is` with `==`" + fixable: true location: row: 14 - column: 14 + column: 3 end_location: row: 14 - column: 16 - parent: ~ -- kind: - name: IsLiteral - body: "Use `==` to compare constant literals" - suggestion: "Replace `is` with `==`" - fixable: true - location: - row: 17 - column: 3 - end_location: - row: 17 - column: 20 - fix: - content: "==" + column: 18 + fix: + content: "==" + location: + row: 14 + column: 14 + end_location: + row: 14 + column: 16 + parent: ~ + - kind: + name: IsLiteral + body: "Use `==` to compare constant literals" + suggestion: "Replace `is` with `==`" + fixable: true location: row: 17 - column: 16 + column: 3 end_location: row: 17 - column: 18 - parent: ~ -- kind: - name: IsLiteral - body: "Use `==` to compare constant literals" - suggestion: "Replace `is` with `==`" - fixable: true - location: - row: 20 - column: 13 - end_location: - row: 20 - column: 19 - fix: - content: "==" + column: 20 + fix: + content: "==" + location: + row: 17 + column: 16 + end_location: + row: 17 + column: 18 + parent: ~ + - kind: + name: IsLiteral + body: "Use `==` to compare constant literals" + suggestion: "Replace `is` with `==`" + fixable: true location: row: 20 - column: 15 + column: 13 end_location: row: 20 - column: 17 - parent: ~ + column: 19 + fix: + content: "==" + location: + row: 20 + column: 15 + end_location: + row: 20 + column: 17 + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F633_F633.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F633_F633.py.snap index 143a1ece5752e8..e936d014ec511a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F633_F633.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F633_F633.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: InvalidPrintSyntax - body: "Use of `>>` is invalid with `print` function" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 5 - fix: ~ - parent: ~ +- - kind: + name: InvalidPrintSyntax + body: "Use of `>>` is invalid with `print` function" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 5 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F634_F634.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F634_F634.py.snap index d8b5f883fc9b7d..ccabf44f51cf00 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F634_F634.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F634_F634.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: IfTuple - body: "If test is a tuple, which is always `True`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 2 - column: 8 - fix: ~ - parent: ~ -- kind: - name: IfTuple - body: "If test is a tuple, which is always `True`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 4 - end_location: - row: 10 - column: 12 - fix: ~ - parent: ~ +- - kind: + name: IfTuple + body: "If test is a tuple, which is always `True`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 2 + column: 8 + fix: ~ + parent: ~ + - kind: + name: IfTuple + body: "If test is a tuple, which is always `True`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 4 + end_location: + row: 10 + column: 12 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F701_F701.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F701_F701.py.snap index b34152f0905edb..5d8c7aa9d46160 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F701_F701.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F701_F701.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: BreakOutsideLoop - body: "`break` outside loop" - suggestion: ~ - fixable: false - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 9 - fix: ~ - parent: ~ -- kind: - name: BreakOutsideLoop - body: "`break` outside loop" - suggestion: ~ - fixable: false - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 9 - fix: ~ - parent: ~ -- kind: - name: BreakOutsideLoop - body: "`break` outside loop" - suggestion: ~ - fixable: false - location: - row: 20 - column: 4 - end_location: - row: 20 - column: 9 - fix: ~ - parent: ~ -- kind: - name: BreakOutsideLoop - body: "`break` outside loop" - suggestion: ~ - fixable: false - location: - row: 23 - column: 0 - end_location: - row: 23 - column: 5 - fix: ~ - parent: ~ +- - kind: + name: BreakOutsideLoop + body: "`break` outside loop" + suggestion: ~ + fixable: false + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 9 + fix: ~ + parent: ~ + - kind: + name: BreakOutsideLoop + body: "`break` outside loop" + suggestion: ~ + fixable: false + location: + row: 16 + column: 4 + end_location: + row: 16 + column: 9 + fix: ~ + parent: ~ + - kind: + name: BreakOutsideLoop + body: "`break` outside loop" + suggestion: ~ + fixable: false + location: + row: 20 + column: 4 + end_location: + row: 20 + column: 9 + fix: ~ + parent: ~ + - kind: + name: BreakOutsideLoop + body: "`break` outside loop" + suggestion: ~ + fixable: false + location: + row: 23 + column: 0 + end_location: + row: 23 + column: 5 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F702_F702.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F702_F702.py.snap index a99dcce3ea127f..cf0d408c173475 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F702_F702.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F702_F702.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: ContinueOutsideLoop - body: "`continue` not properly in loop" - suggestion: ~ - fixable: false - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 12 - fix: ~ - parent: ~ -- kind: - name: ContinueOutsideLoop - body: "`continue` not properly in loop" - suggestion: ~ - fixable: false - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 12 - fix: ~ - parent: ~ -- kind: - name: ContinueOutsideLoop - body: "`continue` not properly in loop" - suggestion: ~ - fixable: false - location: - row: 20 - column: 4 - end_location: - row: 20 - column: 12 - fix: ~ - parent: ~ -- kind: - name: ContinueOutsideLoop - body: "`continue` not properly in loop" - suggestion: ~ - fixable: false - location: - row: 23 - column: 0 - end_location: - row: 23 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: ContinueOutsideLoop + body: "`continue` not properly in loop" + suggestion: ~ + fixable: false + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 12 + fix: ~ + parent: ~ + - kind: + name: ContinueOutsideLoop + body: "`continue` not properly in loop" + suggestion: ~ + fixable: false + location: + row: 16 + column: 4 + end_location: + row: 16 + column: 12 + fix: ~ + parent: ~ + - kind: + name: ContinueOutsideLoop + body: "`continue` not properly in loop" + suggestion: ~ + fixable: false + location: + row: 20 + column: 4 + end_location: + row: 20 + column: 12 + fix: ~ + parent: ~ + - kind: + name: ContinueOutsideLoop + body: "`continue` not properly in loop" + suggestion: ~ + fixable: false + location: + row: 23 + column: 0 + end_location: + row: 23 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F704_F704.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F704_F704.py.snap index 19c160ef6c01ca..dd5b42ffca598c 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F704_F704.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F704_F704.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: YieldOutsideFunction - body: "`yield` statement outside of a function" - suggestion: ~ - fixable: false - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 11 - fix: ~ - parent: ~ -- kind: - name: YieldOutsideFunction - body: "`yield` statement outside of a function" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 7 - fix: ~ - parent: ~ -- kind: - name: YieldOutsideFunction - body: "`yield from` statement outside of a function" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 12 - fix: ~ - parent: ~ -- kind: - name: YieldOutsideFunction - body: "`await` statement outside of a function" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 9 - fix: ~ - parent: ~ +- - kind: + name: YieldOutsideFunction + body: "`yield` statement outside of a function" + suggestion: ~ + fixable: false + location: + row: 6 + column: 4 + end_location: + row: 6 + column: 11 + fix: ~ + parent: ~ + - kind: + name: YieldOutsideFunction + body: "`yield` statement outside of a function" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 7 + fix: ~ + parent: ~ + - kind: + name: YieldOutsideFunction + body: "`yield from` statement outside of a function" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 12 + fix: ~ + parent: ~ + - kind: + name: YieldOutsideFunction + body: "`await` statement outside of a function" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 9 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F706_F706.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F706_F706.py.snap index 1623807514744a..e95403012561f0 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F706_F706.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F706_F706.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: ReturnOutsideFunction - body: "`return` statement outside of a function/method" - suggestion: ~ - fixable: false - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 12 - fix: ~ - parent: ~ -- kind: - name: ReturnOutsideFunction - body: "`return` statement outside of a function/method" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: ReturnOutsideFunction + body: "`return` statement outside of a function/method" + suggestion: ~ + fixable: false + location: + row: 6 + column: 4 + end_location: + row: 6 + column: 12 + fix: ~ + parent: ~ + - kind: + name: ReturnOutsideFunction + body: "`return` statement outside of a function/method" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F707_F707.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F707_F707.py.snap index 839fe65c1b7c79..0da3a125f156c3 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F707_F707.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F707_F707.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: DefaultExceptNotLast - body: "An `except` block as not the last exception handler" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 6 - fix: ~ - parent: ~ -- kind: - name: DefaultExceptNotLast - body: "An `except` block as not the last exception handler" - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 6 - fix: ~ - parent: ~ -- kind: - name: DefaultExceptNotLast - body: "An `except` block as not the last exception handler" - suggestion: ~ - fixable: false - location: - row: 19 - column: 0 - end_location: - row: 19 - column: 6 - fix: ~ - parent: ~ +- - kind: + name: DefaultExceptNotLast + body: "An `except` block as not the last exception handler" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 6 + fix: ~ + parent: ~ + - kind: + name: DefaultExceptNotLast + body: "An `except` block as not the last exception handler" + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 6 + fix: ~ + parent: ~ + - kind: + name: DefaultExceptNotLast + body: "An `except` block as not the last exception handler" + suggestion: ~ + fixable: false + location: + row: 19 + column: 0 + end_location: + row: 19 + column: 6 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F722_F722.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F722_F722.py.snap index 7abd45ef9fb14f..e7d6c5586e68d0 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F722_F722.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F722_F722.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: ForwardAnnotationSyntaxError - body: "Syntax error in forward annotation: `///`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 11 - end_location: - row: 9 - column: 16 - fix: ~ - parent: ~ +- - kind: + name: ForwardAnnotationSyntaxError + body: "Syntax error in forward annotation: `///`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 11 + end_location: + row: 9 + column: 16 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_0.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_0.py.snap index dcbae234d05ae7..e373331c5b94d4 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_0.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_0.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: RedefinedWhileUnused - body: "Redefinition of unused `bar` from line 6" - suggestion: ~ - fixable: false - location: - row: 10 - column: 4 - end_location: - row: 10 - column: 7 - fix: ~ - parent: ~ +- - kind: + name: RedefinedWhileUnused + body: "Redefinition of unused `bar` from line 6" + suggestion: ~ + fixable: false + location: + row: 10 + column: 4 + end_location: + row: 10 + column: 7 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_1.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_1.py.snap index a25bc30b53c9ce..b161398f19fbbb 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_1.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_1.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: RedefinedWhileUnused - body: "Redefinition of unused `FU` from line 1" - suggestion: ~ - fixable: false - location: - row: 1 - column: 17 - end_location: - row: 1 - column: 26 - fix: ~ - parent: ~ +- - kind: + name: RedefinedWhileUnused + body: "Redefinition of unused `FU` from line 1" + suggestion: ~ + fixable: false + location: + row: 1 + column: 17 + end_location: + row: 1 + column: 26 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_10.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_10.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_10.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_10.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_11.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_11.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_11.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_11.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_12.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_12.py.snap index 1e4ef1d35f390f..2151807f251430 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_12.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_12.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: RedefinedWhileUnused - body: "Redefinition of unused `mixer` from line 2" - suggestion: ~ - fixable: false - location: - row: 6 - column: 19 - end_location: - row: 6 - column: 24 - fix: ~ - parent: ~ +- - kind: + name: RedefinedWhileUnused + body: "Redefinition of unused `mixer` from line 2" + suggestion: ~ + fixable: false + location: + row: 6 + column: 19 + end_location: + row: 6 + column: 24 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_13.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_13.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_13.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_13.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_14.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_14.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_14.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_14.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_15.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_15.py.snap index bc9a8d525569b3..5d8ea779407e70 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_15.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_15.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: RedefinedWhileUnused - body: "Redefinition of unused `fu` from line 1" - suggestion: ~ - fixable: false - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 6 - fix: ~ - parent: ~ +- - kind: + name: RedefinedWhileUnused + body: "Redefinition of unused `fu` from line 1" + suggestion: ~ + fixable: false + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 6 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_16.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_16.py.snap index fd70244356f9e0..62892a6eb99903 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_16.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_16.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: RedefinedWhileUnused - body: "Redefinition of unused `fu` from line 3" - suggestion: ~ - fixable: false - location: - row: 8 - column: 12 - end_location: - row: 8 - column: 14 - fix: ~ - parent: ~ +- - kind: + name: RedefinedWhileUnused + body: "Redefinition of unused `fu` from line 3" + suggestion: ~ + fixable: false + location: + row: 8 + column: 12 + end_location: + row: 8 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_17.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_17.py.snap index 5ae127d83d75d6..27f0c416a33396 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_17.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_17.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: RedefinedWhileUnused - body: "Redefinition of unused `fu` from line 2" - suggestion: ~ - fixable: false - location: - row: 6 - column: 11 - end_location: - row: 6 - column: 13 - fix: ~ - parent: ~ -- kind: - name: RedefinedWhileUnused - body: "Redefinition of unused `fu` from line 6" - suggestion: ~ - fixable: false - location: - row: 9 - column: 12 - end_location: - row: 9 - column: 14 - fix: ~ - parent: ~ +- - kind: + name: RedefinedWhileUnused + body: "Redefinition of unused `fu` from line 2" + suggestion: ~ + fixable: false + location: + row: 6 + column: 11 + end_location: + row: 6 + column: 13 + fix: ~ + parent: ~ + - kind: + name: RedefinedWhileUnused + body: "Redefinition of unused `fu` from line 6" + suggestion: ~ + fixable: false + location: + row: 9 + column: 12 + end_location: + row: 9 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_18.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_18.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_18.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_18.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_19.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_19.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_19.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_19.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_2.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_2.py.snap index b521c2d22ba57f..9f48438b91a68b 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_2.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_2.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: RedefinedWhileUnused - body: "Redefinition of unused `FU` from line 1" - suggestion: ~ - fixable: false - location: - row: 1 - column: 26 - end_location: - row: 1 - column: 35 - fix: ~ - parent: ~ +- - kind: + name: RedefinedWhileUnused + body: "Redefinition of unused `FU` from line 1" + suggestion: ~ + fixable: false + location: + row: 1 + column: 26 + end_location: + row: 1 + column: 35 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_20.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_20.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_20.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_20.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_21.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_21.py.snap index 7f0942c349300d..5826589a1bdcbd 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_21.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_21.py.snap @@ -2,19 +2,19 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: RedefinedWhileUnused - body: "Redefinition of unused `Sequence` from line 26" - suggestion: ~ - fixable: false - location: - row: 32 - column: 4 - end_location: - row: 32 - column: 12 - fix: ~ - parent: - row: 30 - column: 0 +- - kind: + name: RedefinedWhileUnused + body: "Redefinition of unused `Sequence` from line 26" + suggestion: ~ + fixable: false + location: + row: 32 + column: 4 + end_location: + row: 32 + column: 12 + fix: ~ + parent: + row: 30 + column: 0 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_3.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_3.py.snap index d10e460688256b..d127d211ba8637 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_3.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_3.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: RedefinedWhileUnused - body: "Redefinition of unused `fu` from line 1" - suggestion: ~ - fixable: false - location: - row: 1 - column: 11 - end_location: - row: 1 - column: 13 - fix: ~ - parent: ~ +- - kind: + name: RedefinedWhileUnused + body: "Redefinition of unused `fu` from line 1" + suggestion: ~ + fixable: false + location: + row: 1 + column: 11 + end_location: + row: 1 + column: 13 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_4.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_4.py.snap index d10e460688256b..d127d211ba8637 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_4.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_4.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: RedefinedWhileUnused - body: "Redefinition of unused `fu` from line 1" - suggestion: ~ - fixable: false - location: - row: 1 - column: 11 - end_location: - row: 1 - column: 13 - fix: ~ - parent: ~ +- - kind: + name: RedefinedWhileUnused + body: "Redefinition of unused `fu` from line 1" + suggestion: ~ + fixable: false + location: + row: 1 + column: 11 + end_location: + row: 1 + column: 13 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_5.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_5.py.snap index f215f9172a9026..746a0526e0ddce 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_5.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_5.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: RedefinedWhileUnused - body: "Redefinition of unused `fu` from line 1" - suggestion: ~ - fixable: false - location: - row: 1 - column: 12 - end_location: - row: 1 - column: 14 - fix: ~ - parent: ~ +- - kind: + name: RedefinedWhileUnused + body: "Redefinition of unused `fu` from line 1" + suggestion: ~ + fixable: false + location: + row: 1 + column: 12 + end_location: + row: 1 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_6.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_6.py.snap index f9ca75790e2175..29670946a4976d 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_6.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_6.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: RedefinedWhileUnused - body: "Redefinition of unused `os` from line 5" - suggestion: ~ - fixable: false - location: - row: 6 - column: 11 - end_location: - row: 6 - column: 13 - fix: ~ - parent: ~ +- - kind: + name: RedefinedWhileUnused + body: "Redefinition of unused `os` from line 5" + suggestion: ~ + fixable: false + location: + row: 6 + column: 11 + end_location: + row: 6 + column: 13 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_7.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_7.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_7.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_7.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_8.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_8.py.snap index ec4d243b9f9910..9edffe5af61b32 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_8.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_8.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: RedefinedWhileUnused - body: "Redefinition of unused `os` from line 4" - suggestion: ~ - fixable: false - location: - row: 5 - column: 11 - end_location: - row: 5 - column: 13 - fix: ~ - parent: ~ +- - kind: + name: RedefinedWhileUnused + body: "Redefinition of unused `os` from line 4" + suggestion: ~ + fixable: false + location: + row: 5 + column: 11 + end_location: + row: 5 + column: 13 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_9.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_9.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_9.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_9.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_0.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_0.py.snap index 9e379a7431252e..f7185149e811a5 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_0.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_0.py.snap @@ -2,173 +2,173 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedName - body: "Undefined name `self`" - suggestion: ~ - fixable: false - location: - row: 2 - column: 11 - end_location: - row: 2 - column: 15 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `self`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 12 - end_location: - row: 6 - column: 16 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `self`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 8 - end_location: - row: 10 - column: 12 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `numeric_string`" - suggestion: ~ - fixable: false - location: - row: 21 - column: 11 - end_location: - row: 21 - column: 25 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `Bar`" - suggestion: ~ - fixable: false - location: - row: 58 - column: 3 - end_location: - row: 58 - column: 8 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `TOMATO`" - suggestion: ~ - fixable: false - location: - row: 83 - column: 10 - end_location: - row: 83 - column: 16 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `B`" - suggestion: ~ - fixable: false - location: - row: 87 - column: 7 - end_location: - row: 87 - column: 8 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `B`" - suggestion: ~ - fixable: false - location: - row: 90 - column: 7 - end_location: - row: 90 - column: 8 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `B`" - suggestion: ~ - fixable: false - location: - row: 92 - column: 10 - end_location: - row: 92 - column: 11 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `B`" - suggestion: ~ - fixable: false - location: - row: 93 - column: 13 - end_location: - row: 93 - column: 14 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `PEP593Test123`" - suggestion: ~ - fixable: false - location: - row: 115 - column: 8 - end_location: - row: 115 - column: 23 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `foo`" - suggestion: ~ - fixable: false - location: - row: 123 - column: 13 - end_location: - row: 123 - column: 18 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `bar`" - suggestion: ~ - fixable: false - location: - row: 123 - column: 20 - end_location: - row: 123 - column: 25 - fix: ~ - parent: ~ +- - kind: + name: UndefinedName + body: "Undefined name `self`" + suggestion: ~ + fixable: false + location: + row: 2 + column: 11 + end_location: + row: 2 + column: 15 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `self`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 12 + end_location: + row: 6 + column: 16 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `self`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 8 + end_location: + row: 10 + column: 12 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `numeric_string`" + suggestion: ~ + fixable: false + location: + row: 21 + column: 11 + end_location: + row: 21 + column: 25 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `Bar`" + suggestion: ~ + fixable: false + location: + row: 58 + column: 3 + end_location: + row: 58 + column: 8 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `TOMATO`" + suggestion: ~ + fixable: false + location: + row: 83 + column: 10 + end_location: + row: 83 + column: 16 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `B`" + suggestion: ~ + fixable: false + location: + row: 87 + column: 7 + end_location: + row: 87 + column: 8 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `B`" + suggestion: ~ + fixable: false + location: + row: 90 + column: 7 + end_location: + row: 90 + column: 8 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `B`" + suggestion: ~ + fixable: false + location: + row: 92 + column: 10 + end_location: + row: 92 + column: 11 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `B`" + suggestion: ~ + fixable: false + location: + row: 93 + column: 13 + end_location: + row: 93 + column: 14 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `PEP593Test123`" + suggestion: ~ + fixable: false + location: + row: 115 + column: 8 + end_location: + row: 115 + column: 23 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `foo`" + suggestion: ~ + fixable: false + location: + row: 123 + column: 13 + end_location: + row: 123 + column: 18 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `bar`" + suggestion: ~ + fixable: false + location: + row: 123 + column: 20 + end_location: + row: 123 + column: 25 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_1.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_1.py.snap index 37d0c8883cea04..6aa6bd29842071 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_1.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_1.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedName - body: "Undefined name `Model`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 9 - end_location: - row: 11 - column: 16 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `Model`" - suggestion: ~ - fixable: false - location: - row: 18 - column: 16 - end_location: - row: 18 - column: 23 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `Model`" - suggestion: ~ - fixable: false - location: - row: 24 - column: 12 - end_location: - row: 24 - column: 19 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `Model`" - suggestion: ~ - fixable: false - location: - row: 30 - column: 10 - end_location: - row: 30 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: UndefinedName + body: "Undefined name `Model`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 9 + end_location: + row: 11 + column: 16 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `Model`" + suggestion: ~ + fixable: false + location: + row: 18 + column: 16 + end_location: + row: 18 + column: 23 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `Model`" + suggestion: ~ + fixable: false + location: + row: 24 + column: 12 + end_location: + row: 24 + column: 19 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `Model`" + suggestion: ~ + fixable: false + location: + row: 30 + column: 10 + end_location: + row: 30 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_10.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_10.py.snap index bd5537b631331b..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_10.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_10.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_11.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_11.py.snap index 5c04e948829414..d2eed617827e02 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_11.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_11.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedName - body: "Undefined name `os`" - suggestion: ~ - fixable: false - location: - row: 18 - column: 26 - end_location: - row: 18 - column: 30 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `Baz`" - suggestion: ~ - fixable: false - location: - row: 23 - column: 12 - end_location: - row: 23 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: UndefinedName + body: "Undefined name `os`" + suggestion: ~ + fixable: false + location: + row: 18 + column: 26 + end_location: + row: 18 + column: 30 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `Baz`" + suggestion: ~ + fixable: false + location: + row: 23 + column: 12 + end_location: + row: 23 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_12.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_12.py.snap index b2c3135b2156a6..fafcc006523eb4 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_12.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_12.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedName - body: "Undefined name `os`" - suggestion: ~ - fixable: false - location: - row: 20 - column: 26 - end_location: - row: 20 - column: 30 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `Baz`" - suggestion: ~ - fixable: false - location: - row: 25 - column: 12 - end_location: - row: 25 - column: 17 - fix: ~ - parent: ~ +- - kind: + name: UndefinedName + body: "Undefined name `os`" + suggestion: ~ + fixable: false + location: + row: 20 + column: 26 + end_location: + row: 20 + column: 30 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `Baz`" + suggestion: ~ + fixable: false + location: + row: 25 + column: 12 + end_location: + row: 25 + column: 17 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_2.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_2.py.snap index 7ebf1ccc8de2d2..9391f1d2dbcf67 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_2.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_2.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedName - body: "Undefined name `Model`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 11 - end_location: - row: 5 - column: 18 - fix: ~ - parent: ~ +- - kind: + name: UndefinedName + body: "Undefined name `Model`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 11 + end_location: + row: 5 + column: 18 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_3.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_3.py.snap index e53911d9d4b640..01eed0799e6345 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_3.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_3.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedName - body: "Undefined name `key`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 8 - end_location: - row: 11 - column: 13 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `value`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 15 - end_location: - row: 11 - column: 22 - fix: ~ - parent: ~ +- - kind: + name: UndefinedName + body: "Undefined name `key`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 8 + end_location: + row: 11 + column: 13 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `value`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 15 + end_location: + row: 11 + column: 22 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_4.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_4.py.snap index adfb3fa013d2c1..f4ed197e64b5c2 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_4.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_4.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedName - body: "Undefined name `Model`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 9 - end_location: - row: 4 - column: 16 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `Model`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 10 - end_location: - row: 9 - column: 17 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `Model`" - suggestion: ~ - fixable: false - location: - row: 14 - column: 14 - end_location: - row: 14 - column: 21 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `Model`" - suggestion: ~ - fixable: false - location: - row: 19 - column: 30 - end_location: - row: 19 - column: 37 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `Model`" - suggestion: ~ - fixable: false - location: - row: 24 - column: 18 - end_location: - row: 24 - column: 25 - fix: ~ - parent: ~ +- - kind: + name: UndefinedName + body: "Undefined name `Model`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 9 + end_location: + row: 4 + column: 16 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `Model`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 10 + end_location: + row: 9 + column: 17 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `Model`" + suggestion: ~ + fixable: false + location: + row: 14 + column: 14 + end_location: + row: 14 + column: 21 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `Model`" + suggestion: ~ + fixable: false + location: + row: 19 + column: 30 + end_location: + row: 19 + column: 37 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `Model`" + suggestion: ~ + fixable: false + location: + row: 24 + column: 18 + end_location: + row: 24 + column: 25 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_5.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_5.py.snap index 2c32a17a7eddcc..4624c15de15842 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_5.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_5.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedName - body: "Undefined name `InnerClass`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 29 - end_location: - row: 5 - column: 41 - fix: ~ - parent: ~ +- - kind: + name: UndefinedName + body: "Undefined name `InnerClass`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 29 + end_location: + row: 5 + column: 41 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_6.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_6.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_6.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_6.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_7.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_7.py.snap index 93de75646e469e..ba9e29946b211a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_7.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_7.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedName - body: "Undefined name `Undefined`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 20 - end_location: - row: 11 - column: 31 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `Undefined`" - suggestion: ~ - fixable: false - location: - row: 12 - column: 25 - end_location: - row: 12 - column: 36 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `Undefined`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 20 - end_location: - row: 13 - column: 31 - fix: ~ - parent: ~ +- - kind: + name: UndefinedName + body: "Undefined name `Undefined`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 20 + end_location: + row: 11 + column: 31 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `Undefined`" + suggestion: ~ + fixable: false + location: + row: 12 + column: 25 + end_location: + row: 12 + column: 36 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `Undefined`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 20 + end_location: + row: 13 + column: 31 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_8.pyi.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_8.pyi.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_8.pyi.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_8.pyi.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_9.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_9.py.snap index 6becc38817e8f6..f3408780cb6691 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_9.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_9.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedName - body: "Undefined name `captured`" - suggestion: ~ - fixable: false - location: - row: 22 - column: 19 - end_location: - row: 22 - column: 27 - fix: ~ - parent: ~ +- - kind: + name: UndefinedName + body: "Undefined name `captured`" + suggestion: ~ + fixable: false + location: + row: 22 + column: 19 + end_location: + row: 22 + column: 27 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_0.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_0.py.snap index c1de83dff06210..ff01f4e8c93f6a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_0.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_0.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedExport - body: "Undefined name `b` in `__all__`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 7 - fix: ~ - parent: ~ +- - kind: + name: UndefinedExport + body: "Undefined name `b` in `__all__`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 7 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_1.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_1.py.snap index c1de83dff06210..ff01f4e8c93f6a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_1.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_1.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedExport - body: "Undefined name `b` in `__all__`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 7 - fix: ~ - parent: ~ +- - kind: + name: UndefinedExport + body: "Undefined name `b` in `__all__`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 7 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_2.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_2.py.snap index bd5537b631331b..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_2.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_2.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F823_F823.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F823_F823.py.snap index d03ab14a1833d3..c0ddc047b0461c 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F823_F823.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F823_F823.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedLocal - body: "Local variable `my_var` referenced before assignment" - suggestion: ~ - fixable: false - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 10 - fix: ~ - parent: ~ +- - kind: + name: UndefinedLocal + body: "Local variable `my_var` referenced before assignment" + suggestion: ~ + fixable: false + location: + row: 6 + column: 4 + end_location: + row: 6 + column: 10 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_0.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_0.py.snap index 9186e688c3152e..69790a7dc1f950 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_0.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_0.py.snap @@ -2,341 +2,341 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UnusedVariable - body: "Local variable `e` is assigned to but never used" - suggestion: "Remove assignment to unused variable `e`" - fixable: true - location: - row: 3 - column: 21 - end_location: - row: 3 - column: 22 - fix: - content: "" +- - kind: + name: UnusedVariable + body: "Local variable `e` is assigned to but never used" + suggestion: "Remove assignment to unused variable `e`" + fixable: true location: row: 3 - column: 17 + column: 21 end_location: row: 3 column: 22 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `x` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x`" - fixable: true - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 5 - fix: - content: "" + fix: + content: "" + location: + row: 3 + column: 17 + end_location: + row: 3 + column: 22 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `z` is assigned to but never used" + suggestion: "Remove assignment to unused variable `z`" + fixable: true location: - row: 14 - column: 0 + row: 16 + column: 4 end_location: - row: 15 - column: 0 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y`" - fixable: true - location: - row: 15 - column: 4 - end_location: - row: 15 - column: 5 - fix: - content: pass + row: 16 + column: 5 + fix: + content: "" + location: + row: 16 + column: 0 + end_location: + row: 17 + column: 0 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `foo` is assigned to but never used" + suggestion: "Remove assignment to unused variable `foo`" + fixable: true location: - row: 15 + row: 20 column: 4 end_location: - row: 15 - column: 9 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `z` is assigned to but never used" - suggestion: "Remove assignment to unused variable `z`" - fixable: true - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 5 - fix: - content: "" + row: 20 + column: 7 + fix: + content: "" + location: + row: 20 + column: 0 + end_location: + row: 21 + column: 0 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `a` is assigned to but never used" + suggestion: "Remove assignment to unused variable `a`" + fixable: true location: - row: 16 - column: 0 + row: 21 + column: 5 end_location: - row: 17 - column: 0 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `a` is assigned to but never used" - suggestion: "Remove assignment to unused variable `a`" - fixable: true - location: - row: 18 - column: 5 - end_location: - row: 18 - column: 6 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `b` is assigned to but never used" - suggestion: "Remove assignment to unused variable `b`" - fixable: true - location: - row: 18 - column: 8 - end_location: - row: 18 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `a` is assigned to but never used" - suggestion: "Remove assignment to unused variable `a`" - fixable: true - location: - row: 19 - column: 5 - end_location: - row: 19 - column: 6 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `b` is assigned to but never used" - suggestion: "Remove assignment to unused variable `b`" - fixable: true - location: - row: 19 - column: 8 - end_location: - row: 19 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `foo` is assigned to but never used" - suggestion: "Remove assignment to unused variable `foo`" - fixable: true - location: - row: 20 - column: 4 - end_location: - row: 20 - column: 7 - fix: - content: "" + row: 21 + column: 6 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `b` is assigned to but never used" + suggestion: "Remove assignment to unused variable `b`" + fixable: true location: - row: 20 - column: 0 + row: 21 + column: 8 end_location: row: 21 - column: 0 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `a` is assigned to but never used" - suggestion: "Remove assignment to unused variable `a`" - fixable: true - location: - row: 21 - column: 5 - end_location: - row: 21 - column: 6 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `b` is assigned to but never used" - suggestion: "Remove assignment to unused variable `b`" - fixable: true - location: - row: 21 - column: 8 - end_location: - row: 21 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `baz` is assigned to but never used" - suggestion: "Remove assignment to unused variable `baz`" - fixable: true - location: - row: 26 - column: 13 - end_location: - row: 26 - column: 16 - fix: - content: "" + column: 9 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `baz` is assigned to but never used" + suggestion: "Remove assignment to unused variable `baz`" + fixable: true location: row: 26 column: 13 end_location: row: 26 - column: 19 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `b` is assigned to but never used" - suggestion: "Remove assignment to unused variable `b`" - fixable: true - location: - row: 51 - column: 8 - end_location: - row: 51 - column: 9 - fix: - content: pass + column: 16 + fix: + content: "" + location: + row: 26 + column: 13 + end_location: + row: 26 + column: 19 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `b` is assigned to but never used" + suggestion: "Remove assignment to unused variable `b`" + fixable: true location: row: 51 column: 8 end_location: row: 51 - column: 13 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `my_file` is assigned to but never used" - suggestion: "Remove assignment to unused variable `my_file`" - fixable: true - location: - row: 79 - column: 25 - end_location: - row: 79 - column: 32 - fix: - content: "" + column: 9 + fix: + content: pass + location: + row: 51 + column: 8 + end_location: + row: 51 + column: 13 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `my_file` is assigned to but never used" + suggestion: "Remove assignment to unused variable `my_file`" + fixable: true location: row: 79 - column: 21 + column: 25 end_location: row: 79 column: 32 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `my_file` is assigned to but never used" - suggestion: "Remove assignment to unused variable `my_file`" - fixable: true - location: - row: 85 - column: 24 - end_location: - row: 85 - column: 31 - fix: - content: "" + fix: + content: "" + location: + row: 79 + column: 21 + end_location: + row: 79 + column: 32 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `my_file` is assigned to but never used" + suggestion: "Remove assignment to unused variable `my_file`" + fixable: true location: row: 85 - column: 20 + column: 24 end_location: row: 85 column: 31 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `msg3` is assigned to but never used" - suggestion: "Remove assignment to unused variable `msg3`" - fixable: true - location: - row: 102 - column: 4 - end_location: - row: 102 - column: 8 - fix: - content: "" + fix: + content: "" + location: + row: 85 + column: 20 + end_location: + row: 85 + column: 31 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `msg3` is assigned to but never used" + suggestion: "Remove assignment to unused variable `msg3`" + fixable: true location: row: 102 - column: 0 + column: 4 end_location: - row: 103 - column: 0 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `Baz` is assigned to but never used" - suggestion: "Remove assignment to unused variable `Baz`" - fixable: true - location: - row: 115 - column: 4 - end_location: - row: 115 - column: 7 - fix: - content: "" + row: 102 + column: 8 + fix: + content: "" + location: + row: 102 + column: 0 + end_location: + row: 103 + column: 0 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `Baz` is assigned to but never used" + suggestion: "Remove assignment to unused variable `Baz`" + fixable: true location: row: 115 column: 4 end_location: row: 115 - column: 10 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y`" - fixable: true - location: - row: 118 - column: 13 - end_location: - row: 118 - column: 14 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y`" - fixable: true - location: - row: 119 - column: 13 - end_location: - row: 119 - column: 14 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y`" - fixable: true - location: - row: 122 - column: 13 - end_location: - row: 122 - column: 14 - fix: ~ - parent: ~ + column: 7 + fix: + content: "" + location: + row: 115 + column: 4 + end_location: + row: 115 + column: 10 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y`" + fixable: true + location: + row: 122 + column: 13 + end_location: + row: 122 + column: 14 + fix: ~ + parent: ~ +- - kind: + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x`" + fixable: true + location: + row: 14 + column: 4 + end_location: + row: 14 + column: 5 + fix: + content: "" + location: + row: 14 + column: 0 + end_location: + row: 15 + column: 0 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y`" + fixable: true + location: + row: 15 + column: 4 + end_location: + row: 15 + column: 5 + fix: + content: pass + location: + row: 15 + column: 4 + end_location: + row: 15 + column: 9 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `a` is assigned to but never used" + suggestion: "Remove assignment to unused variable `a`" + fixable: true + location: + row: 19 + column: 5 + end_location: + row: 19 + column: 6 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `b` is assigned to but never used" + suggestion: "Remove assignment to unused variable `b`" + fixable: true + location: + row: 19 + column: 8 + end_location: + row: 19 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y`" + fixable: true + location: + row: 119 + column: 13 + end_location: + row: 119 + column: 14 + fix: ~ + parent: ~ +- - kind: + name: UnusedVariable + body: "Local variable `a` is assigned to but never used" + suggestion: "Remove assignment to unused variable `a`" + fixable: true + location: + row: 18 + column: 5 + end_location: + row: 18 + column: 6 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `b` is assigned to but never used" + suggestion: "Remove assignment to unused variable `b`" + fixable: true + location: + row: 18 + column: 8 + end_location: + row: 18 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y`" + fixable: true + location: + row: 118 + column: 13 + end_location: + row: 118 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_1.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_1.py.snap index 027cfce398bb7c..f42edca91b7d1d 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_1.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_1.py.snap @@ -2,174 +2,174 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UnusedVariable - body: "Local variable `x` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x`" - fixable: true - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y`" - fixable: true - location: - row: 6 - column: 7 - end_location: - row: 6 - column: 8 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `x` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x`" - fixable: true - location: - row: 16 - column: 5 - end_location: - row: 16 - column: 6 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y`" - fixable: true - location: - row: 16 - column: 8 - end_location: - row: 16 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `coords` is assigned to but never used" - suggestion: "Remove assignment to unused variable `coords`" - fixable: true - location: - row: 16 - column: 13 - end_location: - row: 16 - column: 19 - fix: - content: "" +- - kind: + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x`" + fixable: true + location: + row: 6 + column: 4 + end_location: + row: 6 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y`" + fixable: true + location: + row: 6 + column: 7 + end_location: + row: 6 + column: 8 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `coords` is assigned to but never used" + suggestion: "Remove assignment to unused variable `coords`" + fixable: true location: row: 16 column: 13 end_location: row: 16 - column: 22 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `coords` is assigned to but never used" - suggestion: "Remove assignment to unused variable `coords`" - fixable: true - location: - row: 20 - column: 4 - end_location: - row: 20 - column: 10 - fix: - content: "" + column: 19 + fix: + content: "" + location: + row: 16 + column: 13 + end_location: + row: 16 + column: 22 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `coords` is assigned to but never used" + suggestion: "Remove assignment to unused variable `coords`" + fixable: true location: row: 20 column: 4 end_location: row: 20 - column: 13 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `x` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x`" - fixable: true - location: - row: 20 - column: 5 - end_location: - row: 20 - column: 6 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y`" - fixable: true - location: - row: 20 - column: 8 - end_location: - row: 20 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `a` is assigned to but never used" - suggestion: "Remove assignment to unused variable `a`" - fixable: true - location: - row: 24 - column: 5 - end_location: - row: 24 - column: 6 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `b` is assigned to but never used" - suggestion: "Remove assignment to unused variable `b`" - fixable: true - location: - row: 24 - column: 8 - end_location: - row: 24 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `x` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x`" - fixable: true - location: - row: 24 - column: 14 - end_location: - row: 24 - column: 15 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y`" - fixable: true - location: - row: 24 - column: 17 - end_location: - row: 24 - column: 18 - fix: ~ - parent: ~ + column: 10 + fix: + content: "" + location: + row: 20 + column: 4 + end_location: + row: 20 + column: 13 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `a` is assigned to but never used" + suggestion: "Remove assignment to unused variable `a`" + fixable: true + location: + row: 24 + column: 5 + end_location: + row: 24 + column: 6 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `b` is assigned to but never used" + suggestion: "Remove assignment to unused variable `b`" + fixable: true + location: + row: 24 + column: 8 + end_location: + row: 24 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x`" + fixable: true + location: + row: 24 + column: 14 + end_location: + row: 24 + column: 15 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y`" + fixable: true + location: + row: 24 + column: 17 + end_location: + row: 24 + column: 18 + fix: ~ + parent: ~ +- - kind: + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x`" + fixable: true + location: + row: 16 + column: 5 + end_location: + row: 16 + column: 6 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y`" + fixable: true + location: + row: 16 + column: 8 + end_location: + row: 16 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x`" + fixable: true + location: + row: 20 + column: 5 + end_location: + row: 20 + column: 6 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y`" + fixable: true + location: + row: 20 + column: 8 + end_location: + row: 20 + column: 9 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_2.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_2.py.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_2.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_2.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_3.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_3.py.snap index e3a2ba09eb4601..89f61861b68240 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_3.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_3.py.snap @@ -2,608 +2,608 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UnusedVariable - body: "Local variable `x` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x`" - fixable: true - location: - row: 5 - column: 4 - end_location: - row: 5 - column: 5 - fix: - content: "" +- - kind: + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x`" + fixable: true location: row: 5 - column: 0 + column: 4 end_location: - row: 6 - column: 0 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y`" - fixable: true - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 5 - fix: - content: "" + row: 5 + column: 5 + fix: + content: "" + location: + row: 5 + column: 0 + end_location: + row: 6 + column: 0 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y`" + fixable: true location: row: 6 - column: 0 - end_location: - row: 7 - column: 0 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `x` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x`" - fixable: true - location: - row: 13 - column: 4 - end_location: - row: 13 - column: 5 - fix: - content: "" + column: 4 + end_location: + row: 6 + column: 5 + fix: + content: "" + location: + row: 6 + column: 0 + end_location: + row: 7 + column: 0 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x`" + fixable: true location: row: 13 - column: 0 + column: 4 end_location: - row: 14 - column: 0 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y`" - fixable: true - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 5 - fix: - content: "" + row: 13 + column: 5 + fix: + content: "" + location: + row: 13 + column: 0 + end_location: + row: 14 + column: 0 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y`" + fixable: true location: row: 14 - column: 0 - end_location: - row: 15 - column: 0 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `x1` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x1`" - fixable: true - location: - row: 21 - column: 18 - end_location: - row: 21 - column: 20 - fix: - content: "" + column: 4 + end_location: + row: 14 + column: 5 + fix: + content: "" + location: + row: 14 + column: 0 + end_location: + row: 15 + column: 0 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `x1` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x1`" + fixable: true location: row: 21 - column: 14 + column: 18 end_location: row: 21 column: 20 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `x3` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x3`" - fixable: true - location: - row: 27 - column: 19 - end_location: - row: 27 - column: 21 - fix: - content: "" + fix: + content: "" + location: + row: 21 + column: 14 + end_location: + row: 21 + column: 20 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `x3` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x3`" + fixable: true location: row: 27 - column: 15 + column: 19 end_location: row: 27 column: 21 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y3` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y3`" - fixable: true - location: - row: 27 - column: 32 - end_location: - row: 27 - column: 34 - fix: - content: "" + fix: + content: "" + location: + row: 27 + column: 15 + end_location: + row: 27 + column: 21 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y3` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y3`" + fixable: true location: row: 27 - column: 28 + column: 32 end_location: row: 27 column: 34 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `z3` is assigned to but never used" - suggestion: "Remove assignment to unused variable `z3`" - fixable: true - location: - row: 27 - column: 45 - end_location: - row: 27 - column: 47 - fix: - content: "" + fix: + content: "" + location: + row: 27 + column: 28 + end_location: + row: 27 + column: 34 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `z3` is assigned to but never used" + suggestion: "Remove assignment to unused variable `z3`" + fixable: true location: row: 27 - column: 41 + column: 45 end_location: row: 27 column: 47 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `x1` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x1`" - fixable: true - location: - row: 28 - column: 5 - end_location: - row: 28 - column: 7 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y1` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y1`" - fixable: true - location: - row: 28 - column: 9 - end_location: - row: 28 - column: 11 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `x2` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x2`" - fixable: true - location: - row: 29 - column: 5 - end_location: - row: 29 - column: 7 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y2` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y2`" - fixable: true - location: - row: 29 - column: 9 - end_location: - row: 29 - column: 11 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `x3` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x3`" - fixable: true - location: - row: 30 - column: 5 - end_location: - row: 30 - column: 7 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y3` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y3`" - fixable: true - location: - row: 30 - column: 9 - end_location: - row: 30 - column: 11 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `x1` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x1`" - fixable: true - location: - row: 32 - column: 5 - end_location: - row: 32 - column: 7 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y1` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y1`" - fixable: true - location: - row: 32 - column: 9 - end_location: - row: 32 - column: 11 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `coords2` is assigned to but never used" - suggestion: "Remove assignment to unused variable `coords2`" - fixable: true - location: - row: 33 - column: 15 - end_location: - row: 33 - column: 22 - fix: - content: "" + fix: + content: "" + location: + row: 27 + column: 41 + end_location: + row: 27 + column: 47 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `x1` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x1`" + fixable: true + location: + row: 32 + column: 5 + end_location: + row: 32 + column: 7 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y1` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y1`" + fixable: true + location: + row: 32 + column: 9 + end_location: + row: 32 + column: 11 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `coords2` is assigned to but never used" + suggestion: "Remove assignment to unused variable `coords2`" + fixable: true location: row: 33 column: 15 end_location: row: 33 - column: 25 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `coords3` is assigned to but never used" - suggestion: "Remove assignment to unused variable `coords3`" - fixable: true - location: - row: 34 - column: 4 - end_location: - row: 34 - column: 11 - fix: - content: "" + column: 22 + fix: + content: "" + location: + row: 33 + column: 15 + end_location: + row: 33 + column: 25 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `coords3` is assigned to but never used" + suggestion: "Remove assignment to unused variable `coords3`" + fixable: true location: row: 34 column: 4 end_location: row: 34 - column: 14 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `x1` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x1`" - fixable: true - location: - row: 40 - column: 25 - end_location: - row: 40 - column: 27 - fix: - content: "" + column: 11 + fix: + content: "" + location: + row: 34 + column: 4 + end_location: + row: 34 + column: 14 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `x1` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x1`" + fixable: true location: row: 40 - column: 21 + column: 25 end_location: row: 40 column: 27 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `x2` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x2`" - fixable: true - location: - row: 45 - column: 46 - end_location: - row: 45 - column: 48 - fix: - content: "" + fix: + content: "" + location: + row: 40 + column: 21 + end_location: + row: 40 + column: 27 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `x2` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x2`" + fixable: true location: row: 45 - column: 42 + column: 46 end_location: row: 45 column: 48 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `x` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x`" - fixable: true - location: - row: 50 - column: 4 - end_location: - row: 50 - column: 5 - fix: - content: "" + fix: + content: "" + location: + row: 45 + column: 42 + end_location: + row: 45 + column: 48 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x`" + fixable: true location: row: 50 column: 4 end_location: row: 50 - column: 8 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y`" - fixable: true - location: - row: 56 - column: 4 - end_location: - row: 56 - column: 5 - fix: - content: "" + column: 5 + fix: + content: "" + location: + row: 50 + column: 4 + end_location: + row: 50 + column: 8 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y`" + fixable: true location: row: 56 column: 4 end_location: - row: 57 - column: 8 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `x` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x`" - fixable: true - location: - row: 61 - column: 4 - end_location: - row: 61 - column: 5 - fix: - content: pass + row: 56 + column: 5 + fix: + content: "" + location: + row: 56 + column: 4 + end_location: + row: 57 + column: 8 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x`" + fixable: true location: row: 61 column: 4 end_location: - row: 65 + row: 61 column: 5 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y`" - fixable: true - location: - row: 67 - column: 4 - end_location: - row: 67 - column: 5 - fix: - content: "" + fix: + content: pass + location: + row: 61 + column: 4 + end_location: + row: 65 + column: 5 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y`" + fixable: true location: row: 67 - column: 0 - end_location: - row: 69 - column: 0 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `cm` is assigned to but never used" - suggestion: "Remove assignment to unused variable `cm`" - fixable: true - location: - row: 72 - column: 23 - end_location: - row: 72 - column: 25 - fix: - content: "" + column: 4 + end_location: + row: 67 + column: 5 + fix: + content: "" + location: + row: 67 + column: 0 + end_location: + row: 69 + column: 0 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `cm` is assigned to but never used" + suggestion: "Remove assignment to unused variable `cm`" + fixable: true location: row: 72 - column: 18 + column: 23 end_location: row: 72 - column: 26 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `cm` is assigned to but never used" - suggestion: "Remove assignment to unused variable `cm`" - fixable: true - location: - row: 77 - column: 24 - end_location: - row: 77 - column: 26 - fix: - content: "" + column: 25 + fix: + content: "" + location: + row: 72 + column: 18 + end_location: + row: 72 + column: 26 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `cm` is assigned to but never used" + suggestion: "Remove assignment to unused variable `cm`" + fixable: true location: row: 77 - column: 19 + column: 24 end_location: row: 77 - column: 27 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `toplevel` is assigned to but never used" - suggestion: "Remove assignment to unused variable `toplevel`" - fixable: true - location: - row: 87 - column: 4 - end_location: - row: 87 - column: 12 - fix: - content: "" + column: 26 + fix: + content: "" + location: + row: 77 + column: 19 + end_location: + row: 77 + column: 27 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `toplevel` is assigned to but never used" + suggestion: "Remove assignment to unused variable `toplevel`" + fixable: true location: row: 87 column: 4 end_location: row: 87 - column: 15 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `toplevel` is assigned to but never used" - suggestion: "Remove assignment to unused variable `toplevel`" - fixable: true - location: - row: 93 - column: 4 - end_location: - row: 93 - column: 12 - fix: - content: "" + column: 12 + fix: + content: "" + location: + row: 87 + column: 4 + end_location: + row: 87 + column: 15 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `toplevel` is assigned to but never used" + suggestion: "Remove assignment to unused variable `toplevel`" + fixable: true location: row: 93 column: 4 end_location: row: 93 - column: 15 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `tt` is assigned to but never used" - suggestion: "Remove assignment to unused variable `tt`" - fixable: true - location: - row: 93 - column: 15 - end_location: - row: 93 - column: 17 - fix: - content: "" + column: 12 + fix: + content: "" + location: + row: 93 + column: 4 + end_location: + row: 93 + column: 15 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `tt` is assigned to but never used" + suggestion: "Remove assignment to unused variable `tt`" + fixable: true location: row: 93 column: 15 end_location: row: 93 - column: 20 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `toplevel` is assigned to but never used" - suggestion: "Remove assignment to unused variable `toplevel`" - fixable: true - location: - row: 97 - column: 4 - end_location: - row: 97 - column: 12 - fix: - content: "" + column: 17 + fix: + content: "" + location: + row: 93 + column: 15 + end_location: + row: 93 + column: 20 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `toplevel` is assigned to but never used" + suggestion: "Remove assignment to unused variable `toplevel`" + fixable: true location: row: 97 column: 4 end_location: row: 97 - column: 15 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `toplevel` is assigned to but never used" - suggestion: "Remove assignment to unused variable `toplevel`" - fixable: true - location: - row: 101 - column: 13 - end_location: - row: 101 - column: 21 - fix: - content: "" + column: 12 + fix: + content: "" + location: + row: 97 + column: 4 + end_location: + row: 97 + column: 15 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `toplevel` is assigned to but never used" + suggestion: "Remove assignment to unused variable `toplevel`" + fixable: true location: row: 101 column: 13 end_location: row: 101 - column: 24 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `toplevel` is assigned to but never used" - suggestion: "Remove assignment to unused variable `toplevel`" - fixable: true - location: - row: 105 - column: 4 - end_location: - row: 105 - column: 12 - fix: - content: "" + column: 21 + fix: + content: "" + location: + row: 101 + column: 13 + end_location: + row: 101 + column: 24 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `toplevel` is assigned to but never used" + suggestion: "Remove assignment to unused variable `toplevel`" + fixable: true location: row: 105 column: 4 end_location: row: 105 - column: 15 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `tt` is assigned to but never used" - suggestion: "Remove assignment to unused variable `tt`" - fixable: true - location: - row: 105 - column: 15 - end_location: - row: 105 - column: 17 - fix: - content: "" + column: 12 + fix: + content: "" + location: + row: 105 + column: 4 + end_location: + row: 105 + column: 15 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `tt` is assigned to but never used" + suggestion: "Remove assignment to unused variable `tt`" + fixable: true location: row: 105 column: 15 end_location: row: 105 - column: 20 - parent: ~ + column: 17 + fix: + content: "" + location: + row: 105 + column: 15 + end_location: + row: 105 + column: 20 + parent: ~ +- - kind: + name: UnusedVariable + body: "Local variable `x1` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x1`" + fixable: true + location: + row: 28 + column: 5 + end_location: + row: 28 + column: 7 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y1` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y1`" + fixable: true + location: + row: 28 + column: 9 + end_location: + row: 28 + column: 11 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `x2` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x2`" + fixable: true + location: + row: 29 + column: 5 + end_location: + row: 29 + column: 7 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y2` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y2`" + fixable: true + location: + row: 29 + column: 9 + end_location: + row: 29 + column: 11 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `x3` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x3`" + fixable: true + location: + row: 30 + column: 5 + end_location: + row: 30 + column: 7 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y3` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y3`" + fixable: true + location: + row: 30 + column: 9 + end_location: + row: 30 + column: 11 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F842_F842.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F842_F842.py.snap index 1c19b4677d3018..53e64c8d863dc8 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F842_F842.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F842_F842.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UnusedAnnotation - body: "Local variable `name` is annotated but never used" - suggestion: ~ - fixable: false - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 8 - fix: ~ - parent: ~ -- kind: - name: UnusedAnnotation - body: "Local variable `age` is annotated but never used" - suggestion: ~ - fixable: false - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 7 - fix: ~ - parent: ~ +- - kind: + name: UnusedAnnotation + body: "Local variable `name` is annotated but never used" + suggestion: ~ + fixable: false + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 8 + fix: ~ + parent: ~ + - kind: + name: UnusedAnnotation + body: "Local variable `age` is annotated but never used" + suggestion: ~ + fixable: false + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 7 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F901_F901.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F901_F901.py.snap index 5946d80c9ddb9b..8e70ae0c11a5e2 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F901_F901.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F901_F901.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: RaiseNotImplemented - body: "`raise NotImplemented` should be `raise NotImplementedError`" - suggestion: "Use `raise NotImplementedError`" - fixable: true - location: - row: 2 - column: 10 - end_location: - row: 2 - column: 24 - fix: - content: NotImplementedError +- - kind: + name: RaiseNotImplemented + body: "`raise NotImplemented` should be `raise NotImplementedError`" + suggestion: "Use `raise NotImplementedError`" + fixable: true location: row: 2 column: 10 end_location: row: 2 column: 24 - parent: ~ -- kind: - name: RaiseNotImplemented - body: "`raise NotImplemented` should be `raise NotImplementedError`" - suggestion: "Use `raise NotImplementedError`" - fixable: true - location: - row: 6 - column: 10 - end_location: - row: 6 - column: 24 - fix: - content: NotImplementedError + fix: + content: NotImplementedError + location: + row: 2 + column: 10 + end_location: + row: 2 + column: 24 + parent: ~ + - kind: + name: RaiseNotImplemented + body: "`raise NotImplemented` should be `raise NotImplementedError`" + suggestion: "Use `raise NotImplementedError`" + fixable: true location: row: 6 column: 10 end_location: row: 6 column: 24 - parent: ~ + fix: + content: NotImplementedError + location: + row: 6 + column: 10 + end_location: + row: 6 + column: 24 + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_builtins.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_builtins.snap index 0892fb0e1bda50..8f739c55a68eea 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_builtins.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_builtins.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedName - body: "Undefined name `_`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 1 - fix: ~ - parent: ~ +- - kind: + name: UndefinedName + body: "Undefined name `_`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 1 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_typing_modules.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_typing_modules.snap index c2408db84930e9..186362012300f9 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_typing_modules.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_typing_modules.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedName - body: "Undefined name `db`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 34 - end_location: - row: 6 - column: 38 - fix: ~ - parent: ~ +- - kind: + name: UndefinedName + body: "Undefined name `db`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 34 + end_location: + row: 6 + column: 38 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__extra_builtins.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__extra_builtins.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__extra_builtins.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__extra_builtins.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__extra_typing_modules.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__extra_typing_modules.snap index 92a021c34284ea..05cf01f6f9d843 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__extra_typing_modules.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__extra_typing_modules.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedName - body: "Undefined name `Class`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 13 - end_location: - row: 7 - column: 20 - fix: ~ - parent: ~ +- - kind: + name: UndefinedName + body: "Undefined name `Class`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 13 + end_location: + row: 7 + column: 20 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__f841_dummy_variable_rgx.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__f841_dummy_variable_rgx.snap index d0b68ec11ec7da..9a35d71e01e213 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__f841_dummy_variable_rgx.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__f841_dummy_variable_rgx.snap @@ -2,302 +2,302 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UnusedVariable - body: "Local variable `e` is assigned to but never used" - suggestion: "Remove assignment to unused variable `e`" - fixable: true - location: - row: 3 - column: 21 - end_location: - row: 3 - column: 22 - fix: - content: "" +- - kind: + name: UnusedVariable + body: "Local variable `e` is assigned to but never used" + suggestion: "Remove assignment to unused variable `e`" + fixable: true location: row: 3 - column: 17 + column: 21 end_location: row: 3 column: 22 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `foo` is assigned to but never used" - suggestion: "Remove assignment to unused variable `foo`" - fixable: true - location: - row: 20 - column: 4 - end_location: - row: 20 - column: 7 - fix: - content: "" + fix: + content: "" + location: + row: 3 + column: 17 + end_location: + row: 3 + column: 22 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `foo` is assigned to but never used" + suggestion: "Remove assignment to unused variable `foo`" + fixable: true location: row: 20 - column: 0 + column: 4 + end_location: + row: 20 + column: 7 + fix: + content: "" + location: + row: 20 + column: 0 + end_location: + row: 21 + column: 0 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `a` is assigned to but never used" + suggestion: "Remove assignment to unused variable `a`" + fixable: true + location: + row: 21 + column: 5 end_location: row: 21 - column: 0 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `a` is assigned to but never used" - suggestion: "Remove assignment to unused variable `a`" - fixable: true - location: - row: 20 - column: 5 - end_location: - row: 20 - column: 6 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `b` is assigned to but never used" - suggestion: "Remove assignment to unused variable `b`" - fixable: true - location: - row: 20 - column: 8 - end_location: - row: 20 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `a` is assigned to but never used" - suggestion: "Remove assignment to unused variable `a`" - fixable: true - location: - row: 21 - column: 5 - end_location: - row: 21 - column: 6 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `b` is assigned to but never used" - suggestion: "Remove assignment to unused variable `b`" - fixable: true - location: - row: 21 - column: 8 - end_location: - row: 21 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `baz` is assigned to but never used" - suggestion: "Remove assignment to unused variable `baz`" - fixable: true - location: - row: 26 - column: 13 - end_location: - row: 26 - column: 16 - fix: - content: "" + column: 6 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `b` is assigned to but never used" + suggestion: "Remove assignment to unused variable `b`" + fixable: true + location: + row: 21 + column: 8 + end_location: + row: 21 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `baz` is assigned to but never used" + suggestion: "Remove assignment to unused variable `baz`" + fixable: true location: row: 26 column: 13 end_location: row: 26 - column: 19 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `_` is assigned to but never used" - suggestion: "Remove assignment to unused variable `_`" - fixable: true - location: - row: 35 - column: 4 - end_location: - row: 35 - column: 5 - fix: - content: "" + column: 16 + fix: + content: "" + location: + row: 26 + column: 13 + end_location: + row: 26 + column: 19 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `_` is assigned to but never used" + suggestion: "Remove assignment to unused variable `_`" + fixable: true location: row: 35 - column: 0 + column: 4 end_location: - row: 36 - column: 0 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `__` is assigned to but never used" - suggestion: "Remove assignment to unused variable `__`" - fixable: true - location: - row: 36 - column: 4 - end_location: - row: 36 - column: 6 - fix: - content: "" + row: 35 + column: 5 + fix: + content: "" + location: + row: 35 + column: 0 + end_location: + row: 36 + column: 0 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `__` is assigned to but never used" + suggestion: "Remove assignment to unused variable `__`" + fixable: true location: row: 36 - column: 0 + column: 4 end_location: - row: 37 - column: 0 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `_discarded` is assigned to but never used" - suggestion: "Remove assignment to unused variable `_discarded`" - fixable: true - location: - row: 37 - column: 4 - end_location: - row: 37 - column: 14 - fix: - content: pass + row: 36 + column: 6 + fix: + content: "" + location: + row: 36 + column: 0 + end_location: + row: 37 + column: 0 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `_discarded` is assigned to but never used" + suggestion: "Remove assignment to unused variable `_discarded`" + fixable: true location: row: 37 column: 4 end_location: row: 37 - column: 18 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `b` is assigned to but never used" - suggestion: "Remove assignment to unused variable `b`" - fixable: true - location: - row: 51 - column: 8 - end_location: - row: 51 - column: 9 - fix: - content: pass + column: 14 + fix: + content: pass + location: + row: 37 + column: 4 + end_location: + row: 37 + column: 18 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `b` is assigned to but never used" + suggestion: "Remove assignment to unused variable `b`" + fixable: true location: row: 51 column: 8 end_location: row: 51 - column: 13 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `my_file` is assigned to but never used" - suggestion: "Remove assignment to unused variable `my_file`" - fixable: true - location: - row: 79 - column: 25 - end_location: - row: 79 - column: 32 - fix: - content: "" + column: 9 + fix: + content: pass + location: + row: 51 + column: 8 + end_location: + row: 51 + column: 13 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `my_file` is assigned to but never used" + suggestion: "Remove assignment to unused variable `my_file`" + fixable: true location: row: 79 - column: 21 + column: 25 end_location: row: 79 column: 32 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `my_file` is assigned to but never used" - suggestion: "Remove assignment to unused variable `my_file`" - fixable: true - location: - row: 85 - column: 24 - end_location: - row: 85 - column: 31 - fix: - content: "" + fix: + content: "" + location: + row: 79 + column: 21 + end_location: + row: 79 + column: 32 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `my_file` is assigned to but never used" + suggestion: "Remove assignment to unused variable `my_file`" + fixable: true location: row: 85 - column: 20 + column: 24 end_location: row: 85 column: 31 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `msg3` is assigned to but never used" - suggestion: "Remove assignment to unused variable `msg3`" - fixable: true - location: - row: 102 - column: 4 - end_location: - row: 102 - column: 8 - fix: - content: "" + fix: + content: "" + location: + row: 85 + column: 20 + end_location: + row: 85 + column: 31 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `msg3` is assigned to but never used" + suggestion: "Remove assignment to unused variable `msg3`" + fixable: true location: row: 102 - column: 0 + column: 4 end_location: - row: 103 - column: 0 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `Baz` is assigned to but never used" - suggestion: "Remove assignment to unused variable `Baz`" - fixable: true - location: - row: 115 - column: 4 - end_location: - row: 115 - column: 7 - fix: - content: "" + row: 102 + column: 8 + fix: + content: "" + location: + row: 102 + column: 0 + end_location: + row: 103 + column: 0 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `Baz` is assigned to but never used" + suggestion: "Remove assignment to unused variable `Baz`" + fixable: true location: row: 115 column: 4 end_location: row: 115 - column: 10 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y`" - fixable: true - location: - row: 118 - column: 13 - end_location: - row: 118 - column: 14 - fix: ~ - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `y` is assigned to but never used" - suggestion: "Remove assignment to unused variable `y`" - fixable: true - location: - row: 122 - column: 13 - end_location: - row: 122 - column: 14 - fix: ~ - parent: ~ + column: 7 + fix: + content: "" + location: + row: 115 + column: 4 + end_location: + row: 115 + column: 10 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y`" + fixable: true + location: + row: 122 + column: 13 + end_location: + row: 122 + column: 14 + fix: ~ + parent: ~ +- - kind: + name: UnusedVariable + body: "Local variable `a` is assigned to but never used" + suggestion: "Remove assignment to unused variable `a`" + fixable: true + location: + row: 20 + column: 5 + end_location: + row: 20 + column: 6 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `b` is assigned to but never used" + suggestion: "Remove assignment to unused variable `b`" + fixable: true + location: + row: 20 + column: 8 + end_location: + row: 20 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `y` is assigned to but never used" + suggestion: "Remove assignment to unused variable `y`" + fixable: true + location: + row: 118 + column: 13 + end_location: + row: 118 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__future_annotations.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__future_annotations.snap index 66eee76ed57ad2..bf39088a1398a6 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__future_annotations.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__future_annotations.snap @@ -2,52 +2,52 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UnusedImport - body: "`models.Nut` imported but unused" - suggestion: "Remove unused import: `models.Nut`" - fixable: true - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 7 - fix: - content: "from models import (\n Fruit,\n)" +- - kind: + name: UnusedImport + body: "`models.Nut` imported but unused" + suggestion: "Remove unused import: `models.Nut`" + fixable: true location: + row: 8 + column: 4 + end_location: + row: 8 + column: 7 + fix: + content: "from models import (\n Fruit,\n)" + location: + row: 6 + column: 0 + end_location: + row: 9 + column: 1 + parent: row: 6 column: 0 + - kind: + name: UndefinedName + body: "Undefined name `Bar`" + suggestion: ~ + fixable: false + location: + row: 26 + column: 18 + end_location: + row: 26 + column: 21 + fix: ~ + parent: ~ +- - kind: + name: UndefinedName + body: "Undefined name `Bar`" + suggestion: ~ + fixable: false + location: + row: 25 + column: 18 end_location: - row: 9 - column: 1 - parent: - row: 6 - column: 0 -- kind: - name: UndefinedName - body: "Undefined name `Bar`" - suggestion: ~ - fixable: false - location: - row: 25 - column: 18 - end_location: - row: 25 - column: 21 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `Bar`" - suggestion: ~ - fixable: false - location: - row: 26 - column: 18 - end_location: - row: 26 - column: 21 - fix: ~ - parent: ~ + row: 25 + column: 21 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__init.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__init.snap index c9243cbdca4cd7..d73c4e64731793 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__init.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__init.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pyflakes/mod.rs +source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__multi_statement_lines.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__multi_statement_lines.snap index bf90f48fa7be66..8855430d045a3e 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__multi_statement_lines.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__multi_statement_lines.snap @@ -2,264 +2,264 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UnusedImport - body: "`foo1` imported but unused" - suggestion: "Remove unused import: `foo1`" - fixable: true - location: - row: 3 - column: 11 - end_location: - row: 3 - column: 15 - fix: - content: "" +- - kind: + name: UnusedImport + body: "`foo1` imported but unused" + suggestion: "Remove unused import: `foo1`" + fixable: true location: row: 3 - column: 4 + column: 11 end_location: row: 3 - column: 17 - parent: ~ -- kind: - name: UnusedImport - body: "`foo2` imported but unused" - suggestion: "Remove unused import: `foo2`" - fixable: true - location: - row: 4 - column: 11 - end_location: - row: 4 - column: 15 - fix: - content: "" + column: 15 + fix: + content: "" + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 17 + parent: ~ + - kind: + name: UnusedImport + body: "`foo2` imported but unused" + suggestion: "Remove unused import: `foo2`" + fixable: true location: row: 4 - column: 4 + column: 11 end_location: row: 4 - column: 21 - parent: ~ -- kind: - name: UnusedImport - body: "`foo3` imported but unused" - suggestion: "Remove unused import: `foo3`" - fixable: true - location: - row: 7 - column: 11 - end_location: - row: 7 - column: 15 - fix: - content: "" + column: 15 + fix: + content: "" + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 21 + parent: ~ + - kind: + name: UnusedImport + body: "`foo3` imported but unused" + suggestion: "Remove unused import: `foo3`" + fixable: true location: row: 7 - column: 4 + column: 11 end_location: - row: 8 - column: 0 - parent: ~ -- kind: - name: UnusedImport - body: "`foo4` imported but unused" - suggestion: "Remove unused import: `foo4`" - fixable: true - location: - row: 11 - column: 11 - end_location: - row: 11 - column: 15 - fix: - content: "" + row: 7 + column: 15 + fix: + content: "" + location: + row: 7 + column: 4 + end_location: + row: 8 + column: 0 + parent: ~ + - kind: + name: UnusedImport + body: "`foo4` imported but unused" + suggestion: "Remove unused import: `foo4`" + fixable: true location: row: 11 - column: 4 + column: 11 end_location: - row: 12 - column: 10 - parent: ~ -- kind: - name: UnusedImport - body: "`foo5` imported but unused" - suggestion: "Remove unused import: `foo5`" - fixable: true - location: - row: 16 - column: 18 - end_location: - row: 16 - column: 22 - fix: - content: "" + row: 11 + column: 15 + fix: + content: "" + location: + row: 11 + column: 4 + end_location: + row: 12 + column: 10 + parent: ~ + - kind: + name: UnusedImport + body: "`foo5` imported but unused" + suggestion: "Remove unused import: `foo5`" + fixable: true location: row: 16 - column: 11 + column: 18 end_location: row: 16 column: 22 - parent: ~ -- kind: - name: UnusedImport - body: "`foo6` imported but unused" - suggestion: "Remove unused import: `foo6`" - fixable: true - location: - row: 21 - column: 16 - end_location: - row: 21 - column: 20 - fix: - content: "" + fix: + content: "" + location: + row: 16 + column: 11 + end_location: + row: 16 + column: 22 + parent: ~ + - kind: + name: UnusedImport + body: "`foo6` imported but unused" + suggestion: "Remove unused import: `foo6`" + fixable: true location: row: 21 - column: 9 + column: 16 end_location: row: 21 column: 20 - parent: ~ -- kind: - name: UnusedImport - body: "`foo7` imported but unused" - suggestion: "Remove unused import: `foo7`" - fixable: true - location: - row: 26 - column: 17 - end_location: - row: 26 - column: 21 - fix: - content: "" + fix: + content: "" + location: + row: 21 + column: 9 + end_location: + row: 21 + column: 20 + parent: ~ + - kind: + name: UnusedImport + body: "`foo7` imported but unused" + suggestion: "Remove unused import: `foo7`" + fixable: true location: row: 26 - column: 10 + column: 17 end_location: row: 26 column: 21 - parent: ~ -- kind: - name: UnusedImport - body: "`foo8` imported but unused" - suggestion: "Remove unused import: `foo8`" - fixable: true - location: - row: 30 - column: 18 - end_location: - row: 30 - column: 22 - fix: - content: "" + fix: + content: "" + location: + row: 26 + column: 10 + end_location: + row: 26 + column: 21 + parent: ~ + - kind: + name: UnusedImport + body: "`foo8` imported but unused" + suggestion: "Remove unused import: `foo8`" + fixable: true location: row: 30 - column: 11 + column: 18 end_location: row: 30 - column: 24 - parent: ~ -- kind: - name: UnusedImport - body: "`foo9` imported but unused" - suggestion: "Remove unused import: `foo9`" - fixable: true - location: - row: 31 - column: 22 - end_location: - row: 31 - column: 26 - fix: - content: "" + column: 22 + fix: + content: "" + location: + row: 30 + column: 11 + end_location: + row: 30 + column: 24 + parent: ~ + - kind: + name: UnusedImport + body: "`foo9` imported but unused" + suggestion: "Remove unused import: `foo9`" + fixable: true location: row: 31 - column: 15 + column: 22 end_location: row: 31 - column: 32 - parent: ~ -- kind: - name: UnusedImport - body: "`foo10` imported but unused" - suggestion: "Remove unused import: `foo10`" - fixable: true - location: - row: 35 - column: 15 - end_location: - row: 35 - column: 20 - fix: - content: "" + column: 26 + fix: + content: "" + location: + row: 31 + column: 15 + end_location: + row: 31 + column: 32 + parent: ~ + - kind: + name: UnusedImport + body: "`foo10` imported but unused" + suggestion: "Remove unused import: `foo10`" + fixable: true location: row: 35 - column: 8 + column: 15 end_location: - row: 36 - column: 4 - parent: ~ -- kind: - name: UnusedImport - body: "`foo11` imported but unused" - suggestion: "Remove unused import: `foo11`" - fixable: true - location: - row: 40 - column: 16 - end_location: - row: 40 - column: 21 - fix: - content: "" + row: 35 + column: 20 + fix: + content: "" + location: + row: 35 + column: 8 + end_location: + row: 36 + column: 4 + parent: ~ + - kind: + name: UnusedImport + body: "`foo11` imported but unused" + suggestion: "Remove unused import: `foo11`" + fixable: true location: row: 40 - column: 9 + column: 16 end_location: - row: 41 - column: 9 - parent: ~ -- kind: - name: UnusedImport - body: "`foo12` imported but unused" - suggestion: "Remove unused import: `foo12`" - fixable: true - location: - row: 46 - column: 7 - end_location: - row: 46 - column: 12 - fix: - content: "" + row: 40 + column: 21 + fix: + content: "" + location: + row: 40 + column: 9 + end_location: + row: 41 + column: 9 + parent: ~ + - kind: + name: UnusedImport + body: "`foo12` imported but unused" + suggestion: "Remove unused import: `foo12`" + fixable: true location: row: 46 - column: 0 + column: 7 end_location: row: 46 column: 12 - parent: ~ -- kind: - name: UnusedImport - body: "`foo13` imported but unused" - suggestion: "Remove unused import: `foo13`" - fixable: true - location: - row: 51 - column: 7 - end_location: - row: 51 - column: 12 - fix: - content: "" + fix: + content: "" + location: + row: 46 + column: 0 + end_location: + row: 46 + column: 12 + parent: ~ + - kind: + name: UnusedImport + body: "`foo13` imported but unused" + suggestion: "Remove unused import: `foo13`" + fixable: true location: row: 51 - column: 0 + column: 7 end_location: row: 51 column: 12 - parent: ~ + fix: + content: "" + location: + row: 51 + column: 0 + end_location: + row: 51 + column: 12 + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__nested_relative_typing_module.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__nested_relative_typing_module.snap index ff559d928f176d..1dcbca384c8f92 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__nested_relative_typing_module.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__nested_relative_typing_module.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedName - body: "Undefined name `foo`" - suggestion: ~ - fixable: false - location: - row: 26 - column: 15 - end_location: - row: 26 - column: 20 - fix: ~ - parent: ~ -- kind: - name: UndefinedName - body: "Undefined name `foo`" - suggestion: ~ - fixable: false - location: - row: 33 - column: 15 - end_location: - row: 33 - column: 20 - fix: ~ - parent: ~ +- - kind: + name: UndefinedName + body: "Undefined name `foo`" + suggestion: ~ + fixable: false + location: + row: 26 + column: 15 + end_location: + row: 26 + column: 20 + fix: ~ + parent: ~ + - kind: + name: UndefinedName + body: "Undefined name `foo`" + suggestion: ~ + fixable: false + location: + row: 33 + column: 15 + end_location: + row: 33 + column: 20 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__relative_typing_module.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__relative_typing_module.snap index 78ec903d88d162..315b769fcca0d8 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__relative_typing_module.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__relative_typing_module.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pyflakes/mod.rs expression: diagnostics --- -- kind: - name: UndefinedName - body: "Undefined name `foo`" - suggestion: ~ - fixable: false - location: - row: 26 - column: 15 - end_location: - row: 26 - column: 20 - fix: ~ - parent: ~ +- - kind: + name: UndefinedName + body: "Undefined name `foo`" + suggestion: ~ + fixable: false + location: + row: 26 + column: 15 + end_location: + row: 26 + column: 20 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH001_PGH001_0.py.snap b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH001_PGH001_0.py.snap index 47cb5e844b7772..5f44a245ff53d1 100644 --- a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH001_PGH001_0.py.snap +++ b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH001_PGH001_0.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pygrep_hooks/mod.rs expression: diagnostics --- -- kind: - name: NoEval - body: "No builtin `eval()` allowed" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 4 - fix: ~ - parent: ~ -- kind: - name: NoEval - body: "No builtin `eval()` allowed" - suggestion: ~ - fixable: false - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: NoEval + body: "No builtin `eval()` allowed" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 4 + fix: ~ + parent: ~ + - kind: + name: NoEval + body: "No builtin `eval()` allowed" + suggestion: ~ + fixable: false + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH001_PGH001_1.py.snap b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH001_PGH001_1.py.snap index 78f68fce45aff9..d77fe2ff842a80 100644 --- a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH001_PGH001_1.py.snap +++ b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH001_PGH001_1.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pygrep_hooks/mod.rs +source: crates/ruff/src/rules/pygrep_hooks/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH002_PGH002_0.py.snap b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH002_PGH002_0.py.snap index 78f68fce45aff9..d77fe2ff842a80 100644 --- a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH002_PGH002_0.py.snap +++ b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH002_PGH002_0.py.snap @@ -1,6 +1,6 @@ --- -source: src/rules/pygrep_hooks/mod.rs +source: crates/ruff/src/rules/pygrep_hooks/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH002_PGH002_1.py.snap b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH002_PGH002_1.py.snap index d9bbc05eb8e8c2..605e9617fbb397 100644 --- a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH002_PGH002_1.py.snap +++ b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH002_PGH002_1.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pygrep_hooks/mod.rs expression: diagnostics --- -- kind: - name: DeprecatedLogWarn - body: "`warn` is deprecated in favor of `warning`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 12 - fix: ~ - parent: ~ -- kind: - name: DeprecatedLogWarn - body: "`warn` is deprecated in favor of `warning`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 4 - fix: ~ - parent: ~ +- - kind: + name: DeprecatedLogWarn + body: "`warn` is deprecated in favor of `warning`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 12 + fix: ~ + parent: ~ + - kind: + name: DeprecatedLogWarn + body: "`warn` is deprecated in favor of `warning`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 4 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH003_PGH003_0.py.snap b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH003_PGH003_0.py.snap index 7fac68accaca83..29632ffa21a97b 100644 --- a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH003_PGH003_0.py.snap +++ b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH003_PGH003_0.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pygrep_hooks/mod.rs expression: diagnostics --- -- kind: - name: BlanketTypeIgnore - body: Use specific rule codes when ignoring type issues - suggestion: ~ - fixable: false - location: - row: 1 - column: 7 - end_location: - row: 1 - column: 21 - fix: ~ - parent: ~ -- kind: - name: BlanketTypeIgnore - body: Use specific rule codes when ignoring type issues - suggestion: ~ - fixable: false - location: - row: 2 - column: 7 - end_location: - row: 2 - column: 20 - fix: ~ - parent: ~ -- kind: - name: BlanketTypeIgnore - body: Use specific rule codes when ignoring type issues - suggestion: ~ - fixable: false - location: - row: 3 - column: 7 - end_location: - row: 3 - column: 20 - fix: ~ - parent: ~ +- - kind: + name: BlanketTypeIgnore + body: Use specific rule codes when ignoring type issues + suggestion: ~ + fixable: false + location: + row: 1 + column: 7 + end_location: + row: 1 + column: 21 + fix: ~ + parent: ~ + - kind: + name: BlanketTypeIgnore + body: Use specific rule codes when ignoring type issues + suggestion: ~ + fixable: false + location: + row: 2 + column: 7 + end_location: + row: 2 + column: 20 + fix: ~ + parent: ~ + - kind: + name: BlanketTypeIgnore + body: Use specific rule codes when ignoring type issues + suggestion: ~ + fixable: false + location: + row: 3 + column: 7 + end_location: + row: 3 + column: 20 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH004_PGH004_0.py.snap b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH004_PGH004_0.py.snap index f0580d91713925..22e2fdad67fb8e 100644 --- a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH004_PGH004_0.py.snap +++ b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH004_PGH004_0.py.snap @@ -2,82 +2,82 @@ source: crates/ruff/src/rules/pygrep_hooks/mod.rs expression: diagnostics --- -- kind: - name: BlanketNOQA - body: "Use specific rule codes when using `noqa`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 7 - end_location: - row: 1 - column: 13 - fix: ~ - parent: ~ -- kind: - name: BlanketNOQA - body: "Use specific rule codes when using `noqa`" - suggestion: ~ - fixable: false - location: - row: 2 - column: 7 - end_location: - row: 2 - column: 15 - fix: ~ - parent: ~ -- kind: - name: BlanketNOQA - body: "Use specific rule codes when using `noqa`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 6 - fix: ~ - parent: ~ -- kind: - name: BlanketNOQA - body: "Use specific rule codes when using `noqa`" - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 6 - fix: ~ - parent: ~ -- kind: - name: BlanketNOQA - body: "Use specific rule codes when using `noqa`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 8 - fix: ~ - parent: ~ -- kind: - name: BlanketNOQA - body: "Use specific rule codes when using `noqa`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: BlanketNOQA + body: "Use specific rule codes when using `noqa`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 7 + end_location: + row: 1 + column: 13 + fix: ~ + parent: ~ + - kind: + name: BlanketNOQA + body: "Use specific rule codes when using `noqa`" + suggestion: ~ + fixable: false + location: + row: 2 + column: 7 + end_location: + row: 2 + column: 15 + fix: ~ + parent: ~ + - kind: + name: BlanketNOQA + body: "Use specific rule codes when using `noqa`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 6 + fix: ~ + parent: ~ + - kind: + name: BlanketNOQA + body: "Use specific rule codes when using `noqa`" + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 6 + fix: ~ + parent: ~ + - kind: + name: BlanketNOQA + body: "Use specific rule codes when using `noqa`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 8 + fix: ~ + parent: ~ + - kind: + name: BlanketNOQA + body: "Use specific rule codes when using `noqa`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC0414_import_aliasing.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC0414_import_aliasing.py.snap index 8f1b751fd60a5c..f4b245c340c1b3 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC0414_import_aliasing.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC0414_import_aliasing.py.snap @@ -2,164 +2,164 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: UselessImportAlias - body: Import alias does not rename original package - suggestion: Remove import alias - fixable: true - location: - row: 6 - column: 7 - end_location: - row: 6 - column: 33 - fix: - content: collections +- - kind: + name: UselessImportAlias + body: Import alias does not rename original package + suggestion: Remove import alias + fixable: true location: row: 6 column: 7 end_location: row: 6 column: 33 - parent: ~ -- kind: - name: UselessImportAlias - body: Import alias does not rename original package - suggestion: Remove import alias - fixable: true - location: - row: 7 - column: 24 - end_location: - row: 7 - column: 50 - fix: - content: OrderedDict + fix: + content: collections + location: + row: 6 + column: 7 + end_location: + row: 6 + column: 33 + parent: ~ + - kind: + name: UselessImportAlias + body: Import alias does not rename original package + suggestion: Remove import alias + fixable: true location: row: 7 column: 24 end_location: row: 7 column: 50 - parent: ~ -- kind: - name: UselessImportAlias - body: Import alias does not rename original package - suggestion: Remove import alias - fixable: true - location: - row: 16 - column: 14 - end_location: - row: 16 - column: 24 - fix: - content: bar + fix: + content: OrderedDict + location: + row: 7 + column: 24 + end_location: + row: 7 + column: 50 + parent: ~ + - kind: + name: UselessImportAlias + body: Import alias does not rename original package + suggestion: Remove import alias + fixable: true location: row: 16 column: 14 end_location: row: 16 column: 24 - parent: ~ -- kind: - name: UselessImportAlias - body: Import alias does not rename original package - suggestion: Remove import alias - fixable: true - location: - row: 19 - column: 18 - end_location: - row: 19 - column: 28 - fix: - content: bar + fix: + content: bar + location: + row: 16 + column: 14 + end_location: + row: 16 + column: 24 + parent: ~ + - kind: + name: UselessImportAlias + body: Import alias does not rename original package + suggestion: Remove import alias + fixable: true location: row: 19 column: 18 end_location: row: 19 column: 28 - parent: ~ -- kind: - name: UselessImportAlias - body: Import alias does not rename original package - suggestion: Remove import alias - fixable: true - location: - row: 20 - column: 22 - end_location: - row: 20 - column: 38 - fix: - content: foobar + fix: + content: bar + location: + row: 19 + column: 18 + end_location: + row: 19 + column: 28 + parent: ~ + - kind: + name: UselessImportAlias + body: Import alias does not rename original package + suggestion: Remove import alias + fixable: true location: row: 20 column: 22 end_location: row: 20 column: 38 - parent: ~ -- kind: - name: UselessImportAlias - body: Import alias does not rename original package - suggestion: Remove import alias - fixable: true - location: - row: 22 - column: 14 - end_location: - row: 22 - column: 24 - fix: - content: foo + fix: + content: foobar + location: + row: 20 + column: 22 + end_location: + row: 20 + column: 38 + parent: ~ + - kind: + name: UselessImportAlias + body: Import alias does not rename original package + suggestion: Remove import alias + fixable: true location: row: 22 column: 14 end_location: row: 22 column: 24 - parent: ~ -- kind: - name: UselessImportAlias - body: Import alias does not rename original package - suggestion: Remove import alias - fixable: true - location: - row: 23 - column: 26 - end_location: - row: 23 - column: 38 - fix: - content: foo2 + fix: + content: foo + location: + row: 22 + column: 14 + end_location: + row: 22 + column: 24 + parent: ~ + - kind: + name: UselessImportAlias + body: Import alias does not rename original package + suggestion: Remove import alias + fixable: true location: row: 23 column: 26 end_location: row: 23 column: 38 - parent: ~ -- kind: - name: UselessImportAlias - body: Import alias does not rename original package - suggestion: Remove import alias - fixable: true - location: - row: 25 - column: 20 - end_location: - row: 25 - column: 36 - fix: - content: foobar + fix: + content: foo2 + location: + row: 23 + column: 26 + end_location: + row: 23 + column: 38 + parent: ~ + - kind: + name: UselessImportAlias + body: Import alias does not rename original package + suggestion: Remove import alias + fixable: true location: row: 25 column: 20 end_location: row: 25 column: 36 - parent: ~ + fix: + content: foobar + location: + row: 25 + column: 20 + end_location: + row: 25 + column: 36 + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC1901_compare_to_empty_string.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC1901_compare_to_empty_string.py.snap index 22a19ceab507fa..b102d6357ba985 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC1901_compare_to_empty_string.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC1901_compare_to_empty_string.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: CompareToEmptyString - body: "`x is \"\"` can be simplified to `not x` as an empty string is falsey" - suggestion: ~ - fixable: false - location: - row: 7 - column: 12 - end_location: - row: 7 - column: 14 - fix: ~ - parent: ~ -- kind: - name: CompareToEmptyString - body: "`x == \"\"` can be simplified to `not x` as an empty string is falsey" - suggestion: ~ - fixable: false - location: - row: 7 - column: 23 - end_location: - row: 7 - column: 25 - fix: ~ - parent: ~ -- kind: - name: CompareToEmptyString - body: "`y is not \"\"` can be simplified to `y` as an empty string is falsey" - suggestion: ~ - fixable: false - location: - row: 10 - column: 16 - end_location: - row: 10 - column: 18 - fix: ~ - parent: ~ -- kind: - name: CompareToEmptyString - body: "`y != \"\"` can be simplified to `y` as an empty string is falsey" - suggestion: ~ - fixable: false - location: - row: 10 - column: 27 - end_location: - row: 10 - column: 29 - fix: ~ - parent: ~ -- kind: - name: CompareToEmptyString - body: "`\"\" != z` can be simplified to `z` as an empty string is falsey" - suggestion: ~ - fixable: false - location: - row: 13 - column: 7 - end_location: - row: 13 - column: 9 - fix: ~ - parent: ~ +- - kind: + name: CompareToEmptyString + body: "`x is \"\"` can be simplified to `not x` as an empty string is falsey" + suggestion: ~ + fixable: false + location: + row: 7 + column: 12 + end_location: + row: 7 + column: 14 + fix: ~ + parent: ~ + - kind: + name: CompareToEmptyString + body: "`x == \"\"` can be simplified to `not x` as an empty string is falsey" + suggestion: ~ + fixable: false + location: + row: 7 + column: 23 + end_location: + row: 7 + column: 25 + fix: ~ + parent: ~ + - kind: + name: CompareToEmptyString + body: "`y is not \"\"` can be simplified to `y` as an empty string is falsey" + suggestion: ~ + fixable: false + location: + row: 10 + column: 16 + end_location: + row: 10 + column: 18 + fix: ~ + parent: ~ + - kind: + name: CompareToEmptyString + body: "`y != \"\"` can be simplified to `y` as an empty string is falsey" + suggestion: ~ + fixable: false + location: + row: 10 + column: 27 + end_location: + row: 10 + column: 29 + fix: ~ + parent: ~ + - kind: + name: CompareToEmptyString + body: "`\"\" != z` can be simplified to `z` as an empty string is falsey" + suggestion: ~ + fixable: false + location: + row: 13 + column: 7 + end_location: + row: 13 + column: 9 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap index 2ab715103fc640..80a53a1fcf5a45 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryDirectLambdaCall - body: Lambda expression called directly. Execute the expression inline instead. - suggestion: ~ - fixable: false - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 33 - fix: ~ - parent: ~ -- kind: - name: UnnecessaryDirectLambdaCall - body: Lambda expression called directly. Execute the expression inline instead. - suggestion: ~ - fixable: false - location: - row: 5 - column: 8 - end_location: - row: 5 - column: 27 - fix: ~ - parent: ~ -- kind: - name: UnnecessaryDirectLambdaCall - body: Lambda expression called directly. Execute the expression inline instead. - suggestion: ~ - fixable: false - location: - row: 5 - column: 29 - end_location: - row: 5 - column: 47 - fix: ~ - parent: ~ +- - kind: + name: UnnecessaryDirectLambdaCall + body: Lambda expression called directly. Execute the expression inline instead. + suggestion: ~ + fixable: false + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 33 + fix: ~ + parent: ~ + - kind: + name: UnnecessaryDirectLambdaCall + body: Lambda expression called directly. Execute the expression inline instead. + suggestion: ~ + fixable: false + location: + row: 5 + column: 8 + end_location: + row: 5 + column: 27 + fix: ~ + parent: ~ + - kind: + name: UnnecessaryDirectLambdaCall + body: Lambda expression called directly. Execute the expression inline instead. + suggestion: ~ + fixable: false + location: + row: 5 + column: 29 + end_location: + row: 5 + column: 47 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0100_yield_in_init.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0100_yield_in_init.py.snap index b8d866d607af9a..117d75873e11ea 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0100_yield_in_init.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0100_yield_in_init.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: YieldInInit - body: "`__init__` method is a generator" - suggestion: ~ - fixable: false - location: - row: 9 - column: 8 - end_location: - row: 9 - column: 13 - fix: ~ - parent: ~ -- kind: - name: YieldInInit - body: "`__init__` method is a generator" - suggestion: ~ - fixable: false - location: - row: 14 - column: 8 - end_location: - row: 14 - column: 29 - fix: ~ - parent: ~ +- - kind: + name: YieldInInit + body: "`__init__` method is a generator" + suggestion: ~ + fixable: false + location: + row: 9 + column: 8 + end_location: + row: 9 + column: 13 + fix: ~ + parent: ~ + - kind: + name: YieldInInit + body: "`__init__` method is a generator" + suggestion: ~ + fixable: false + location: + row: 14 + column: 8 + end_location: + row: 14 + column: 29 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0101_return_in_init.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0101_return_in_init.py.snap index 286a00647fe3bf..0dc0fcbfcb8bc7 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0101_return_in_init.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0101_return_in_init.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: ReturnInInit - body: "Explicit return in `__init__`" - suggestion: ~ - fixable: false - location: - row: 14 - column: 8 - end_location: - row: 14 - column: 16 - fix: ~ - parent: ~ -- kind: - name: ReturnInInit - body: "Explicit return in `__init__`" - suggestion: ~ - fixable: false - location: - row: 22 - column: 8 - end_location: - row: 22 - column: 16 - fix: ~ - parent: ~ +- - kind: + name: ReturnInInit + body: "Explicit return in `__init__`" + suggestion: ~ + fixable: false + location: + row: 14 + column: 8 + end_location: + row: 14 + column: 16 + fix: ~ + parent: ~ + - kind: + name: ReturnInInit + body: "Explicit return in `__init__`" + suggestion: ~ + fixable: false + location: + row: 22 + column: 8 + end_location: + row: 22 + column: 16 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0116_continue_in_finally.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0116_continue_in_finally.py.snap index 4ca43e3980d22d..3f39191c650de5 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0116_continue_in_finally.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0116_continue_in_finally.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap index 4105992e109505..244cabdd14291d 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: NonlocalWithoutBinding - body: "Nonlocal name `x` found without binding" - suggestion: ~ - fixable: false - location: - row: 5 - column: 13 - end_location: - row: 5 - column: 14 - fix: ~ - parent: ~ -- kind: - name: NonlocalWithoutBinding - body: "Nonlocal name `y` found without binding" - suggestion: ~ - fixable: false - location: - row: 9 - column: 13 - end_location: - row: 9 - column: 14 - fix: ~ - parent: ~ -- kind: - name: NonlocalWithoutBinding - body: "Nonlocal name `y` found without binding" - suggestion: ~ - fixable: false - location: - row: 19 - column: 17 - end_location: - row: 19 - column: 18 - fix: ~ - parent: ~ +- - kind: + name: NonlocalWithoutBinding + body: "Nonlocal name `x` found without binding" + suggestion: ~ + fixable: false + location: + row: 5 + column: 13 + end_location: + row: 5 + column: 14 + fix: ~ + parent: ~ + - kind: + name: NonlocalWithoutBinding + body: "Nonlocal name `y` found without binding" + suggestion: ~ + fixable: false + location: + row: 9 + column: 13 + end_location: + row: 9 + column: 14 + fix: ~ + parent: ~ + - kind: + name: NonlocalWithoutBinding + body: "Nonlocal name `y` found without binding" + suggestion: ~ + fixable: false + location: + row: 19 + column: 17 + end_location: + row: 19 + column: 18 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0118_used_prior_global_declaration.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0118_used_prior_global_declaration.py.snap index b1a014b6b8d4ac..75568eb14ef899 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0118_used_prior_global_declaration.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0118_used_prior_global_declaration.py.snap @@ -2,173 +2,173 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: UsedPriorGlobalDeclaration - body: "Name `x` is used prior to global declaration on line 7" - suggestion: ~ - fixable: false - location: - row: 5 - column: 10 - end_location: - row: 5 - column: 11 - fix: ~ - parent: ~ -- kind: - name: UsedPriorGlobalDeclaration - body: "Name `x` is used prior to global declaration on line 17" - suggestion: ~ - fixable: false - location: - row: 15 - column: 10 - end_location: - row: 15 - column: 11 - fix: ~ - parent: ~ -- kind: - name: UsedPriorGlobalDeclaration - body: "Name `x` is used prior to global declaration on line 25" - suggestion: ~ - fixable: false - location: - row: 23 - column: 10 - end_location: - row: 23 - column: 11 - fix: ~ - parent: ~ -- kind: - name: UsedPriorGlobalDeclaration - body: "Name `x` is used prior to global declaration on line 35" - suggestion: ~ - fixable: false - location: - row: 33 - column: 10 - end_location: - row: 33 - column: 11 - fix: ~ - parent: ~ -- kind: - name: UsedPriorGlobalDeclaration - body: "Name `x` is used prior to global declaration on line 43" - suggestion: ~ - fixable: false - location: - row: 41 - column: 4 - end_location: - row: 41 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UsedPriorGlobalDeclaration - body: "Name `x` is used prior to global declaration on line 53" - suggestion: ~ - fixable: false - location: - row: 51 - column: 4 - end_location: - row: 51 - column: 5 - fix: ~ - parent: ~ -- kind: - name: UsedPriorGlobalDeclaration - body: "Name `x` is used prior to global declaration on line 61" - suggestion: ~ - fixable: false - location: - row: 59 - column: 8 - end_location: - row: 59 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UsedPriorGlobalDeclaration - body: "Name `x` is used prior to global declaration on line 71" - suggestion: ~ - fixable: false - location: - row: 69 - column: 8 - end_location: - row: 69 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UsedPriorGlobalDeclaration - body: "Name `x` is used prior to global declaration on line 79" - suggestion: ~ - fixable: false - location: - row: 77 - column: 8 - end_location: - row: 77 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UsedPriorGlobalDeclaration - body: "Name `x` is used prior to global declaration on line 89" - suggestion: ~ - fixable: false - location: - row: 87 - column: 8 - end_location: - row: 87 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UsedPriorGlobalDeclaration - body: "Name `x` is used prior to global declaration on line 97" - suggestion: ~ - fixable: false - location: - row: 95 - column: 8 - end_location: - row: 95 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UsedPriorGlobalDeclaration - body: "Name `x` is used prior to global declaration on line 107" - suggestion: ~ - fixable: false - location: - row: 105 - column: 8 - end_location: - row: 105 - column: 9 - fix: ~ - parent: ~ -- kind: - name: UsedPriorGlobalDeclaration - body: "Name `x` is used prior to global declaration on line 114" - suggestion: ~ - fixable: false - location: - row: 113 - column: 13 - end_location: - row: 113 - column: 14 - fix: ~ - parent: ~ +- - kind: + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 7" + suggestion: ~ + fixable: false + location: + row: 5 + column: 10 + end_location: + row: 5 + column: 11 + fix: ~ + parent: ~ + - kind: + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 17" + suggestion: ~ + fixable: false + location: + row: 15 + column: 10 + end_location: + row: 15 + column: 11 + fix: ~ + parent: ~ + - kind: + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 25" + suggestion: ~ + fixable: false + location: + row: 23 + column: 10 + end_location: + row: 23 + column: 11 + fix: ~ + parent: ~ + - kind: + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 35" + suggestion: ~ + fixable: false + location: + row: 33 + column: 10 + end_location: + row: 33 + column: 11 + fix: ~ + parent: ~ + - kind: + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 43" + suggestion: ~ + fixable: false + location: + row: 41 + column: 4 + end_location: + row: 41 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 53" + suggestion: ~ + fixable: false + location: + row: 51 + column: 4 + end_location: + row: 51 + column: 5 + fix: ~ + parent: ~ + - kind: + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 61" + suggestion: ~ + fixable: false + location: + row: 59 + column: 8 + end_location: + row: 59 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 71" + suggestion: ~ + fixable: false + location: + row: 69 + column: 8 + end_location: + row: 69 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 79" + suggestion: ~ + fixable: false + location: + row: 77 + column: 8 + end_location: + row: 77 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 89" + suggestion: ~ + fixable: false + location: + row: 87 + column: 8 + end_location: + row: 87 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 97" + suggestion: ~ + fixable: false + location: + row: 95 + column: 8 + end_location: + row: 95 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 107" + suggestion: ~ + fixable: false + location: + row: 105 + column: 8 + end_location: + row: 105 + column: 9 + fix: ~ + parent: ~ + - kind: + name: UsedPriorGlobalDeclaration + body: "Name `x` is used prior to global declaration on line 114" + suggestion: ~ + fixable: false + location: + row: 113 + column: 13 + end_location: + row: 113 + column: 14 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0604_invalid_all_object.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0604_invalid_all_object.py.snap index c0f2133f35ca7e..4dfca6ddf98779 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0604_invalid_all_object.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0604_invalid_all_object.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: InvalidAllObject - body: "Invalid object in `__all__`, must contain only strings" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 7 - fix: ~ - parent: ~ -- kind: - name: InvalidAllObject - body: "Invalid object in `__all__`, must contain only strings" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 7 - fix: ~ - parent: ~ +- - kind: + name: InvalidAllObject + body: "Invalid object in `__all__`, must contain only strings" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 7 + fix: ~ + parent: ~ + - kind: + name: InvalidAllObject + body: "Invalid object in `__all__`, must contain only strings" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 7 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0605_invalid_all_format.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0605_invalid_all_format.py.snap index c6809415275514..42c73772d4b6d5 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0605_invalid_all_format.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0605_invalid_all_format.py.snap @@ -2,108 +2,108 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: InvalidAllFormat - body: "Invalid format for `__all__`, must be `tuple` or `list`" - suggestion: ~ - fixable: false - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 7 - fix: ~ - parent: ~ -- kind: - name: InvalidAllFormat - body: "Invalid format for `__all__`, must be `tuple` or `list`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 7 - fix: ~ - parent: ~ -- kind: - name: InvalidAllFormat - body: "Invalid format for `__all__`, must be `tuple` or `list`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 7 - fix: ~ - parent: ~ -- kind: - name: InvalidAllFormat - body: "Invalid format for `__all__`, must be `tuple` or `list`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 7 - fix: ~ - parent: ~ -- kind: - name: InvalidAllFormat - body: "Invalid format for `__all__`, must be `tuple` or `list`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 7 - fix: ~ - parent: ~ -- kind: - name: InvalidAllFormat - body: "Invalid format for `__all__`, must be `tuple` or `list`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 7 - fix: ~ - parent: ~ -- kind: - name: InvalidAllFormat - body: "Invalid format for `__all__`, must be `tuple` or `list`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 7 - fix: ~ - parent: ~ -- kind: - name: InvalidAllFormat - body: "Invalid format for `__all__`, must be `tuple` or `list`" - suggestion: ~ - fixable: false - location: - row: 15 - column: 0 - end_location: - row: 15 - column: 7 - fix: ~ - parent: ~ +- - kind: + name: InvalidAllFormat + body: "Invalid format for `__all__`, must be `tuple` or `list`" + suggestion: ~ + fixable: false + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 7 + fix: ~ + parent: ~ + - kind: + name: InvalidAllFormat + body: "Invalid format for `__all__`, must be `tuple` or `list`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 7 + fix: ~ + parent: ~ + - kind: + name: InvalidAllFormat + body: "Invalid format for `__all__`, must be `tuple` or `list`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 7 + fix: ~ + parent: ~ + - kind: + name: InvalidAllFormat + body: "Invalid format for `__all__`, must be `tuple` or `list`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 7 + fix: ~ + parent: ~ + - kind: + name: InvalidAllFormat + body: "Invalid format for `__all__`, must be `tuple` or `list`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 7 + fix: ~ + parent: ~ + - kind: + name: InvalidAllFormat + body: "Invalid format for `__all__`, must be `tuple` or `list`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 7 + fix: ~ + parent: ~ + - kind: + name: InvalidAllFormat + body: "Invalid format for `__all__`, must be `tuple` or `list`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 7 + fix: ~ + parent: ~ + - kind: + name: InvalidAllFormat + body: "Invalid format for `__all__`, must be `tuple` or `list`" + suggestion: ~ + fixable: false + location: + row: 15 + column: 0 + end_location: + row: 15 + column: 7 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1142_await_outside_async.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1142_await_outside_async.py.snap index 54a6caa18b6dee..8595302636be95 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1142_await_outside_async.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1142_await_outside_async.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: AwaitOutsideAsync - body: "`await` should be used within an async function" - suggestion: ~ - fixable: false - location: - row: 12 - column: 10 - end_location: - row: 12 - column: 24 - fix: ~ - parent: ~ -- kind: - name: AwaitOutsideAsync - body: "`await` should be used within an async function" - suggestion: ~ - fixable: false - location: - row: 25 - column: 8 - end_location: - row: 25 - column: 30 - fix: ~ - parent: ~ +- - kind: + name: AwaitOutsideAsync + body: "`await` should be used within an async function" + suggestion: ~ + fixable: false + location: + row: 12 + column: 10 + end_location: + row: 12 + column: 24 + fix: ~ + parent: ~ + - kind: + name: AwaitOutsideAsync + body: "`await` should be used within an async function" + suggestion: ~ + fixable: false + location: + row: 25 + column: 8 + end_location: + row: 25 + column: 30 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1205_logging_too_many_args.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1205_logging_too_many_args.py.snap index 3dfe66d1063871..ce07033c604c7e 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1205_logging_too_many_args.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1205_logging_too_many_args.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: LoggingTooManyArgs - body: "Too many arguments for `logging` format string" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 15 - fix: ~ - parent: ~ -- kind: - name: LoggingTooManyArgs - body: "Too many arguments for `logging` format string" - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 15 - fix: ~ - parent: ~ +- - kind: + name: LoggingTooManyArgs + body: "Too many arguments for `logging` format string" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 15 + fix: ~ + parent: ~ + - kind: + name: LoggingTooManyArgs + body: "Too many arguments for `logging` format string" + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 15 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1206_logging_too_few_args.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1206_logging_too_few_args.py.snap index ef42fd67182412..bccb01339367fc 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1206_logging_too_few_args.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1206_logging_too_few_args.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: LoggingTooFewArgs - body: "Not enough arguments for `logging` format string" - suggestion: ~ - fixable: false - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 15 - fix: ~ - parent: ~ +- - kind: + name: LoggingTooFewArgs + body: "Not enough arguments for `logging` format string" + suggestion: ~ + fixable: false + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 15 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1307_bad_string_format_type.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1307_bad_string_format_type.py.snap index 84aeb65de1c9e6..6f4e34de638f0f 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1307_bad_string_format_type.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1307_bad_string_format_type.py.snap @@ -2,147 +2,147 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: BadStringFormatType - body: Format type does not match argument type - suggestion: ~ - fixable: false - location: - row: 2 - column: 6 - end_location: - row: 2 - column: 58 - fix: ~ - parent: ~ -- kind: - name: BadStringFormatType - body: Format type does not match argument type - suggestion: ~ - fixable: false - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 26 - fix: ~ - parent: ~ -- kind: - name: BadStringFormatType - body: Format type does not match argument type - suggestion: ~ - fixable: false - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 10 - fix: ~ - parent: ~ -- kind: - name: BadStringFormatType - body: Format type does not match argument type - suggestion: ~ - fixable: false - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 10 - fix: ~ - parent: ~ -- kind: - name: BadStringFormatType - body: Format type does not match argument type - suggestion: ~ - fixable: false - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 24 - fix: ~ - parent: ~ -- kind: - name: BadStringFormatType - body: Format type does not match argument type - suggestion: ~ - fixable: false - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 10 - fix: ~ - parent: ~ -- kind: - name: BadStringFormatType - body: Format type does not match argument type - suggestion: ~ - fixable: false - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 24 - fix: ~ - parent: ~ -- kind: - name: BadStringFormatType - body: Format type does not match argument type - suggestion: ~ - fixable: false - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 12 - fix: ~ - parent: ~ -- kind: - name: BadStringFormatType - body: Format type does not match argument type - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 23 - fix: ~ - parent: ~ -- kind: - name: BadStringFormatType - body: Format type does not match argument type - suggestion: ~ - fixable: false - location: - row: 14 - column: 6 - end_location: - row: 14 - column: 34 - fix: ~ - parent: ~ -- kind: - name: BadStringFormatType - body: Format type does not match argument type - suggestion: ~ - fixable: false - location: - row: 15 - column: 0 - end_location: - row: 15 - column: 19 - fix: ~ - parent: ~ +- - kind: + name: BadStringFormatType + body: Format type does not match argument type + suggestion: ~ + fixable: false + location: + row: 2 + column: 6 + end_location: + row: 2 + column: 58 + fix: ~ + parent: ~ + - kind: + name: BadStringFormatType + body: Format type does not match argument type + suggestion: ~ + fixable: false + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 26 + fix: ~ + parent: ~ + - kind: + name: BadStringFormatType + body: Format type does not match argument type + suggestion: ~ + fixable: false + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 10 + fix: ~ + parent: ~ + - kind: + name: BadStringFormatType + body: Format type does not match argument type + suggestion: ~ + fixable: false + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 10 + fix: ~ + parent: ~ + - kind: + name: BadStringFormatType + body: Format type does not match argument type + suggestion: ~ + fixable: false + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 24 + fix: ~ + parent: ~ + - kind: + name: BadStringFormatType + body: Format type does not match argument type + suggestion: ~ + fixable: false + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 10 + fix: ~ + parent: ~ + - kind: + name: BadStringFormatType + body: Format type does not match argument type + suggestion: ~ + fixable: false + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 24 + fix: ~ + parent: ~ + - kind: + name: BadStringFormatType + body: Format type does not match argument type + suggestion: ~ + fixable: false + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 12 + fix: ~ + parent: ~ + - kind: + name: BadStringFormatType + body: Format type does not match argument type + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 23 + fix: ~ + parent: ~ + - kind: + name: BadStringFormatType + body: Format type does not match argument type + suggestion: ~ + fixable: false + location: + row: 14 + column: 6 + end_location: + row: 14 + column: 34 + fix: ~ + parent: ~ + - kind: + name: BadStringFormatType + body: Format type does not match argument type + suggestion: ~ + fixable: false + location: + row: 15 + column: 0 + end_location: + row: 15 + column: 19 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap index a9045f4a832f6d..37832ae72662ff 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap @@ -2,212 +2,212 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: BadStrStripCall - body: "String `strip` call contains duplicate characters" - suggestion: ~ - fixable: false - location: - row: 2 - column: 20 - end_location: - row: 2 - column: 27 - fix: ~ - parent: ~ -- kind: - name: BadStrStripCall - body: "String `strip` call contains duplicate characters" - suggestion: ~ - fixable: false - location: - row: 5 - column: 20 - end_location: - row: 5 - column: 27 - fix: ~ - parent: ~ -- kind: - name: BadStrStripCall - body: "String `strip` call contains duplicate characters" - suggestion: ~ - fixable: false - location: - row: 8 - column: 20 - end_location: - row: 8 - column: 28 - fix: ~ - parent: ~ -- kind: - name: BadStrStripCall - body: "String `strip` call contains duplicate characters" - suggestion: ~ - fixable: false - location: - row: 11 - column: 20 - end_location: - row: 11 - column: 28 - fix: ~ - parent: ~ -- kind: - name: BadStrStripCall - body: "String `strip` call contains duplicate characters" - suggestion: ~ - fixable: false - location: - row: 14 - column: 20 - end_location: - row: 14 - column: 29 - fix: ~ - parent: ~ -- kind: - name: BadStrStripCall - body: "String `strip` call contains duplicate characters" - suggestion: ~ - fixable: false - location: - row: 17 - column: 20 - end_location: - row: 17 - column: 30 - fix: ~ - parent: ~ -- kind: - name: BadStrStripCall - body: "String `strip` call contains duplicate characters" - suggestion: ~ - fixable: false - location: - row: 20 - column: 20 - end_location: - row: 20 - column: 29 - fix: ~ - parent: ~ -- kind: - name: BadStrStripCall - body: "String `strip` call contains duplicate characters" - suggestion: ~ - fixable: false - location: - row: 23 - column: 20 - end_location: - row: 23 - column: 30 - fix: ~ - parent: ~ -- kind: - name: BadStrStripCall - body: "String `strip` call contains duplicate characters" - suggestion: ~ - fixable: false - location: - row: 26 - column: 20 - end_location: - row: 26 - column: 29 - fix: ~ - parent: ~ -- kind: - name: BadStrStripCall - body: "String `strip` call contains duplicate characters" - suggestion: ~ - fixable: false - location: - row: 30 - column: 4 - end_location: - row: 32 - column: 3 - fix: ~ - parent: ~ -- kind: - name: BadStrStripCall - body: "String `strip` call contains duplicate characters" - suggestion: ~ - fixable: false - location: - row: 36 - column: 20 - end_location: - row: 38 - column: 29 - fix: ~ - parent: ~ -- kind: - name: BadStrStripCall - body: "String `strip` call contains duplicate characters" - suggestion: ~ - fixable: false - location: - row: 42 - column: 4 - end_location: - row: 44 - column: 13 - fix: ~ - parent: ~ -- kind: - name: BadStrStripCall - body: "String `strip` call contains duplicate characters" - suggestion: ~ - fixable: false - location: - row: 49 - column: 4 - end_location: - row: 51 - column: 13 - fix: ~ - parent: ~ -- kind: - name: BadStrStripCall - body: "String `strip` call contains duplicate characters" - suggestion: ~ - fixable: false - location: - row: 61 - column: 10 - end_location: - row: 61 - column: 19 - fix: ~ - parent: ~ -- kind: - name: BadStrStripCall - body: "String `lstrip` call contains duplicate characters (did you mean `removeprefix`?)" - suggestion: ~ - fixable: false - location: - row: 64 - column: 11 - end_location: - row: 64 - column: 20 - fix: ~ - parent: ~ -- kind: - name: BadStrStripCall - body: "String `rstrip` call contains duplicate characters (did you mean `removesuffix`?)" - suggestion: ~ - fixable: false - location: - row: 67 - column: 11 - end_location: - row: 67 - column: 20 - fix: ~ - parent: ~ +- - kind: + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + suggestion: ~ + fixable: false + location: + row: 2 + column: 20 + end_location: + row: 2 + column: 27 + fix: ~ + parent: ~ + - kind: + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + suggestion: ~ + fixable: false + location: + row: 5 + column: 20 + end_location: + row: 5 + column: 27 + fix: ~ + parent: ~ + - kind: + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + suggestion: ~ + fixable: false + location: + row: 8 + column: 20 + end_location: + row: 8 + column: 28 + fix: ~ + parent: ~ + - kind: + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + suggestion: ~ + fixable: false + location: + row: 11 + column: 20 + end_location: + row: 11 + column: 28 + fix: ~ + parent: ~ + - kind: + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + suggestion: ~ + fixable: false + location: + row: 14 + column: 20 + end_location: + row: 14 + column: 29 + fix: ~ + parent: ~ + - kind: + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + suggestion: ~ + fixable: false + location: + row: 17 + column: 20 + end_location: + row: 17 + column: 30 + fix: ~ + parent: ~ + - kind: + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + suggestion: ~ + fixable: false + location: + row: 20 + column: 20 + end_location: + row: 20 + column: 29 + fix: ~ + parent: ~ + - kind: + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + suggestion: ~ + fixable: false + location: + row: 23 + column: 20 + end_location: + row: 23 + column: 30 + fix: ~ + parent: ~ + - kind: + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + suggestion: ~ + fixable: false + location: + row: 26 + column: 20 + end_location: + row: 26 + column: 29 + fix: ~ + parent: ~ + - kind: + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + suggestion: ~ + fixable: false + location: + row: 30 + column: 4 + end_location: + row: 32 + column: 3 + fix: ~ + parent: ~ + - kind: + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + suggestion: ~ + fixable: false + location: + row: 36 + column: 20 + end_location: + row: 38 + column: 29 + fix: ~ + parent: ~ + - kind: + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + suggestion: ~ + fixable: false + location: + row: 42 + column: 4 + end_location: + row: 44 + column: 13 + fix: ~ + parent: ~ + - kind: + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + suggestion: ~ + fixable: false + location: + row: 49 + column: 4 + end_location: + row: 51 + column: 13 + fix: ~ + parent: ~ + - kind: + name: BadStrStripCall + body: "String `strip` call contains duplicate characters" + suggestion: ~ + fixable: false + location: + row: 61 + column: 10 + end_location: + row: 61 + column: 19 + fix: ~ + parent: ~ + - kind: + name: BadStrStripCall + body: "String `lstrip` call contains duplicate characters (did you mean `removeprefix`?)" + suggestion: ~ + fixable: false + location: + row: 64 + column: 11 + end_location: + row: 64 + column: 20 + fix: ~ + parent: ~ + - kind: + name: BadStrStripCall + body: "String `rstrip` call contains duplicate characters (did you mean `removesuffix`?)" + suggestion: ~ + fixable: false + location: + row: 67 + column: 11 + end_location: + row: 67 + column: 20 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1507_invalid_envvar_value.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1507_invalid_envvar_value.py.snap index 632fa3450696b0..e992d66f252de6 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1507_invalid_envvar_value.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1507_invalid_envvar_value.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: InvalidEnvvarValue - body: "Invalid type for initial `os.getenv` argument; expected `str`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 10 - end_location: - row: 3 - column: 11 - fix: ~ - parent: ~ -- kind: - name: InvalidEnvvarValue - body: "Invalid type for initial `os.getenv` argument; expected `str`" - suggestion: ~ - fixable: false - location: - row: 7 - column: 14 - end_location: - row: 7 - column: 16 - fix: ~ - parent: ~ -- kind: - name: InvalidEnvvarValue - body: "Invalid type for initial `os.getenv` argument; expected `str`" - suggestion: ~ - fixable: false - location: - row: 8 - column: 10 - end_location: - row: 8 - column: 19 - fix: ~ - parent: ~ -- kind: - name: InvalidEnvvarValue - body: "Invalid type for initial `os.getenv` argument; expected `str`" - suggestion: ~ - fixable: false - location: - row: 12 - column: 14 - end_location: - row: 12 - column: 23 - fix: ~ - parent: ~ +- - kind: + name: InvalidEnvvarValue + body: "Invalid type for initial `os.getenv` argument; expected `str`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 10 + end_location: + row: 3 + column: 11 + fix: ~ + parent: ~ + - kind: + name: InvalidEnvvarValue + body: "Invalid type for initial `os.getenv` argument; expected `str`" + suggestion: ~ + fixable: false + location: + row: 7 + column: 14 + end_location: + row: 7 + column: 16 + fix: ~ + parent: ~ + - kind: + name: InvalidEnvvarValue + body: "Invalid type for initial `os.getenv` argument; expected `str`" + suggestion: ~ + fixable: false + location: + row: 8 + column: 10 + end_location: + row: 8 + column: 19 + fix: ~ + parent: ~ + - kind: + name: InvalidEnvvarValue + body: "Invalid type for initial `os.getenv` argument; expected `str`" + suggestion: ~ + fixable: false + location: + row: 12 + column: 14 + end_location: + row: 12 + column: 23 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap index dd70149cc774a6..ac9409e2f6d30b 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: BidirectionalUnicode - body: Contains control characters that can permit obfuscated code - suggestion: ~ - fixable: false - location: - row: 2 - column: 0 - end_location: - row: 3 - column: 0 - fix: ~ - parent: ~ -- kind: - name: BidirectionalUnicode - body: Contains control characters that can permit obfuscated code - suggestion: ~ - fixable: false - location: - row: 5 - column: 0 - end_location: - row: 6 - column: 0 - fix: ~ - parent: ~ -- kind: - name: BidirectionalUnicode - body: Contains control characters that can permit obfuscated code - suggestion: ~ - fixable: false - location: - row: 8 - column: 0 - end_location: - row: 9 - column: 0 - fix: ~ - parent: ~ -- kind: - name: BidirectionalUnicode - body: Contains control characters that can permit obfuscated code - suggestion: ~ - fixable: false - location: - row: 14 - column: 0 - end_location: - row: 15 - column: 0 - fix: ~ - parent: ~ +- - kind: + name: BidirectionalUnicode + body: Contains control characters that can permit obfuscated code + suggestion: ~ + fixable: false + location: + row: 2 + column: 0 + end_location: + row: 3 + column: 0 + fix: ~ + parent: ~ + - kind: + name: BidirectionalUnicode + body: Contains control characters that can permit obfuscated code + suggestion: ~ + fixable: false + location: + row: 5 + column: 0 + end_location: + row: 6 + column: 0 + fix: ~ + parent: ~ + - kind: + name: BidirectionalUnicode + body: Contains control characters that can permit obfuscated code + suggestion: ~ + fixable: false + location: + row: 8 + column: 0 + end_location: + row: 9 + column: 0 + fix: ~ + parent: ~ + - kind: + name: BidirectionalUnicode + body: Contains control characters that can permit obfuscated code + suggestion: ~ + fixable: false + location: + row: 14 + column: 0 + end_location: + row: 15 + column: 0 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0133_comparison_of_constant.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0133_comparison_of_constant.py.snap index ddef7164e99085..552f096d59448b 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0133_comparison_of_constant.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0133_comparison_of_constant.py.snap @@ -2,134 +2,134 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: ComparisonOfConstant - body: "Two constants compared in a comparison, consider replacing `100 == 100`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 3 - end_location: - row: 3 - column: 6 - fix: ~ - parent: ~ -- kind: - name: ComparisonOfConstant - body: "Two constants compared in a comparison, consider replacing `1 == 3`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 3 - end_location: - row: 6 - column: 4 - fix: ~ - parent: ~ -- kind: - name: ComparisonOfConstant - body: "Two constants compared in a comparison, consider replacing `1 != 3`" - suggestion: ~ - fixable: false - location: - row: 9 - column: 3 - end_location: - row: 9 - column: 4 - fix: ~ - parent: ~ -- kind: - name: ComparisonOfConstant - body: "Two constants compared in a comparison, consider replacing `4 == 3`" - suggestion: ~ - fixable: false - location: - row: 13 - column: 3 - end_location: - row: 13 - column: 4 - fix: ~ - parent: ~ -- kind: - name: ComparisonOfConstant - body: "Two constants compared in a comparison, consider replacing `1 > 0`" - suggestion: ~ - fixable: false - location: - row: 23 - column: 3 - end_location: - row: 23 - column: 4 - fix: ~ - parent: ~ -- kind: - name: ComparisonOfConstant - body: "Two constants compared in a comparison, consider replacing `1 >= 0`" - suggestion: ~ - fixable: false - location: - row: 29 - column: 3 - end_location: - row: 29 - column: 4 - fix: ~ - parent: ~ -- kind: - name: ComparisonOfConstant - body: "Two constants compared in a comparison, consider replacing `1 < 0`" - suggestion: ~ - fixable: false - location: - row: 35 - column: 3 - end_location: - row: 35 - column: 4 - fix: ~ - parent: ~ -- kind: - name: ComparisonOfConstant - body: "Two constants compared in a comparison, consider replacing `1 <= 0`" - suggestion: ~ - fixable: false - location: - row: 41 - column: 3 - end_location: - row: 41 - column: 4 - fix: ~ - parent: ~ -- kind: - name: ComparisonOfConstant - body: "Two constants compared in a comparison, consider replacing `\"hello\" == \"\"`" - suggestion: ~ - fixable: false - location: - row: 51 - column: 3 - end_location: - row: 51 - column: 10 - fix: ~ - parent: ~ -- kind: - name: ComparisonOfConstant - body: "Two constants compared in a comparison, consider replacing `True == False`" - suggestion: ~ - fixable: false - location: - row: 58 - column: 3 - end_location: - row: 58 - column: 7 - fix: ~ - parent: ~ +- - kind: + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `100 == 100`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 3 + end_location: + row: 3 + column: 6 + fix: ~ + parent: ~ + - kind: + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `1 == 3`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 3 + end_location: + row: 6 + column: 4 + fix: ~ + parent: ~ + - kind: + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `1 != 3`" + suggestion: ~ + fixable: false + location: + row: 9 + column: 3 + end_location: + row: 9 + column: 4 + fix: ~ + parent: ~ + - kind: + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `4 == 3`" + suggestion: ~ + fixable: false + location: + row: 13 + column: 3 + end_location: + row: 13 + column: 4 + fix: ~ + parent: ~ + - kind: + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `1 > 0`" + suggestion: ~ + fixable: false + location: + row: 23 + column: 3 + end_location: + row: 23 + column: 4 + fix: ~ + parent: ~ + - kind: + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `1 >= 0`" + suggestion: ~ + fixable: false + location: + row: 29 + column: 3 + end_location: + row: 29 + column: 4 + fix: ~ + parent: ~ + - kind: + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `1 < 0`" + suggestion: ~ + fixable: false + location: + row: 35 + column: 3 + end_location: + row: 35 + column: 4 + fix: ~ + parent: ~ + - kind: + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `1 <= 0`" + suggestion: ~ + fixable: false + location: + row: 41 + column: 3 + end_location: + row: 41 + column: 4 + fix: ~ + parent: ~ + - kind: + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `\"hello\" == \"\"`" + suggestion: ~ + fixable: false + location: + row: 51 + column: 3 + end_location: + row: 51 + column: 10 + fix: ~ + parent: ~ + - kind: + name: ComparisonOfConstant + body: "Two constants compared in a comparison, consider replacing `True == False`" + suggestion: ~ + fixable: false + location: + row: 58 + column: 3 + end_location: + row: 58 + column: 7 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0206_property_with_parameters.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0206_property_with_parameters.py.snap index f181a1f07b24aa..438548be64ef8a 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0206_property_with_parameters.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0206_property_with_parameters.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: PropertyWithParameters - body: Cannot have defined parameters for properties - suggestion: ~ - fixable: false - location: - row: 7 - column: 8 - end_location: - row: 7 - column: 17 - fix: ~ - parent: ~ -- kind: - name: PropertyWithParameters - body: Cannot have defined parameters for properties - suggestion: ~ - fixable: false - location: - row: 11 - column: 8 - end_location: - row: 11 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PropertyWithParameters - body: Cannot have defined parameters for properties - suggestion: ~ - fixable: false - location: - row: 15 - column: 8 - end_location: - row: 15 - column: 33 - fix: ~ - parent: ~ +- - kind: + name: PropertyWithParameters + body: Cannot have defined parameters for properties + suggestion: ~ + fixable: false + location: + row: 7 + column: 8 + end_location: + row: 7 + column: 17 + fix: ~ + parent: ~ + - kind: + name: PropertyWithParameters + body: Cannot have defined parameters for properties + suggestion: ~ + fixable: false + location: + row: 11 + column: 8 + end_location: + row: 11 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PropertyWithParameters + body: Cannot have defined parameters for properties + suggestion: ~ + fixable: false + location: + row: 15 + column: 8 + end_location: + row: 15 + column: 33 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0402_import_aliasing.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0402_import_aliasing.py.snap index c16c6d990c6c0f..58a568a00005f5 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0402_import_aliasing.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0402_import_aliasing.py.snap @@ -2,57 +2,57 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: ConsiderUsingFromImport - body: "Use `from os import path` in lieu of alias" - suggestion: "Replace with `from os import path`" - fixable: true - location: - row: 9 - column: 7 - end_location: - row: 9 - column: 22 - fix: - content: from os import path +- - kind: + name: ConsiderUsingFromImport + body: "Use `from os import path` in lieu of alias" + suggestion: "Replace with `from os import path`" + fixable: true location: row: 9 - column: 0 + column: 7 end_location: row: 9 column: 22 - parent: ~ -- kind: - name: ConsiderUsingFromImport - body: "Use `from foo.bar import foobar` in lieu of alias" - suggestion: "Replace with `from foo.bar import foobar`" - fixable: true - location: - row: 11 - column: 7 - end_location: - row: 11 - column: 31 - fix: - content: from foo.bar import foobar + fix: + content: from os import path + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 22 + parent: ~ + - kind: + name: ConsiderUsingFromImport + body: "Use `from foo.bar import foobar` in lieu of alias" + suggestion: "Replace with `from foo.bar import foobar`" + fixable: true location: row: 11 - column: 0 + column: 7 end_location: row: 11 column: 31 - parent: ~ -- kind: - name: ConsiderUsingFromImport - body: "Use `from foo.bar import foobar` in lieu of alias" - suggestion: ~ - fixable: false - location: - row: 12 - column: 7 - end_location: - row: 12 - column: 31 - fix: ~ - parent: ~ + fix: + content: from foo.bar import foobar + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 31 + parent: ~ + - kind: + name: ConsiderUsingFromImport + body: "Use `from foo.bar import foobar` in lieu of alias" + suggestion: ~ + fixable: false + location: + row: 12 + column: 7 + end_location: + row: 12 + column: 31 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0911_too_many_return_statements.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0911_too_many_return_statements.py.snap index b5380f2bc8af10..3275b30a308539 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0911_too_many_return_statements.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0911_too_many_return_statements.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: TooManyReturnStatements - body: Too many return statements (11 > 6) - suggestion: ~ - fixable: false - location: - row: 4 - column: 4 - end_location: - row: 4 - column: 19 - fix: ~ - parent: ~ +- - kind: + name: TooManyReturnStatements + body: Too many return statements (11 > 6) + suggestion: ~ + fixable: false + location: + row: 4 + column: 4 + end_location: + row: 4 + column: 19 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0912_too_many_branches.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0912_too_many_branches.py.snap index d5f086b68fc746..d30cbefbeaeab8 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0912_too_many_branches.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0912_too_many_branches.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: TooManyBranches - body: Too many branches (13 > 12) - suggestion: ~ - fixable: false - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 9 - fix: ~ - parent: ~ +- - kind: + name: TooManyBranches + body: Too many branches (13 > 12) + suggestion: ~ + fixable: false + location: + row: 6 + column: 4 + end_location: + row: 6 + column: 9 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0913_too_many_arguments.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0913_too_many_arguments.py.snap index 322ae7535f6442..21a60aef3a6daa 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0913_too_many_arguments.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0913_too_many_arguments.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: TooManyArguments - body: Too many arguments to function call (8 > 5) - suggestion: ~ - fixable: false - location: - row: 1 - column: 4 - end_location: - row: 1 - column: 5 - fix: ~ - parent: ~ -- kind: - name: TooManyArguments - body: Too many arguments to function call (6 > 5) - suggestion: ~ - fixable: false - location: - row: 17 - column: 4 - end_location: - row: 17 - column: 5 - fix: ~ - parent: ~ -- kind: - name: TooManyArguments - body: Too many arguments to function call (6 > 5) - suggestion: ~ - fixable: false - location: - row: 33 - column: 4 - end_location: - row: 33 - column: 5 - fix: ~ - parent: ~ +- - kind: + name: TooManyArguments + body: Too many arguments to function call (8 > 5) + suggestion: ~ + fixable: false + location: + row: 1 + column: 4 + end_location: + row: 1 + column: 5 + fix: ~ + parent: ~ + - kind: + name: TooManyArguments + body: Too many arguments to function call (6 > 5) + suggestion: ~ + fixable: false + location: + row: 17 + column: 4 + end_location: + row: 17 + column: 5 + fix: ~ + parent: ~ + - kind: + name: TooManyArguments + body: Too many arguments to function call (6 > 5) + suggestion: ~ + fixable: false + location: + row: 33 + column: 4 + end_location: + row: 33 + column: 5 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0915_too_many_statements.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0915_too_many_statements.py.snap index b2400d3d11c040..d7e0edbdbc2d05 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0915_too_many_statements.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0915_too_many_statements.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: TooManyStatements - body: Too many statements (52 > 50) - suggestion: ~ - fixable: false - location: - row: 5 - column: 10 - end_location: - row: 5 - column: 11 - fix: ~ - parent: ~ +- - kind: + name: TooManyStatements + body: Too many statements (52 > 50) + suggestion: ~ + fixable: false + location: + row: 5 + column: 10 + end_location: + row: 5 + column: 11 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1701_consider_merging_isinstance.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1701_consider_merging_isinstance.py.snap index 6e1ab26b101019..748102daba002e 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1701_consider_merging_isinstance.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1701_consider_merging_isinstance.py.snap @@ -2,82 +2,82 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: ConsiderMergingIsinstance - body: "Merge these isinstance calls: `isinstance(var[3], (float, int))`" - suggestion: ~ - fixable: false - location: - row: 15 - column: 7 - end_location: - row: 15 - column: 96 - fix: ~ - parent: ~ -- kind: - name: ConsiderMergingIsinstance - body: "Merge these isinstance calls: `isinstance(var[4], (float, int))`" - suggestion: ~ - fixable: false - location: - row: 17 - column: 13 - end_location: - row: 17 - column: 103 - fix: ~ - parent: ~ -- kind: - name: ConsiderMergingIsinstance - body: "Merge these isinstance calls: `isinstance(var[5], (float, int))`" - suggestion: ~ - fixable: false - location: - row: 19 - column: 13 - end_location: - row: 19 - column: 73 - fix: ~ - parent: ~ -- kind: - name: ConsiderMergingIsinstance - body: "Merge these isinstance calls: `isinstance(var[10], (list, str))`" - suggestion: ~ - fixable: false - location: - row: 23 - column: 13 - end_location: - row: 23 - column: 158 - fix: ~ - parent: ~ -- kind: - name: ConsiderMergingIsinstance - body: "Merge these isinstance calls: `isinstance(var[11], (float, int))`" - suggestion: ~ - fixable: false - location: - row: 24 - column: 13 - end_location: - row: 24 - column: 95 - fix: ~ - parent: ~ -- kind: - name: ConsiderMergingIsinstance - body: "Merge these isinstance calls: `isinstance(var[12], (float, int, list))`" - suggestion: ~ - fixable: false - location: - row: 30 - column: 13 - end_location: - row: 30 - column: 75 - fix: ~ - parent: ~ +- - kind: + name: ConsiderMergingIsinstance + body: "Merge these isinstance calls: `isinstance(var[3], (float, int))`" + suggestion: ~ + fixable: false + location: + row: 15 + column: 7 + end_location: + row: 15 + column: 96 + fix: ~ + parent: ~ + - kind: + name: ConsiderMergingIsinstance + body: "Merge these isinstance calls: `isinstance(var[4], (float, int))`" + suggestion: ~ + fixable: false + location: + row: 17 + column: 13 + end_location: + row: 17 + column: 103 + fix: ~ + parent: ~ + - kind: + name: ConsiderMergingIsinstance + body: "Merge these isinstance calls: `isinstance(var[5], (float, int))`" + suggestion: ~ + fixable: false + location: + row: 19 + column: 13 + end_location: + row: 19 + column: 73 + fix: ~ + parent: ~ + - kind: + name: ConsiderMergingIsinstance + body: "Merge these isinstance calls: `isinstance(var[10], (list, str))`" + suggestion: ~ + fixable: false + location: + row: 23 + column: 13 + end_location: + row: 23 + column: 158 + fix: ~ + parent: ~ + - kind: + name: ConsiderMergingIsinstance + body: "Merge these isinstance calls: `isinstance(var[11], (float, int))`" + suggestion: ~ + fixable: false + location: + row: 24 + column: 13 + end_location: + row: 24 + column: 95 + fix: ~ + parent: ~ + - kind: + name: ConsiderMergingIsinstance + body: "Merge these isinstance calls: `isinstance(var[12], (float, int, list))`" + suggestion: ~ + fixable: false + location: + row: 30 + column: 13 + end_location: + row: 30 + column: 75 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_0.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_0.py.snap index 8aa20e1524c223..f01721dc25f095 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_0.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_0.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `exit`" - suggestion: "Replace `exit` with `sys.exit()`" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 4 - fix: ~ - parent: ~ -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `quit`" - suggestion: "Replace `quit` with `sys.exit()`" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 4 - fix: ~ - parent: ~ -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `exit`" - suggestion: "Replace `exit` with `sys.exit()`" - fixable: true - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 8 - fix: ~ - parent: ~ -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `quit`" - suggestion: "Replace `quit` with `sys.exit()`" - fixable: true - location: - row: 7 - column: 4 - end_location: - row: 7 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + suggestion: "Replace `exit` with `sys.exit()`" + fixable: true + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 4 + fix: ~ + parent: ~ + - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + suggestion: "Replace `quit` with `sys.exit()`" + fixable: true + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 4 + fix: ~ + parent: ~ + - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + suggestion: "Replace `exit` with `sys.exit()`" + fixable: true + location: + row: 6 + column: 4 + end_location: + row: 6 + column: 8 + fix: ~ + parent: ~ + - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + suggestion: "Replace `quit` with `sys.exit()`" + fixable: true + location: + row: 7 + column: 4 + end_location: + row: 7 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_1.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_1.py.snap index f7eca30fd1b776..0c780f3a8d41a8 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_1.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_1.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `exit`" - suggestion: "Replace `exit` with `sys.exit()`" - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 4 - fix: - content: sys.exit +- - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + suggestion: "Replace `exit` with `sys.exit()`" + fixable: true location: row: 3 column: 0 end_location: row: 3 column: 4 - parent: ~ -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `quit`" - suggestion: "Replace `quit` with `sys.exit()`" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 4 - fix: - content: sys.exit + fix: + content: sys.exit + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 4 + parent: ~ + - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + suggestion: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 4 - parent: ~ -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `exit`" - suggestion: "Replace `exit` with `sys.exit()`" - fixable: true - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 8 - fix: - content: sys.exit + fix: + content: sys.exit + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 4 + parent: ~ + - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + suggestion: "Replace `exit` with `sys.exit()`" + fixable: true location: row: 8 column: 4 end_location: row: 8 column: 8 - parent: ~ -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `quit`" - suggestion: "Replace `quit` with `sys.exit()`" - fixable: true - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 8 - fix: - content: sys.exit + fix: + content: sys.exit + location: + row: 8 + column: 4 + end_location: + row: 8 + column: 8 + parent: ~ + - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + suggestion: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 9 column: 4 end_location: row: 9 column: 8 - parent: ~ + fix: + content: sys.exit + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 8 + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_2.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_2.py.snap index 6e9a6c72915220..ad2c4a91663b93 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_2.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_2.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `exit`" - suggestion: "Replace `exit` with `sys.exit()`" - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 4 - fix: - content: sys2.exit +- - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + suggestion: "Replace `exit` with `sys.exit()`" + fixable: true location: row: 3 column: 0 end_location: row: 3 column: 4 - parent: ~ -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `quit`" - suggestion: "Replace `quit` with `sys.exit()`" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 4 - fix: - content: sys2.exit + fix: + content: sys2.exit + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 4 + parent: ~ + - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + suggestion: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 4 - parent: ~ -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `exit`" - suggestion: "Replace `exit` with `sys.exit()`" - fixable: true - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 8 - fix: - content: sys2.exit + fix: + content: sys2.exit + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 4 + parent: ~ + - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + suggestion: "Replace `exit` with `sys.exit()`" + fixable: true location: row: 8 column: 4 end_location: row: 8 column: 8 - parent: ~ -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `quit`" - suggestion: "Replace `quit` with `sys.exit()`" - fixable: true - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 8 - fix: - content: sys2.exit + fix: + content: sys2.exit + location: + row: 8 + column: 4 + end_location: + row: 8 + column: 8 + parent: ~ + - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + suggestion: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 9 column: 4 end_location: row: 9 column: 8 - parent: ~ + fix: + content: sys2.exit + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 8 + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_3.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_3.py.snap index bc69bd958d7134..6dcf5be8d67d28 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_3.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_3.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `quit`" - suggestion: "Replace `quit` with `sys.exit()`" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 4 - fix: - content: exit +- - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + suggestion: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 4 - parent: ~ -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `quit`" - suggestion: "Replace `quit` with `sys.exit()`" - fixable: true - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 8 - fix: - content: exit + fix: + content: exit + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 4 + parent: ~ + - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + suggestion: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 9 column: 4 end_location: row: 9 column: 8 - parent: ~ + fix: + content: exit + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 8 + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_4.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_4.py.snap index 2799ef4576d580..0c4d07e6be05cc 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_4.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_4.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `exit`" - suggestion: "Replace `exit` with `sys.exit()`" - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 4 - fix: - content: exit2 +- - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + suggestion: "Replace `exit` with `sys.exit()`" + fixable: true location: row: 3 column: 0 end_location: row: 3 column: 4 - parent: ~ -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `quit`" - suggestion: "Replace `quit` with `sys.exit()`" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 4 - fix: - content: exit2 + fix: + content: exit2 + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 4 + parent: ~ + - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + suggestion: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 4 - parent: ~ -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `exit`" - suggestion: "Replace `exit` with `sys.exit()`" - fixable: true - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 8 - fix: - content: exit2 + fix: + content: exit2 + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 4 + parent: ~ + - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + suggestion: "Replace `exit` with `sys.exit()`" + fixable: true location: row: 8 column: 4 end_location: row: 8 column: 8 - parent: ~ -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `quit`" - suggestion: "Replace `quit` with `sys.exit()`" - fixable: true - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 8 - fix: - content: exit2 + fix: + content: exit2 + location: + row: 8 + column: 4 + end_location: + row: 8 + column: 8 + parent: ~ + - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + suggestion: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 9 column: 4 end_location: row: 9 column: 8 - parent: ~ + fix: + content: exit2 + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 8 + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_5.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_5.py.snap index bc69bd958d7134..6dcf5be8d67d28 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_5.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_5.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `quit`" - suggestion: "Replace `quit` with `sys.exit()`" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 4 - fix: - content: exit +- - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + suggestion: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 4 - parent: ~ -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `quit`" - suggestion: "Replace `quit` with `sys.exit()`" - fixable: true - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 8 - fix: - content: exit + fix: + content: exit + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 4 + parent: ~ + - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + suggestion: "Replace `quit` with `sys.exit()`" + fixable: true location: row: 9 column: 4 end_location: row: 9 column: 8 - parent: ~ + fix: + content: exit + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 8 + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_6.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_6.py.snap index 04a718aa44730e..0451c263ae676c 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_6.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_consider_using_sys_exit_6.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `exit`" - suggestion: "Replace `exit` with `sys.exit()`" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 4 - fix: ~ - parent: ~ -- kind: - name: ConsiderUsingSysExit - body: "Use `sys.exit()` instead of `quit`" - suggestion: "Replace `quit` with `sys.exit()`" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 4 - fix: ~ - parent: ~ +- - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `exit`" + suggestion: "Replace `exit` with `sys.exit()`" + fixable: true + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 4 + fix: ~ + parent: ~ + - kind: + name: ConsiderUsingSysExit + body: "Use `sys.exit()` instead of `quit`" + suggestion: "Replace `quit` with `sys.exit()`" + fixable: true + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 4 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR2004_magic_value_comparison.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR2004_magic_value_comparison.py.snap index 2fc6598d5a43ea..8404c08df4e9c5 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR2004_magic_value_comparison.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR2004_magic_value_comparison.py.snap @@ -2,69 +2,69 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: MagicValueComparison - body: "Magic value used in comparison, consider replacing 10 with a constant variable" - suggestion: ~ - fixable: false - location: - row: 5 - column: 3 - end_location: - row: 5 - column: 5 - fix: ~ - parent: ~ -- kind: - name: MagicValueComparison - body: "Magic value used in comparison, consider replacing 2 with a constant variable" - suggestion: ~ - fixable: false - location: - row: 38 - column: 11 - end_location: - row: 38 - column: 12 - fix: ~ - parent: ~ -- kind: - name: MagicValueComparison - body: "Magic value used in comparison, consider replacing -2 with a constant variable" - suggestion: ~ - fixable: false - location: - row: 41 - column: 11 - end_location: - row: 41 - column: 13 - fix: ~ - parent: ~ -- kind: - name: MagicValueComparison - body: "Magic value used in comparison, consider replacing +2 with a constant variable" - suggestion: ~ - fixable: false - location: - row: 44 - column: 11 - end_location: - row: 44 - column: 13 - fix: ~ - parent: ~ -- kind: - name: MagicValueComparison - body: "Magic value used in comparison, consider replacing 3.141592653589793 with a constant variable" - suggestion: ~ - fixable: false - location: - row: 65 - column: 20 - end_location: - row: 65 - column: 40 - fix: ~ - parent: ~ +- - kind: + name: MagicValueComparison + body: "Magic value used in comparison, consider replacing 10 with a constant variable" + suggestion: ~ + fixable: false + location: + row: 5 + column: 3 + end_location: + row: 5 + column: 5 + fix: ~ + parent: ~ + - kind: + name: MagicValueComparison + body: "Magic value used in comparison, consider replacing 2 with a constant variable" + suggestion: ~ + fixable: false + location: + row: 38 + column: 11 + end_location: + row: 38 + column: 12 + fix: ~ + parent: ~ + - kind: + name: MagicValueComparison + body: "Magic value used in comparison, consider replacing -2 with a constant variable" + suggestion: ~ + fixable: false + location: + row: 41 + column: 11 + end_location: + row: 41 + column: 13 + fix: ~ + parent: ~ + - kind: + name: MagicValueComparison + body: "Magic value used in comparison, consider replacing +2 with a constant variable" + suggestion: ~ + fixable: false + location: + row: 44 + column: 11 + end_location: + row: 44 + column: 13 + fix: ~ + parent: ~ + - kind: + name: MagicValueComparison + body: "Magic value used in comparison, consider replacing 3.141592653589793 with a constant variable" + suggestion: ~ + fixable: false + location: + row: 65 + column: 20 + end_location: + row: 65 + column: 40 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR5501_collapsible_else_if.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR5501_collapsible_else_if.py.snap index cd5b71bb71df89..e5772aa237a28b 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR5501_collapsible_else_if.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR5501_collapsible_else_if.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: CollapsibleElseIf - body: "Consider using `elif` instead of `else` then `if` to remove one indentation level" - suggestion: ~ - fixable: false - location: - row: 38 - column: 8 - end_location: - row: 39 - column: 16 - fix: ~ - parent: ~ -- kind: - name: CollapsibleElseIf - body: "Consider using `elif` instead of `else` then `if` to remove one indentation level" - suggestion: ~ - fixable: false - location: - row: 46 - column: 8 - end_location: - row: 49 - column: 16 - fix: ~ - parent: ~ +- - kind: + name: CollapsibleElseIf + body: "Consider using `elif` instead of `else` then `if` to remove one indentation level" + suggestion: ~ + fixable: false + location: + row: 38 + column: 8 + end_location: + row: 39 + column: 16 + fix: ~ + parent: ~ + - kind: + name: CollapsibleElseIf + body: "Consider using `elif` instead of `else` then `if` to remove one indentation level" + suggestion: ~ + fixable: false + location: + row: 46 + column: 8 + end_location: + row: 49 + column: 16 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0120_useless_else_on_loop.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0120_useless_else_on_loop.py.snap index 47d9afeaba29f9..e67703de0fecc9 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0120_useless_else_on_loop.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0120_useless_else_on_loop.py.snap @@ -2,95 +2,95 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: UselessElseOnLoop - body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" - suggestion: ~ - fixable: false - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 8 - fix: ~ - parent: ~ -- kind: - name: UselessElseOnLoop - body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" - suggestion: ~ - fixable: false - location: - row: 18 - column: 4 - end_location: - row: 18 - column: 8 - fix: ~ - parent: ~ -- kind: - name: UselessElseOnLoop - body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" - suggestion: ~ - fixable: false - location: - row: 30 - column: 0 - end_location: - row: 30 - column: 4 - fix: ~ - parent: ~ -- kind: - name: UselessElseOnLoop - body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" - suggestion: ~ - fixable: false - location: - row: 37 - column: 0 - end_location: - row: 37 - column: 4 - fix: ~ - parent: ~ -- kind: - name: UselessElseOnLoop - body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" - suggestion: ~ - fixable: false - location: - row: 42 - column: 0 - end_location: - row: 42 - column: 4 - fix: ~ - parent: ~ -- kind: - name: UselessElseOnLoop - body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" - suggestion: ~ - fixable: false - location: - row: 88 - column: 4 - end_location: - row: 88 - column: 8 - fix: ~ - parent: ~ -- kind: - name: UselessElseOnLoop - body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" - suggestion: ~ - fixable: false - location: - row: 98 - column: 8 - end_location: - row: 98 - column: 12 - fix: ~ - parent: ~ +- - kind: + name: UselessElseOnLoop + body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" + suggestion: ~ + fixable: false + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 8 + fix: ~ + parent: ~ + - kind: + name: UselessElseOnLoop + body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" + suggestion: ~ + fixable: false + location: + row: 18 + column: 4 + end_location: + row: 18 + column: 8 + fix: ~ + parent: ~ + - kind: + name: UselessElseOnLoop + body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" + suggestion: ~ + fixable: false + location: + row: 30 + column: 0 + end_location: + row: 30 + column: 4 + fix: ~ + parent: ~ + - kind: + name: UselessElseOnLoop + body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" + suggestion: ~ + fixable: false + location: + row: 37 + column: 0 + end_location: + row: 37 + column: 4 + fix: ~ + parent: ~ + - kind: + name: UselessElseOnLoop + body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" + suggestion: ~ + fixable: false + location: + row: 42 + column: 0 + end_location: + row: 42 + column: 4 + fix: ~ + parent: ~ + - kind: + name: UselessElseOnLoop + body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" + suggestion: ~ + fixable: false + location: + row: 88 + column: 4 + end_location: + row: 88 + column: 8 + fix: ~ + parent: ~ + - kind: + name: UselessElseOnLoop + body: "`else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it" + suggestion: ~ + fixable: false + location: + row: 98 + column: 8 + end_location: + row: 98 + column: 12 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0602_global_variable_not_assigned.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0602_global_variable_not_assigned.py.snap index 7b67d36f4ed53d..216370c4290e6f 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0602_global_variable_not_assigned.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0602_global_variable_not_assigned.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: GlobalVariableNotAssigned - body: "Using global for `X` but no assignment is done" - suggestion: ~ - fixable: false - location: - row: 5 - column: 11 - end_location: - row: 5 - column: 12 - fix: ~ - parent: ~ -- kind: - name: GlobalVariableNotAssigned - body: "Using global for `X` but no assignment is done" - suggestion: ~ - fixable: false - location: - row: 9 - column: 11 - end_location: - row: 9 - column: 12 - fix: ~ - parent: ~ +- - kind: + name: GlobalVariableNotAssigned + body: "Using global for `X` but no assignment is done" + suggestion: ~ + fixable: false + location: + row: 5 + column: 11 + end_location: + row: 5 + column: 12 + fix: ~ + parent: ~ + - kind: + name: GlobalVariableNotAssigned + body: "Using global for `X` but no assignment is done" + suggestion: ~ + fixable: false + location: + row: 9 + column: 11 + end_location: + row: 9 + column: 12 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0603_global_statement.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0603_global_statement.py.snap index 40bcbf8e9982fd..9fed067a459eb5 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0603_global_statement.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0603_global_statement.py.snap @@ -2,108 +2,108 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: GlobalStatement - body: "Using the global statement to update `CONSTANT` is discouraged" - suggestion: ~ - fixable: false - location: - row: 17 - column: 4 - end_location: - row: 17 - column: 19 - fix: ~ - parent: ~ -- kind: - name: GlobalStatement - body: "Using the global statement to update `sys` is discouraged" - suggestion: ~ - fixable: false - location: - row: 24 - column: 4 - end_location: - row: 24 - column: 14 - fix: ~ - parent: ~ -- kind: - name: GlobalStatement - body: "Using the global statement to update `namedtuple` is discouraged" - suggestion: ~ - fixable: false - location: - row: 30 - column: 4 - end_location: - row: 30 - column: 21 - fix: ~ - parent: ~ -- kind: - name: GlobalStatement - body: "Using the global statement to update `CONSTANT` is discouraged" - suggestion: ~ - fixable: false - location: - row: 36 - column: 4 - end_location: - row: 36 - column: 19 - fix: ~ - parent: ~ -- kind: - name: GlobalStatement - body: "Using the global statement to update `CONSTANT` is discouraged" - suggestion: ~ - fixable: false - location: - row: 43 - column: 4 - end_location: - row: 43 - column: 19 - fix: ~ - parent: ~ -- kind: - name: GlobalStatement - body: "Using the global statement to update `CONSTANT` is discouraged" - suggestion: ~ - fixable: false - location: - row: 50 - column: 4 - end_location: - row: 50 - column: 19 - fix: ~ - parent: ~ -- kind: - name: GlobalStatement - body: "Using the global statement to update `FUNC` is discouraged" - suggestion: ~ - fixable: false - location: - row: 60 - column: 4 - end_location: - row: 60 - column: 15 - fix: ~ - parent: ~ -- kind: - name: GlobalStatement - body: "Using the global statement to update `CLASS` is discouraged" - suggestion: ~ - fixable: false - location: - row: 70 - column: 4 - end_location: - row: 70 - column: 16 - fix: ~ - parent: ~ +- - kind: + name: GlobalStatement + body: "Using the global statement to update `CONSTANT` is discouraged" + suggestion: ~ + fixable: false + location: + row: 17 + column: 4 + end_location: + row: 17 + column: 19 + fix: ~ + parent: ~ + - kind: + name: GlobalStatement + body: "Using the global statement to update `sys` is discouraged" + suggestion: ~ + fixable: false + location: + row: 24 + column: 4 + end_location: + row: 24 + column: 14 + fix: ~ + parent: ~ + - kind: + name: GlobalStatement + body: "Using the global statement to update `namedtuple` is discouraged" + suggestion: ~ + fixable: false + location: + row: 30 + column: 4 + end_location: + row: 30 + column: 21 + fix: ~ + parent: ~ + - kind: + name: GlobalStatement + body: "Using the global statement to update `CONSTANT` is discouraged" + suggestion: ~ + fixable: false + location: + row: 36 + column: 4 + end_location: + row: 36 + column: 19 + fix: ~ + parent: ~ + - kind: + name: GlobalStatement + body: "Using the global statement to update `CONSTANT` is discouraged" + suggestion: ~ + fixable: false + location: + row: 43 + column: 4 + end_location: + row: 43 + column: 19 + fix: ~ + parent: ~ + - kind: + name: GlobalStatement + body: "Using the global statement to update `CONSTANT` is discouraged" + suggestion: ~ + fixable: false + location: + row: 50 + column: 4 + end_location: + row: 50 + column: 19 + fix: ~ + parent: ~ + - kind: + name: GlobalStatement + body: "Using the global statement to update `FUNC` is discouraged" + suggestion: ~ + fixable: false + location: + row: 60 + column: 4 + end_location: + row: 60 + column: 15 + fix: ~ + parent: ~ + - kind: + name: GlobalStatement + body: "Using the global statement to update `CLASS` is discouraged" + suggestion: ~ + fixable: false + location: + row: 70 + column: 4 + end_location: + row: 70 + column: 16 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW1508_invalid_envvar_default.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW1508_invalid_envvar_default.py.snap index 2561e3db083b79..6afd73a7b9a5a8 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW1508_invalid_envvar_default.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW1508_invalid_envvar_default.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: InvalidEnvvarDefault - body: "Invalid type for environment variable default; expected `str` or `None`" - suggestion: ~ - fixable: false - location: - row: 3 - column: 28 - end_location: - row: 3 - column: 30 - fix: ~ - parent: ~ -- kind: - name: InvalidEnvvarDefault - body: "Invalid type for environment variable default; expected `str` or `None`" - suggestion: ~ - fixable: false - location: - row: 5 - column: 30 - end_location: - row: 5 - column: 38 - fix: ~ - parent: ~ -- kind: - name: InvalidEnvvarDefault - body: "Invalid type for environment variable default; expected `str` or `None`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 24 - end_location: - row: 6 - column: 29 - fix: ~ - parent: ~ -- kind: - name: InvalidEnvvarDefault - body: "Invalid type for environment variable default; expected `str` or `None`" - suggestion: ~ - fixable: false - location: - row: 10 - column: 16 - end_location: - row: 10 - column: 26 - fix: ~ - parent: ~ +- - kind: + name: InvalidEnvvarDefault + body: "Invalid type for environment variable default; expected `str` or `None`" + suggestion: ~ + fixable: false + location: + row: 3 + column: 28 + end_location: + row: 3 + column: 30 + fix: ~ + parent: ~ + - kind: + name: InvalidEnvvarDefault + body: "Invalid type for environment variable default; expected `str` or `None`" + suggestion: ~ + fixable: false + location: + row: 5 + column: 30 + end_location: + row: 5 + column: 38 + fix: ~ + parent: ~ + - kind: + name: InvalidEnvvarDefault + body: "Invalid type for environment variable default; expected `str` or `None`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 24 + end_location: + row: 6 + column: 29 + fix: ~ + parent: ~ + - kind: + name: InvalidEnvvarDefault + body: "Invalid type for environment variable default; expected `str` or `None`" + suggestion: ~ + fixable: false + location: + row: 10 + column: 16 + end_location: + row: 10 + column: 26 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW2901_redefined_loop_name.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW2901_redefined_loop_name.py.snap index e95084fe18dba9..6610fc25206e07 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW2901_redefined_loop_name.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW2901_redefined_loop_name.py.snap @@ -2,329 +2,329 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: RedefinedLoopName - body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" - suggestion: ~ - fixable: false - location: - row: 3 - column: 8 - end_location: - row: 3 - column: 9 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "`with` statement variable `i` overwritten by `for` loop target" - suggestion: ~ - fixable: false - location: - row: 8 - column: 8 - end_location: - row: 8 - column: 9 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "`for` loop variable `i` overwritten by `with` statement target" - suggestion: ~ - fixable: false - location: - row: 13 - column: 17 - end_location: - row: 13 - column: 18 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "Outer `with` statement variable `i` overwritten by inner `with` statement target" - suggestion: ~ - fixable: false - location: - row: 18 - column: 17 - end_location: - row: 18 - column: 18 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" - suggestion: ~ - fixable: false - location: - row: 34 - column: 12 - end_location: - row: 34 - column: 13 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" - suggestion: ~ - fixable: false - location: - row: 40 - column: 12 - end_location: - row: 40 - column: 13 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "Outer `for` loop variable `j` overwritten by inner `for` loop target" - suggestion: ~ - fixable: false - location: - row: 41 - column: 16 - end_location: - row: 41 - column: 17 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "`for` loop variable `i` overwritten by assignment target" - suggestion: ~ - fixable: false - location: - row: 46 - column: 4 - end_location: - row: 46 - column: 5 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "`for` loop variable `i` overwritten by assignment target" - suggestion: ~ - fixable: false - location: - row: 50 - column: 4 - end_location: - row: 50 - column: 5 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "`for` loop variable `i` overwritten by assignment target" - suggestion: ~ - fixable: false - location: - row: 54 - column: 4 - end_location: - row: 54 - column: 5 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" - suggestion: ~ - fixable: false - location: - row: 58 - column: 8 - end_location: - row: 58 - column: 9 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" - suggestion: ~ - fixable: false - location: - row: 63 - column: 14 - end_location: - row: 63 - column: 15 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" - suggestion: ~ - fixable: false - location: - row: 68 - column: 8 - end_location: - row: 68 - column: 9 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" - suggestion: ~ - fixable: false - location: - row: 73 - column: 8 - end_location: - row: 73 - column: 9 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" - suggestion: ~ - fixable: false - location: - row: 78 - column: 8 - end_location: - row: 78 - column: 9 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "Outer `for` loop variable `j` overwritten by inner `for` loop target" - suggestion: ~ - fixable: false - location: - row: 78 - column: 11 - end_location: - row: 78 - column: 12 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "Outer `for` loop variable `j` overwritten by inner `for` loop target" - suggestion: ~ - fixable: false - location: - row: 95 - column: 8 - end_location: - row: 95 - column: 9 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "`for` loop variable `i` overwritten by assignment target" - suggestion: ~ - fixable: false - location: - row: 112 - column: 12 - end_location: - row: 112 - column: 13 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" - suggestion: ~ - fixable: false - location: - row: 118 - column: 16 - end_location: - row: 118 - column: 17 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "`for` loop variable `a[0]` overwritten by assignment target" - suggestion: ~ - fixable: false - location: - row: 133 - column: 4 - end_location: - row: 133 - column: 8 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "`for` loop variable `a['i']` overwritten by assignment target" - suggestion: ~ - fixable: false - location: - row: 138 - column: 4 - end_location: - row: 138 - column: 10 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "`for` loop variable `a.i` overwritten by assignment target" - suggestion: ~ - fixable: false - location: - row: 143 - column: 4 - end_location: - row: 143 - column: 7 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "`for` loop variable `a.i.j` overwritten by assignment target" - suggestion: ~ - fixable: false - location: - row: 148 - column: 4 - end_location: - row: 148 - column: 9 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "`for` loop variable `a.i` overwritten by assignment target" - suggestion: ~ - fixable: false - location: - row: 153 - column: 4 - end_location: - row: 153 - column: 8 - fix: ~ - parent: ~ -- kind: - name: RedefinedLoopName - body: "`for` loop variable `a.i` overwritten by assignment target" - suggestion: ~ - fixable: false - location: - row: 155 - column: 4 - end_location: - row: 155 - column: 7 - fix: ~ - parent: ~ +- - kind: + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + suggestion: ~ + fixable: false + location: + row: 3 + column: 8 + end_location: + row: 3 + column: 9 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "`with` statement variable `i` overwritten by `for` loop target" + suggestion: ~ + fixable: false + location: + row: 8 + column: 8 + end_location: + row: 8 + column: 9 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "`for` loop variable `i` overwritten by `with` statement target" + suggestion: ~ + fixable: false + location: + row: 13 + column: 17 + end_location: + row: 13 + column: 18 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "Outer `with` statement variable `i` overwritten by inner `with` statement target" + suggestion: ~ + fixable: false + location: + row: 18 + column: 17 + end_location: + row: 18 + column: 18 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + suggestion: ~ + fixable: false + location: + row: 34 + column: 12 + end_location: + row: 34 + column: 13 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + suggestion: ~ + fixable: false + location: + row: 40 + column: 12 + end_location: + row: 40 + column: 13 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "Outer `for` loop variable `j` overwritten by inner `for` loop target" + suggestion: ~ + fixable: false + location: + row: 41 + column: 16 + end_location: + row: 41 + column: 17 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "`for` loop variable `i` overwritten by assignment target" + suggestion: ~ + fixable: false + location: + row: 46 + column: 4 + end_location: + row: 46 + column: 5 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "`for` loop variable `i` overwritten by assignment target" + suggestion: ~ + fixable: false + location: + row: 50 + column: 4 + end_location: + row: 50 + column: 5 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "`for` loop variable `i` overwritten by assignment target" + suggestion: ~ + fixable: false + location: + row: 54 + column: 4 + end_location: + row: 54 + column: 5 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + suggestion: ~ + fixable: false + location: + row: 58 + column: 8 + end_location: + row: 58 + column: 9 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + suggestion: ~ + fixable: false + location: + row: 63 + column: 14 + end_location: + row: 63 + column: 15 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + suggestion: ~ + fixable: false + location: + row: 68 + column: 8 + end_location: + row: 68 + column: 9 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + suggestion: ~ + fixable: false + location: + row: 73 + column: 8 + end_location: + row: 73 + column: 9 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + suggestion: ~ + fixable: false + location: + row: 78 + column: 8 + end_location: + row: 78 + column: 9 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "Outer `for` loop variable `j` overwritten by inner `for` loop target" + suggestion: ~ + fixable: false + location: + row: 78 + column: 11 + end_location: + row: 78 + column: 12 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "Outer `for` loop variable `j` overwritten by inner `for` loop target" + suggestion: ~ + fixable: false + location: + row: 95 + column: 8 + end_location: + row: 95 + column: 9 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "`for` loop variable `i` overwritten by assignment target" + suggestion: ~ + fixable: false + location: + row: 112 + column: 12 + end_location: + row: 112 + column: 13 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "Outer `for` loop variable `i` overwritten by inner `for` loop target" + suggestion: ~ + fixable: false + location: + row: 118 + column: 16 + end_location: + row: 118 + column: 17 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "`for` loop variable `a[0]` overwritten by assignment target" + suggestion: ~ + fixable: false + location: + row: 133 + column: 4 + end_location: + row: 133 + column: 8 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "`for` loop variable `a['i']` overwritten by assignment target" + suggestion: ~ + fixable: false + location: + row: 138 + column: 4 + end_location: + row: 138 + column: 10 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "`for` loop variable `a.i` overwritten by assignment target" + suggestion: ~ + fixable: false + location: + row: 143 + column: 4 + end_location: + row: 143 + column: 7 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "`for` loop variable `a.i.j` overwritten by assignment target" + suggestion: ~ + fixable: false + location: + row: 148 + column: 4 + end_location: + row: 148 + column: 9 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "`for` loop variable `a.i` overwritten by assignment target" + suggestion: ~ + fixable: false + location: + row: 153 + column: 4 + end_location: + row: 153 + column: 8 + fix: ~ + parent: ~ + - kind: + name: RedefinedLoopName + body: "`for` loop variable `a.i` overwritten by assignment target" + suggestion: ~ + fixable: false + location: + row: 155 + column: 4 + end_location: + row: 155 + column: 7 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__allow_magic_value_types.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__allow_magic_value_types.snap index 5c3725765a9456..415fbf9ca3f5c2 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__allow_magic_value_types.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__allow_magic_value_types.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: MagicValueComparison - body: "Magic value used in comparison, consider replacing \"Hunter2\" with a constant variable" - suggestion: ~ - fixable: false - location: - row: 59 - column: 21 - end_location: - row: 59 - column: 30 - fix: ~ - parent: ~ -- kind: - name: MagicValueComparison - body: "Magic value used in comparison, consider replacing 3.141592653589793 with a constant variable" - suggestion: ~ - fixable: false - location: - row: 65 - column: 20 - end_location: - row: 65 - column: 40 - fix: ~ - parent: ~ -- kind: - name: MagicValueComparison - body: "Magic value used in comparison, consider replacing b\"something\" with a constant variable" - suggestion: ~ - fixable: false - location: - row: 74 - column: 17 - end_location: - row: 74 - column: 29 - fix: ~ - parent: ~ +- - kind: + name: MagicValueComparison + body: "Magic value used in comparison, consider replacing \"Hunter2\" with a constant variable" + suggestion: ~ + fixable: false + location: + row: 59 + column: 21 + end_location: + row: 59 + column: 30 + fix: ~ + parent: ~ + - kind: + name: MagicValueComparison + body: "Magic value used in comparison, consider replacing 3.141592653589793 with a constant variable" + suggestion: ~ + fixable: false + location: + row: 65 + column: 20 + end_location: + row: 65 + column: 40 + fix: ~ + parent: ~ + - kind: + name: MagicValueComparison + body: "Magic value used in comparison, consider replacing b\"something\" with a constant variable" + suggestion: ~ + fixable: false + location: + row: 74 + column: 17 + end_location: + row: 74 + column: 29 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__continue_in_finally.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__continue_in_finally.snap index 37b29557b8a27b..a38b3b3a88e808 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__continue_in_finally.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__continue_in_finally.snap @@ -2,173 +2,173 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: ContinueInFinally - body: "`continue` not supported inside `finally` clause" - suggestion: ~ - fixable: false - location: - row: 5 - column: 8 - end_location: - row: 5 - column: 16 - fix: ~ - parent: ~ -- kind: - name: ContinueInFinally - body: "`continue` not supported inside `finally` clause" - suggestion: ~ - fixable: false - location: - row: 16 - column: 12 - end_location: - row: 16 - column: 20 - fix: ~ - parent: ~ -- kind: - name: ContinueInFinally - body: "`continue` not supported inside `finally` clause" - suggestion: ~ - fixable: false - location: - row: 26 - column: 16 - end_location: - row: 26 - column: 24 - fix: ~ - parent: ~ -- kind: - name: ContinueInFinally - body: "`continue` not supported inside `finally` clause" - suggestion: ~ - fixable: false - location: - row: 33 - column: 12 - end_location: - row: 33 - column: 20 - fix: ~ - parent: ~ -- kind: - name: ContinueInFinally - body: "`continue` not supported inside `finally` clause" - suggestion: ~ - fixable: false - location: - row: 40 - column: 12 - end_location: - row: 40 - column: 20 - fix: ~ - parent: ~ -- kind: - name: ContinueInFinally - body: "`continue` not supported inside `finally` clause" - suggestion: ~ - fixable: false - location: - row: 41 - column: 8 - end_location: - row: 41 - column: 16 - fix: ~ - parent: ~ -- kind: - name: ContinueInFinally - body: "`continue` not supported inside `finally` clause" - suggestion: ~ - fixable: false - location: - row: 49 - column: 16 - end_location: - row: 49 - column: 24 - fix: ~ - parent: ~ -- kind: - name: ContinueInFinally - body: "`continue` not supported inside `finally` clause" - suggestion: ~ - fixable: false - location: - row: 56 - column: 8 - end_location: - row: 56 - column: 16 - fix: ~ - parent: ~ -- kind: - name: ContinueInFinally - body: "`continue` not supported inside `finally` clause" - suggestion: ~ - fixable: false - location: - row: 69 - column: 8 - end_location: - row: 69 - column: 16 - fix: ~ - parent: ~ -- kind: - name: ContinueInFinally - body: "`continue` not supported inside `finally` clause" - suggestion: ~ - fixable: false - location: - row: 74 - column: 12 - end_location: - row: 74 - column: 20 - fix: ~ - parent: ~ -- kind: - name: ContinueInFinally - body: "`continue` not supported inside `finally` clause" - suggestion: ~ - fixable: false - location: - row: 89 - column: 12 - end_location: - row: 89 - column: 20 - fix: ~ - parent: ~ -- kind: - name: ContinueInFinally - body: "`continue` not supported inside `finally` clause" - suggestion: ~ - fixable: false - location: - row: 91 - column: 12 - end_location: - row: 91 - column: 20 - fix: ~ - parent: ~ -- kind: - name: ContinueInFinally - body: "`continue` not supported inside `finally` clause" - suggestion: ~ - fixable: false - location: - row: 95 - column: 16 - end_location: - row: 95 - column: 24 - fix: ~ - parent: ~ +- - kind: + name: ContinueInFinally + body: "`continue` not supported inside `finally` clause" + suggestion: ~ + fixable: false + location: + row: 5 + column: 8 + end_location: + row: 5 + column: 16 + fix: ~ + parent: ~ + - kind: + name: ContinueInFinally + body: "`continue` not supported inside `finally` clause" + suggestion: ~ + fixable: false + location: + row: 16 + column: 12 + end_location: + row: 16 + column: 20 + fix: ~ + parent: ~ + - kind: + name: ContinueInFinally + body: "`continue` not supported inside `finally` clause" + suggestion: ~ + fixable: false + location: + row: 26 + column: 16 + end_location: + row: 26 + column: 24 + fix: ~ + parent: ~ + - kind: + name: ContinueInFinally + body: "`continue` not supported inside `finally` clause" + suggestion: ~ + fixable: false + location: + row: 33 + column: 12 + end_location: + row: 33 + column: 20 + fix: ~ + parent: ~ + - kind: + name: ContinueInFinally + body: "`continue` not supported inside `finally` clause" + suggestion: ~ + fixable: false + location: + row: 40 + column: 12 + end_location: + row: 40 + column: 20 + fix: ~ + parent: ~ + - kind: + name: ContinueInFinally + body: "`continue` not supported inside `finally` clause" + suggestion: ~ + fixable: false + location: + row: 41 + column: 8 + end_location: + row: 41 + column: 16 + fix: ~ + parent: ~ + - kind: + name: ContinueInFinally + body: "`continue` not supported inside `finally` clause" + suggestion: ~ + fixable: false + location: + row: 49 + column: 16 + end_location: + row: 49 + column: 24 + fix: ~ + parent: ~ + - kind: + name: ContinueInFinally + body: "`continue` not supported inside `finally` clause" + suggestion: ~ + fixable: false + location: + row: 56 + column: 8 + end_location: + row: 56 + column: 16 + fix: ~ + parent: ~ + - kind: + name: ContinueInFinally + body: "`continue` not supported inside `finally` clause" + suggestion: ~ + fixable: false + location: + row: 69 + column: 8 + end_location: + row: 69 + column: 16 + fix: ~ + parent: ~ + - kind: + name: ContinueInFinally + body: "`continue` not supported inside `finally` clause" + suggestion: ~ + fixable: false + location: + row: 74 + column: 12 + end_location: + row: 74 + column: 20 + fix: ~ + parent: ~ + - kind: + name: ContinueInFinally + body: "`continue` not supported inside `finally` clause" + suggestion: ~ + fixable: false + location: + row: 89 + column: 12 + end_location: + row: 89 + column: 20 + fix: ~ + parent: ~ + - kind: + name: ContinueInFinally + body: "`continue` not supported inside `finally` clause" + suggestion: ~ + fixable: false + location: + row: 91 + column: 12 + end_location: + row: 91 + column: 20 + fix: ~ + parent: ~ + - kind: + name: ContinueInFinally + body: "`continue` not supported inside `finally` clause" + suggestion: ~ + fixable: false + location: + row: 95 + column: 16 + end_location: + row: 95 + column: 24 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args.snap index 403cd755a15125..d942c628dcb3e4 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: TooManyArguments - body: Too many arguments to function call (6 > 4) - suggestion: ~ - fixable: false - location: - row: 3 - column: 4 - end_location: - row: 3 - column: 5 - fix: ~ - parent: ~ -- kind: - name: TooManyArguments - body: Too many arguments to function call (6 > 4) - suggestion: ~ - fixable: false - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 5 - fix: ~ - parent: ~ +- - kind: + name: TooManyArguments + body: Too many arguments to function call (6 > 4) + suggestion: ~ + fixable: false + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 5 + fix: ~ + parent: ~ + - kind: + name: TooManyArguments + body: Too many arguments to function call (6 > 4) + suggestion: ~ + fixable: false + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 5 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args_with_dummy_variables.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args_with_dummy_variables.snap index aabf525484bb2b..28d3dff1d22631 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args_with_dummy_variables.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args_with_dummy_variables.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: TooManyArguments - body: Too many arguments to function call (6 > 5) - suggestion: ~ - fixable: false - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 5 - fix: ~ - parent: ~ +- - kind: + name: TooManyArguments + body: Too many arguments to function call (6 > 5) + suggestion: ~ + fixable: false + location: + row: 9 + column: 4 + end_location: + row: 9 + column: 5 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_branches.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_branches.snap index 5861ab0c68bc99..1e320fdf14314f 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_branches.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_branches.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: TooManyBranches - body: Too many branches (2 > 1) - suggestion: ~ - fixable: false - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 5 - fix: ~ - parent: ~ -- kind: - name: TooManyBranches - body: Too many branches (2 > 1) - suggestion: ~ - fixable: false - location: - row: 15 - column: 8 - end_location: - row: 15 - column: 9 - fix: ~ - parent: ~ +- - kind: + name: TooManyBranches + body: Too many branches (2 > 1) + suggestion: ~ + fixable: false + location: + row: 6 + column: 4 + end_location: + row: 6 + column: 5 + fix: ~ + parent: ~ + - kind: + name: TooManyBranches + body: Too many branches (2 > 1) + suggestion: ~ + fixable: false + location: + row: 15 + column: 8 + end_location: + row: 15 + column: 9 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_return_statements.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_return_statements.snap index a670693bf4a5c5..914f63518e48ef 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_return_statements.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_return_statements.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: TooManyReturnStatements - body: Too many return statements (2 > 1) - suggestion: ~ - fixable: false - location: - row: 1 - column: 4 - end_location: - row: 1 - column: 5 - fix: ~ - parent: ~ +- - kind: + name: TooManyReturnStatements + body: Too many return statements (2 > 1) + suggestion: ~ + fixable: false + location: + row: 1 + column: 4 + end_location: + row: 1 + column: 5 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_statements.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_statements.snap index 67f07d53037b6d..b3250a1137df5b 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_statements.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_statements.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/pylint/mod.rs expression: diagnostics --- -- kind: - name: TooManyStatements - body: Too many statements (2 > 1) - suggestion: ~ - fixable: false - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 5 - fix: ~ - parent: ~ -- kind: - name: TooManyStatements - body: Too many statements (3 > 1) - suggestion: ~ - fixable: false - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 5 - fix: ~ - parent: ~ -- kind: - name: TooManyStatements - body: Too many statements (2 > 1) - suggestion: ~ - fixable: false - location: - row: 7 - column: 8 - end_location: - row: 7 - column: 9 - fix: ~ - parent: ~ +- - kind: + name: TooManyStatements + body: Too many statements (2 > 1) + suggestion: ~ + fixable: false + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 5 + fix: ~ + parent: ~ + - kind: + name: TooManyStatements + body: Too many statements (3 > 1) + suggestion: ~ + fixable: false + location: + row: 6 + column: 4 + end_location: + row: 6 + column: 5 + fix: ~ + parent: ~ + - kind: + name: TooManyStatements + body: Too many statements (2 > 1) + suggestion: ~ + fixable: false + location: + row: 7 + column: 8 + end_location: + row: 7 + column: 9 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP001.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP001.py.snap index 0916a7073a8137..607096ad92bb3e 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP001.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP001.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: UselessMetaclassType - body: "`__metaclass__ = type` is implied" - suggestion: "Remove `__metaclass__ = type`" - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 24 - fix: - content: pass +- - kind: + name: UselessMetaclassType + body: "`__metaclass__ = type` is implied" + suggestion: "Remove `__metaclass__ = type`" + fixable: true location: row: 2 column: 4 end_location: row: 2 column: 24 - parent: ~ -- kind: - name: UselessMetaclassType - body: "`__metaclass__ = type` is implied" - suggestion: "Remove `__metaclass__ = type`" - fixable: true - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 24 - fix: - content: "" + fix: + content: pass + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 24 + parent: ~ + - kind: + name: UselessMetaclassType + body: "`__metaclass__ = type` is implied" + suggestion: "Remove `__metaclass__ = type`" + fixable: true location: row: 6 - column: 0 + column: 4 end_location: - row: 7 - column: 0 - parent: ~ + row: 6 + column: 24 + fix: + content: "" + location: + row: 6 + column: 0 + end_location: + row: 7 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP003.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP003.py.snap index 1957ca50ad02fe..b40f5782389d17 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP003.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP003.py.snap @@ -2,104 +2,104 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: TypeOfPrimitive - body: "Use `str` instead of `type(...)`" - suggestion: "Replace `type(...)` with `str`" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 8 - fix: - content: str +- - kind: + name: TypeOfPrimitive + body: "Use `str` instead of `type(...)`" + suggestion: "Replace `type(...)` with `str`" + fixable: true location: row: 1 column: 0 end_location: row: 1 column: 8 - parent: ~ -- kind: - name: TypeOfPrimitive - body: "Use `bytes` instead of `type(...)`" - suggestion: "Replace `type(...)` with `bytes`" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 9 - fix: - content: bytes + fix: + content: str + location: + row: 1 + column: 0 + end_location: + row: 1 + column: 8 + parent: ~ + - kind: + name: TypeOfPrimitive + body: "Use `bytes` instead of `type(...)`" + suggestion: "Replace `type(...)` with `bytes`" + fixable: true location: row: 2 column: 0 end_location: row: 2 column: 9 - parent: ~ -- kind: - name: TypeOfPrimitive - body: "Use `int` instead of `type(...)`" - suggestion: "Replace `type(...)` with `int`" - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 7 - fix: - content: int + fix: + content: bytes + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 9 + parent: ~ + - kind: + name: TypeOfPrimitive + body: "Use `int` instead of `type(...)`" + suggestion: "Replace `type(...)` with `int`" + fixable: true location: row: 3 column: 0 end_location: row: 3 column: 7 - parent: ~ -- kind: - name: TypeOfPrimitive - body: "Use `float` instead of `type(...)`" - suggestion: "Replace `type(...)` with `float`" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 9 - fix: - content: float + fix: + content: int + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 7 + parent: ~ + - kind: + name: TypeOfPrimitive + body: "Use `float` instead of `type(...)`" + suggestion: "Replace `type(...)` with `float`" + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 9 - parent: ~ -- kind: - name: TypeOfPrimitive - body: "Use `complex` instead of `type(...)`" - suggestion: "Replace `type(...)` with `complex`" - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 8 - fix: - content: complex + fix: + content: float + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 9 + parent: ~ + - kind: + name: TypeOfPrimitive + body: "Use `complex` instead of `type(...)`" + suggestion: "Replace `type(...)` with `complex`" + fixable: true location: row: 5 column: 0 end_location: row: 5 column: 8 - parent: ~ + fix: + content: complex + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 8 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP004.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP004.py.snap index 451a6e89fcde0a..2f8ff45aedc350 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP004.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP004.py.snap @@ -2,404 +2,404 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: UselessObjectInheritance - body: "Class `A` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 5 - column: 8 - end_location: - row: 5 - column: 14 - fix: - content: "" +- - kind: + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: row: 5 - column: 7 + column: 8 end_location: row: 5 - column: 15 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `A` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 10 - column: 4 - end_location: - row: 10 - column: 10 - fix: - content: "" + column: 14 + fix: + content: "" + location: + row: 5 + column: 7 + end_location: + row: 5 + column: 15 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: - row: 9 - column: 7 + row: 10 + column: 4 end_location: - row: 11 - column: 1 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `A` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 10 - fix: - content: "" + row: 10 + column: 10 + fix: + content: "" + location: + row: 9 + column: 7 + end_location: + row: 11 + column: 1 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: - row: 15 - column: 7 + row: 16 + column: 4 end_location: - row: 18 - column: 1 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `A` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 24 - column: 4 - end_location: - row: 24 - column: 10 - fix: - content: "" + row: 16 + column: 10 + fix: + content: "" + location: + row: 15 + column: 7 + end_location: + row: 18 + column: 1 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: - row: 22 - column: 7 + row: 24 + column: 4 end_location: - row: 25 - column: 1 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `A` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 31 - column: 4 - end_location: - row: 31 - column: 10 - fix: - content: "" + row: 24 + column: 10 + fix: + content: "" + location: + row: 22 + column: 7 + end_location: + row: 25 + column: 1 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: - row: 29 - column: 7 + row: 31 + column: 4 end_location: - row: 32 - column: 1 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `A` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 37 - column: 4 - end_location: - row: 37 - column: 10 - fix: - content: "" + row: 31 + column: 10 + fix: + content: "" + location: + row: 29 + column: 7 + end_location: + row: 32 + column: 1 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: - row: 36 - column: 7 + row: 37 + column: 4 end_location: - row: 39 - column: 1 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `A` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 45 - column: 4 - end_location: - row: 45 - column: 10 - fix: - content: "" + row: 37 + column: 10 + fix: + content: "" + location: + row: 36 + column: 7 + end_location: + row: 39 + column: 1 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: - row: 43 - column: 7 + row: 45 + column: 4 end_location: - row: 47 - column: 1 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `A` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 53 - column: 4 - end_location: - row: 53 - column: 10 - fix: - content: "" + row: 45 + column: 10 + fix: + content: "" + location: + row: 43 + column: 7 + end_location: + row: 47 + column: 1 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: - row: 51 - column: 7 + row: 53 + column: 4 end_location: - row: 55 - column: 1 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `A` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 61 - column: 4 - end_location: - row: 61 - column: 10 - fix: - content: "" + row: 53 + column: 10 + fix: + content: "" + location: + row: 51 + column: 7 + end_location: + row: 55 + column: 1 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: - row: 59 - column: 7 + row: 61 + column: 4 end_location: - row: 63 - column: 1 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `A` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 69 - column: 4 - end_location: - row: 69 - column: 10 - fix: - content: "" + row: 61 + column: 10 + fix: + content: "" + location: + row: 59 + column: 7 + end_location: + row: 63 + column: 1 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: - row: 67 - column: 7 + row: 69 + column: 4 end_location: - row: 71 - column: 1 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `B` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 75 - column: 11 - end_location: - row: 75 - column: 17 - fix: - content: "" + row: 69 + column: 10 + fix: + content: "" + location: + row: 67 + column: 7 + end_location: + row: 71 + column: 1 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `B` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: row: 75 - column: 9 + column: 11 end_location: row: 75 column: 17 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `B` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 79 - column: 8 - end_location: - row: 79 - column: 14 - fix: - content: "" + fix: + content: "" + location: + row: 75 + column: 9 + end_location: + row: 75 + column: 17 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `B` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: row: 79 column: 8 end_location: row: 79 - column: 16 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `B` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 84 - column: 4 - end_location: - row: 84 - column: 10 - fix: - content: "" + column: 14 + fix: + content: "" + location: + row: 79 + column: 8 + end_location: + row: 79 + column: 16 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `B` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: row: 84 column: 4 end_location: - row: 85 - column: 4 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `B` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 92 - column: 4 - end_location: - row: 92 - column: 10 - fix: - content: "" + row: 84 + column: 10 + fix: + content: "" + location: + row: 84 + column: 4 + end_location: + row: 85 + column: 4 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `B` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: - row: 91 - column: 5 + row: 92 + column: 4 end_location: row: 92 column: 10 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `B` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 98 - column: 4 - end_location: - row: 98 - column: 10 - fix: - content: "" + fix: + content: "" + location: + row: 91 + column: 5 + end_location: + row: 92 + column: 10 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `B` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: row: 98 column: 4 end_location: - row: 99 - column: 4 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `B` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 108 - column: 4 - end_location: - row: 108 - column: 10 - fix: - content: "" + row: 98 + column: 10 + fix: + content: "" + location: + row: 98 + column: 4 + end_location: + row: 99 + column: 4 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `B` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: - row: 107 - column: 5 + row: 108 + column: 4 end_location: row: 108 column: 10 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `A` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 114 - column: 12 - end_location: - row: 114 - column: 18 - fix: - content: "" + fix: + content: "" + location: + row: 107 + column: 5 + end_location: + row: 108 + column: 10 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: row: 114 - column: 11 + column: 12 end_location: row: 114 - column: 19 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `A` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 119 - column: 4 - end_location: - row: 119 - column: 10 - fix: - content: "" + column: 18 + fix: + content: "" + location: + row: 114 + column: 11 + end_location: + row: 114 + column: 19 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: - row: 118 - column: 7 + row: 119 + column: 4 end_location: - row: 120 - column: 1 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `A` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 125 - column: 4 - end_location: - row: 125 - column: 10 - fix: - content: "" + row: 119 + column: 10 + fix: + content: "" + location: + row: 118 + column: 7 + end_location: + row: 120 + column: 1 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: - row: 124 - column: 7 + row: 125 + column: 4 end_location: - row: 126 - column: 1 - parent: ~ -- kind: - name: UselessObjectInheritance - body: "Class `A` inherits from `object`" - suggestion: "Remove `object` inheritance" - fixable: true - location: - row: 131 - column: 4 - end_location: - row: 131 - column: 10 - fix: - content: "" + row: 125 + column: 10 + fix: + content: "" + location: + row: 124 + column: 7 + end_location: + row: 126 + column: 1 + parent: ~ + - kind: + name: UselessObjectInheritance + body: "Class `A` inherits from `object`" + suggestion: "Remove `object` inheritance" + fixable: true location: - row: 130 - column: 7 + row: 131 + column: 4 end_location: - row: 133 - column: 1 - parent: ~ + row: 131 + column: 10 + fix: + content: "" + location: + row: 130 + column: 7 + end_location: + row: 133 + column: 1 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP005.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP005.py.snap index 5e84443a946c1d..e4e9cb11986d1a 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP005.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP005.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: DeprecatedUnittestAlias - body: "`assertEquals` is deprecated, use `assertEqual`" - suggestion: "Replace `assertEqual` with `assertEquals`" - fixable: true - location: - row: 6 - column: 8 - end_location: - row: 6 - column: 25 - fix: - content: self.assertEqual +- - kind: + name: DeprecatedUnittestAlias + body: "`assertEquals` is deprecated, use `assertEqual`" + suggestion: "Replace `assertEqual` with `assertEquals`" + fixable: true location: row: 6 column: 8 end_location: row: 6 column: 25 - parent: ~ -- kind: - name: DeprecatedUnittestAlias - body: "`assertEquals` is deprecated, use `assertEqual`" - suggestion: "Replace `assertEqual` with `assertEquals`" - fixable: true - location: - row: 7 - column: 8 - end_location: - row: 7 - column: 25 - fix: - content: self.assertEqual + fix: + content: self.assertEqual + location: + row: 6 + column: 8 + end_location: + row: 6 + column: 25 + parent: ~ + - kind: + name: DeprecatedUnittestAlias + body: "`assertEquals` is deprecated, use `assertEqual`" + suggestion: "Replace `assertEqual` with `assertEquals`" + fixable: true location: row: 7 column: 8 end_location: row: 7 column: 25 - parent: ~ -- kind: - name: DeprecatedUnittestAlias - body: "`failUnlessAlmostEqual` is deprecated, use `assertAlmostEqual`" - suggestion: "Replace `assertAlmostEqual` with `failUnlessAlmostEqual`" - fixable: true - location: - row: 9 - column: 8 - end_location: - row: 9 - column: 34 - fix: - content: self.assertAlmostEqual + fix: + content: self.assertEqual + location: + row: 7 + column: 8 + end_location: + row: 7 + column: 25 + parent: ~ + - kind: + name: DeprecatedUnittestAlias + body: "`failUnlessAlmostEqual` is deprecated, use `assertAlmostEqual`" + suggestion: "Replace `assertAlmostEqual` with `failUnlessAlmostEqual`" + fixable: true location: row: 9 column: 8 end_location: row: 9 column: 34 - parent: ~ -- kind: - name: DeprecatedUnittestAlias - body: "`assertNotRegexpMatches` is deprecated, use `assertNotRegex`" - suggestion: "Replace `assertNotRegex` with `assertNotRegexpMatches`" - fixable: true - location: - row: 10 - column: 8 - end_location: - row: 10 - column: 35 - fix: - content: self.assertNotRegex + fix: + content: self.assertAlmostEqual + location: + row: 9 + column: 8 + end_location: + row: 9 + column: 34 + parent: ~ + - kind: + name: DeprecatedUnittestAlias + body: "`assertNotRegexpMatches` is deprecated, use `assertNotRegex`" + suggestion: "Replace `assertNotRegex` with `assertNotRegexpMatches`" + fixable: true location: row: 10 column: 8 end_location: row: 10 column: 35 - parent: ~ + fix: + content: self.assertNotRegex + location: + row: 10 + column: 8 + end_location: + row: 10 + column: 35 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP006.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP006.py.snap index d2eda83f7ced78..d7637bbb79bfc2 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP006.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP006.py.snap @@ -2,97 +2,97 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: DeprecatedCollectionType - body: "Use `list` instead of `List` for type annotations" - suggestion: "Replace `List` with `list`" - fixable: true - location: - row: 4 - column: 9 - end_location: - row: 4 - column: 20 - fix: - content: list +- - kind: + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + suggestion: "Replace `List` with `list`" + fixable: true location: row: 4 column: 9 end_location: row: 4 column: 20 - parent: ~ -- kind: - name: DeprecatedCollectionType - body: "Use `list` instead of `List` for type annotations" - suggestion: "Replace `List` with `list`" - fixable: true - location: - row: 11 - column: 9 - end_location: - row: 11 - column: 13 - fix: - content: list + fix: + content: list + location: + row: 4 + column: 9 + end_location: + row: 4 + column: 20 + parent: ~ + - kind: + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + suggestion: "Replace `List` with `list`" + fixable: true location: row: 11 column: 9 end_location: row: 11 column: 13 - parent: ~ -- kind: - name: DeprecatedCollectionType - body: "Use `list` instead of `List` for type annotations" - suggestion: "Replace `List` with `list`" - fixable: true - location: - row: 18 - column: 9 - end_location: - row: 18 - column: 15 - fix: - content: list + fix: + content: list + location: + row: 11 + column: 9 + end_location: + row: 11 + column: 13 + parent: ~ + - kind: + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + suggestion: "Replace `List` with `list`" + fixable: true location: row: 18 column: 9 end_location: row: 18 column: 15 - parent: ~ -- kind: - name: DeprecatedCollectionType - body: "Use `list` instead of `List` for type annotations" - suggestion: "Replace `List` with `list`" - fixable: true - location: - row: 25 - column: 9 - end_location: - row: 25 - column: 14 - fix: - content: list + fix: + content: list + location: + row: 18 + column: 9 + end_location: + row: 18 + column: 15 + parent: ~ + - kind: + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + suggestion: "Replace `List` with `list`" + fixable: true location: row: 25 column: 9 end_location: row: 25 column: 14 - parent: ~ -- kind: - name: DeprecatedCollectionType - body: "Use `list` instead of `List` for type annotations" - suggestion: "Replace `List` with `list`" - fixable: true - location: - row: 36 - column: 9 - end_location: - row: 36 - column: 13 - fix: ~ - parent: ~ + fix: + content: list + location: + row: 25 + column: 9 + end_location: + row: 25 + column: 14 + parent: ~ + - kind: + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + suggestion: "Replace `List` with `list`" + fixable: true + location: + row: 36 + column: 9 + end_location: + row: 36 + column: 13 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP007.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP007.py.snap index 82c190d357a735..864b032363c2ac 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP007.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP007.py.snap @@ -2,184 +2,184 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: TypingUnion - body: "Use `X | Y` for type annotations" - suggestion: "Convert to `X | Y`" - fixable: true - location: - row: 6 - column: 9 - end_location: - row: 6 - column: 22 - fix: - content: str | None +- - kind: + name: TypingUnion + body: "Use `X | Y` for type annotations" + suggestion: "Convert to `X | Y`" + fixable: true location: row: 6 column: 9 end_location: row: 6 column: 22 - parent: ~ -- kind: - name: TypingUnion - body: "Use `X | Y` for type annotations" - suggestion: "Convert to `X | Y`" - fixable: true - location: - row: 10 - column: 9 - end_location: - row: 10 - column: 29 - fix: - content: str | None + fix: + content: str | None + location: + row: 6 + column: 9 + end_location: + row: 6 + column: 22 + parent: ~ + - kind: + name: TypingUnion + body: "Use `X | Y` for type annotations" + suggestion: "Convert to `X | Y`" + fixable: true location: row: 10 column: 9 end_location: row: 10 column: 29 - parent: ~ -- kind: - name: TypingUnion - body: "Use `X | Y` for type annotations" - suggestion: "Convert to `X | Y`" - fixable: true - location: - row: 14 - column: 9 - end_location: - row: 14 - column: 45 - fix: - content: "str | int | Union[float, bytes]" + fix: + content: str | None + location: + row: 10 + column: 9 + end_location: + row: 10 + column: 29 + parent: ~ + - kind: + name: TypingUnion + body: "Use `X | Y` for type annotations" + suggestion: "Convert to `X | Y`" + fixable: true location: row: 14 column: 9 end_location: row: 14 column: 45 - parent: ~ -- kind: - name: TypingUnion - body: "Use `X | Y` for type annotations" - suggestion: "Convert to `X | Y`" - fixable: true - location: - row: 14 - column: 21 - end_location: - row: 14 - column: 40 - fix: - content: float | bytes - location: - row: 14 - column: 21 - end_location: - row: 14 - column: 40 - parent: ~ -- kind: - name: TypingUnion - body: "Use `X | Y` for type annotations" - suggestion: "Convert to `X | Y`" - fixable: true - location: - row: 14 - column: 25 - end_location: - row: 14 - column: 44 - fix: - content: float | bytes + fix: + content: "str | int | Union[float, bytes]" + location: + row: 14 + column: 9 + end_location: + row: 14 + column: 45 + parent: ~ + - kind: + name: TypingUnion + body: "Use `X | Y` for type annotations" + suggestion: "Convert to `X | Y`" + fixable: true location: row: 14 column: 25 end_location: row: 14 column: 44 - parent: ~ -- kind: - name: TypingUnion - body: "Use `X | Y` for type annotations" - suggestion: "Convert to `X | Y`" - fixable: true - location: - row: 18 - column: 9 - end_location: - row: 18 - column: 31 - fix: - content: str | int + fix: + content: float | bytes + location: + row: 14 + column: 25 + end_location: + row: 14 + column: 44 + parent: ~ + - kind: + name: TypingUnion + body: "Use `X | Y` for type annotations" + suggestion: "Convert to `X | Y`" + fixable: true location: row: 18 column: 9 end_location: row: 18 column: 31 - parent: ~ -- kind: - name: TypingUnion - body: "Use `X | Y` for type annotations" - suggestion: "Convert to `X | Y`" - fixable: true - location: - row: 22 - column: 9 - end_location: - row: 22 - column: 33 - fix: - content: str | int + fix: + content: str | int + location: + row: 18 + column: 9 + end_location: + row: 18 + column: 31 + parent: ~ + - kind: + name: TypingUnion + body: "Use `X | Y` for type annotations" + suggestion: "Convert to `X | Y`" + fixable: true location: row: 22 column: 9 end_location: row: 22 column: 33 - parent: ~ -- kind: - name: TypingUnion - body: "Use `X | Y` for type annotations" - suggestion: "Convert to `X | Y`" - fixable: true - location: - row: 26 - column: 9 - end_location: - row: 26 - column: 40 - fix: - content: "(str, int) | float" + fix: + content: str | int + location: + row: 22 + column: 9 + end_location: + row: 22 + column: 33 + parent: ~ + - kind: + name: TypingUnion + body: "Use `X | Y` for type annotations" + suggestion: "Convert to `X | Y`" + fixable: true location: row: 26 column: 9 end_location: row: 26 column: 40 - parent: ~ -- kind: - name: TypingUnion - body: "Use `X | Y` for type annotations" - suggestion: "Convert to `X | Y`" - fixable: true - location: - row: 47 - column: 7 - end_location: - row: 47 - column: 20 - fix: - content: str | None + fix: + content: "(str, int) | float" + location: + row: 26 + column: 9 + end_location: + row: 26 + column: 40 + parent: ~ + - kind: + name: TypingUnion + body: "Use `X | Y` for type annotations" + suggestion: "Convert to `X | Y`" + fixable: true location: row: 47 column: 7 end_location: row: 47 column: 20 - parent: ~ + fix: + content: str | None + location: + row: 47 + column: 7 + end_location: + row: 47 + column: 20 + parent: ~ +- - kind: + name: TypingUnion + body: "Use `X | Y` for type annotations" + suggestion: "Convert to `X | Y`" + fixable: true + location: + row: 14 + column: 21 + end_location: + row: 14 + column: 40 + fix: + content: float | bytes + location: + row: 14 + column: 21 + end_location: + row: 14 + column: 40 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP008.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP008.py.snap index 064e73350db60a..0d6033e1abf7f8 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP008.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP008.py.snap @@ -2,104 +2,104 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: SuperCallWithParameters - body: "Use `super()` instead of `super(__class__, self)`" - suggestion: "Remove `__super__` parameters" - fixable: true - location: - row: 17 - column: 17 - end_location: - row: 17 - column: 35 - fix: - content: super() +- - kind: + name: SuperCallWithParameters + body: "Use `super()` instead of `super(__class__, self)`" + suggestion: "Remove `__super__` parameters" + fixable: true location: row: 17 column: 17 end_location: row: 17 column: 35 - parent: ~ -- kind: - name: SuperCallWithParameters - body: "Use `super()` instead of `super(__class__, self)`" - suggestion: "Remove `__super__` parameters" - fixable: true - location: - row: 18 - column: 8 - end_location: - row: 18 - column: 26 - fix: - content: super() + fix: + content: super() + location: + row: 17 + column: 17 + end_location: + row: 17 + column: 35 + parent: ~ + - kind: + name: SuperCallWithParameters + body: "Use `super()` instead of `super(__class__, self)`" + suggestion: "Remove `__super__` parameters" + fixable: true location: row: 18 column: 8 end_location: row: 18 column: 26 - parent: ~ -- kind: - name: SuperCallWithParameters - body: "Use `super()` instead of `super(__class__, self)`" - suggestion: "Remove `__super__` parameters" - fixable: true - location: - row: 19 - column: 8 - end_location: - row: 22 - column: 9 - fix: - content: super() + fix: + content: super() + location: + row: 18 + column: 8 + end_location: + row: 18 + column: 26 + parent: ~ + - kind: + name: SuperCallWithParameters + body: "Use `super()` instead of `super(__class__, self)`" + suggestion: "Remove `__super__` parameters" + fixable: true location: row: 19 column: 8 end_location: row: 22 column: 9 - parent: ~ -- kind: - name: SuperCallWithParameters - body: "Use `super()` instead of `super(__class__, self)`" - suggestion: "Remove `__super__` parameters" - fixable: true - location: - row: 36 - column: 8 - end_location: - row: 36 - column: 28 - fix: - content: super() + fix: + content: super() + location: + row: 19 + column: 8 + end_location: + row: 22 + column: 9 + parent: ~ + - kind: + name: SuperCallWithParameters + body: "Use `super()` instead of `super(__class__, self)`" + suggestion: "Remove `__super__` parameters" + fixable: true location: row: 36 column: 8 end_location: row: 36 column: 28 - parent: ~ -- kind: - name: SuperCallWithParameters - body: "Use `super()` instead of `super(__class__, self)`" - suggestion: "Remove `__super__` parameters" - fixable: true - location: - row: 50 - column: 12 - end_location: - row: 50 - column: 32 - fix: - content: super() + fix: + content: super() + location: + row: 36 + column: 8 + end_location: + row: 36 + column: 28 + parent: ~ + - kind: + name: SuperCallWithParameters + body: "Use `super()` instead of `super(__class__, self)`" + suggestion: "Remove `__super__` parameters" + fixable: true location: row: 50 column: 12 end_location: row: 50 column: 32 - parent: ~ + fix: + content: super() + location: + row: 50 + column: 12 + end_location: + row: 50 + column: 32 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_0.py.snap index c3a460d22b1fb0..7107844b7234b7 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_0.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: UTF8EncodingDeclaration - body: UTF-8 encoding declaration is unnecessary - suggestion: Remove unnecessary coding comment - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 2 - column: 0 - fix: - content: "" +- - kind: + name: UTF8EncodingDeclaration + body: UTF-8 encoding declaration is unnecessary + suggestion: Remove unnecessary coding comment + fixable: true location: row: 1 column: 0 end_location: row: 2 column: 0 - parent: ~ + fix: + content: "" + location: + row: 1 + column: 0 + end_location: + row: 2 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_1.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_1.py.snap index 42f86ee89c2e5c..32949797b65b90 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_1.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_1.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: UTF8EncodingDeclaration - body: UTF-8 encoding declaration is unnecessary - suggestion: Remove unnecessary coding comment - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 3 - column: 0 - fix: - content: "" +- - kind: + name: UTF8EncodingDeclaration + body: UTF-8 encoding declaration is unnecessary + suggestion: Remove unnecessary coding comment + fixable: true location: row: 2 column: 0 end_location: row: 3 column: 0 - parent: ~ + fix: + content: "" + location: + row: 2 + column: 0 + end_location: + row: 3 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_2.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_2.py.snap index 0defbd08dc1d28..6ba64a58776454 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_2.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_2.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_3.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_3.py.snap index 0defbd08dc1d28..6ba64a58776454 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_3.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_3.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_4.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_4.py.snap index 0defbd08dc1d28..6ba64a58776454 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_4.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_4.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP010.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP010.py.snap index 6bdcd5bbf136ed..e22562dc0d746e 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP010.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP010.py.snap @@ -2,204 +2,204 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryFutureImport - body: "Unnecessary `__future__` imports `generators`, `nested_scopes` for target Python version" - suggestion: "Remove unnecessary `__future__` import" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 48 - fix: - content: "" +- - kind: + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` imports `generators`, `nested_scopes` for target Python version" + suggestion: "Remove unnecessary `__future__` import" + fixable: true location: row: 1 column: 0 end_location: - row: 2 - column: 0 - parent: ~ -- kind: - name: UnnecessaryFutureImport - body: "Unnecessary `__future__` imports `unicode_literals`, `with_statement` for target Python version" - suggestion: "Remove unnecessary `__future__` import" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 55 - fix: - content: "" + row: 1 + column: 48 + fix: + content: "" + location: + row: 1 + column: 0 + end_location: + row: 2 + column: 0 + parent: ~ + - kind: + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` imports `unicode_literals`, `with_statement` for target Python version" + suggestion: "Remove unnecessary `__future__` import" + fixable: true location: row: 2 column: 0 end_location: - row: 3 - column: 0 - parent: ~ -- kind: - name: UnnecessaryFutureImport - body: "Unnecessary `__future__` imports `absolute_import`, `division` for target Python version" - suggestion: "Remove unnecessary `__future__` import" - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 48 - fix: - content: "" + row: 2 + column: 55 + fix: + content: "" + location: + row: 2 + column: 0 + end_location: + row: 3 + column: 0 + parent: ~ + - kind: + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` imports `absolute_import`, `division` for target Python version" + suggestion: "Remove unnecessary `__future__` import" + fixable: true location: row: 3 column: 0 end_location: - row: 4 - column: 0 - parent: ~ -- kind: - name: UnnecessaryFutureImport - body: "Unnecessary `__future__` import `generator_stop` for target Python version" - suggestion: "Remove unnecessary `__future__` import" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 37 - fix: - content: "" + row: 3 + column: 48 + fix: + content: "" + location: + row: 3 + column: 0 + end_location: + row: 4 + column: 0 + parent: ~ + - kind: + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` import `generator_stop` for target Python version" + suggestion: "Remove unnecessary `__future__` import" + fixable: true location: row: 4 column: 0 end_location: - row: 5 - column: 0 - parent: ~ -- kind: - name: UnnecessaryFutureImport - body: "Unnecessary `__future__` imports `generator_stop`, `print_function` for target Python version" - suggestion: "Remove unnecessary `__future__` import" - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 53 - fix: - content: "" + row: 4 + column: 37 + fix: + content: "" + location: + row: 4 + column: 0 + end_location: + row: 5 + column: 0 + parent: ~ + - kind: + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` imports `generator_stop`, `print_function` for target Python version" + suggestion: "Remove unnecessary `__future__` import" + fixable: true location: row: 5 column: 0 end_location: - row: 6 - column: 0 - parent: ~ -- kind: - name: UnnecessaryFutureImport - body: "Unnecessary `__future__` import `generators` for target Python version" - suggestion: "Remove unnecessary `__future__` import" - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 49 - fix: - content: from __future__ import invalid_module + row: 5 + column: 53 + fix: + content: "" + location: + row: 5 + column: 0 + end_location: + row: 6 + column: 0 + parent: ~ + - kind: + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` import `generators` for target Python version" + suggestion: "Remove unnecessary `__future__` import" + fixable: true location: row: 6 column: 0 end_location: row: 6 column: 49 - parent: ~ -- kind: - name: UnnecessaryFutureImport - body: "Unnecessary `__future__` import `generator_stop` for target Python version" - suggestion: "Remove unnecessary `__future__` import" - fixable: true - location: - row: 9 - column: 4 - end_location: - row: 9 - column: 41 - fix: - content: "" + fix: + content: from __future__ import invalid_module + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 49 + parent: ~ + - kind: + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` import `generator_stop` for target Python version" + suggestion: "Remove unnecessary `__future__` import" + fixable: true location: row: 9 - column: 0 + column: 4 end_location: - row: 10 - column: 0 - parent: ~ -- kind: - name: UnnecessaryFutureImport - body: "Unnecessary `__future__` import `generators` for target Python version" - suggestion: "Remove unnecessary `__future__` import" - fixable: true - location: - row: 10 - column: 4 - end_location: - row: 10 - column: 37 - fix: - content: pass + row: 9 + column: 41 + fix: + content: "" + location: + row: 9 + column: 0 + end_location: + row: 10 + column: 0 + parent: ~ + - kind: + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` import `generators` for target Python version" + suggestion: "Remove unnecessary `__future__` import" + fixable: true location: row: 10 column: 4 end_location: row: 10 column: 37 - parent: ~ -- kind: - name: UnnecessaryFutureImport - body: "Unnecessary `__future__` import `generator_stop` for target Python version" - suggestion: "Remove unnecessary `__future__` import" - fixable: true - location: - row: 13 - column: 4 - end_location: - row: 13 - column: 41 - fix: - content: "" + fix: + content: pass + location: + row: 10 + column: 4 + end_location: + row: 10 + column: 37 + parent: ~ + - kind: + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` import `generator_stop` for target Python version" + suggestion: "Remove unnecessary `__future__` import" + fixable: true location: row: 13 - column: 0 + column: 4 end_location: - row: 14 - column: 0 - parent: ~ -- kind: - name: UnnecessaryFutureImport - body: "Unnecessary `__future__` import `generators` for target Python version" - suggestion: "Remove unnecessary `__future__` import" - fixable: true - location: - row: 14 - column: 4 - end_location: - row: 14 - column: 53 - fix: - content: from __future__ import invalid_module + row: 13 + column: 41 + fix: + content: "" + location: + row: 13 + column: 0 + end_location: + row: 14 + column: 0 + parent: ~ + - kind: + name: UnnecessaryFutureImport + body: "Unnecessary `__future__` import `generators` for target Python version" + suggestion: "Remove unnecessary `__future__` import" + fixable: true location: row: 14 column: 4 end_location: row: 14 column: 53 - parent: ~ + fix: + content: from __future__ import invalid_module + location: + row: 14 + column: 4 + end_location: + row: 14 + column: 53 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP011.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP011.py.snap index 922e3e4f4eb88b..5e64cb2b5f3934 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP011.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP011.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: LRUCacheWithoutParameters - body: "Unnecessary parameters to `functools.lru_cache`" - suggestion: Remove unnecessary parameters - fixable: true - location: - row: 5 - column: 20 - end_location: - row: 5 - column: 22 - fix: - content: functools.lru_cache +- - kind: + name: LRUCacheWithoutParameters + body: "Unnecessary parameters to `functools.lru_cache`" + suggestion: Remove unnecessary parameters + fixable: true location: row: 5 - column: 1 + column: 20 end_location: row: 5 column: 22 - parent: ~ -- kind: - name: LRUCacheWithoutParameters - body: "Unnecessary parameters to `functools.lru_cache`" - suggestion: Remove unnecessary parameters - fixable: true - location: - row: 10 - column: 10 - end_location: - row: 10 - column: 12 - fix: - content: lru_cache + fix: + content: functools.lru_cache + location: + row: 5 + column: 1 + end_location: + row: 5 + column: 22 + parent: ~ + - kind: + name: LRUCacheWithoutParameters + body: "Unnecessary parameters to `functools.lru_cache`" + suggestion: Remove unnecessary parameters + fixable: true location: row: 10 - column: 1 + column: 10 end_location: row: 10 column: 12 - parent: ~ -- kind: - name: LRUCacheWithoutParameters - body: "Unnecessary parameters to `functools.lru_cache`" - suggestion: Remove unnecessary parameters - fixable: true - location: - row: 16 - column: 20 - end_location: - row: 16 - column: 22 - fix: - content: functools.lru_cache + fix: + content: lru_cache + location: + row: 10 + column: 1 + end_location: + row: 10 + column: 12 + parent: ~ + - kind: + name: LRUCacheWithoutParameters + body: "Unnecessary parameters to `functools.lru_cache`" + suggestion: Remove unnecessary parameters + fixable: true location: row: 16 - column: 1 + column: 20 end_location: row: 16 column: 22 - parent: ~ -- kind: - name: LRUCacheWithoutParameters - body: "Unnecessary parameters to `functools.lru_cache`" - suggestion: Remove unnecessary parameters - fixable: true - location: - row: 21 - column: 20 - end_location: - row: 21 - column: 22 - fix: - content: functools.lru_cache + fix: + content: functools.lru_cache + location: + row: 16 + column: 1 + end_location: + row: 16 + column: 22 + parent: ~ + - kind: + name: LRUCacheWithoutParameters + body: "Unnecessary parameters to `functools.lru_cache`" + suggestion: Remove unnecessary parameters + fixable: true location: row: 21 - column: 1 + column: 20 end_location: row: 21 column: 22 - parent: ~ + fix: + content: functools.lru_cache + location: + row: 21 + column: 1 + end_location: + row: 21 + column: 22 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP012.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP012.py.snap index 751fb400c833cc..54ad7d09329fb1 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP012.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP012.py.snap @@ -2,364 +2,364 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 21 - fix: - content: "b\"foo\"" +- - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 2 column: 0 end_location: row: 2 column: 21 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 18 - fix: - content: "b\"foo\"" + fix: + content: "b\"foo\"" + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 21 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 3 column: 0 end_location: row: 3 column: 18 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 14 - fix: - content: "b\"foo\"" + fix: + content: "b\"foo\"" + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 18 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 14 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 20 - fix: - content: "b\"foo\"" + fix: + content: "b\"foo\"" + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 14 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 5 column: 0 end_location: row: 5 column: 20 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 22 - fix: - content: "b\"foo\"" + fix: + content: "b\"foo\"" + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 20 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 6 column: 0 end_location: row: 6 column: 22 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 30 - fix: - content: "b\"foo\"" + fix: + content: "b\"foo\"" + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 22 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 7 column: 0 end_location: row: 7 column: 30 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 14 - column: 1 - fix: - content: "b\"\"\"\nLorem\n\nIpsum\n\"\"\"" + fix: + content: "b\"foo\"" + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 30 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 8 column: 0 end_location: row: 14 column: 1 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 16 - column: 4 - end_location: - row: 17 - column: 20 - fix: - content: "b\"Lorem \"\n b\"Ipsum\"" + fix: + content: "b\"\"\"\nLorem\n\nIpsum\n\"\"\"" + location: + row: 8 + column: 0 + end_location: + row: 14 + column: 1 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 16 column: 4 end_location: row: 17 column: 20 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 20 - column: 4 - end_location: - row: 21 - column: 20 - fix: - content: "b\"Lorem \" # Comment\n b\"Ipsum\"" + fix: + content: "b\"Lorem \"\n b\"Ipsum\"" + location: + row: 16 + column: 4 + end_location: + row: 17 + column: 20 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 20 column: 4 end_location: row: 21 column: 20 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 24 - column: 4 - end_location: - row: 24 - column: 29 - fix: - content: "b\"Lorem \" b\"Ipsum\"" + fix: + content: "b\"Lorem \" # Comment\n b\"Ipsum\"" + location: + row: 20 + column: 4 + end_location: + row: 21 + column: 20 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 24 column: 4 end_location: row: 24 column: 29 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 32 - column: 0 - end_location: - row: 32 - column: 27 - fix: - content: "" + fix: + content: "b\"Lorem \" b\"Ipsum\"" + location: + row: 24 + column: 4 + end_location: + row: 24 + column: 29 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 32 - column: 19 + column: 0 end_location: row: 32 - column: 26 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 50 - column: 0 - end_location: - row: 50 - column: 31 - fix: - content: "" + column: 27 + fix: + content: "" + location: + row: 32 + column: 19 + end_location: + row: 32 + column: 26 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 50 - column: 23 + column: 0 end_location: row: 50 - column: 30 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 52 - column: 0 - end_location: - row: 52 - column: 39 - fix: - content: "" + column: 31 + fix: + content: "" + location: + row: 50 + column: 23 + end_location: + row: 50 + column: 30 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 52 - column: 23 + column: 0 end_location: row: 52 - column: 38 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 54 - column: 0 - end_location: - row: 54 - column: 24 - fix: - content: "br\"foo\\o\"" + column: 39 + fix: + content: "" + location: + row: 52 + column: 23 + end_location: + row: 52 + column: 38 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 54 column: 0 end_location: row: 54 column: 24 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 55 - column: 0 - end_location: - row: 55 - column: 22 - fix: - content: "b\"foo\"" + fix: + content: "br\"foo\\o\"" + location: + row: 54 + column: 0 + end_location: + row: 54 + column: 24 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 55 column: 0 end_location: row: 55 column: 22 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 56 - column: 0 - end_location: - row: 56 - column: 24 - fix: - content: "bR\"foo\\o\"" + fix: + content: "b\"foo\"" + location: + row: 55 + column: 0 + end_location: + row: 55 + column: 22 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 56 column: 0 end_location: row: 56 column: 24 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 57 - column: 0 - end_location: - row: 57 - column: 22 - fix: - content: "b\"foo\"" + fix: + content: "bR\"foo\\o\"" + location: + row: 56 + column: 0 + end_location: + row: 56 + column: 24 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 57 column: 0 end_location: row: 57 column: 22 - parent: ~ -- kind: - name: UnnecessaryEncodeUTF8 - body: "Unnecessary call to `encode` as UTF-8" - suggestion: "Remove unnecessary `encode`" - fixable: true - location: - row: 58 - column: 6 - end_location: - row: 58 - column: 20 - fix: - content: "b\"foo\"" + fix: + content: "b\"foo\"" + location: + row: 57 + column: 0 + end_location: + row: 57 + column: 22 + parent: ~ + - kind: + name: UnnecessaryEncodeUTF8 + body: "Unnecessary call to `encode` as UTF-8" + suggestion: "Remove unnecessary `encode`" + fixable: true location: row: 58 column: 6 end_location: row: 58 column: 20 - parent: ~ + fix: + content: "b\"foo\"" + location: + row: 58 + column: 6 + end_location: + row: 58 + column: 20 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP013.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP013.py.snap index c667eb40b743f2..fa6207d17c909b 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP013.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP013.py.snap @@ -2,244 +2,244 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: ConvertTypedDictFunctionalToClass - body: "Convert `MyType` from `TypedDict` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 50 - fix: - content: "class MyType(TypedDict):\n a: int\n b: str" +- - kind: + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 5 column: 0 end_location: row: 5 column: 50 - parent: ~ -- kind: - name: ConvertTypedDictFunctionalToClass - body: "Convert `MyType` from `TypedDict` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 48 - fix: - content: "class MyType(TypedDict):\n a: int\n b: str" + fix: + content: "class MyType(TypedDict):\n a: int\n b: str" + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 50 + parent: ~ + - kind: + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 8 column: 0 end_location: row: 8 column: 48 - parent: ~ -- kind: - name: ConvertTypedDictFunctionalToClass - body: "Convert `MyType` from `TypedDict` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 42 - fix: - content: "class MyType(TypedDict):\n a: int\n b: str" + fix: + content: "class MyType(TypedDict):\n a: int\n b: str" + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 48 + parent: ~ + - kind: + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 11 column: 0 end_location: row: 11 column: 42 - parent: ~ -- kind: - name: ConvertTypedDictFunctionalToClass - body: "Convert `MyType` from `TypedDict` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 14 - column: 0 - end_location: - row: 14 - column: 28 - fix: - content: "class MyType(TypedDict):\n pass" + fix: + content: "class MyType(TypedDict):\n a: int\n b: str" + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 42 + parent: ~ + - kind: + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 14 column: 0 end_location: row: 14 column: 28 - parent: ~ -- kind: - name: ConvertTypedDictFunctionalToClass - body: "Convert `MyType` from `TypedDict` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 17 - column: 0 - end_location: - row: 17 - column: 44 - fix: - content: "class MyType(TypedDict):\n a: \"hello\"" + fix: + content: "class MyType(TypedDict):\n pass" + location: + row: 14 + column: 0 + end_location: + row: 14 + column: 28 + parent: ~ + - kind: + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 17 column: 0 end_location: row: 17 column: 44 - parent: ~ -- kind: - name: ConvertTypedDictFunctionalToClass - body: "Convert `MyType` from `TypedDict` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 18 - column: 0 - end_location: - row: 18 - column: 39 - fix: - content: "class MyType(TypedDict):\n a: \"hello\"" + fix: + content: "class MyType(TypedDict):\n a: \"hello\"" + location: + row: 17 + column: 0 + end_location: + row: 17 + column: 44 + parent: ~ + - kind: + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 18 column: 0 end_location: row: 18 column: 39 - parent: ~ -- kind: - name: ConvertTypedDictFunctionalToClass - body: "Convert `MyType` from `TypedDict` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 21 - column: 0 - end_location: - row: 21 - column: 54 - fix: - content: "class MyType(TypedDict):\n a: NotRequired[dict]" + fix: + content: "class MyType(TypedDict):\n a: \"hello\"" + location: + row: 18 + column: 0 + end_location: + row: 18 + column: 39 + parent: ~ + - kind: + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 21 column: 0 end_location: row: 21 column: 54 - parent: ~ -- kind: - name: ConvertTypedDictFunctionalToClass - body: "Convert `MyType` from `TypedDict` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 24 - column: 0 - end_location: - row: 24 - column: 63 - fix: - content: "class MyType(TypedDict, total=False):\n x: int\n y: int" + fix: + content: "class MyType(TypedDict):\n a: NotRequired[dict]" + location: + row: 21 + column: 0 + end_location: + row: 21 + column: 54 + parent: ~ + - kind: + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 24 column: 0 end_location: row: 24 column: 63 - parent: ~ -- kind: - name: ConvertTypedDictFunctionalToClass - body: "Convert `MyType` from `TypedDict` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 27 - column: 0 - end_location: - row: 27 - column: 55 - fix: - content: "class MyType(TypedDict):\n key: Literal[\"value\"]" + fix: + content: "class MyType(TypedDict, total=False):\n x: int\n y: int" + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 63 + parent: ~ + - kind: + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 27 column: 0 end_location: row: 27 column: 55 - parent: ~ -- kind: - name: ConvertTypedDictFunctionalToClass - body: "Convert `MyType` from `TypedDict` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 30 - column: 0 - end_location: - row: 30 - column: 49 - fix: - content: "class MyType(typing.TypedDict):\n key: int" + fix: + content: "class MyType(TypedDict):\n key: Literal[\"value\"]" + location: + row: 27 + column: 0 + end_location: + row: 27 + column: 55 + parent: ~ + - kind: + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 30 column: 0 end_location: row: 30 column: 49 - parent: ~ -- kind: - name: ConvertTypedDictFunctionalToClass - body: "Convert `MyType` from `TypedDict` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 40 - column: 0 - end_location: - row: 40 - column: 32 - fix: - content: "class MyType(TypedDict):\n pass" + fix: + content: "class MyType(typing.TypedDict):\n key: int" + location: + row: 30 + column: 0 + end_location: + row: 30 + column: 49 + parent: ~ + - kind: + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 40 column: 0 end_location: row: 40 column: 32 - parent: ~ -- kind: - name: ConvertTypedDictFunctionalToClass - body: "Convert `MyType` from `TypedDict` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 43 - column: 0 - end_location: - row: 43 - column: 36 - fix: - content: "class MyType(TypedDict):\n pass" + fix: + content: "class MyType(TypedDict):\n pass" + location: + row: 40 + column: 0 + end_location: + row: 40 + column: 32 + parent: ~ + - kind: + name: ConvertTypedDictFunctionalToClass + body: "Convert `MyType` from `TypedDict` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 43 column: 0 end_location: row: 43 column: 36 - parent: ~ + fix: + content: "class MyType(TypedDict):\n pass" + location: + row: 43 + column: 0 + end_location: + row: 43 + column: 36 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP014.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP014.py.snap index 10161c5a5db806..ec20f3cc14e5f8 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP014.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP014.py.snap @@ -2,104 +2,104 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: ConvertNamedTupleFunctionalToClass - body: "Convert `MyType` from `NamedTuple` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 67 - fix: - content: "class MyType(NamedTuple):\n a: int\n b: tuple[str, ...]" +- - kind: + name: ConvertNamedTupleFunctionalToClass + body: "Convert `MyType` from `NamedTuple` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 5 column: 0 end_location: row: 5 column: 67 - parent: ~ -- kind: - name: ConvertNamedTupleFunctionalToClass - body: "Convert `MyType` from `NamedTuple` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 12 - column: 1 - fix: - content: "class MyType(NamedTuple):\n a: int\n b: str = \"foo\"\n c: list[bool] = [True]" + fix: + content: "class MyType(NamedTuple):\n a: int\n b: tuple[str, ...]" + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 67 + parent: ~ + - kind: + name: ConvertNamedTupleFunctionalToClass + body: "Convert `MyType` from `NamedTuple` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 8 column: 0 end_location: row: 12 column: 1 - parent: ~ -- kind: - name: ConvertNamedTupleFunctionalToClass - body: "Convert `MyType` from `NamedTuple` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 15 - column: 0 - end_location: - row: 15 - column: 62 - fix: - content: "class MyType(typing.NamedTuple):\n a: int\n b: str" + fix: + content: "class MyType(NamedTuple):\n a: int\n b: str = \"foo\"\n c: list[bool] = [True]" + location: + row: 8 + column: 0 + end_location: + row: 12 + column: 1 + parent: ~ + - kind: + name: ConvertNamedTupleFunctionalToClass + body: "Convert `MyType` from `NamedTuple` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 15 column: 0 end_location: row: 15 column: 62 - parent: ~ -- kind: - name: ConvertNamedTupleFunctionalToClass - body: "Convert `MyType` from `NamedTuple` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 28 - column: 0 - end_location: - row: 28 - column: 36 - fix: - content: "class MyType(typing.NamedTuple):\n pass" + fix: + content: "class MyType(typing.NamedTuple):\n a: int\n b: str" + location: + row: 15 + column: 0 + end_location: + row: 15 + column: 62 + parent: ~ + - kind: + name: ConvertNamedTupleFunctionalToClass + body: "Convert `MyType` from `NamedTuple` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 28 column: 0 end_location: row: 28 column: 36 - parent: ~ -- kind: - name: ConvertNamedTupleFunctionalToClass - body: "Convert `MyType` from `NamedTuple` functional to class syntax" - suggestion: "Convert `MyType` to class syntax" - fixable: true - location: - row: 31 - column: 0 - end_location: - row: 31 - column: 40 - fix: - content: "class MyType(typing.NamedTuple):\n pass" + fix: + content: "class MyType(typing.NamedTuple):\n pass" + location: + row: 28 + column: 0 + end_location: + row: 28 + column: 36 + parent: ~ + - kind: + name: ConvertNamedTupleFunctionalToClass + body: "Convert `MyType` from `NamedTuple` functional to class syntax" + suggestion: "Convert `MyType` to class syntax" + fixable: true location: row: 31 column: 0 end_location: row: 31 column: 40 - parent: ~ + fix: + content: "class MyType(typing.NamedTuple):\n pass" + location: + row: 31 + column: 0 + end_location: + row: 31 + column: 40 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP015.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP015.py.snap index c10dfd9933846a..3988a6973c3ca0 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP015.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP015.py.snap @@ -2,884 +2,884 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 16 - fix: - content: "" +- - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 1 - column: 10 + column: 0 end_location: row: 1 - column: 15 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 17 - fix: - content: "" + column: 16 + fix: + content: "" + location: + row: 1 + column: 10 + end_location: + row: 1 + column: 15 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 2 - column: 10 + column: 0 end_location: row: 2 - column: 16 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 17 - fix: - content: "\"rb\"" + column: 17 + fix: + content: "" + location: + row: 2 + column: 10 + end_location: + row: 2 + column: 16 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 3 - column: 12 + column: 0 end_location: row: 3 - column: 16 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 18 - fix: - content: "\"rb\"" + column: 17 + fix: + content: "\"rb\"" + location: + row: 3 + column: 12 + end_location: + row: 3 + column: 16 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 4 - column: 12 + column: 0 end_location: row: 4 - column: 17 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 16 - fix: - content: "" + column: 18 + fix: + content: "\"rb\"" + location: + row: 4 + column: 12 + end_location: + row: 4 + column: 17 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 5 - column: 10 + column: 0 end_location: row: 5 - column: 15 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 17 - fix: - content: "" + column: 16 + fix: + content: "" + location: + row: 5 + column: 10 + end_location: + row: 5 + column: 15 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 6 - column: 10 + column: 0 end_location: row: 6 - column: 16 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 32 - fix: - content: "" + column: 17 + fix: + content: "" + location: + row: 6 + column: 10 + end_location: + row: 6 + column: 16 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 7 - column: 8 + column: 0 end_location: row: 7 - column: 13 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"w\"\"" - suggestion: "Replace with \"\"w\"\"" - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 15 - fix: - content: "\"w\"" + column: 32 + fix: + content: "" + location: + row: 7 + column: 8 + end_location: + row: 7 + column: 13 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"w\"\"" + suggestion: "Replace with \"\"w\"\"" + fixable: true location: row: 8 - column: 10 + column: 0 end_location: row: 8 - column: 14 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 10 - column: 5 - end_location: - row: 10 - column: 21 - fix: - content: "" + column: 15 + fix: + content: "\"w\"" + location: + row: 8 + column: 10 + end_location: + row: 8 + column: 14 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 10 - column: 15 + column: 5 end_location: row: 10 - column: 20 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 12 - column: 5 - end_location: - row: 12 - column: 22 - fix: - content: "" + column: 21 + fix: + content: "" + location: + row: 10 + column: 15 + end_location: + row: 10 + column: 20 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 12 - column: 15 + column: 5 end_location: row: 12 - column: 21 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 14 - column: 5 - end_location: - row: 14 - column: 22 - fix: - content: "\"rb\"" + column: 22 + fix: + content: "" + location: + row: 12 + column: 15 + end_location: + row: 12 + column: 21 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 14 - column: 17 + column: 5 end_location: row: 14 - column: 21 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 16 - column: 5 - end_location: - row: 16 - column: 23 - fix: - content: "\"rb\"" + column: 22 + fix: + content: "\"rb\"" + location: + row: 14 + column: 17 + end_location: + row: 14 + column: 21 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 16 - column: 17 + column: 5 end_location: row: 16 - column: 22 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 18 - column: 5 - end_location: - row: 18 - column: 21 - fix: - content: "" + column: 23 + fix: + content: "\"rb\"" + location: + row: 16 + column: 17 + end_location: + row: 16 + column: 22 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 18 - column: 15 + column: 5 end_location: row: 18 - column: 20 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 20 - column: 5 - end_location: - row: 20 - column: 22 - fix: - content: "" + column: 21 + fix: + content: "" + location: + row: 18 + column: 15 + end_location: + row: 18 + column: 20 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 20 - column: 15 + column: 5 end_location: row: 20 - column: 21 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 22 - column: 5 - end_location: - row: 22 - column: 39 - fix: - content: "" + column: 22 + fix: + content: "" + location: + row: 20 + column: 15 + end_location: + row: 20 + column: 21 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 22 - column: 15 + column: 5 end_location: row: 22 - column: 20 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"w\"\"" - suggestion: "Replace with \"\"w\"\"" - fixable: true - location: - row: 24 - column: 5 - end_location: - row: 24 - column: 22 - fix: - content: "\"w\"" + column: 39 + fix: + content: "" + location: + row: 22 + column: 15 + end_location: + row: 22 + column: 20 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"w\"\"" + suggestion: "Replace with \"\"w\"\"" + fixable: true location: row: 24 - column: 17 + column: 5 end_location: row: 24 - column: 21 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 27 - column: 0 - end_location: - row: 27 - column: 27 - fix: - content: "" + column: 22 + fix: + content: "\"w\"" + location: + row: 24 + column: 17 + end_location: + row: 24 + column: 21 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 27 - column: 21 + column: 0 end_location: row: 27 - column: 26 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 28 - column: 0 - end_location: - row: 28 - column: 28 - fix: - content: "\"rb\"" + column: 27 + fix: + content: "" + location: + row: 27 + column: 21 + end_location: + row: 27 + column: 26 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 28 - column: 23 + column: 0 end_location: row: 28 - column: 27 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 30 - column: 5 - end_location: - row: 30 - column: 32 - fix: - content: "" + column: 28 + fix: + content: "\"rb\"" + location: + row: 28 + column: 23 + end_location: + row: 28 + column: 27 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 30 - column: 26 + column: 5 end_location: row: 30 - column: 31 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 32 - column: 5 - end_location: - row: 32 - column: 33 - fix: - content: "\"rb\"" + column: 32 + fix: + content: "" + location: + row: 30 + column: 26 + end_location: + row: 30 + column: 31 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 32 - column: 28 + column: 5 end_location: row: 32 - column: 32 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 35 - column: 5 - end_location: - row: 35 - column: 21 - fix: - content: "" + column: 33 + fix: + content: "\"rb\"" + location: + row: 32 + column: 28 + end_location: + row: 32 + column: 32 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 35 - column: 15 + column: 5 end_location: row: 35 - column: 20 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 35 - column: 29 - end_location: - row: 35 - column: 45 - fix: - content: "" + column: 21 + fix: + content: "" + location: + row: 35 + column: 15 + end_location: + row: 35 + column: 20 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 35 - column: 39 + column: 29 end_location: row: 35 - column: 44 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 37 - column: 5 - end_location: - row: 37 - column: 22 - fix: - content: "\"rb\"" + column: 45 + fix: + content: "" + location: + row: 35 + column: 39 + end_location: + row: 35 + column: 44 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 37 - column: 17 + column: 5 end_location: row: 37 - column: 21 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 37 - column: 30 - end_location: - row: 37 - column: 47 - fix: - content: "\"rb\"" + column: 22 + fix: + content: "\"rb\"" + location: + row: 37 + column: 17 + end_location: + row: 37 + column: 21 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 37 - column: 42 + column: 30 end_location: row: 37 - column: 46 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 40 - column: 0 - end_location: - row: 40 - column: 21 - fix: - content: "" + column: 47 + fix: + content: "\"rb\"" + location: + row: 37 + column: 42 + end_location: + row: 37 + column: 46 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 40 - column: 10 + column: 0 end_location: row: 40 - column: 20 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 41 - column: 0 - end_location: - row: 41 - column: 26 - fix: - content: "" + column: 21 + fix: + content: "" + location: + row: 40 + column: 10 + end_location: + row: 40 + column: 20 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 41 - column: 15 + column: 0 end_location: row: 41 - column: 25 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 42 - column: 0 - end_location: - row: 42 - column: 26 - fix: - content: "" + column: 26 + fix: + content: "" + location: + row: 41 + column: 15 + end_location: + row: 41 + column: 25 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 42 - column: 5 + column: 0 end_location: row: 42 - column: 15 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 44 - column: 5 - end_location: - row: 44 - column: 26 - fix: - content: "" + column: 26 + fix: + content: "" + location: + row: 42 + column: 5 + end_location: + row: 42 + column: 15 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 44 - column: 15 + column: 5 end_location: row: 44 - column: 25 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 46 - column: 5 - end_location: - row: 46 - column: 31 - fix: - content: "" + column: 26 + fix: + content: "" + location: + row: 44 + column: 15 + end_location: + row: 44 + column: 25 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 46 - column: 20 + column: 5 end_location: row: 46 - column: 30 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 48 - column: 5 - end_location: - row: 48 - column: 31 - fix: - content: "" + column: 31 + fix: + content: "" + location: + row: 46 + column: 20 + end_location: + row: 46 + column: 30 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 48 - column: 10 + column: 5 end_location: row: 48 - column: 20 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 51 - column: 0 - end_location: - row: 51 - column: 22 - fix: - content: "\"rb\"" + column: 31 + fix: + content: "" + location: + row: 48 + column: 10 + end_location: + row: 48 + column: 20 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 51 - column: 17 + column: 0 end_location: row: 51 - column: 21 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 52 - column: 0 - end_location: - row: 52 - column: 27 - fix: - content: "\"rb\"" + column: 22 + fix: + content: "\"rb\"" + location: + row: 51 + column: 17 + end_location: + row: 51 + column: 21 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 52 - column: 22 + column: 0 end_location: row: 52 - column: 26 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 53 - column: 0 - end_location: - row: 53 - column: 27 - fix: - content: "\"rb\"" + column: 27 + fix: + content: "\"rb\"" + location: + row: 52 + column: 22 + end_location: + row: 52 + column: 26 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 53 - column: 10 + column: 0 end_location: row: 53 - column: 14 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 55 - column: 5 - end_location: - row: 55 - column: 27 - fix: - content: "\"rb\"" + column: 27 + fix: + content: "\"rb\"" + location: + row: 53 + column: 10 + end_location: + row: 53 + column: 14 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 55 - column: 22 + column: 5 end_location: row: 55 - column: 26 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 57 - column: 5 - end_location: - row: 57 - column: 32 - fix: - content: "\"rb\"" + column: 27 + fix: + content: "\"rb\"" + location: + row: 55 + column: 22 + end_location: + row: 55 + column: 26 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 57 - column: 27 + column: 5 end_location: row: 57 - column: 31 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 59 - column: 5 - end_location: - row: 59 - column: 32 - fix: - content: "\"rb\"" + column: 32 + fix: + content: "\"rb\"" + location: + row: 57 + column: 27 + end_location: + row: 57 + column: 31 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 59 - column: 15 + column: 5 end_location: row: 59 - column: 19 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 62 - column: 0 - end_location: - row: 62 - column: 110 - fix: - content: "" + column: 32 + fix: + content: "\"rb\"" + location: + row: 59 + column: 15 + end_location: + row: 59 + column: 19 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 62 - column: 15 + column: 0 end_location: row: 62 - column: 25 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 63 - column: 0 - end_location: - row: 63 - column: 110 - fix: - content: "" + column: 110 + fix: + content: "" + location: + row: 62 + column: 15 + end_location: + row: 62 + column: 25 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 63 - column: 99 + column: 0 end_location: row: 63 - column: 109 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 64 - column: 0 - end_location: - row: 64 - column: 110 - fix: - content: "" + column: 110 + fix: + content: "" + location: + row: 63 + column: 99 + end_location: + row: 63 + column: 109 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 64 - column: 58 + column: 0 end_location: row: 64 - column: 68 - parent: ~ -- kind: - name: RedundantOpenModes - body: Unnecessary open mode parameters - suggestion: Remove open mode parameters - fixable: true - location: - row: 65 - column: 0 - end_location: - row: 65 - column: 110 - fix: - content: "" + column: 110 + fix: + content: "" + location: + row: 64 + column: 58 + end_location: + row: 64 + column: 68 + parent: ~ + - kind: + name: RedundantOpenModes + body: Unnecessary open mode parameters + suggestion: Remove open mode parameters + fixable: true location: row: 65 - column: 5 + column: 0 end_location: row: 65 - column: 15 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 67 - column: 0 - end_location: - row: 67 - column: 111 - fix: - content: "\"rb\"" + column: 110 + fix: + content: "" + location: + row: 65 + column: 5 + end_location: + row: 65 + column: 15 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 67 - column: 22 + column: 0 end_location: row: 67 - column: 26 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 68 - column: 0 - end_location: - row: 68 - column: 111 - fix: - content: "\"rb\"" + column: 111 + fix: + content: "\"rb\"" + location: + row: 67 + column: 22 + end_location: + row: 67 + column: 26 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 68 - column: 106 + column: 0 end_location: row: 68 - column: 110 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 69 - column: 0 - end_location: - row: 69 - column: 111 - fix: - content: "\"rb\"" + column: 111 + fix: + content: "\"rb\"" + location: + row: 68 + column: 106 + end_location: + row: 68 + column: 110 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 69 - column: 65 + column: 0 end_location: row: 69 - column: 69 - parent: ~ -- kind: - name: RedundantOpenModes - body: "Unnecessary open mode parameters, use \"\"rb\"\"" - suggestion: "Replace with \"\"rb\"\"" - fixable: true - location: - row: 70 - column: 0 - end_location: - row: 70 - column: 111 - fix: - content: "\"rb\"" + column: 111 + fix: + content: "\"rb\"" + location: + row: 69 + column: 65 + end_location: + row: 69 + column: 69 + parent: ~ + - kind: + name: RedundantOpenModes + body: "Unnecessary open mode parameters, use \"\"rb\"\"" + suggestion: "Replace with \"\"rb\"\"" + fixable: true location: row: 70 - column: 10 + column: 0 end_location: row: 70 - column: 14 - parent: ~ + column: 111 + fix: + content: "\"rb\"" + location: + row: 70 + column: 10 + end_location: + row: 70 + column: 14 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP018.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP018.py.snap index d86ed2e71f05f2..c9eb5444cee689 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP018.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP018.py.snap @@ -2,124 +2,124 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: NativeLiterals - body: "Unnecessary call to `str`" - suggestion: "Replace with `str`" - fixable: true - location: - row: 20 - column: 0 - end_location: - row: 20 - column: 5 - fix: - content: "\"\"" +- - kind: + name: NativeLiterals + body: "Unnecessary call to `str`" + suggestion: "Replace with `str`" + fixable: true location: row: 20 column: 0 end_location: row: 20 column: 5 - parent: ~ -- kind: - name: NativeLiterals - body: "Unnecessary call to `str`" - suggestion: "Replace with `str`" - fixable: true - location: - row: 21 - column: 0 - end_location: - row: 21 - column: 10 - fix: - content: "\"foo\"" + fix: + content: "\"\"" + location: + row: 20 + column: 0 + end_location: + row: 20 + column: 5 + parent: ~ + - kind: + name: NativeLiterals + body: "Unnecessary call to `str`" + suggestion: "Replace with `str`" + fixable: true location: row: 21 column: 0 end_location: row: 21 column: 10 - parent: ~ -- kind: - name: NativeLiterals - body: "Unnecessary call to `str`" - suggestion: "Replace with `str`" - fixable: true - location: - row: 22 - column: 0 - end_location: - row: 23 - column: 7 - fix: - content: "\"\"\"\nfoo\"\"\"" + fix: + content: "\"foo\"" + location: + row: 21 + column: 0 + end_location: + row: 21 + column: 10 + parent: ~ + - kind: + name: NativeLiterals + body: "Unnecessary call to `str`" + suggestion: "Replace with `str`" + fixable: true location: row: 22 column: 0 end_location: row: 23 column: 7 - parent: ~ -- kind: - name: NativeLiterals - body: "Unnecessary call to `bytes`" - suggestion: "Replace with `bytes`" - fixable: true - location: - row: 24 - column: 0 - end_location: - row: 24 - column: 7 - fix: - content: "b\"\"" + fix: + content: "\"\"\"\nfoo\"\"\"" + location: + row: 22 + column: 0 + end_location: + row: 23 + column: 7 + parent: ~ + - kind: + name: NativeLiterals + body: "Unnecessary call to `bytes`" + suggestion: "Replace with `bytes`" + fixable: true location: row: 24 column: 0 end_location: row: 24 column: 7 - parent: ~ -- kind: - name: NativeLiterals - body: "Unnecessary call to `bytes`" - suggestion: "Replace with `bytes`" - fixable: true - location: - row: 25 - column: 0 - end_location: - row: 25 - column: 13 - fix: - content: "b\"foo\"" + fix: + content: "b\"\"" + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 7 + parent: ~ + - kind: + name: NativeLiterals + body: "Unnecessary call to `bytes`" + suggestion: "Replace with `bytes`" + fixable: true location: row: 25 column: 0 end_location: row: 25 column: 13 - parent: ~ -- kind: - name: NativeLiterals - body: "Unnecessary call to `bytes`" - suggestion: "Replace with `bytes`" - fixable: true - location: - row: 26 - column: 0 - end_location: - row: 27 - column: 7 - fix: - content: "b\"\"\"\nfoo\"\"\"" + fix: + content: "b\"foo\"" + location: + row: 25 + column: 0 + end_location: + row: 25 + column: 13 + parent: ~ + - kind: + name: NativeLiterals + body: "Unnecessary call to `bytes`" + suggestion: "Replace with `bytes`" + fixable: true location: row: 26 column: 0 end_location: row: 27 column: 7 - parent: ~ + fix: + content: "b\"\"\"\nfoo\"\"\"" + location: + row: 26 + column: 0 + end_location: + row: 27 + column: 7 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP019.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP019.py.snap index 8277f1f3fd0f59..7159ded9863ace 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP019.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP019.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: TypingTextStrAlias - body: "`typing.Text` is deprecated, use `str`" - suggestion: "Replace with `str`" - fixable: true - location: - row: 7 - column: 21 - end_location: - row: 7 - column: 25 - fix: - content: str +- - kind: + name: TypingTextStrAlias + body: "`typing.Text` is deprecated, use `str`" + suggestion: "Replace with `str`" + fixable: true location: row: 7 column: 21 end_location: row: 7 column: 25 - parent: ~ -- kind: - name: TypingTextStrAlias - body: "`typing.Text` is deprecated, use `str`" - suggestion: "Replace with `str`" - fixable: true - location: - row: 11 - column: 28 - end_location: - row: 11 - column: 39 - fix: - content: str + fix: + content: str + location: + row: 7 + column: 21 + end_location: + row: 7 + column: 25 + parent: ~ + - kind: + name: TypingTextStrAlias + body: "`typing.Text` is deprecated, use `str`" + suggestion: "Replace with `str`" + fixable: true location: row: 11 column: 28 end_location: row: 11 column: 39 - parent: ~ -- kind: - name: TypingTextStrAlias - body: "`typing.Text` is deprecated, use `str`" - suggestion: "Replace with `str`" - fixable: true - location: - row: 15 - column: 27 - end_location: - row: 15 - column: 37 - fix: - content: str + fix: + content: str + location: + row: 11 + column: 28 + end_location: + row: 11 + column: 39 + parent: ~ + - kind: + name: TypingTextStrAlias + body: "`typing.Text` is deprecated, use `str`" + suggestion: "Replace with `str`" + fixable: true location: row: 15 column: 27 end_location: row: 15 column: 37 - parent: ~ -- kind: - name: TypingTextStrAlias - body: "`typing.Text` is deprecated, use `str`" - suggestion: "Replace with `str`" - fixable: true - location: - row: 19 - column: 28 - end_location: - row: 19 - column: 35 - fix: - content: str + fix: + content: str + location: + row: 15 + column: 27 + end_location: + row: 15 + column: 37 + parent: ~ + - kind: + name: TypingTextStrAlias + body: "`typing.Text` is deprecated, use `str`" + suggestion: "Replace with `str`" + fixable: true location: row: 19 column: 28 end_location: row: 19 column: 35 - parent: ~ + fix: + content: str + location: + row: 19 + column: 28 + end_location: + row: 19 + column: 35 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP021.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP021.py.snap index ebfcaecd3f1364..26cecfc43ce557 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP021.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP021.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: ReplaceUniversalNewlines - body: "`universal_newlines` is deprecated, use `text`" - suggestion: "Replace with `text` keyword argument" - fixable: true - location: - row: 6 - column: 24 - end_location: - row: 6 - column: 42 - fix: - content: text +- - kind: + name: ReplaceUniversalNewlines + body: "`universal_newlines` is deprecated, use `text`" + suggestion: "Replace with `text` keyword argument" + fixable: true location: row: 6 column: 24 end_location: row: 6 column: 42 - parent: ~ -- kind: - name: ReplaceUniversalNewlines - body: "`universal_newlines` is deprecated, use `text`" - suggestion: "Replace with `text` keyword argument" - fixable: true - location: - row: 7 - column: 22 - end_location: - row: 7 - column: 40 - fix: - content: text + fix: + content: text + location: + row: 6 + column: 24 + end_location: + row: 6 + column: 42 + parent: ~ + - kind: + name: ReplaceUniversalNewlines + body: "`universal_newlines` is deprecated, use `text`" + suggestion: "Replace with `text` keyword argument" + fixable: true location: row: 7 column: 22 end_location: row: 7 column: 40 - parent: ~ -- kind: - name: ReplaceUniversalNewlines - body: "`universal_newlines` is deprecated, use `text`" - suggestion: "Replace with `text` keyword argument" - fixable: true - location: - row: 9 - column: 13 - end_location: - row: 9 - column: 31 - fix: - content: text + fix: + content: text + location: + row: 7 + column: 22 + end_location: + row: 7 + column: 40 + parent: ~ + - kind: + name: ReplaceUniversalNewlines + body: "`universal_newlines` is deprecated, use `text`" + suggestion: "Replace with `text` keyword argument" + fixable: true location: row: 9 column: 13 end_location: row: 9 column: 31 - parent: ~ -- kind: - name: ReplaceUniversalNewlines - body: "`universal_newlines` is deprecated, use `text`" - suggestion: "Replace with `text` keyword argument" - fixable: true - location: - row: 10 - column: 21 - end_location: - row: 10 - column: 39 - fix: - content: text + fix: + content: text + location: + row: 9 + column: 13 + end_location: + row: 9 + column: 31 + parent: ~ + - kind: + name: ReplaceUniversalNewlines + body: "`universal_newlines` is deprecated, use `text`" + suggestion: "Replace with `text` keyword argument" + fixable: true location: row: 10 column: 21 end_location: row: 10 column: 39 - parent: ~ + fix: + content: text + location: + row: 10 + column: 21 + end_location: + row: 10 + column: 39 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP022.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP022.py.snap index 2d82b2b78f009d..50b08030be1b24 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP022.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP022.py.snap @@ -2,144 +2,144 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: ReplaceStdoutStderr - body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" - suggestion: "Replace with `capture_output` keyword argument" - fixable: true - location: - row: 4 - column: 9 - end_location: - row: 4 - column: 69 - fix: - content: capture_output=True +- - kind: + name: ReplaceStdoutStderr + body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" + suggestion: "Replace with `capture_output` keyword argument" + fixable: true location: row: 4 - column: 22 + column: 9 end_location: row: 4 - column: 68 - parent: ~ -- kind: - name: ReplaceStdoutStderr - body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" - suggestion: "Replace with `capture_output` keyword argument" - fixable: true - location: - row: 6 - column: 9 - end_location: - row: 6 - column: 80 - fix: - content: capture_output=True + column: 69 + fix: + content: capture_output=True + location: + row: 4 + column: 22 + end_location: + row: 4 + column: 68 + parent: ~ + - kind: + name: ReplaceStdoutStderr + body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" + suggestion: "Replace with `capture_output` keyword argument" + fixable: true location: row: 6 - column: 33 + column: 9 end_location: row: 6 - column: 79 - parent: ~ -- kind: - name: ReplaceStdoutStderr - body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" - suggestion: "Replace with `capture_output` keyword argument" - fixable: true - location: - row: 8 - column: 9 - end_location: - row: 8 - column: 86 - fix: - content: "capture_output=True, args=[\"foo\"]" + column: 80 + fix: + content: capture_output=True + location: + row: 6 + column: 33 + end_location: + row: 6 + column: 79 + parent: ~ + - kind: + name: ReplaceStdoutStderr + body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" + suggestion: "Replace with `capture_output` keyword argument" + fixable: true location: row: 8 - column: 24 + column: 9 end_location: row: 8 - column: 85 - parent: ~ -- kind: - name: ReplaceStdoutStderr - body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" - suggestion: "Replace with `capture_output` keyword argument" - fixable: true - location: - row: 10 - column: 9 - end_location: - row: 12 - column: 1 - fix: - content: "capture_output=True, check=True" + column: 86 + fix: + content: "capture_output=True, args=[\"foo\"]" + location: + row: 8 + column: 24 + end_location: + row: 8 + column: 85 + parent: ~ + - kind: + name: ReplaceStdoutStderr + body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" + suggestion: "Replace with `capture_output` keyword argument" + fixable: true location: - row: 11 - column: 13 + row: 10 + column: 9 end_location: - row: 11 - column: 71 - parent: ~ -- kind: - name: ReplaceStdoutStderr - body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" - suggestion: "Replace with `capture_output` keyword argument" - fixable: true - location: - row: 14 - column: 9 - end_location: - row: 16 - column: 1 - fix: - content: "capture_output=True, check=True" + row: 12 + column: 1 + fix: + content: "capture_output=True, check=True" + location: + row: 11 + column: 13 + end_location: + row: 11 + column: 71 + parent: ~ + - kind: + name: ReplaceStdoutStderr + body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" + suggestion: "Replace with `capture_output` keyword argument" + fixable: true location: - row: 15 - column: 13 + row: 14 + column: 9 end_location: - row: 15 - column: 71 - parent: ~ -- kind: - name: ReplaceStdoutStderr - body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" - suggestion: "Replace with `capture_output` keyword argument" - fixable: true - location: - row: 18 - column: 9 - end_location: - row: 26 - column: 1 - fix: - content: "capture_output=True,\n check=True" + row: 16 + column: 1 + fix: + content: "capture_output=True, check=True" + location: + row: 15 + column: 13 + end_location: + row: 15 + column: 71 + parent: ~ + - kind: + name: ReplaceStdoutStderr + body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" + suggestion: "Replace with `capture_output` keyword argument" + fixable: true location: - row: 20 - column: 4 + row: 18 + column: 9 end_location: - row: 22 - column: 26 - parent: ~ -- kind: - name: ReplaceStdoutStderr - body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" - suggestion: "Replace with `capture_output` keyword argument" - fixable: true - location: - row: 29 - column: 13 - end_location: - row: 36 - column: 5 - fix: - content: "capture_output=True,\n check=True" + row: 26 + column: 1 + fix: + content: "capture_output=True,\n check=True" + location: + row: 20 + column: 4 + end_location: + row: 22 + column: 26 + parent: ~ + - kind: + name: ReplaceStdoutStderr + body: "Sending stdout and stderr to pipe is deprecated, use `capture_output`" + suggestion: "Replace with `capture_output` keyword argument" + fixable: true location: - row: 31 - column: 8 + row: 29 + column: 13 end_location: - row: 33 - column: 30 - parent: ~ + row: 36 + column: 5 + fix: + content: "capture_output=True,\n check=True" + location: + row: 31 + column: 8 + end_location: + row: 33 + column: 30 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP023.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP023.py.snap index fcf107949c6849..e0f26acf944a92 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP023.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP023.py.snap @@ -2,204 +2,204 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: RewriteCElementTree - body: "`cElementTree` is deprecated, use `ElementTree`" - suggestion: "Replace with `ElementTree`" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 59 - fix: - content: "from xml.etree.ElementTree import XML, Element, SubElement" +- - kind: + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + suggestion: "Replace with `ElementTree`" + fixable: true location: row: 2 column: 0 end_location: row: 2 column: 59 - parent: ~ -- kind: - name: RewriteCElementTree - body: "`cElementTree` is deprecated, use `ElementTree`" - suggestion: "Replace with `ElementTree`" - fixable: true - location: - row: 3 - column: 7 - end_location: - row: 3 - column: 35 - fix: - content: xml.etree.ElementTree as ET + fix: + content: "from xml.etree.ElementTree import XML, Element, SubElement" + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 59 + parent: ~ + - kind: + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + suggestion: "Replace with `ElementTree`" + fixable: true location: row: 3 column: 7 end_location: row: 3 column: 35 - parent: ~ -- kind: - name: RewriteCElementTree - body: "`cElementTree` is deprecated, use `ElementTree`" - suggestion: "Replace with `ElementTree`" - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 44 - fix: - content: from xml.etree.ElementTree import XML + fix: + content: xml.etree.ElementTree as ET + location: + row: 3 + column: 7 + end_location: + row: 3 + column: 35 + parent: ~ + - kind: + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + suggestion: "Replace with `ElementTree`" + fixable: true location: row: 6 column: 0 end_location: row: 6 column: 44 - parent: ~ -- kind: - name: RewriteCElementTree - body: "`cElementTree` is deprecated, use `ElementTree`" - suggestion: "Replace with `ElementTree`" - fixable: true - location: - row: 7 - column: 10 - end_location: - row: 7 - column: 49 - fix: - content: xml.etree.ElementTree as ET + fix: + content: from xml.etree.ElementTree import XML + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 44 + parent: ~ + - kind: + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + suggestion: "Replace with `ElementTree`" + fixable: true location: row: 7 column: 10 end_location: row: 7 column: 49 - parent: ~ -- kind: - name: RewriteCElementTree - body: "`cElementTree` is deprecated, use `ElementTree`" - suggestion: "Replace with `ElementTree`" - fixable: true - location: - row: 10 - column: 0 - end_location: - row: 14 - column: 1 - fix: - content: "from xml.etree.ElementTree import (\n XML,\n Element,\n SubElement,\n)" + fix: + content: xml.etree.ElementTree as ET + location: + row: 7 + column: 10 + end_location: + row: 7 + column: 49 + parent: ~ + - kind: + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + suggestion: "Replace with `ElementTree`" + fixable: true location: row: 10 column: 0 end_location: row: 14 column: 1 - parent: ~ -- kind: - name: RewriteCElementTree - body: "`cElementTree` is deprecated, use `ElementTree`" - suggestion: "Replace with `ElementTree`" - fixable: true - location: - row: 16 - column: 11 - end_location: - row: 16 - column: 39 - fix: - content: xml.etree.ElementTree as ET + fix: + content: "from xml.etree.ElementTree import (\n XML,\n Element,\n SubElement,\n)" + location: + row: 10 + column: 0 + end_location: + row: 14 + column: 1 + parent: ~ + - kind: + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + suggestion: "Replace with `ElementTree`" + fixable: true location: row: 16 column: 11 end_location: row: 16 column: 39 - parent: ~ -- kind: - name: RewriteCElementTree - body: "`cElementTree` is deprecated, use `ElementTree`" - suggestion: "Replace with `ElementTree`" - fixable: true - location: - row: 17 - column: 26 - end_location: - row: 17 - column: 45 - fix: - content: ElementTree as CET + fix: + content: xml.etree.ElementTree as ET + location: + row: 16 + column: 11 + end_location: + row: 16 + column: 39 + parent: ~ + - kind: + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + suggestion: "Replace with `ElementTree`" + fixable: true location: row: 17 column: 26 end_location: row: 17 column: 45 - parent: ~ -- kind: - name: RewriteCElementTree - body: "`cElementTree` is deprecated, use `ElementTree`" - suggestion: "Replace with `ElementTree`" - fixable: true - location: - row: 19 - column: 22 - end_location: - row: 19 - column: 40 - fix: - content: ElementTree as ET + fix: + content: ElementTree as CET + location: + row: 17 + column: 26 + end_location: + row: 17 + column: 45 + parent: ~ + - kind: + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + suggestion: "Replace with `ElementTree`" + fixable: true location: row: 19 column: 22 end_location: row: 19 column: 40 - parent: ~ -- kind: - name: RewriteCElementTree - body: "`cElementTree` is deprecated, use `ElementTree`" - suggestion: "Replace with `ElementTree`" - fixable: true - location: - row: 21 - column: 19 - end_location: - row: 21 - column: 47 - fix: - content: xml.etree.ElementTree as ET + fix: + content: ElementTree as ET + location: + row: 19 + column: 22 + end_location: + row: 19 + column: 40 + parent: ~ + - kind: + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + suggestion: "Replace with `ElementTree`" + fixable: true location: row: 21 column: 19 end_location: row: 21 column: 47 - parent: ~ -- kind: - name: RewriteCElementTree - body: "`cElementTree` is deprecated, use `ElementTree`" - suggestion: "Replace with `ElementTree`" - fixable: true - location: - row: 24 - column: 31 - end_location: - row: 24 - column: 59 - fix: - content: xml.etree.ElementTree as ET + fix: + content: xml.etree.ElementTree as ET + location: + row: 21 + column: 19 + end_location: + row: 21 + column: 47 + parent: ~ + - kind: + name: RewriteCElementTree + body: "`cElementTree` is deprecated, use `ElementTree`" + suggestion: "Replace with `ElementTree`" + fixable: true location: row: 24 column: 31 end_location: row: 24 column: 59 - parent: ~ + fix: + content: xml.etree.ElementTree as ET + location: + row: 24 + column: 31 + end_location: + row: 24 + column: 59 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_0.py.snap index 96484c4ea2f5e5..065e9fd5b43948 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_0.py.snap @@ -2,264 +2,264 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `EnvironmentError` with builtin `OSError`" - fixable: true - location: - row: 6 - column: 7 - end_location: - row: 6 - column: 23 - fix: - content: OSError +- - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `EnvironmentError` with builtin `OSError`" + fixable: true location: row: 6 column: 7 end_location: row: 6 column: 23 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `IOError` with builtin `OSError`" - fixable: true - location: - row: 11 - column: 7 - end_location: - row: 11 - column: 14 - fix: - content: OSError + fix: + content: OSError + location: + row: 6 + column: 7 + end_location: + row: 6 + column: 23 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `IOError` with builtin `OSError`" + fixable: true location: row: 11 column: 7 end_location: row: 11 column: 14 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `WindowsError` with builtin `OSError`" - fixable: true - location: - row: 16 - column: 7 - end_location: - row: 16 - column: 19 - fix: - content: OSError + fix: + content: OSError + location: + row: 11 + column: 7 + end_location: + row: 11 + column: 14 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `WindowsError` with builtin `OSError`" + fixable: true location: row: 16 column: 7 end_location: row: 16 column: 19 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `mmap.error` with builtin `OSError`" - fixable: true - location: - row: 21 - column: 7 - end_location: - row: 21 - column: 17 - fix: - content: OSError + fix: + content: OSError + location: + row: 16 + column: 7 + end_location: + row: 16 + column: 19 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `mmap.error` with builtin `OSError`" + fixable: true location: row: 21 column: 7 end_location: row: 21 column: 17 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `select.error` with builtin `OSError`" - fixable: true - location: - row: 26 - column: 7 - end_location: - row: 26 - column: 19 - fix: - content: OSError + fix: + content: OSError + location: + row: 21 + column: 7 + end_location: + row: 21 + column: 17 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `select.error` with builtin `OSError`" + fixable: true location: row: 26 column: 7 end_location: row: 26 column: 19 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `socket.error` with builtin `OSError`" - fixable: true - location: - row: 31 - column: 7 - end_location: - row: 31 - column: 19 - fix: - content: OSError + fix: + content: OSError + location: + row: 26 + column: 7 + end_location: + row: 26 + column: 19 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `socket.error` with builtin `OSError`" + fixable: true location: row: 31 column: 7 end_location: row: 31 column: 19 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `error` with builtin `OSError`" - fixable: true - location: - row: 36 - column: 7 - end_location: - row: 36 - column: 12 - fix: - content: OSError + fix: + content: OSError + location: + row: 31 + column: 7 + end_location: + row: 31 + column: 19 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `error` with builtin `OSError`" + fixable: true location: row: 36 column: 7 end_location: row: 36 column: 12 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace with builtin `OSError`" - fixable: true - location: - row: 43 - column: 7 - end_location: - row: 43 - column: 17 - fix: - content: OSError + fix: + content: OSError + location: + row: 36 + column: 7 + end_location: + row: 36 + column: 12 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace with builtin `OSError`" + fixable: true location: row: 43 column: 7 end_location: row: 43 column: 17 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace with builtin `OSError`" - fixable: true - location: - row: 47 - column: 7 - end_location: - row: 47 - column: 20 - fix: - content: OSError + fix: + content: OSError + location: + row: 43 + column: 7 + end_location: + row: 43 + column: 17 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace with builtin `OSError`" + fixable: true location: row: 47 column: 7 end_location: row: 47 column: 20 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace with builtin `OSError`" - fixable: true - location: - row: 51 - column: 7 - end_location: - row: 51 - column: 57 - fix: - content: OSError + fix: + content: OSError + location: + row: 47 + column: 7 + end_location: + row: 47 + column: 20 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace with builtin `OSError`" + fixable: true location: row: 51 column: 7 end_location: row: 51 column: 57 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace with builtin `OSError`" - fixable: true - location: - row: 58 - column: 7 - end_location: - row: 58 - column: 35 - fix: - content: "(KeyError, OSError)" + fix: + content: OSError + location: + row: 51 + column: 7 + end_location: + row: 51 + column: 57 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace with builtin `OSError`" + fixable: true location: row: 58 column: 7 end_location: row: 58 column: 35 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace with builtin `OSError`" - fixable: true - location: - row: 65 - column: 7 - end_location: - row: 65 - column: 23 - fix: - content: "(OSError, error)" + fix: + content: "(KeyError, OSError)" + location: + row: 58 + column: 7 + end_location: + row: 58 + column: 35 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace with builtin `OSError`" + fixable: true location: row: 65 column: 7 end_location: row: 65 column: 23 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `mmap.error` with builtin `OSError`" - fixable: true - location: - row: 87 - column: 7 - end_location: - row: 87 - column: 19 - fix: - content: OSError + fix: + content: "(OSError, error)" + location: + row: 65 + column: 7 + end_location: + row: 65 + column: 23 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `mmap.error` with builtin `OSError`" + fixable: true location: row: 87 column: 7 end_location: row: 87 column: 19 - parent: ~ + fix: + content: OSError + location: + row: 87 + column: 7 + end_location: + row: 87 + column: 19 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_1.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_1.py.snap index 4175489659c77a..4fd3ef74be14c8 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_1.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_1.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace with builtin `OSError`" - fixable: true - location: - row: 5 - column: 7 - end_location: - row: 5 - column: 37 - fix: - content: OSError +- - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace with builtin `OSError`" + fixable: true location: row: 5 column: 7 end_location: row: 5 column: 37 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace with builtin `OSError`" - fixable: true - location: - row: 7 - column: 7 - end_location: - row: 7 - column: 40 - fix: - content: "(OSError, KeyError)" + fix: + content: OSError + location: + row: 5 + column: 7 + end_location: + row: 5 + column: 37 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace with builtin `OSError`" + fixable: true location: row: 7 column: 7 end_location: row: 7 column: 40 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace with builtin `OSError`" - fixable: true - location: - row: 12 - column: 7 - end_location: - row: 16 - column: 1 - fix: - content: OSError + fix: + content: "(OSError, KeyError)" + location: + row: 7 + column: 7 + end_location: + row: 7 + column: 40 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace with builtin `OSError`" + fixable: true location: row: 12 column: 7 end_location: row: 16 column: 1 - parent: ~ + fix: + content: OSError + location: + row: 12 + column: 7 + end_location: + row: 16 + column: 1 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_2.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_2.py.snap index a2b5213990cb38..80c2dc5253a55d 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_2.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_2.py.snap @@ -2,404 +2,404 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `socket.error` with builtin `OSError`" - fixable: true - location: - row: 10 - column: 6 - end_location: - row: 10 - column: 18 - fix: - content: OSError +- - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `socket.error` with builtin `OSError`" + fixable: true location: row: 10 column: 6 end_location: row: 10 column: 18 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `mmap.error` with builtin `OSError`" - fixable: true - location: - row: 11 - column: 6 - end_location: - row: 11 - column: 16 - fix: - content: OSError + fix: + content: OSError + location: + row: 10 + column: 6 + end_location: + row: 10 + column: 18 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `mmap.error` with builtin `OSError`" + fixable: true location: row: 11 column: 6 end_location: row: 11 column: 16 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `select.error` with builtin `OSError`" - fixable: true - location: - row: 12 - column: 6 - end_location: - row: 12 - column: 18 - fix: - content: OSError + fix: + content: OSError + location: + row: 11 + column: 6 + end_location: + row: 11 + column: 16 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `select.error` with builtin `OSError`" + fixable: true location: row: 12 column: 6 end_location: row: 12 column: 18 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `socket.error` with builtin `OSError`" - fixable: true - location: - row: 14 - column: 6 - end_location: - row: 14 - column: 18 - fix: - content: OSError + fix: + content: OSError + location: + row: 12 + column: 6 + end_location: + row: 12 + column: 18 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `socket.error` with builtin `OSError`" + fixable: true location: row: 14 column: 6 end_location: row: 14 column: 18 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `mmap.error` with builtin `OSError`" - fixable: true - location: - row: 15 - column: 6 - end_location: - row: 15 - column: 16 - fix: - content: OSError + fix: + content: OSError + location: + row: 14 + column: 6 + end_location: + row: 14 + column: 18 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `mmap.error` with builtin `OSError`" + fixable: true location: row: 15 column: 6 end_location: row: 15 column: 16 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `select.error` with builtin `OSError`" - fixable: true - location: - row: 16 - column: 6 - end_location: - row: 16 - column: 18 - fix: - content: OSError + fix: + content: OSError + location: + row: 15 + column: 6 + end_location: + row: 15 + column: 16 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `select.error` with builtin `OSError`" + fixable: true location: row: 16 column: 6 end_location: row: 16 column: 18 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `socket.error` with builtin `OSError`" - fixable: true - location: - row: 18 - column: 6 - end_location: - row: 18 - column: 18 - fix: - content: OSError + fix: + content: OSError + location: + row: 16 + column: 6 + end_location: + row: 16 + column: 18 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `socket.error` with builtin `OSError`" + fixable: true location: row: 18 column: 6 end_location: row: 18 column: 18 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `error` with builtin `OSError`" - fixable: true - location: - row: 25 - column: 6 - end_location: - row: 25 - column: 11 - fix: - content: OSError + fix: + content: OSError + location: + row: 18 + column: 6 + end_location: + row: 18 + column: 18 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `error` with builtin `OSError`" + fixable: true location: row: 25 column: 6 end_location: row: 25 column: 11 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `error` with builtin `OSError`" - fixable: true - location: - row: 28 - column: 6 - end_location: - row: 28 - column: 11 - fix: - content: OSError + fix: + content: OSError + location: + row: 25 + column: 6 + end_location: + row: 25 + column: 11 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `error` with builtin `OSError`" + fixable: true location: row: 28 column: 6 end_location: row: 28 column: 11 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `error` with builtin `OSError`" - fixable: true - location: - row: 31 - column: 6 - end_location: - row: 31 - column: 11 - fix: - content: OSError + fix: + content: OSError + location: + row: 28 + column: 6 + end_location: + row: 28 + column: 11 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `error` with builtin `OSError`" + fixable: true location: row: 31 column: 6 end_location: row: 31 column: 11 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `EnvironmentError` with builtin `OSError`" - fixable: true - location: - row: 34 - column: 6 - end_location: - row: 34 - column: 22 - fix: - content: OSError + fix: + content: OSError + location: + row: 31 + column: 6 + end_location: + row: 31 + column: 11 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `EnvironmentError` with builtin `OSError`" + fixable: true location: row: 34 column: 6 end_location: row: 34 column: 22 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `IOError` with builtin `OSError`" - fixable: true - location: - row: 35 - column: 6 - end_location: - row: 35 - column: 13 - fix: - content: OSError + fix: + content: OSError + location: + row: 34 + column: 6 + end_location: + row: 34 + column: 22 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `IOError` with builtin `OSError`" + fixable: true location: row: 35 column: 6 end_location: row: 35 column: 13 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `WindowsError` with builtin `OSError`" - fixable: true - location: - row: 36 - column: 6 - end_location: - row: 36 - column: 18 - fix: - content: OSError + fix: + content: OSError + location: + row: 35 + column: 6 + end_location: + row: 35 + column: 13 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `WindowsError` with builtin `OSError`" + fixable: true location: row: 36 column: 6 end_location: row: 36 column: 18 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `EnvironmentError` with builtin `OSError`" - fixable: true - location: - row: 38 - column: 6 - end_location: - row: 38 - column: 22 - fix: - content: OSError + fix: + content: OSError + location: + row: 36 + column: 6 + end_location: + row: 36 + column: 18 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `EnvironmentError` with builtin `OSError`" + fixable: true location: row: 38 column: 6 end_location: row: 38 column: 22 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `IOError` with builtin `OSError`" - fixable: true - location: - row: 39 - column: 6 - end_location: - row: 39 - column: 13 - fix: - content: OSError + fix: + content: OSError + location: + row: 38 + column: 6 + end_location: + row: 38 + column: 22 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `IOError` with builtin `OSError`" + fixable: true location: row: 39 column: 6 end_location: row: 39 column: 13 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `WindowsError` with builtin `OSError`" - fixable: true - location: - row: 40 - column: 6 - end_location: - row: 40 - column: 18 - fix: - content: OSError + fix: + content: OSError + location: + row: 39 + column: 6 + end_location: + row: 39 + column: 13 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `WindowsError` with builtin `OSError`" + fixable: true location: row: 40 column: 6 end_location: row: 40 column: 18 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `EnvironmentError` with builtin `OSError`" - fixable: true - location: - row: 42 - column: 6 - end_location: - row: 42 - column: 22 - fix: - content: OSError + fix: + content: OSError + location: + row: 40 + column: 6 + end_location: + row: 40 + column: 18 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `EnvironmentError` with builtin `OSError`" + fixable: true location: row: 42 column: 6 end_location: row: 42 column: 22 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `WindowsError` with builtin `OSError`" - fixable: true - location: - row: 48 - column: 6 - end_location: - row: 48 - column: 18 - fix: - content: OSError + fix: + content: OSError + location: + row: 42 + column: 6 + end_location: + row: 42 + column: 22 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `WindowsError` with builtin `OSError`" + fixable: true location: row: 48 column: 6 end_location: row: 48 column: 18 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `EnvironmentError` with builtin `OSError`" - fixable: true - location: - row: 49 - column: 6 - end_location: - row: 49 - column: 22 - fix: - content: OSError + fix: + content: OSError + location: + row: 48 + column: 6 + end_location: + row: 48 + column: 18 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `EnvironmentError` with builtin `OSError`" + fixable: true location: row: 49 column: 6 end_location: row: 49 column: 22 - parent: ~ -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace `IOError` with builtin `OSError`" - fixable: true - location: - row: 50 - column: 6 - end_location: - row: 50 - column: 13 - fix: - content: OSError + fix: + content: OSError + location: + row: 49 + column: 6 + end_location: + row: 49 + column: 22 + parent: ~ + - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace `IOError` with builtin `OSError`" + fixable: true location: row: 50 column: 6 end_location: row: 50 column: 13 - parent: ~ + fix: + content: OSError + location: + row: 50 + column: 6 + end_location: + row: 50 + column: 13 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_3.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_3.py.snap index 0defbd08dc1d28..6ba64a58776454 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_3.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_3.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_4.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_4.py.snap index 8783b93e1eacbf..aafc88dd2d5516 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_4.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_4.py.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: OSErrorAlias - body: "Replace aliased errors with `OSError`" - suggestion: "Replace with builtin `OSError`" - fixable: true - location: - row: 9 - column: 7 - end_location: - row: 9 - column: 50 - fix: - content: "(OSError, exceptions.OperationalError)" +- - kind: + name: OSErrorAlias + body: "Replace aliased errors with `OSError`" + suggestion: "Replace with builtin `OSError`" + fixable: true location: row: 9 column: 7 end_location: row: 9 column: 50 - parent: ~ + fix: + content: "(OSError, exceptions.OperationalError)" + location: + row: 9 + column: 7 + end_location: + row: 9 + column: 50 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP025.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP025.py.snap index fceb98b0a443ca..364c476be2f930 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP025.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP025.py.snap @@ -2,244 +2,244 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: RewriteUnicodeLiteral - body: Remove unicode literals from strings - suggestion: Remove unicode prefix - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 2 - column: 12 - fix: - content: "" +- - kind: + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + suggestion: Remove unicode prefix + fixable: true location: row: 2 column: 4 end_location: row: 2 - column: 5 - parent: ~ -- kind: - name: RewriteUnicodeLiteral - body: Remove unicode literals from strings - suggestion: Remove unicode prefix - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 8 - fix: - content: "" + column: 12 + fix: + content: "" + location: + row: 2 + column: 4 + end_location: + row: 2 + column: 5 + parent: ~ + - kind: + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + suggestion: Remove unicode prefix + fixable: true location: row: 4 column: 0 end_location: row: 4 - column: 1 - parent: ~ -- kind: - name: RewriteUnicodeLiteral - body: Remove unicode literals from strings - suggestion: Remove unicode prefix - fixable: true - location: - row: 6 - column: 6 - end_location: - row: 6 - column: 14 - fix: - content: "" + column: 8 + fix: + content: "" + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 1 + parent: ~ + - kind: + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + suggestion: Remove unicode prefix + fixable: true location: row: 6 column: 6 end_location: row: 6 - column: 7 - parent: ~ -- kind: - name: RewriteUnicodeLiteral - body: Remove unicode literals from strings - suggestion: Remove unicode prefix - fixable: true - location: - row: 8 - column: 6 - end_location: - row: 8 - column: 14 - fix: - content: "" + column: 14 + fix: + content: "" + location: + row: 6 + column: 6 + end_location: + row: 6 + column: 7 + parent: ~ + - kind: + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + suggestion: Remove unicode prefix + fixable: true location: row: 8 column: 6 end_location: row: 8 - column: 7 - parent: ~ -- kind: - name: RewriteUnicodeLiteral - body: Remove unicode literals from strings - suggestion: Remove unicode prefix - fixable: true - location: - row: 12 - column: 4 - end_location: - row: 12 - column: 12 - fix: - content: "" + column: 14 + fix: + content: "" + location: + row: 8 + column: 6 + end_location: + row: 8 + column: 7 + parent: ~ + - kind: + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + suggestion: Remove unicode prefix + fixable: true location: row: 12 column: 4 end_location: row: 12 - column: 5 - parent: ~ -- kind: - name: RewriteUnicodeLiteral - body: Remove unicode literals from strings - suggestion: Remove unicode prefix - fixable: true - location: - row: 12 - column: 14 - end_location: - row: 12 - column: 22 - fix: - content: "" + column: 12 + fix: + content: "" + location: + row: 12 + column: 4 + end_location: + row: 12 + column: 5 + parent: ~ + - kind: + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + suggestion: Remove unicode prefix + fixable: true location: row: 12 column: 14 end_location: row: 12 - column: 15 - parent: ~ -- kind: - name: RewriteUnicodeLiteral - body: Remove unicode literals from strings - suggestion: Remove unicode prefix - fixable: true - location: - row: 12 - column: 26 - end_location: - row: 12 - column: 34 - fix: - content: "" + column: 22 + fix: + content: "" + location: + row: 12 + column: 14 + end_location: + row: 12 + column: 15 + parent: ~ + - kind: + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + suggestion: Remove unicode prefix + fixable: true location: row: 12 column: 26 end_location: row: 12 - column: 27 - parent: ~ -- kind: - name: RewriteUnicodeLiteral - body: Remove unicode literals from strings - suggestion: Remove unicode prefix - fixable: true - location: - row: 12 - column: 38 - end_location: - row: 12 - column: 46 - fix: - content: "" + column: 34 + fix: + content: "" + location: + row: 12 + column: 26 + end_location: + row: 12 + column: 27 + parent: ~ + - kind: + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + suggestion: Remove unicode prefix + fixable: true location: row: 12 column: 38 end_location: row: 12 - column: 39 - parent: ~ -- kind: - name: RewriteUnicodeLiteral - body: Remove unicode literals from strings - suggestion: Remove unicode prefix - fixable: true - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 12 - fix: - content: "" + column: 46 + fix: + content: "" + location: + row: 12 + column: 38 + end_location: + row: 12 + column: 39 + parent: ~ + - kind: + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + suggestion: Remove unicode prefix + fixable: true location: row: 16 column: 4 end_location: row: 16 - column: 5 - parent: ~ -- kind: - name: RewriteUnicodeLiteral - body: Remove unicode literals from strings - suggestion: Remove unicode prefix - fixable: true - location: - row: 17 - column: 4 - end_location: - row: 17 - column: 16 - fix: - content: "" + column: 12 + fix: + content: "" + location: + row: 16 + column: 4 + end_location: + row: 16 + column: 5 + parent: ~ + - kind: + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + suggestion: Remove unicode prefix + fixable: true location: row: 17 column: 4 end_location: row: 17 - column: 5 - parent: ~ -- kind: - name: RewriteUnicodeLiteral - body: Remove unicode literals from strings - suggestion: Remove unicode prefix - fixable: true - location: - row: 18 - column: 4 - end_location: - row: 18 - column: 16 - fix: - content: "" + column: 16 + fix: + content: "" + location: + row: 17 + column: 4 + end_location: + row: 17 + column: 5 + parent: ~ + - kind: + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + suggestion: Remove unicode prefix + fixable: true location: row: 18 column: 4 end_location: row: 18 - column: 5 - parent: ~ -- kind: - name: RewriteUnicodeLiteral - body: Remove unicode literals from strings - suggestion: Remove unicode prefix - fixable: true - location: - row: 19 - column: 4 - end_location: - row: 19 - column: 20 - fix: - content: "" + column: 16 + fix: + content: "" + location: + row: 18 + column: 4 + end_location: + row: 18 + column: 5 + parent: ~ + - kind: + name: RewriteUnicodeLiteral + body: Remove unicode literals from strings + suggestion: Remove unicode prefix + fixable: true location: row: 19 column: 4 end_location: row: 19 - column: 5 - parent: ~ + column: 20 + fix: + content: "" + location: + row: 19 + column: 4 + end_location: + row: 19 + column: 5 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP026.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP026.py.snap index 49a288bdd1e0b8..2a40f095f30648 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP026.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP026.py.snap @@ -2,524 +2,524 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 3 - column: 11 - end_location: - row: 3 - column: 15 - fix: - content: from unittest import mock +- - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 3 - column: 4 + column: 11 end_location: row: 3 column: 15 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 7 - column: 11 - end_location: - row: 7 - column: 15 - fix: - content: "import sys\n from unittest import mock" + fix: + content: from unittest import mock + location: + row: 3 + column: 4 + end_location: + row: 3 + column: 15 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 7 - column: 4 + column: 11 end_location: row: 7 - column: 20 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 11 - column: 4 - end_location: - row: 11 - column: 22 - fix: - content: from unittest.mock import * + column: 15 + fix: + content: "import sys\n from unittest import mock" + location: + row: 7 + column: 4 + end_location: + row: 7 + column: 20 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 11 column: 4 end_location: row: 11 column: 22 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 14 - column: 7 - end_location: - row: 14 - column: 16 - fix: - content: from unittest import mock + fix: + content: from unittest.mock import * + location: + row: 11 + column: 4 + end_location: + row: 11 + column: 22 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 14 - column: 0 + column: 7 end_location: row: 14 column: 16 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 17 - column: 19 - end_location: - row: 17 - column: 23 - fix: - content: "import contextlib, sys\nfrom unittest import mock" + fix: + content: from unittest import mock + location: + row: 14 + column: 0 + end_location: + row: 14 + column: 16 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 17 - column: 0 + column: 19 end_location: row: 17 - column: 28 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 20 - column: 7 - end_location: - row: 20 - column: 11 - fix: - content: "import sys\nfrom unittest import mock" + column: 23 + fix: + content: "import contextlib, sys\nfrom unittest import mock" + location: + row: 17 + column: 0 + end_location: + row: 17 + column: 28 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 20 - column: 0 + column: 7 end_location: row: 20 - column: 16 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 24 - column: 0 - end_location: - row: 24 - column: 21 - fix: - content: from unittest import mock + column: 11 + fix: + content: "import sys\nfrom unittest import mock" + location: + row: 20 + column: 0 + end_location: + row: 20 + column: 16 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 24 column: 0 end_location: row: 24 column: 21 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 27 - column: 0 - end_location: - row: 32 - column: 1 - fix: - content: "from unittest.mock import (\n a,\n b,\n c,\n)\nfrom unittest import mock" + fix: + content: from unittest import mock + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 21 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 27 column: 0 end_location: row: 32 column: 1 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 33 - column: 0 - end_location: - row: 38 - column: 1 - fix: - content: "from unittest.mock import (\n a,\n b,\n c,\n)\nfrom unittest import mock" + fix: + content: "from unittest.mock import (\n a,\n b,\n c,\n)\nfrom unittest import mock" + location: + row: 27 + column: 0 + end_location: + row: 32 + column: 1 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 33 column: 0 end_location: row: 38 column: 1 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 41 - column: 0 - end_location: - row: 46 - column: 1 - fix: - content: "from unittest.mock import (\n a,\n b,\n c\n)\nfrom unittest import mock" + fix: + content: "from unittest.mock import (\n a,\n b,\n c,\n)\nfrom unittest import mock" + location: + row: 33 + column: 0 + end_location: + row: 38 + column: 1 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 41 column: 0 end_location: row: 46 column: 1 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 47 - column: 0 - end_location: - row: 52 - column: 1 - fix: - content: "from unittest.mock import (\n a,\n b,\n c\n)\nfrom unittest import mock" + fix: + content: "from unittest.mock import (\n a,\n b,\n c\n)\nfrom unittest import mock" + location: + row: 41 + column: 0 + end_location: + row: 46 + column: 1 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 47 column: 0 end_location: row: 52 column: 1 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 53 - column: 0 - end_location: - row: 53 - column: 30 - fix: - content: "from unittest.mock import a, b, c\nfrom unittest import mock" + fix: + content: "from unittest.mock import (\n a,\n b,\n c\n)\nfrom unittest import mock" + location: + row: 47 + column: 0 + end_location: + row: 52 + column: 1 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 53 column: 0 end_location: row: 53 column: 30 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 54 - column: 0 - end_location: - row: 54 - column: 30 - fix: - content: "from unittest.mock import a, b, c\nfrom unittest import mock" + fix: + content: "from unittest.mock import a, b, c\nfrom unittest import mock" + location: + row: 53 + column: 0 + end_location: + row: 53 + column: 30 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 54 column: 0 end_location: row: 54 column: 30 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 58 - column: 8 - end_location: - row: 63 - column: 9 - fix: - content: "from unittest.mock import (\n a,\n b,\n c\n )\n from unittest import mock" + fix: + content: "from unittest.mock import a, b, c\nfrom unittest import mock" + location: + row: 54 + column: 0 + end_location: + row: 54 + column: 30 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 58 column: 8 end_location: row: 63 column: 9 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 69 - column: 7 - end_location: - row: 69 - column: 11 - fix: - content: "from unittest import mock\nfrom unittest import mock" + fix: + content: "from unittest.mock import (\n a,\n b,\n c\n )\n from unittest import mock" + location: + row: 58 + column: 8 + end_location: + row: 63 + column: 9 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 69 - column: 0 + column: 7 end_location: row: 69 - column: 17 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 69 - column: 13 - end_location: - row: 69 - column: 17 - fix: - content: "from unittest import mock\nfrom unittest import mock" + column: 11 + fix: + content: "from unittest import mock\nfrom unittest import mock" + location: + row: 69 + column: 0 + end_location: + row: 69 + column: 17 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 69 - column: 0 + column: 13 end_location: row: 69 column: 17 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 72 - column: 7 - end_location: - row: 72 - column: 18 - fix: - content: from unittest import mock as foo + fix: + content: "from unittest import mock\nfrom unittest import mock" + location: + row: 69 + column: 0 + end_location: + row: 69 + column: 17 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 72 - column: 0 + column: 7 end_location: row: 72 column: 18 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 75 - column: 0 - end_location: - row: 75 - column: 28 - fix: - content: from unittest import mock as foo + fix: + content: from unittest import mock as foo + location: + row: 72 + column: 0 + end_location: + row: 72 + column: 18 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 75 column: 0 end_location: row: 75 column: 28 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 79 - column: 11 - end_location: - row: 79 - column: 22 - fix: - content: "from unittest import mock as foo\n from unittest import mock as bar\n from unittest import mock" + fix: + content: from unittest import mock as foo + location: + row: 75 + column: 0 + end_location: + row: 75 + column: 28 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 79 - column: 4 + column: 11 end_location: row: 79 - column: 41 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 79 - column: 24 - end_location: - row: 79 - column: 35 - fix: - content: "from unittest import mock as foo\n from unittest import mock as bar\n from unittest import mock" + column: 22 + fix: + content: "from unittest import mock as foo\n from unittest import mock as bar\n from unittest import mock" + location: + row: 79 + column: 4 + end_location: + row: 79 + column: 41 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 79 - column: 4 + column: 24 end_location: row: 79 - column: 41 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 79 - column: 37 - end_location: - row: 79 - column: 41 - fix: - content: "from unittest import mock as foo\n from unittest import mock as bar\n from unittest import mock" + column: 35 + fix: + content: "from unittest import mock as foo\n from unittest import mock as bar\n from unittest import mock" + location: + row: 79 + column: 4 + end_location: + row: 79 + column: 41 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 79 - column: 4 + column: 37 end_location: row: 79 column: 41 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 82 - column: 11 - end_location: - row: 82 - column: 22 - fix: - content: "import os\n from unittest import mock as foo\n from unittest import mock as bar\n from unittest import mock" + fix: + content: "from unittest import mock as foo\n from unittest import mock as bar\n from unittest import mock" + location: + row: 79 + column: 4 + end_location: + row: 79 + column: 41 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 82 - column: 4 + column: 11 end_location: row: 82 - column: 45 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 82 - column: 24 - end_location: - row: 82 - column: 35 - fix: - content: "import os\n from unittest import mock as foo\n from unittest import mock as bar\n from unittest import mock" + column: 22 + fix: + content: "import os\n from unittest import mock as foo\n from unittest import mock as bar\n from unittest import mock" + location: + row: 82 + column: 4 + end_location: + row: 82 + column: 45 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 82 - column: 4 + column: 24 end_location: row: 82 - column: 45 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 82 - column: 37 - end_location: - row: 82 - column: 41 - fix: - content: "import os\n from unittest import mock as foo\n from unittest import mock as bar\n from unittest import mock" + column: 35 + fix: + content: "import os\n from unittest import mock as foo\n from unittest import mock as bar\n from unittest import mock" + location: + row: 82 + column: 4 + end_location: + row: 82 + column: 45 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 82 - column: 4 + column: 37 end_location: row: 82 - column: 45 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Import from `unittest.mock` instead" - fixable: true - location: - row: 86 - column: 4 - end_location: - row: 86 - column: 51 - fix: - content: "from unittest import mock as foo\n from unittest import mock as bar\n from unittest import mock" + column: 41 + fix: + content: "import os\n from unittest import mock as foo\n from unittest import mock as bar\n from unittest import mock" + location: + row: 82 + column: 4 + end_location: + row: 82 + column: 45 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Import from `unittest.mock` instead" + fixable: true location: row: 86 column: 4 end_location: row: 86 column: 51 - parent: ~ -- kind: - name: RewriteMockImport - body: "`mock` is deprecated, use `unittest.mock`" - suggestion: "Replace `mock.mock` with `mock`" - fixable: true - location: - row: 93 - column: 4 - end_location: - row: 93 - column: 13 - fix: - content: mock + fix: + content: "from unittest import mock as foo\n from unittest import mock as bar\n from unittest import mock" + location: + row: 86 + column: 4 + end_location: + row: 86 + column: 51 + parent: ~ + - kind: + name: RewriteMockImport + body: "`mock` is deprecated, use `unittest.mock`" + suggestion: "Replace `mock.mock` with `mock`" + fixable: true location: row: 93 column: 4 end_location: row: 93 column: 13 - parent: ~ + fix: + content: mock + location: + row: 93 + column: 4 + end_location: + row: 93 + column: 13 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP027.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP027.py.snap index 5a57eb3217b500..f4bcfaea850f97 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP027.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP027.py.snap @@ -2,104 +2,104 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: RewriteListComprehension - body: Replace unpacked list comprehension with a generator expression - suggestion: Replace with generator expression - fixable: true - location: - row: 2 - column: 16 - end_location: - row: 2 - column: 38 - fix: - content: (fn(x) for x in items) +- - kind: + name: RewriteListComprehension + body: Replace unpacked list comprehension with a generator expression + suggestion: Replace with generator expression + fixable: true location: row: 2 column: 16 end_location: row: 2 column: 38 - parent: ~ -- kind: - name: RewriteListComprehension - body: Replace unpacked list comprehension with a generator expression - suggestion: Replace with generator expression - fixable: true - location: - row: 4 - column: 15 - end_location: - row: 4 - column: 37 - fix: - content: (fn(x) for x in items) + fix: + content: (fn(x) for x in items) + location: + row: 2 + column: 16 + end_location: + row: 2 + column: 38 + parent: ~ + - kind: + name: RewriteListComprehension + body: Replace unpacked list comprehension with a generator expression + suggestion: Replace with generator expression + fixable: true location: row: 4 column: 15 end_location: row: 4 column: 37 - parent: ~ -- kind: - name: RewriteListComprehension - body: Replace unpacked list comprehension with a generator expression - suggestion: Replace with generator expression - fixable: true - location: - row: 6 - column: 25 - end_location: - row: 6 - column: 47 - fix: - content: (fn(x) for x in items) + fix: + content: (fn(x) for x in items) + location: + row: 4 + column: 15 + end_location: + row: 4 + column: 37 + parent: ~ + - kind: + name: RewriteListComprehension + body: Replace unpacked list comprehension with a generator expression + suggestion: Replace with generator expression + fixable: true location: row: 6 column: 25 end_location: row: 6 column: 47 - parent: ~ -- kind: - name: RewriteListComprehension - body: Replace unpacked list comprehension with a generator expression - suggestion: Replace with generator expression - fixable: true - location: - row: 8 - column: 16 - end_location: - row: 8 - column: 51 - fix: - content: "([i for i in fn(x)] for x in items)" + fix: + content: (fn(x) for x in items) + location: + row: 6 + column: 25 + end_location: + row: 6 + column: 47 + parent: ~ + - kind: + name: RewriteListComprehension + body: Replace unpacked list comprehension with a generator expression + suggestion: Replace with generator expression + fixable: true location: row: 8 column: 16 end_location: row: 8 column: 51 - parent: ~ -- kind: - name: RewriteListComprehension - body: Replace unpacked list comprehension with a generator expression - suggestion: Replace with generator expression - fixable: true - location: - row: 10 - column: 16 - end_location: - row: 13 - column: 1 - fix: - content: "(\n fn(x)\n for x in items\n)" + fix: + content: "([i for i in fn(x)] for x in items)" + location: + row: 8 + column: 16 + end_location: + row: 8 + column: 51 + parent: ~ + - kind: + name: RewriteListComprehension + body: Replace unpacked list comprehension with a generator expression + suggestion: Replace with generator expression + fixable: true location: row: 10 column: 16 end_location: row: 13 column: 1 - parent: ~ + fix: + content: "(\n fn(x)\n for x in items\n)" + location: + row: 10 + column: 16 + end_location: + row: 13 + column: 1 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP028_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP028_0.py.snap index 812715bca034bf..04b85f52359c6c 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP028_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP028_0.py.snap @@ -2,244 +2,244 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: RewriteYieldFrom - body: "Replace `yield` over `for` loop with `yield from`" - suggestion: "Replace with `yield from`" - fixable: true - location: - row: 2 - column: 4 - end_location: - row: 3 - column: 15 - fix: - content: yield from y +- - kind: + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + suggestion: "Replace with `yield from`" + fixable: true location: row: 2 column: 4 end_location: row: 3 column: 15 - parent: ~ -- kind: - name: RewriteYieldFrom - body: "Replace `yield` over `for` loop with `yield from`" - suggestion: "Replace with `yield from`" - fixable: true - location: - row: 7 - column: 4 - end_location: - row: 8 - column: 20 - fix: - content: yield from z + fix: + content: yield from y + location: + row: 2 + column: 4 + end_location: + row: 3 + column: 15 + parent: ~ + - kind: + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + suggestion: "Replace with `yield from`" + fixable: true location: row: 7 column: 4 end_location: row: 8 column: 20 - parent: ~ -- kind: - name: RewriteYieldFrom - body: "Replace `yield` over `for` loop with `yield from`" - suggestion: "Replace with `yield from`" - fixable: true - location: - row: 12 - column: 4 - end_location: - row: 13 - column: 15 - fix: - content: "yield from [1, 2, 3]" + fix: + content: yield from z + location: + row: 7 + column: 4 + end_location: + row: 8 + column: 20 + parent: ~ + - kind: + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + suggestion: "Replace with `yield from`" + fixable: true location: row: 12 column: 4 end_location: row: 13 column: 15 - parent: ~ -- kind: - name: RewriteYieldFrom - body: "Replace `yield` over `for` loop with `yield from`" - suggestion: "Replace with `yield from`" - fixable: true - location: - row: 17 - column: 4 - end_location: - row: 18 - column: 15 - fix: - content: "yield from {x for x in y}" + fix: + content: "yield from [1, 2, 3]" + location: + row: 12 + column: 4 + end_location: + row: 13 + column: 15 + parent: ~ + - kind: + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + suggestion: "Replace with `yield from`" + fixable: true location: row: 17 column: 4 end_location: row: 18 column: 15 - parent: ~ -- kind: - name: RewriteYieldFrom - body: "Replace `yield` over `for` loop with `yield from`" - suggestion: "Replace with `yield from`" - fixable: true - location: - row: 22 - column: 4 - end_location: - row: 23 - column: 15 - fix: - content: "yield from (1, 2, 3)" + fix: + content: "yield from {x for x in y}" + location: + row: 17 + column: 4 + end_location: + row: 18 + column: 15 + parent: ~ + - kind: + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + suggestion: "Replace with `yield from`" + fixable: true location: row: 22 column: 4 end_location: row: 23 column: 15 - parent: ~ -- kind: - name: RewriteYieldFrom - body: "Replace `yield` over `for` loop with `yield from`" - suggestion: "Replace with `yield from`" - fixable: true - location: - row: 27 - column: 4 - end_location: - row: 28 - column: 18 - fix: - content: "yield from {3: \"x\", 6: \"y\"}" + fix: + content: "yield from (1, 2, 3)" + location: + row: 22 + column: 4 + end_location: + row: 23 + column: 15 + parent: ~ + - kind: + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + suggestion: "Replace with `yield from`" + fixable: true location: row: 27 column: 4 end_location: row: 28 column: 18 - parent: ~ -- kind: - name: RewriteYieldFrom - body: "Replace `yield` over `for` loop with `yield from`" - suggestion: "Replace with `yield from`" - fixable: true - location: - row: 33 - column: 4 - end_location: - row: 39 - column: 18 - fix: - content: "yield from { # Comment three\\n'\n 3: \"x\", # Comment four\\n'\n # Comment five\\n'\n 6: \"y\", # Comment six\\n'\n }" + fix: + content: "yield from {3: \"x\", 6: \"y\"}" + location: + row: 27 + column: 4 + end_location: + row: 28 + column: 18 + parent: ~ + - kind: + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + suggestion: "Replace with `yield from`" + fixable: true location: row: 33 column: 4 end_location: row: 39 column: 18 - parent: ~ -- kind: - name: RewriteYieldFrom - body: "Replace `yield` over `for` loop with `yield from`" - suggestion: "Replace with `yield from`" - fixable: true - location: - row: 44 - column: 4 - end_location: - row: 45 - column: 18 - fix: - content: "yield from [{3: (3, [44, \"long ss\"]), 6: \"y\"}]" + fix: + content: "yield from { # Comment three\\n'\n 3: \"x\", # Comment four\\n'\n # Comment five\\n'\n 6: \"y\", # Comment six\\n'\n }" + location: + row: 33 + column: 4 + end_location: + row: 39 + column: 18 + parent: ~ + - kind: + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + suggestion: "Replace with `yield from`" + fixable: true location: row: 44 column: 4 end_location: row: 45 column: 18 - parent: ~ -- kind: - name: RewriteYieldFrom - body: "Replace `yield` over `for` loop with `yield from`" - suggestion: "Replace with `yield from`" - fixable: true - location: - row: 49 - column: 4 - end_location: - row: 50 - column: 18 - fix: - content: yield from z() + fix: + content: "yield from [{3: (3, [44, \"long ss\"]), 6: \"y\"}]" + location: + row: 44 + column: 4 + end_location: + row: 45 + column: 18 + parent: ~ + - kind: + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + suggestion: "Replace with `yield from`" + fixable: true location: row: 49 column: 4 end_location: row: 50 column: 18 - parent: ~ -- kind: - name: RewriteYieldFrom - body: "Replace `yield` over `for` loop with `yield from`" - suggestion: "Replace with `yield from`" - fixable: true - location: - row: 55 - column: 8 - end_location: - row: 57 - column: 22 - fix: - content: yield from z() + fix: + content: yield from z() + location: + row: 49 + column: 4 + end_location: + row: 50 + column: 18 + parent: ~ + - kind: + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + suggestion: "Replace with `yield from`" + fixable: true location: row: 55 column: 8 end_location: row: 57 column: 22 - parent: ~ -- kind: - name: RewriteYieldFrom - body: "Replace `yield` over `for` loop with `yield from`" - suggestion: "Replace with `yield from`" - fixable: true - location: - row: 67 - column: 4 - end_location: - row: 68 - column: 15 - fix: - content: yield from x + fix: + content: yield from z() + location: + row: 55 + column: 8 + end_location: + row: 57 + column: 22 + parent: ~ + - kind: + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + suggestion: "Replace with `yield from`" + fixable: true location: row: 67 column: 4 end_location: row: 68 column: 15 - parent: ~ -- kind: - name: RewriteYieldFrom - body: "Replace `yield` over `for` loop with `yield from`" - suggestion: "Replace with `yield from`" - fixable: true - location: - row: 72 - column: 4 - end_location: - row: 73 - column: 18 - fix: - content: yield from z() + fix: + content: yield from x + location: + row: 67 + column: 4 + end_location: + row: 68 + column: 15 + parent: ~ + - kind: + name: RewriteYieldFrom + body: "Replace `yield` over `for` loop with `yield from`" + suggestion: "Replace with `yield from`" + fixable: true location: row: 72 column: 4 end_location: row: 73 column: 18 - parent: ~ + fix: + content: yield from z() + location: + row: 72 + column: 4 + end_location: + row: 73 + column: 18 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP028_1.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP028_1.py.snap index 0defbd08dc1d28..6ba64a58776454 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP028_1.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP028_1.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP029.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP029.py.snap index 3f58b4df1dc4d3..4183a4a7810448 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP029.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP029.py.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: UnnecessaryBuiltinImport - body: "Unnecessary builtin import: `*`" - suggestion: Remove unnecessary builtin import - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 22 - fix: - content: "" +- - kind: + name: UnnecessaryBuiltinImport + body: "Unnecessary builtin import: `*`" + suggestion: Remove unnecessary builtin import + fixable: true location: row: 1 column: 0 end_location: - row: 2 - column: 0 - parent: ~ -- kind: - name: UnnecessaryBuiltinImport - body: "Unnecessary builtin imports: `ascii`, `bytes`" - suggestion: Remove unnecessary builtin import - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 42 - fix: - content: from builtins import compile + row: 1 + column: 22 + fix: + content: "" + location: + row: 1 + column: 0 + end_location: + row: 2 + column: 0 + parent: ~ + - kind: + name: UnnecessaryBuiltinImport + body: "Unnecessary builtin imports: `ascii`, `bytes`" + suggestion: Remove unnecessary builtin import + fixable: true location: row: 2 column: 0 end_location: row: 2 column: 42 - parent: ~ -- kind: - name: UnnecessaryBuiltinImport - body: "Unnecessary builtin imports: `filter`, `zip`" - suggestion: Remove unnecessary builtin import - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 46 - fix: - content: from six.moves import zip_longest + fix: + content: from builtins import compile + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 42 + parent: ~ + - kind: + name: UnnecessaryBuiltinImport + body: "Unnecessary builtin imports: `filter`, `zip`" + suggestion: Remove unnecessary builtin import + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 46 - parent: ~ -- kind: - name: UnnecessaryBuiltinImport - body: "Unnecessary builtin import: `open`" - suggestion: Remove unnecessary builtin import - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 19 - fix: - content: "" + fix: + content: from six.moves import zip_longest + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 46 + parent: ~ + - kind: + name: UnnecessaryBuiltinImport + body: "Unnecessary builtin import: `open`" + suggestion: Remove unnecessary builtin import + fixable: true location: row: 5 column: 0 end_location: - row: 6 - column: 0 - parent: ~ + row: 5 + column: 19 + fix: + content: "" + location: + row: 5 + column: 0 + end_location: + row: 6 + column: 0 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_0.py.snap index 62691d7759e88d..fb9d16de230e95 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_0.py.snap @@ -2,223 +2,223 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 3 - column: 33 - fix: - content: "\"{}\" \"{}\" \"{}\".format(1, 2, 3)" +- - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 3 column: 0 end_location: row: 3 column: 33 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 7 - column: 1 - fix: - content: "\"a {} complicated {} string with {} {}\".format(\n \"fourth\", \"second\", \"first\", \"third\"\n)" + fix: + content: "\"{}\" \"{}\" \"{}\".format(1, 2, 3)" + location: + row: 3 + column: 0 + end_location: + row: 3 + column: 33 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 5 column: 0 end_location: row: 7 column: 1 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 15 - fix: - content: "'{}'.format(1)" + fix: + content: "\"a {} complicated {} string with {} {}\".format(\n \"fourth\", \"second\", \"first\", \"third\"\n)" + location: + row: 5 + column: 0 + end_location: + row: 7 + column: 1 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 9 column: 0 end_location: row: 9 column: 15 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 18 - fix: - content: "'{:x}'.format(30)" + fix: + content: "'{}'.format(1)" + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 15 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 11 column: 0 end_location: row: 11 column: 18 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 13 - column: 4 - end_location: - row: 13 - column: 19 - fix: - content: "'{}'.format(1)" + fix: + content: "'{:x}'.format(30)" + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 18 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 13 column: 4 end_location: row: 13 column: 19 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 15 - column: 0 - end_location: - row: 15 - column: 29 - fix: - content: "'''{}\\n{}\\n'''.format(1, 2)" + fix: + content: "'{}'.format(1)" + location: + row: 13 + column: 4 + end_location: + row: 13 + column: 19 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 15 column: 0 end_location: row: 15 column: 29 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 17 - column: 4 - end_location: - row: 18 - column: 26 - fix: - content: "\"foo {}\" \\\n \"bar {}\".format(1, 2)" + fix: + content: "'''{}\\n{}\\n'''.format(1, 2)" + location: + row: 15 + column: 0 + end_location: + row: 15 + column: 29 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 17 column: 4 end_location: row: 18 column: 26 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 20 - column: 0 - end_location: - row: 20 - column: 17 - fix: - content: "(\"{}\").format(1)" + fix: + content: "\"foo {}\" \\\n \"bar {}\".format(1, 2)" + location: + row: 17 + column: 4 + end_location: + row: 18 + column: 26 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 20 column: 0 end_location: row: 20 column: 17 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 22 - column: 0 - end_location: - row: 22 - column: 27 - fix: - content: "\"\\N{snowman} {}\".format(1)" + fix: + content: "(\"{}\").format(1)" + location: + row: 20 + column: 0 + end_location: + row: 20 + column: 17 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 22 column: 0 end_location: row: 22 column: 27 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 24 - column: 0 - end_location: - row: 24 - column: 18 - fix: ~ - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 29 - column: 4 - end_location: - row: 30 - column: 25 - fix: ~ - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 34 - column: 4 - end_location: - row: 35 - column: 25 - fix: ~ - parent: ~ + fix: + content: "\"\\N{snowman} {}\".format(1)" + location: + row: 22 + column: 0 + end_location: + row: 22 + column: 27 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 18 + fix: ~ + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true + location: + row: 29 + column: 4 + end_location: + row: 30 + column: 25 + fix: ~ + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true + location: + row: 34 + column: 4 + end_location: + row: 35 + column: 25 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_1.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_1.py.snap index 0defbd08dc1d28..6ba64a58776454 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_1.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_1.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_2.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_2.py.snap index e44af6bb77389a..e2f3e7f1df77b4 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_2.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_2.py.snap @@ -2,237 +2,237 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 19 - fix: - content: "\"{}\".format(*args)" +- - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 6 column: 0 end_location: row: 6 column: 19 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 22 - fix: - content: "\"{}\".format(**kwargs)" + fix: + content: "\"{}\".format(*args)" + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 19 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 8 column: 0 end_location: row: 8 column: 22 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 23 - fix: - content: "\"{}_{}\".format(*args)" + fix: + content: "\"{}\".format(**kwargs)" + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 22 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 10 column: 0 end_location: row: 10 column: 23 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 12 - column: 0 - end_location: - row: 12 - column: 26 - fix: - content: "\"{}_{}\".format(1, *args)" + fix: + content: "\"{}_{}\".format(*args)" + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 23 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 12 column: 0 end_location: row: 12 column: 26 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 14 - column: 0 - end_location: - row: 14 - column: 23 - fix: ~ - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 16 - column: 0 - end_location: - row: 16 - column: 26 - fix: - content: "\"{}_{}\".format(*args, 1)" + fix: + content: "\"{}_{}\".format(1, *args)" + location: + row: 12 + column: 0 + end_location: + row: 12 + column: 26 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true + location: + row: 14 + column: 0 + end_location: + row: 14 + column: 23 + fix: ~ + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 16 column: 0 end_location: row: 16 column: 26 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 18 - column: 0 - end_location: - row: 18 - column: 29 - fix: - content: "\"{}_{}\".format(1, 2, *args)" + fix: + content: "\"{}_{}\".format(*args, 1)" + location: + row: 16 + column: 0 + end_location: + row: 16 + column: 26 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 18 column: 0 end_location: row: 18 column: 29 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 20 - column: 0 - end_location: - row: 20 - column: 29 - fix: - content: "\"{}_{}\".format(*args, 1, 2)" + fix: + content: "\"{}_{}\".format(1, 2, *args)" + location: + row: 18 + column: 0 + end_location: + row: 18 + column: 29 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 20 column: 0 end_location: row: 20 column: 29 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 22 - column: 0 - end_location: - row: 22 - column: 33 - fix: - content: "\"{}_{}_{}\".format(1, **kwargs)" + fix: + content: "\"{}_{}\".format(*args, 1, 2)" + location: + row: 20 + column: 0 + end_location: + row: 20 + column: 29 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 22 column: 0 end_location: row: 22 column: 33 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 24 - column: 0 - end_location: - row: 24 - column: 36 - fix: - content: "\"{}_{}_{}\".format(1, 2, **kwargs)" + fix: + content: "\"{}_{}_{}\".format(1, **kwargs)" + location: + row: 22 + column: 0 + end_location: + row: 22 + column: 33 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 24 column: 0 end_location: row: 24 column: 36 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 26 - column: 0 - end_location: - row: 26 - column: 39 - fix: - content: "\"{}_{}_{}\".format(1, 2, 3, **kwargs)" + fix: + content: "\"{}_{}_{}\".format(1, 2, **kwargs)" + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 36 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 26 column: 0 end_location: row: 26 column: 39 - parent: ~ -- kind: - name: FormatLiterals - body: Use implicit references for positional format fields - suggestion: Remove explicit positional indexes - fixable: true - location: - row: 28 - column: 0 - end_location: - row: 28 - column: 46 - fix: - content: "\"{}_{}_{}\".format(1, 2, 3, *args, **kwargs)" + fix: + content: "\"{}_{}_{}\".format(1, 2, 3, **kwargs)" + location: + row: 26 + column: 0 + end_location: + row: 26 + column: 39 + parent: ~ + - kind: + name: FormatLiterals + body: Use implicit references for positional format fields + suggestion: Remove explicit positional indexes + fixable: true location: row: 28 column: 0 end_location: row: 28 column: 46 - parent: ~ + fix: + content: "\"{}_{}_{}\".format(1, 2, 3, *args, **kwargs)" + location: + row: 28 + column: 0 + end_location: + row: 28 + column: 46 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP031_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP031_0.py.snap index a6c4891fb90121..0665dac3420e23 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP031_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP031_0.py.snap @@ -2,604 +2,604 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 4 - column: 6 - end_location: - row: 4 - column: 22 - fix: - content: "'{} {}'.format(a, b)" +- - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 4 column: 6 end_location: row: 4 column: 22 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 6 - column: 6 - end_location: - row: 6 - column: 21 - fix: - content: "'{}{}'.format(a, b)" + fix: + content: "'{} {}'.format(a, b)" + location: + row: 4 + column: 6 + end_location: + row: 4 + column: 22 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 6 column: 6 end_location: row: 6 column: 21 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 8 - column: 6 - end_location: - row: 8 - column: 20 - fix: - content: "\"trivial\".format()" + fix: + content: "'{}{}'.format(a, b)" + location: + row: 6 + column: 6 + end_location: + row: 6 + column: 21 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 8 column: 6 end_location: row: 8 column: 20 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 10 - column: 6 - end_location: - row: 10 - column: 24 - fix: - content: "\"{}\".format(\"simple\")" + fix: + content: "\"trivial\".format()" + location: + row: 8 + column: 6 + end_location: + row: 8 + column: 20 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 10 column: 6 end_location: row: 10 column: 24 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 12 - column: 6 - end_location: - row: 12 - column: 34 - fix: - content: "\"{}\".format(\"%s\" % (\"nested\",))" + fix: + content: "\"{}\".format(\"simple\")" + location: + row: 10 + column: 6 + end_location: + row: 10 + column: 24 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 12 column: 6 end_location: row: 12 column: 34 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 12 - column: 14 - end_location: - row: 12 - column: 32 - fix: - content: "\"{}\".format(\"nested\")" + fix: + content: "\"{}\".format(\"%s\" % (\"nested\",))" + location: + row: 12 + column: 6 + end_location: + row: 12 + column: 34 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 12 column: 14 end_location: row: 12 column: 32 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 12 - column: 18 - end_location: - row: 12 - column: 36 - fix: - content: "\"{}\".format(\"nested\")" - location: - row: 12 - column: 18 - end_location: - row: 12 - column: 36 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 14 - column: 6 - end_location: - row: 14 - column: 28 - fix: - content: "\"{}% percent\".format(15)" + fix: + content: "\"{}\".format(\"nested\")" + location: + row: 12 + column: 14 + end_location: + row: 12 + column: 32 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 14 column: 6 end_location: row: 14 column: 28 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 16 - column: 6 - end_location: - row: 16 - column: 18 - fix: - content: "\"{:f}\".format(15)" + fix: + content: "\"{}% percent\".format(15)" + location: + row: 14 + column: 6 + end_location: + row: 14 + column: 28 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 16 column: 6 end_location: row: 16 column: 18 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 18 - column: 6 - end_location: - row: 18 - column: 19 - fix: - content: "\"{:.0f}\".format(15)" + fix: + content: "\"{:f}\".format(15)" + location: + row: 16 + column: 6 + end_location: + row: 16 + column: 18 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 18 column: 6 end_location: row: 18 column: 19 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 20 - column: 6 - end_location: - row: 20 - column: 20 - fix: - content: "\"{:.3f}\".format(15)" + fix: + content: "\"{:.0f}\".format(15)" + location: + row: 18 + column: 6 + end_location: + row: 18 + column: 19 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 20 column: 6 end_location: row: 20 column: 20 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 22 - column: 6 - end_location: - row: 22 - column: 19 - fix: - content: "\"{:3f}\".format(15)" + fix: + content: "\"{:.3f}\".format(15)" + location: + row: 20 + column: 6 + end_location: + row: 20 + column: 20 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 22 column: 6 end_location: row: 22 column: 19 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 24 - column: 6 - end_location: - row: 24 - column: 19 - fix: - content: "\"{:<5f}\".format(5)" + fix: + content: "\"{:3f}\".format(15)" + location: + row: 22 + column: 6 + end_location: + row: 22 + column: 19 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 24 column: 6 end_location: row: 24 column: 19 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 26 - column: 6 - end_location: - row: 26 - column: 18 - fix: - content: "\"{:9f}\".format(5)" + fix: + content: "\"{:<5f}\".format(5)" + location: + row: 24 + column: 6 + end_location: + row: 24 + column: 19 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 26 column: 6 end_location: row: 26 column: 18 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 28 - column: 6 - end_location: - row: 28 - column: 20 - fix: - content: "\"{:#o}\".format(123)" + fix: + content: "\"{:9f}\".format(5)" + location: + row: 26 + column: 6 + end_location: + row: 26 + column: 18 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 28 column: 6 end_location: row: 28 column: 20 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 30 - column: 6 - end_location: - row: 30 - column: 26 - fix: - content: "\"brace {{}} {}\".format(1)" + fix: + content: "\"{:#o}\".format(123)" + location: + row: 28 + column: 6 + end_location: + row: 28 + column: 20 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 30 column: 6 end_location: row: 30 column: 26 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 33 - column: 2 - end_location: - row: 35 - column: 9 - fix: - content: "\"{}\".format(\n \"trailing comma\",\n )" + fix: + content: "\"brace {{}} {}\".format(1)" + location: + row: 30 + column: 6 + end_location: + row: 30 + column: 26 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 33 column: 2 end_location: row: 35 column: 9 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 38 - column: 6 - end_location: - row: 38 - column: 22 - fix: - content: "\"foo {} \".format(x)" + fix: + content: "\"{}\".format(\n \"trailing comma\",\n )" + location: + row: 33 + column: 2 + end_location: + row: 35 + column: 9 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 38 column: 6 end_location: row: 38 column: 22 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 40 - column: 6 - end_location: - row: 40 - column: 26 - fix: - content: "\"{k}\".format(k=\"v\")" + fix: + content: "\"foo {} \".format(x)" + location: + row: 38 + column: 6 + end_location: + row: 38 + column: 22 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 40 column: 6 end_location: row: 40 column: 26 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 42 - column: 6 - end_location: - row: 45 - column: 1 - fix: - content: "\"{k}\".format(\n k=\"v\",\n i=\"j\",\n)" + fix: + content: "\"{k}\".format(k=\"v\")" + location: + row: 40 + column: 6 + end_location: + row: 40 + column: 26 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 42 column: 6 end_location: row: 45 column: 1 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 47 - column: 6 - end_location: - row: 47 - column: 37 - fix: - content: "\"{to_list}\".format(to_list=[])" + fix: + content: "\"{k}\".format(\n k=\"v\",\n i=\"j\",\n)" + location: + row: 42 + column: 6 + end_location: + row: 45 + column: 1 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 47 column: 6 end_location: row: 47 column: 37 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 49 - column: 6 - end_location: - row: 49 - column: 43 - fix: - content: "\"{k}\".format(k=\"v\", i=1, j=[])" + fix: + content: "\"{to_list}\".format(to_list=[])" + location: + row: 47 + column: 6 + end_location: + row: 47 + column: 37 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 49 column: 6 end_location: row: 49 column: 43 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 51 - column: 6 - end_location: - row: 51 - column: 29 - fix: - content: "\"{ab}\".format(ab=1)" + fix: + content: "\"{k}\".format(k=\"v\", i=1, j=[])" + location: + row: 49 + column: 6 + end_location: + row: 49 + column: 43 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 51 column: 6 end_location: row: 51 column: 29 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 53 - column: 6 - end_location: - row: 53 - column: 27 - fix: - content: "\"{a}\".format(a=1)" + fix: + content: "\"{ab}\".format(ab=1)" + location: + row: 51 + column: 6 + end_location: + row: 51 + column: 29 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 53 column: 6 end_location: row: 53 column: 27 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 56 - column: 4 - end_location: - row: 57 - column: 21 - fix: - content: "\"foo {} \"\n \"bar {}\".format(x, y)" + fix: + content: "\"{a}\".format(a=1)" + location: + row: 53 + column: 6 + end_location: + row: 53 + column: 27 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 56 column: 4 end_location: row: 57 column: 21 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 61 - column: 4 - end_location: - row: 62 - column: 40 - fix: - content: "\"foo {foo} \"\n \"bar {bar}\".format(foo=x, bar=y)" + fix: + content: "\"foo {} \"\n \"bar {}\".format(x, y)" + location: + row: 56 + column: 4 + end_location: + row: 57 + column: 21 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 61 column: 4 end_location: row: 62 column: 40 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 67 - column: 4 - end_location: - row: 68 - column: 37 - fix: - content: "\"foo {foo} \"\n \"bar {bar}\".format(foo=x, **bar)" + fix: + content: "\"foo {foo} \"\n \"bar {bar}\".format(foo=x, bar=y)" + location: + row: 61 + column: 4 + end_location: + row: 62 + column: 40 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 67 column: 4 end_location: row: 68 column: 37 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 71 - column: 6 - end_location: - row: 71 - column: 29 - fix: - content: "\"{} \\N{snowman}\".format(a)" + fix: + content: "\"foo {foo} \"\n \"bar {bar}\".format(foo=x, **bar)" + location: + row: 67 + column: 4 + end_location: + row: 68 + column: 37 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 71 column: 6 end_location: row: 71 column: 29 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 73 - column: 6 - end_location: - row: 73 - column: 40 - fix: - content: "\"{foo} \\N{snowman}\".format(foo=1)" + fix: + content: "\"{} \\N{snowman}\".format(a)" + location: + row: 71 + column: 6 + end_location: + row: 71 + column: 29 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 73 column: 6 end_location: row: 73 column: 40 - parent: ~ -- kind: - name: PrintfStringFormatting - body: Use format specifiers instead of percent format - suggestion: Replace with format specifiers - fixable: true - location: - row: 75 - column: 6 - end_location: - row: 75 - column: 35 - fix: - content: "(\"foo {} \" \"bar {}\").format(x, y)" + fix: + content: "\"{foo} \\N{snowman}\".format(foo=1)" + location: + row: 73 + column: 6 + end_location: + row: 73 + column: 40 + parent: ~ + - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true location: row: 75 column: 6 end_location: row: 75 column: 35 - parent: ~ + fix: + content: "(\"foo {} \" \"bar {}\").format(x, y)" + location: + row: 75 + column: 6 + end_location: + row: 75 + column: 35 + parent: ~ +- - kind: + name: PrintfStringFormatting + body: Use format specifiers instead of percent format + suggestion: Replace with format specifiers + fixable: true + location: + row: 12 + column: 18 + end_location: + row: 12 + column: 36 + fix: + content: "\"{}\".format(\"nested\")" + location: + row: 12 + column: 18 + end_location: + row: 12 + column: 36 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP031_1.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP031_1.py.snap index 0defbd08dc1d28..6ba64a58776454 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP031_1.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP031_1.py.snap @@ -2,5 +2,5 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP032.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP032.py.snap index 42ac7606a19198..15fdbb8179b327 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP032.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP032.py.snap @@ -2,444 +2,444 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 5 - column: 0 - end_location: - row: 5 - column: 20 - fix: - content: "f\"{a} {b}\"" +- - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 5 column: 0 end_location: row: 5 column: 20 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 7 - column: 0 - end_location: - row: 7 - column: 22 - fix: - content: "f\"{b} {a}\"" + fix: + content: "f\"{a} {b}\"" + location: + row: 5 + column: 0 + end_location: + row: 5 + column: 20 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 7 column: 0 end_location: row: 7 column: 22 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 19 - fix: - content: "f\"{z.y}\"" + fix: + content: "f\"{b} {a}\"" + location: + row: 7 + column: 0 + end_location: + row: 7 + column: 22 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 9 column: 0 end_location: row: 9 column: 19 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 11 - column: 0 - end_location: - row: 11 - column: 24 - fix: - content: "f\"{a.x} {b.y}\"" + fix: + content: "f\"{z.y}\"" + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 19 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 11 column: 0 end_location: row: 11 column: 24 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 24 - fix: - content: "f\"{a.b} {c.d}\"" + fix: + content: "f\"{a.x} {b.y}\"" + location: + row: 11 + column: 0 + end_location: + row: 11 + column: 24 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 13 column: 0 end_location: row: 13 column: 24 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 15 - column: 0 - end_location: - row: 15 - column: 16 - fix: - content: "f\"{a()}\"" + fix: + content: "f\"{a.b} {c.d}\"" + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 24 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 15 column: 0 end_location: row: 15 column: 16 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 17 - column: 0 - end_location: - row: 17 - column: 18 - fix: - content: "f\"{a.b()}\"" + fix: + content: "f\"{a()}\"" + location: + row: 15 + column: 0 + end_location: + row: 15 + column: 16 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 17 column: 0 end_location: row: 17 column: 18 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 19 - column: 0 - end_location: - row: 19 - column: 22 - fix: - content: "f\"{a.b().c()}\"" + fix: + content: "f\"{a.b()}\"" + location: + row: 17 + column: 0 + end_location: + row: 17 + column: 18 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 19 column: 0 end_location: row: 19 column: 22 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 21 - column: 0 - end_location: - row: 21 - column: 24 - fix: - content: "f\"hello {name}!\"" + fix: + content: "f\"{a.b().c()}\"" + location: + row: 19 + column: 0 + end_location: + row: 19 + column: 22 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 21 column: 0 end_location: row: 21 column: 24 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 23 - column: 0 - end_location: - row: 23 - column: 27 - fix: - content: "f\"{a}{b}{c}\"" + fix: + content: "f\"hello {name}!\"" + location: + row: 21 + column: 0 + end_location: + row: 21 + column: 24 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 23 column: 0 end_location: row: 23 column: 27 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 25 - column: 0 - end_location: - row: 25 - column: 16 - fix: - content: "f\"{0x0}\"" + fix: + content: "f\"{a}{b}{c}\"" + location: + row: 23 + column: 0 + end_location: + row: 23 + column: 27 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 25 column: 0 end_location: row: 25 column: 16 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 27 - column: 0 - end_location: - row: 27 - column: 20 - fix: - content: "f\"{a} {b}\"" + fix: + content: "f\"{0x0}\"" + location: + row: 25 + column: 0 + end_location: + row: 25 + column: 16 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 27 column: 0 end_location: row: 27 column: 20 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 29 - column: 0 - end_location: - row: 29 - column: 24 - fix: - content: "f\"\"\"{a} {b}\"\"\"" + fix: + content: "f\"{a} {b}\"" + location: + row: 27 + column: 0 + end_location: + row: 27 + column: 20 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 29 column: 0 end_location: row: 29 column: 24 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 31 - column: 0 - end_location: - row: 31 - column: 17 - fix: - content: "f\"foo{1}\"" + fix: + content: "f\"\"\"{a} {b}\"\"\"" + location: + row: 29 + column: 0 + end_location: + row: 29 + column: 24 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 31 column: 0 end_location: row: 31 column: 17 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 33 - column: 0 - end_location: - row: 33 - column: 18 - fix: - content: "fr\"foo{1}\"" + fix: + content: "f\"foo{1}\"" + location: + row: 31 + column: 0 + end_location: + row: 31 + column: 17 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 33 column: 0 end_location: row: 33 column: 18 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 35 - column: 4 - end_location: - row: 35 - column: 21 - fix: - content: "f\"{1}\"" + fix: + content: "fr\"foo{1}\"" + location: + row: 33 + column: 0 + end_location: + row: 33 + column: 18 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 35 column: 4 end_location: row: 35 column: 21 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 37 - column: 6 - end_location: - row: 37 - column: 25 - fix: - content: "f\"foo {x} \"" + fix: + content: "f\"{1}\"" + location: + row: 35 + column: 4 + end_location: + row: 35 + column: 21 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 37 column: 6 end_location: row: 37 column: 25 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 39 - column: 0 - end_location: - row: 39 - column: 20 - fix: - content: "f\"{a[b]}\"" + fix: + content: "f\"foo {x} \"" + location: + row: 37 + column: 6 + end_location: + row: 37 + column: 25 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 39 column: 0 end_location: row: 39 column: 20 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 41 - column: 0 - end_location: - row: 41 - column: 22 - fix: - content: "f\"{a.a[b]}\"" + fix: + content: "f\"{a[b]}\"" + location: + row: 39 + column: 0 + end_location: + row: 39 + column: 20 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 41 column: 0 end_location: row: 41 column: 22 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 43 - column: 0 - end_location: - row: 43 - column: 29 - fix: - content: "f\"{escaped}{{}}{y}\"" + fix: + content: "f\"{a.a[b]}\"" + location: + row: 41 + column: 0 + end_location: + row: 41 + column: 22 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 43 column: 0 end_location: row: 43 column: 29 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 45 - column: 0 - end_location: - row: 45 - column: 14 - fix: - content: "f\"{a}\"" + fix: + content: "f\"{escaped}{{}}{y}\"" + location: + row: 43 + column: 0 + end_location: + row: 43 + column: 29 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 45 column: 0 end_location: row: 45 column: 14 - parent: ~ -- kind: - name: FString - body: "Use f-string instead of `format` call" - suggestion: Convert to f-string - fixable: true - location: - row: 47 - column: 0 - end_location: - row: 47 - column: 24 - fix: - content: "f'({a}={{0!e}})'" + fix: + content: "f\"{a}\"" + location: + row: 45 + column: 0 + end_location: + row: 45 + column: 14 + parent: ~ + - kind: + name: FString + body: "Use f-string instead of `format` call" + suggestion: Convert to f-string + fixable: true location: row: 47 column: 0 end_location: row: 47 column: 24 - parent: ~ + fix: + content: "f'({a}={{0!e}})'" + location: + row: 47 + column: 0 + end_location: + row: 47 + column: 24 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP033.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP033.py.snap index 16ffe9abf35525..9eb52ba4e7b32f 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP033.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP033.py.snap @@ -2,77 +2,77 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: FunctoolsCache - body: "Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)`" - suggestion: "Rewrite with `@functools.cache" - fixable: true - location: - row: 5 - column: 20 - end_location: - row: 5 - column: 34 - fix: - content: functools.cache +- - kind: + name: FunctoolsCache + body: "Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)`" + suggestion: "Rewrite with `@functools.cache" + fixable: true location: row: 5 - column: 1 + column: 20 end_location: row: 5 column: 34 - parent: ~ -- kind: - name: FunctoolsCache - body: "Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)`" - suggestion: "Rewrite with `@functools.cache" - fixable: true - location: - row: 10 - column: 10 - end_location: - row: 10 - column: 24 - fix: ~ - parent: ~ -- kind: - name: FunctoolsCache - body: "Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)`" - suggestion: "Rewrite with `@functools.cache" - fixable: true - location: - row: 16 - column: 20 - end_location: - row: 16 - column: 34 - fix: - content: functools.cache + fix: + content: functools.cache + location: + row: 5 + column: 1 + end_location: + row: 5 + column: 34 + parent: ~ + - kind: + name: FunctoolsCache + body: "Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)`" + suggestion: "Rewrite with `@functools.cache" + fixable: true + location: + row: 10 + column: 10 + end_location: + row: 10 + column: 24 + fix: ~ + parent: ~ + - kind: + name: FunctoolsCache + body: "Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)`" + suggestion: "Rewrite with `@functools.cache" + fixable: true location: row: 16 - column: 1 + column: 20 end_location: row: 16 column: 34 - parent: ~ -- kind: - name: FunctoolsCache - body: "Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)`" - suggestion: "Rewrite with `@functools.cache" - fixable: true - location: - row: 21 - column: 20 - end_location: - row: 21 - column: 34 - fix: - content: functools.cache + fix: + content: functools.cache + location: + row: 16 + column: 1 + end_location: + row: 16 + column: 34 + parent: ~ + - kind: + name: FunctoolsCache + body: "Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)`" + suggestion: "Rewrite with `@functools.cache" + fixable: true location: row: 21 - column: 1 + column: 20 end_location: row: 21 column: 34 - parent: ~ + fix: + content: functools.cache + location: + row: 21 + column: 1 + end_location: + row: 21 + column: 34 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP034.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP034.py.snap index 8a700ea1e494f7..dcd282bb4fba46 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP034.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP034.py.snap @@ -2,264 +2,264 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: ExtraneousParentheses - body: Avoid extraneous parentheses - suggestion: Remove extraneous parentheses - fixable: true - location: - row: 2 - column: 6 - end_location: - row: 2 - column: 13 - fix: - content: "\"foo\"" +- - kind: + name: ExtraneousParentheses + body: Avoid extraneous parentheses + suggestion: Remove extraneous parentheses + fixable: true location: row: 2 column: 6 end_location: row: 2 column: 13 - parent: ~ -- kind: - name: ExtraneousParentheses - body: Avoid extraneous parentheses - suggestion: Remove extraneous parentheses - fixable: true - location: - row: 5 - column: 6 - end_location: - row: 5 - column: 26 - fix: - content: "\"hell((goodybe))o\"" + fix: + content: "\"foo\"" + location: + row: 2 + column: 6 + end_location: + row: 2 + column: 13 + parent: ~ + - kind: + name: ExtraneousParentheses + body: Avoid extraneous parentheses + suggestion: Remove extraneous parentheses + fixable: true location: row: 5 column: 6 end_location: row: 5 column: 26 - parent: ~ -- kind: - name: ExtraneousParentheses - body: Avoid extraneous parentheses - suggestion: Remove extraneous parentheses - fixable: true - location: - row: 8 - column: 6 - end_location: - row: 8 - column: 15 - fix: - content: "(\"foo\")" + fix: + content: "\"hell((goodybe))o\"" + location: + row: 5 + column: 6 + end_location: + row: 5 + column: 26 + parent: ~ + - kind: + name: ExtraneousParentheses + body: Avoid extraneous parentheses + suggestion: Remove extraneous parentheses + fixable: true location: row: 8 column: 6 end_location: row: 8 column: 15 - parent: ~ -- kind: - name: ExtraneousParentheses - body: Avoid extraneous parentheses - suggestion: Remove extraneous parentheses - fixable: true - location: - row: 8 - column: 6 - end_location: - row: 8 - column: 13 - fix: - content: "\"foo\"" - location: - row: 8 - column: 6 - end_location: - row: 8 - column: 13 - parent: ~ -- kind: - name: ExtraneousParentheses - body: Avoid extraneous parentheses - suggestion: Remove extraneous parentheses - fixable: true - location: - row: 11 - column: 6 - end_location: - row: 11 - column: 13 - fix: - content: ((1)) + fix: + content: "(\"foo\")" + location: + row: 8 + column: 6 + end_location: + row: 8 + column: 15 + parent: ~ + - kind: + name: ExtraneousParentheses + body: Avoid extraneous parentheses + suggestion: Remove extraneous parentheses + fixable: true location: row: 11 column: 6 end_location: row: 11 column: 13 - parent: ~ -- kind: - name: ExtraneousParentheses - body: Avoid extraneous parentheses - suggestion: Remove extraneous parentheses - fixable: true - location: - row: 11 - column: 6 - end_location: - row: 11 - column: 11 - fix: - content: (1) - location: - row: 11 - column: 6 - end_location: - row: 11 - column: 11 - parent: ~ -- kind: - name: ExtraneousParentheses - body: Avoid extraneous parentheses - suggestion: Remove extraneous parentheses - fixable: true - location: - row: 11 - column: 6 - end_location: - row: 11 - column: 9 - fix: - content: "1" - location: - row: 11 - column: 6 - end_location: - row: 11 - column: 9 - parent: ~ -- kind: - name: ExtraneousParentheses - body: Avoid extraneous parentheses - suggestion: Remove extraneous parentheses - fixable: true - location: - row: 14 - column: 6 - end_location: - row: 14 - column: 25 - fix: - content: "\"foo{}\".format(1)" + fix: + content: ((1)) + location: + row: 11 + column: 6 + end_location: + row: 11 + column: 13 + parent: ~ + - kind: + name: ExtraneousParentheses + body: Avoid extraneous parentheses + suggestion: Remove extraneous parentheses + fixable: true location: row: 14 column: 6 end_location: row: 14 column: 25 - parent: ~ -- kind: - name: ExtraneousParentheses - body: Avoid extraneous parentheses - suggestion: Remove extraneous parentheses - fixable: true - location: - row: 18 - column: 4 - end_location: - row: 18 - column: 23 - fix: - content: "\"foo{}\".format(1)" + fix: + content: "\"foo{}\".format(1)" + location: + row: 14 + column: 6 + end_location: + row: 14 + column: 25 + parent: ~ + - kind: + name: ExtraneousParentheses + body: Avoid extraneous parentheses + suggestion: Remove extraneous parentheses + fixable: true location: row: 18 column: 4 end_location: row: 18 column: 23 - parent: ~ -- kind: - name: ExtraneousParentheses - body: Avoid extraneous parentheses - suggestion: Remove extraneous parentheses - fixable: true - location: - row: 23 - column: 4 - end_location: - row: 25 - column: 5 - fix: - content: "\n \"foo\"\n " + fix: + content: "\"foo{}\".format(1)" + location: + row: 18 + column: 4 + end_location: + row: 18 + column: 23 + parent: ~ + - kind: + name: ExtraneousParentheses + body: Avoid extraneous parentheses + suggestion: Remove extraneous parentheses + fixable: true location: row: 23 column: 4 end_location: row: 25 column: 5 - parent: ~ -- kind: - name: ExtraneousParentheses - body: Avoid extraneous parentheses - suggestion: Remove extraneous parentheses - fixable: true - location: - row: 30 - column: 12 - end_location: - row: 30 - column: 23 - fix: - content: (yield 1) + fix: + content: "\n \"foo\"\n " + location: + row: 23 + column: 4 + end_location: + row: 25 + column: 5 + parent: ~ + - kind: + name: ExtraneousParentheses + body: Avoid extraneous parentheses + suggestion: Remove extraneous parentheses + fixable: true location: row: 30 column: 12 end_location: row: 30 column: 23 - parent: ~ -- kind: - name: ExtraneousParentheses - body: Avoid extraneous parentheses - suggestion: Remove extraneous parentheses - fixable: true - location: - row: 35 - column: 8 - end_location: - row: 35 - column: 27 - fix: - content: "\"foo{}\".format(1)" + fix: + content: (yield 1) + location: + row: 30 + column: 12 + end_location: + row: 30 + column: 23 + parent: ~ + - kind: + name: ExtraneousParentheses + body: Avoid extraneous parentheses + suggestion: Remove extraneous parentheses + fixable: true location: row: 35 column: 8 end_location: row: 35 column: 27 - parent: ~ -- kind: - name: ExtraneousParentheses - body: Avoid extraneous parentheses - suggestion: Remove extraneous parentheses - fixable: true - location: - row: 39 - column: 6 - end_location: - row: 39 - column: 27 - fix: - content: x for x in range(3) + fix: + content: "\"foo{}\".format(1)" + location: + row: 35 + column: 8 + end_location: + row: 35 + column: 27 + parent: ~ + - kind: + name: ExtraneousParentheses + body: Avoid extraneous parentheses + suggestion: Remove extraneous parentheses + fixable: true location: row: 39 column: 6 end_location: row: 39 column: 27 - parent: ~ + fix: + content: x for x in range(3) + location: + row: 39 + column: 6 + end_location: + row: 39 + column: 27 + parent: ~ +- - kind: + name: ExtraneousParentheses + body: Avoid extraneous parentheses + suggestion: Remove extraneous parentheses + fixable: true + location: + row: 8 + column: 6 + end_location: + row: 8 + column: 13 + fix: + content: "\"foo\"" + location: + row: 8 + column: 6 + end_location: + row: 8 + column: 13 + parent: ~ + - kind: + name: ExtraneousParentheses + body: Avoid extraneous parentheses + suggestion: Remove extraneous parentheses + fixable: true + location: + row: 11 + column: 6 + end_location: + row: 11 + column: 11 + fix: + content: (1) + location: + row: 11 + column: 6 + end_location: + row: 11 + column: 11 + parent: ~ +- - kind: + name: ExtraneousParentheses + body: Avoid extraneous parentheses + suggestion: Remove extraneous parentheses + fixable: true + location: + row: 11 + column: 6 + end_location: + row: 11 + column: 9 + fix: + content: "1" + location: + row: 11 + column: 6 + end_location: + row: 11 + column: 9 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP035.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP035.py.snap index fb96ba7212b387..729ad05eec01c0 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP035.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP035.py.snap @@ -2,612 +2,612 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`" - suggestion: "Import from `collections.abc`" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 31 - fix: - content: from collections.abc import Mapping +- - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`" + suggestion: "Import from `collections.abc`" + fixable: true location: row: 2 column: 0 end_location: row: 2 column: 31 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`" - suggestion: "Import from `collections.abc`" - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 4 - column: 38 - fix: - content: from collections.abc import Mapping as MAP + fix: + content: from collections.abc import Mapping + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 31 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`" + suggestion: "Import from `collections.abc`" + fixable: true location: row: 4 column: 0 end_location: row: 4 column: 38 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`, `Sequence`" - suggestion: "Import from `collections.abc`" - fixable: true - location: - row: 6 - column: 0 - end_location: - row: 6 - column: 41 - fix: - content: "from collections.abc import Mapping, Sequence" + fix: + content: from collections.abc import Mapping as MAP + location: + row: 4 + column: 0 + end_location: + row: 4 + column: 38 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`, `Sequence`" + suggestion: "Import from `collections.abc`" + fixable: true location: row: 6 column: 0 end_location: row: 6 column: 41 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`" - suggestion: "Import from `collections.abc`" - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 40 - fix: - content: "from collections import Counter\nfrom collections.abc import Mapping" + fix: + content: "from collections.abc import Mapping, Sequence" + location: + row: 6 + column: 0 + end_location: + row: 6 + column: 41 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`" + suggestion: "Import from `collections.abc`" + fixable: true location: row: 8 column: 0 end_location: row: 8 column: 40 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`" - suggestion: "Import from `collections.abc`" - fixable: true - location: - row: 10 - column: 0 - end_location: - row: 10 - column: 42 - fix: - content: "from collections import (Counter)\nfrom collections.abc import Mapping" + fix: + content: "from collections import Counter\nfrom collections.abc import Mapping" + location: + row: 8 + column: 0 + end_location: + row: 8 + column: 40 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`" + suggestion: "Import from `collections.abc`" + fixable: true location: row: 10 column: 0 end_location: row: 10 column: 42 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`" - suggestion: "Import from `collections.abc`" - fixable: true - location: - row: 12 - column: 0 - end_location: - row: 13 - column: 33 - fix: - content: "from collections import (Counter)\nfrom collections.abc import Mapping" + fix: + content: "from collections import (Counter)\nfrom collections.abc import Mapping" + location: + row: 10 + column: 0 + end_location: + row: 10 + column: 42 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`" + suggestion: "Import from `collections.abc`" + fixable: true location: row: 12 column: 0 end_location: row: 13 column: 33 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`" - suggestion: "Import from `collections.abc`" - fixable: true - location: - row: 15 - column: 0 - end_location: - row: 16 - column: 32 - fix: - content: "from collections import Counter\nfrom collections.abc import Mapping" + fix: + content: "from collections import (Counter)\nfrom collections.abc import Mapping" + location: + row: 12 + column: 0 + end_location: + row: 13 + column: 33 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`" + suggestion: "Import from `collections.abc`" + fixable: true location: row: 15 column: 0 end_location: row: 16 column: 32 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`, `Sequence`" - suggestion: "Import from `collections.abc`" - fixable: true - location: - row: 18 - column: 0 - end_location: - row: 18 - column: 50 - fix: - content: "from collections import Counter\nfrom collections.abc import Mapping, Sequence" + fix: + content: "from collections import Counter\nfrom collections.abc import Mapping" + location: + row: 15 + column: 0 + end_location: + row: 16 + column: 32 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`, `Sequence`" + suggestion: "Import from `collections.abc`" + fixable: true location: row: 18 column: 0 end_location: row: 18 column: 50 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`" - suggestion: "Import from `collections.abc`" - fixable: true - location: - row: 20 - column: 0 - end_location: - row: 20 - column: 51 - fix: - content: "from collections import Counter\nfrom collections.abc import Mapping as mapping" + fix: + content: "from collections import Counter\nfrom collections.abc import Mapping, Sequence" + location: + row: 18 + column: 0 + end_location: + row: 18 + column: 50 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`" + suggestion: "Import from `collections.abc`" + fixable: true location: row: 20 column: 0 end_location: row: 20 column: 51 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`" - suggestion: "Import from `collections.abc`" - fixable: true - location: - row: 23 - column: 4 - end_location: - row: 23 - column: 44 - fix: - content: "from collections import Counter\n from collections.abc import Mapping" + fix: + content: "from collections import Counter\nfrom collections.abc import Mapping as mapping" + location: + row: 20 + column: 0 + end_location: + row: 20 + column: 51 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`" + suggestion: "Import from `collections.abc`" + fixable: true location: row: 23 column: 4 end_location: row: 23 column: 44 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`" - suggestion: "Import from `collections.abc`" - fixable: true - location: - row: 28 - column: 4 - end_location: - row: 28 - column: 44 - fix: - content: "from collections import Counter\n from collections.abc import Mapping" + fix: + content: "from collections import Counter\n from collections.abc import Mapping" + location: + row: 23 + column: 4 + end_location: + row: 23 + column: 44 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`" + suggestion: "Import from `collections.abc`" + fixable: true location: row: 28 column: 4 end_location: row: 28 column: 44 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`" - suggestion: "Import from `collections.abc`" - fixable: true - location: - row: 30 - column: 9 - end_location: - row: 30 - column: 40 - fix: - content: from collections.abc import Mapping + fix: + content: "from collections import Counter\n from collections.abc import Mapping" + location: + row: 28 + column: 4 + end_location: + row: 28 + column: 44 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`" + suggestion: "Import from `collections.abc`" + fixable: true location: row: 30 column: 9 end_location: row: 30 column: 40 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`" - suggestion: "Import from `collections.abc`" - fixable: true - location: - row: 33 - column: 0 - end_location: - row: 33 - column: 40 - fix: - content: "from collections import Counter\nfrom collections.abc import Mapping" + fix: + content: from collections.abc import Mapping + location: + row: 30 + column: 9 + end_location: + row: 30 + column: 40 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`" + suggestion: "Import from `collections.abc`" + fixable: true location: row: 33 column: 0 end_location: row: 33 column: 40 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`, `Callable`" - suggestion: "Import from `collections.abc`" - fixable: true - location: - row: 37 - column: 4 - end_location: - row: 42 - column: 5 - fix: - content: "from collections import (\n Bad,\n Good,\n )\n from collections.abc import Mapping, Callable" + fix: + content: "from collections import Counter\nfrom collections.abc import Mapping" + location: + row: 33 + column: 0 + end_location: + row: 33 + column: 40 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`, `Callable`" + suggestion: "Import from `collections.abc`" + fixable: true location: row: 37 column: 4 end_location: row: 42 column: 5 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Callable`" - suggestion: "Import from `collections.abc`" - fixable: true - location: - row: 44 - column: 0 - end_location: - row: 44 - column: 91 - fix: - content: "from typing import Match, Pattern, List, OrderedDict, AbstractSet, ContextManager\nfrom collections.abc import Callable" + fix: + content: "from collections import (\n Bad,\n Good,\n )\n from collections.abc import Mapping, Callable" + location: + row: 37 + column: 4 + end_location: + row: 42 + column: 5 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Callable`" + suggestion: "Import from `collections.abc`" + fixable: true location: row: 44 column: 0 end_location: row: 44 column: 91 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections` instead: `OrderedDict`" - suggestion: "Import from `collections`" - fixable: true - location: - row: 44 - column: 0 - end_location: - row: 44 - column: 91 - fix: - content: "from typing import Callable, Match, Pattern, List, AbstractSet, ContextManager\nfrom collections import OrderedDict" + fix: + content: "from typing import Match, Pattern, List, OrderedDict, AbstractSet, ContextManager\nfrom collections.abc import Callable" + location: + row: 44 + column: 0 + end_location: + row: 44 + column: 91 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections` instead: `OrderedDict`" + suggestion: "Import from `collections`" + fixable: true location: row: 44 column: 0 end_location: row: 44 column: 91 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `re` instead: `Match`, `Pattern`" - suggestion: "Import from `re`" - fixable: true - location: - row: 44 - column: 0 - end_location: - row: 44 - column: 91 - fix: - content: "from typing import Callable, List, OrderedDict, AbstractSet, ContextManager\nfrom re import Match, Pattern" + fix: + content: "from typing import Callable, Match, Pattern, List, AbstractSet, ContextManager\nfrom collections import OrderedDict" + location: + row: 44 + column: 0 + end_location: + row: 44 + column: 91 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `re` instead: `Match`, `Pattern`" + suggestion: "Import from `re`" + fixable: true location: row: 44 column: 0 end_location: row: 44 column: 91 - parent: ~ -- kind: - name: DeprecatedImport - body: "`typing.List` is deprecated, use `list` instead" - suggestion: ~ - fixable: false - location: - row: 44 - column: 0 - end_location: - row: 44 - column: 91 - fix: ~ - parent: ~ -- kind: - name: DeprecatedImport - body: "`typing.AbstractSet` is deprecated, use `collections.abc.Set` instead" - suggestion: ~ - fixable: false - location: - row: 44 - column: 0 - end_location: - row: 44 - column: 91 - fix: ~ - parent: ~ -- kind: - name: DeprecatedImport - body: "`typing.ContextManager` is deprecated, use `contextlib.AbstractContextManager` instead" - suggestion: ~ - fixable: false - location: - row: 44 - column: 0 - end_location: - row: 44 - column: 91 - fix: ~ - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`" - suggestion: ~ - fixable: false - location: - row: 46 - column: 9 - end_location: - row: 47 - column: 21 - fix: ~ - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections` instead: `OrderedDict`" - suggestion: "Import from `collections`" - fixable: true - location: - row: 50 - column: 0 - end_location: - row: 50 - column: 81 - fix: - content: "from typing import Match, Pattern, List, AbstractSet, ContextManager\nfrom collections import OrderedDict" + fix: + content: "from typing import Callable, List, OrderedDict, AbstractSet, ContextManager\nfrom re import Match, Pattern" + location: + row: 44 + column: 0 + end_location: + row: 44 + column: 91 + parent: ~ + - kind: + name: DeprecatedImport + body: "`typing.List` is deprecated, use `list` instead" + suggestion: ~ + fixable: false + location: + row: 44 + column: 0 + end_location: + row: 44 + column: 91 + fix: ~ + parent: ~ + - kind: + name: DeprecatedImport + body: "`typing.AbstractSet` is deprecated, use `collections.abc.Set` instead" + suggestion: ~ + fixable: false + location: + row: 44 + column: 0 + end_location: + row: 44 + column: 91 + fix: ~ + parent: ~ + - kind: + name: DeprecatedImport + body: "`typing.ContextManager` is deprecated, use `contextlib.AbstractContextManager` instead" + suggestion: ~ + fixable: false + location: + row: 44 + column: 0 + end_location: + row: 44 + column: 91 + fix: ~ + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`" + suggestion: ~ + fixable: false + location: + row: 46 + column: 9 + end_location: + row: 47 + column: 21 + fix: ~ + parent: ~ +- - kind: + name: DeprecatedImport + body: "Import from `collections` instead: `OrderedDict`" + suggestion: "Import from `collections`" + fixable: true location: row: 50 column: 0 end_location: row: 50 column: 81 - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `re` instead: `Match`, `Pattern`" - suggestion: "Import from `re`" - fixable: true - location: - row: 50 - column: 0 - end_location: - row: 50 - column: 81 - fix: - content: "from typing import List, OrderedDict, AbstractSet, ContextManager\nfrom re import Match, Pattern" + fix: + content: "from typing import Match, Pattern, List, AbstractSet, ContextManager\nfrom collections import OrderedDict" + location: + row: 50 + column: 0 + end_location: + row: 50 + column: 81 + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `re` instead: `Match`, `Pattern`" + suggestion: "Import from `re`" + fixable: true location: row: 50 column: 0 end_location: row: 50 column: 81 - parent: ~ -- kind: - name: DeprecatedImport - body: "`typing.List` is deprecated, use `list` instead" - suggestion: ~ - fixable: false - location: - row: 50 - column: 0 - end_location: - row: 50 - column: 81 - fix: ~ - parent: ~ -- kind: - name: DeprecatedImport - body: "`typing.AbstractSet` is deprecated, use `collections.abc.Set` instead" - suggestion: ~ - fixable: false - location: - row: 50 - column: 0 - end_location: - row: 50 - column: 81 - fix: ~ - parent: ~ -- kind: - name: DeprecatedImport - body: "`typing.ContextManager` is deprecated, use `contextlib.AbstractContextManager` instead" - suggestion: ~ - fixable: false - location: - row: 50 - column: 0 - end_location: - row: 50 - column: 81 - fix: ~ - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `re` instead: `Match`, `Pattern`" - suggestion: "Import from `re`" - fixable: true - location: - row: 50 - column: 0 - end_location: - row: 50 - column: 68 - fix: - content: "from typing import List, AbstractSet, ContextManager\nfrom re import Match, Pattern" + fix: + content: "from typing import List, OrderedDict, AbstractSet, ContextManager\nfrom re import Match, Pattern" + location: + row: 50 + column: 0 + end_location: + row: 50 + column: 81 + parent: ~ + - kind: + name: DeprecatedImport + body: "`typing.List` is deprecated, use `list` instead" + suggestion: ~ + fixable: false + location: + row: 50 + column: 0 + end_location: + row: 50 + column: 81 + fix: ~ + parent: ~ + - kind: + name: DeprecatedImport + body: "`typing.AbstractSet` is deprecated, use `collections.abc.Set` instead" + suggestion: ~ + fixable: false + location: + row: 50 + column: 0 + end_location: + row: 50 + column: 81 + fix: ~ + parent: ~ + - kind: + name: DeprecatedImport + body: "`typing.ContextManager` is deprecated, use `contextlib.AbstractContextManager` instead" + suggestion: ~ + fixable: false + location: + row: 50 + column: 0 + end_location: + row: 50 + column: 81 + fix: ~ + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`" + suggestion: ~ + fixable: false + location: + row: 53 + column: 9 + end_location: + row: 54 + column: 21 + fix: ~ + parent: ~ +- - kind: + name: DeprecatedImport + body: "Import from `re` instead: `Match`, `Pattern`" + suggestion: "Import from `re`" + fixable: true + location: + row: 50 + column: 0 + end_location: + row: 50 + column: 68 + fix: + content: "from typing import List, AbstractSet, ContextManager\nfrom re import Match, Pattern" + location: + row: 50 + column: 0 + end_location: + row: 50 + column: 68 + parent: ~ + - kind: + name: DeprecatedImport + body: "`typing.List` is deprecated, use `list` instead" + suggestion: ~ + fixable: false + location: + row: 50 + column: 0 + end_location: + row: 50 + column: 68 + fix: ~ + parent: ~ + - kind: + name: DeprecatedImport + body: "`typing.AbstractSet` is deprecated, use `collections.abc.Set` instead" + suggestion: ~ + fixable: false + location: + row: 50 + column: 0 + end_location: + row: 50 + column: 68 + fix: ~ + parent: ~ + - kind: + name: DeprecatedImport + body: "`typing.ContextManager` is deprecated, use `contextlib.AbstractContextManager` instead" + suggestion: ~ + fixable: false location: row: 50 column: 0 end_location: row: 50 column: 68 - parent: ~ -- kind: - name: DeprecatedImport - body: "`typing.List` is deprecated, use `list` instead" - suggestion: ~ - fixable: false - location: - row: 50 - column: 0 - end_location: - row: 50 - column: 68 - fix: ~ - parent: ~ -- kind: - name: DeprecatedImport - body: "`typing.AbstractSet` is deprecated, use `collections.abc.Set` instead" - suggestion: ~ - fixable: false - location: - row: 50 - column: 0 - end_location: - row: 50 - column: 68 - fix: ~ - parent: ~ -- kind: - name: DeprecatedImport - body: "`typing.ContextManager` is deprecated, use `contextlib.AbstractContextManager` instead" - suggestion: ~ - fixable: false - location: - row: 50 - column: 0 - end_location: - row: 50 - column: 68 - fix: ~ - parent: ~ -- kind: - name: DeprecatedImport - body: "`typing.List` is deprecated, use `list` instead" - suggestion: ~ - fixable: false - location: - row: 50 - column: 0 - end_location: - row: 50 - column: 52 - fix: ~ - parent: ~ -- kind: - name: DeprecatedImport - body: "`typing.AbstractSet` is deprecated, use `collections.abc.Set` instead" - suggestion: ~ - fixable: false - location: - row: 50 - column: 0 - end_location: - row: 50 - column: 52 - fix: ~ - parent: ~ -- kind: - name: DeprecatedImport - body: "`typing.ContextManager` is deprecated, use `contextlib.AbstractContextManager` instead" - suggestion: ~ - fixable: false - location: - row: 50 - column: 0 - end_location: - row: 50 - column: 52 - fix: ~ - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`" - suggestion: ~ - fixable: false - location: - row: 53 - column: 9 - end_location: - row: 54 - column: 21 - fix: ~ - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`" - suggestion: ~ - fixable: false - location: - row: 54 - column: 9 - end_location: - row: 55 - column: 21 - fix: ~ - parent: ~ -- kind: - name: DeprecatedImport - body: "Import from `collections.abc` instead: `Mapping`" - suggestion: ~ - fixable: false - location: - row: 55 - column: 9 - end_location: - row: 56 - column: 21 - fix: ~ - parent: ~ + fix: ~ + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`" + suggestion: ~ + fixable: false + location: + row: 54 + column: 9 + end_location: + row: 55 + column: 21 + fix: ~ + parent: ~ +- - kind: + name: DeprecatedImport + body: "`typing.List` is deprecated, use `list` instead" + suggestion: ~ + fixable: false + location: + row: 50 + column: 0 + end_location: + row: 50 + column: 52 + fix: ~ + parent: ~ + - kind: + name: DeprecatedImport + body: "`typing.AbstractSet` is deprecated, use `collections.abc.Set` instead" + suggestion: ~ + fixable: false + location: + row: 50 + column: 0 + end_location: + row: 50 + column: 52 + fix: ~ + parent: ~ + - kind: + name: DeprecatedImport + body: "`typing.ContextManager` is deprecated, use `contextlib.AbstractContextManager` instead" + suggestion: ~ + fixable: false + location: + row: 50 + column: 0 + end_location: + row: 50 + column: 52 + fix: ~ + parent: ~ + - kind: + name: DeprecatedImport + body: "Import from `collections.abc` instead: `Mapping`" + suggestion: ~ + fixable: false + location: + row: 55 + column: 9 + end_location: + row: 56 + column: 21 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_0.py.snap index b26912ed3da72f..254414f1c01f61 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_0.py.snap @@ -2,564 +2,564 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 6 - column: 16 - fix: - content: "print(\"py3\")" +- - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 3 column: 0 end_location: row: 6 column: 16 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 14 - column: 16 - fix: - content: "print(\"py3\")" + fix: + content: "print(\"py3\")" + location: + row: 3 + column: 0 + end_location: + row: 6 + column: 16 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 8 column: 0 end_location: row: 14 column: 16 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 16 - column: 0 - end_location: - row: 17 - column: 19 - fix: - content: "print(\"PY3!\")" + fix: + content: "print(\"py3\")" + location: + row: 8 + column: 0 + end_location: + row: 14 + column: 16 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 16 column: 0 end_location: row: 17 column: 19 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 20 - column: 4 - end_location: - row: 23 - column: 20 - fix: - content: " print(\"PY3\")" + fix: + content: "print(\"PY3!\")" + location: + row: 16 + column: 0 + end_location: + row: 17 + column: 19 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 20 - column: 0 + column: 4 end_location: row: 23 column: 20 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 25 - column: 0 - end_location: - row: 27 - column: 16 - fix: - content: "print(\"py3\")" + fix: + content: " print(\"PY3\")" + location: + row: 20 + column: 0 + end_location: + row: 23 + column: 20 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 25 column: 0 end_location: row: 27 column: 16 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 29 - column: 0 - end_location: - row: 35 - column: 30 - fix: - content: "def f():\n print(\"py3\")\n print(\"This the next\")" + fix: + content: "print(\"py3\")" + location: + row: 25 + column: 0 + end_location: + row: 27 + column: 16 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 29 column: 0 end_location: row: 35 column: 30 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 37 - column: 0 - end_location: - row: 40 - column: 16 - fix: - content: "print(\"py3\")" + fix: + content: "def f():\n print(\"py3\")\n print(\"This the next\")" + location: + row: 29 + column: 0 + end_location: + row: 35 + column: 30 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 37 column: 0 end_location: row: 40 column: 16 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 45 - column: 0 - end_location: - row: 48 - column: 16 - fix: - content: "print(\"py3\")" + fix: + content: "print(\"py3\")" + location: + row: 37 + column: 0 + end_location: + row: 40 + column: 16 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 45 column: 0 end_location: row: 48 column: 16 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 53 - column: 0 - end_location: - row: 54 - column: 18 - fix: - content: "print(\"py3\")" + fix: + content: "print(\"py3\")" + location: + row: 45 + column: 0 + end_location: + row: 48 + column: 16 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 53 column: 0 end_location: row: 54 column: 18 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 56 - column: 0 - end_location: - row: 59 - column: 16 - fix: - content: "print(\"py3\")" + fix: + content: "print(\"py3\")" + location: + row: 53 + column: 0 + end_location: + row: 54 + column: 18 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 56 column: 0 end_location: row: 59 column: 16 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 62 - column: 4 - end_location: - row: 65 - column: 20 - fix: - content: " print(\"py3\")" + fix: + content: "print(\"py3\")" + location: + row: 56 + column: 0 + end_location: + row: 59 + column: 16 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 62 - column: 0 + column: 4 end_location: row: 65 column: 20 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 67 - column: 0 - end_location: - row: 70 - column: 16 - fix: - content: "print(\"py3\")" + fix: + content: " print(\"py3\")" + location: + row: 62 + column: 0 + end_location: + row: 65 + column: 20 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 67 column: 0 end_location: row: 70 column: 16 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 73 - column: 4 - end_location: - row: 79 - column: 13 - fix: - content: " yield" + fix: + content: "print(\"py3\")" + location: + row: 67 + column: 0 + end_location: + row: 70 + column: 16 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 73 - column: 0 + column: 4 end_location: row: 79 column: 13 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 86 - column: 4 - end_location: - row: 91 - column: 16 - fix: - content: " def f(py3):\n pass" + fix: + content: " yield" + location: + row: 73 + column: 0 + end_location: + row: 79 + column: 13 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 86 - column: 0 + column: 4 end_location: row: 91 column: 16 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 97 - column: 4 - end_location: - row: 100 - column: 9 - fix: - content: " 3" + fix: + content: " def f(py3):\n pass" + location: + row: 86 + column: 0 + end_location: + row: 91 + column: 16 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 97 - column: 0 + column: 4 end_location: row: 100 column: 9 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 104 - column: 0 - end_location: - row: 113 - column: 20 - fix: - content: "def f():\n print(\"py3\")\ndef g():\n print(\"py3\")" + fix: + content: " 3" + location: + row: 97 + column: 0 + end_location: + row: 100 + column: 9 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 104 column: 0 end_location: row: 113 column: 20 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 116 - column: 4 - end_location: - row: 117 - column: 16 - fix: - content: " print(3)" + fix: + content: "def f():\n print(\"py3\")\ndef g():\n print(\"py3\")" + location: + row: 104 + column: 0 + end_location: + row: 113 + column: 20 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 116 - column: 0 + column: 4 end_location: row: 117 column: 16 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 122 - column: 4 - end_location: - row: 122 - column: 40 - fix: - content: print(3) + fix: + content: " print(3)" + location: + row: 116 + column: 0 + end_location: + row: 117 + column: 16 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 122 column: 4 end_location: row: 122 column: 40 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 125 - column: 4 - end_location: - row: 126 - column: 16 - fix: - content: " print(3)" + fix: + content: print(3) + location: + row: 122 + column: 4 + end_location: + row: 122 + column: 40 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 125 - column: 0 + column: 4 end_location: row: 126 column: 16 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 130 - column: 4 - end_location: - row: 137 - column: 9 - fix: - content: " expected_error = [\n\":1:5: Generator expression must be parenthesized\",\n\"max(1 for i in range(10), key=lambda x: x+1)\",\n\" ^\",\n ]" + fix: + content: " print(3)" + location: + row: 125 + column: 0 + end_location: + row: 126 + column: 16 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 130 - column: 0 + column: 4 end_location: row: 137 column: 9 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 140 - column: 0 - end_location: - row: 147 - column: 5 - fix: - content: "expected_error = [\n\":1:5: Generator expression must be parenthesized\",\n\"max(1 for i in range(10), key=lambda x: x+1)\",\n\" ^\",\n]" + fix: + content: " expected_error = [\n\":1:5: Generator expression must be parenthesized\",\n\"max(1 for i in range(10), key=lambda x: x+1)\",\n\" ^\",\n ]" + location: + row: 130 + column: 0 + end_location: + row: 137 + column: 9 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 140 column: 0 end_location: row: 147 column: 5 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 150 - column: 0 - end_location: - row: 161 - column: 28 - fix: - content: "\"\"\"this\nis valid\"\"\"\n\n\"\"\"the indentation on\n this line is significant\"\"\"\n\n\"this is\" \\\n \"allowed too\"\n\n(\"so is\"\n \"this for some reason\")" + fix: + content: "expected_error = [\n\":1:5: Generator expression must be parenthesized\",\n\"max(1 for i in range(10), key=lambda x: x+1)\",\n\" ^\",\n]" + location: + row: 140 + column: 0 + end_location: + row: 147 + column: 5 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 150 column: 0 end_location: row: 161 column: 28 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 163 - column: 0 - end_location: - row: 164 - column: 6 - fix: - content: "expected_error = \\\n []" + fix: + content: "\"\"\"this\nis valid\"\"\"\n\n\"\"\"the indentation on\n this line is significant\"\"\"\n\n\"this is\" \\\n \"allowed too\"\n\n(\"so is\"\n \"this for some reason\")" + location: + row: 150 + column: 0 + end_location: + row: 161 + column: 28 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 163 column: 0 end_location: row: 164 column: 6 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 166 - column: 0 - end_location: - row: 166 - column: 49 - fix: - content: "expected_error = []" + fix: + content: "expected_error = \\\n []" + location: + row: 163 + column: 0 + end_location: + row: 164 + column: 6 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 166 column: 0 end_location: row: 166 column: 49 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 168 - column: 0 - end_location: - row: 169 - column: 23 - fix: - content: "expected_error = []" + fix: + content: "expected_error = []" + location: + row: 166 + column: 0 + end_location: + row: 166 + column: 49 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 168 column: 0 end_location: row: 169 column: 23 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 172 - column: 4 - end_location: - row: 173 - column: 6 - fix: - content: "expected_error = \\\n []" + fix: + content: "expected_error = []" + location: + row: 168 + column: 0 + end_location: + row: 169 + column: 23 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 172 column: 4 end_location: row: 173 column: 6 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 176 - column: 4 - end_location: - row: 176 - column: 53 - fix: - content: "expected_error = []" + fix: + content: "expected_error = \\\n []" + location: + row: 172 + column: 4 + end_location: + row: 173 + column: 6 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 176 column: 4 end_location: row: 176 column: 53 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 179 - column: 4 - end_location: - row: 180 - column: 23 - fix: - content: " expected_error = []" + fix: + content: "expected_error = []" + location: + row: 176 + column: 4 + end_location: + row: 176 + column: 53 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 179 - column: 0 + column: 4 end_location: row: 180 column: 23 - parent: ~ + fix: + content: " expected_error = []" + location: + row: 179 + column: 0 + end_location: + row: 180 + column: 23 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_1.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_1.py.snap index 3c500d5627e41a..e7a1a4dc13aecd 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_1.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_1.py.snap @@ -2,264 +2,264 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 6 - column: 5 - fix: - content: "3" +- - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 3 column: 0 end_location: row: 6 column: 5 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 11 - column: 5 - fix: - content: "3" + fix: + content: "3" + location: + row: 3 + column: 0 + end_location: + row: 6 + column: 5 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 8 column: 0 end_location: row: 11 column: 5 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 13 - column: 0 - end_location: - row: 16 - column: 5 - fix: - content: "3" + fix: + content: "3" + location: + row: 8 + column: 0 + end_location: + row: 11 + column: 5 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 13 column: 0 end_location: row: 16 column: 5 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 18 - column: 0 - end_location: - row: 21 - column: 5 - fix: - content: "3" + fix: + content: "3" + location: + row: 13 + column: 0 + end_location: + row: 16 + column: 5 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 18 column: 0 end_location: row: 21 column: 5 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 23 - column: 0 - end_location: - row: 26 - column: 5 - fix: - content: "3" + fix: + content: "3" + location: + row: 18 + column: 0 + end_location: + row: 21 + column: 5 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 23 column: 0 end_location: row: 26 column: 5 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 28 - column: 0 - end_location: - row: 31 - column: 5 - fix: - content: "3" + fix: + content: "3" + location: + row: 23 + column: 0 + end_location: + row: 26 + column: 5 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 28 column: 0 end_location: row: 31 column: 5 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 35 - column: 0 - end_location: - row: 38 - column: 5 - fix: - content: "3" + fix: + content: "3" + location: + row: 28 + column: 0 + end_location: + row: 31 + column: 5 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 35 column: 0 end_location: row: 38 column: 5 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 42 - column: 0 - end_location: - row: 45 - column: 12 - fix: - content: "" + fix: + content: "3" + location: + row: 35 + column: 0 + end_location: + row: 38 + column: 5 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 42 column: 0 end_location: - row: 44 - column: 0 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 49 - column: 0 - end_location: - row: 52 - column: 12 - fix: - content: "else:\n print(3)" + row: 45 + column: 12 + fix: + content: "" + location: + row: 42 + column: 0 + end_location: + row: 44 + column: 0 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 49 column: 0 end_location: row: 52 column: 12 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 56 - column: 0 - end_location: - row: 57 - column: 12 - fix: - content: "else:\n print(3)" + fix: + content: "else:\n print(3)" + location: + row: 49 + column: 0 + end_location: + row: 52 + column: 12 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 56 column: 0 end_location: row: 57 column: 12 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 62 - column: 4 - end_location: - row: 63 - column: 16 - fix: - content: "else:\n print(3)" + fix: + content: "else:\n print(3)" + location: + row: 56 + column: 0 + end_location: + row: 57 + column: 12 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 62 column: 4 end_location: row: 63 column: 16 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 67 - column: 0 - end_location: - row: 70 - column: 12 - fix: - content: "" + fix: + content: "else:\n print(3)" + location: + row: 62 + column: 4 + end_location: + row: 63 + column: 16 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 67 column: 0 end_location: - row: 69 - column: 0 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 75 - column: 4 - end_location: - row: 76 - column: 16 - fix: - content: "else:\n print(3)" + row: 70 + column: 12 + fix: + content: "" + location: + row: 67 + column: 0 + end_location: + row: 69 + column: 0 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 75 column: 4 end_location: row: 76 column: 16 - parent: ~ + fix: + content: "else:\n print(3)" + location: + row: 75 + column: 4 + end_location: + row: 76 + column: 16 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_2.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_2.py.snap index 11b9ff3e560500..6471e7fb165ec0 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_2.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_2.py.snap @@ -2,244 +2,244 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 4 - column: 0 - end_location: - row: 7 - column: 7 - fix: - content: 3+6 +- - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 4 column: 0 end_location: row: 7 column: 7 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 9 - column: 0 - end_location: - row: 12 - column: 7 - fix: - content: 3+6 + fix: + content: 3+6 + location: + row: 4 + column: 0 + end_location: + row: 7 + column: 7 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 9 column: 0 end_location: row: 12 column: 7 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 14 - column: 0 - end_location: - row: 17 - column: 7 - fix: - content: 3+6 + fix: + content: 3+6 + location: + row: 9 + column: 0 + end_location: + row: 12 + column: 7 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 14 column: 0 end_location: row: 17 column: 7 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 19 - column: 0 - end_location: - row: 22 - column: 7 - fix: - content: 3+6 + fix: + content: 3+6 + location: + row: 14 + column: 0 + end_location: + row: 17 + column: 7 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 19 column: 0 end_location: row: 22 column: 7 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 24 - column: 0 - end_location: - row: 27 - column: 7 - fix: - content: 3+6 + fix: + content: 3+6 + location: + row: 19 + column: 0 + end_location: + row: 22 + column: 7 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 24 column: 0 end_location: row: 27 column: 7 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 29 - column: 0 - end_location: - row: 32 - column: 7 - fix: - content: 3+6 + fix: + content: 3+6 + location: + row: 24 + column: 0 + end_location: + row: 27 + column: 7 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 29 column: 0 end_location: row: 32 column: 7 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 34 - column: 0 - end_location: - row: 37 - column: 7 - fix: - content: 3+6 + fix: + content: 3+6 + location: + row: 29 + column: 0 + end_location: + row: 32 + column: 7 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 34 column: 0 end_location: row: 37 column: 7 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 39 - column: 0 - end_location: - row: 40 - column: 8 - fix: - content: pass + fix: + content: 3+6 + location: + row: 34 + column: 0 + end_location: + row: 37 + column: 7 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 39 column: 0 end_location: row: 40 column: 8 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 42 - column: 0 - end_location: - row: 43 - column: 8 - fix: - content: "" + fix: + content: pass + location: + row: 39 + column: 0 + end_location: + row: 40 + column: 8 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 42 column: 0 end_location: - row: 44 - column: 0 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 46 - column: 4 - end_location: - row: 47 - column: 12 - fix: - content: pass + row: 43 + column: 8 + fix: + content: "" + location: + row: 42 + column: 0 + end_location: + row: 44 + column: 0 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 46 column: 4 end_location: row: 47 column: 12 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 49 - column: 0 - end_location: - row: 52 - column: 8 - fix: - content: "" + fix: + content: pass + location: + row: 46 + column: 4 + end_location: + row: 47 + column: 12 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 49 column: 0 end_location: - row: 51 - column: 2 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 54 - column: 0 - end_location: - row: 57 - column: 8 - fix: - content: pass + row: 52 + column: 8 + fix: + content: "" + location: + row: 49 + column: 0 + end_location: + row: 51 + column: 2 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 54 column: 0 end_location: row: 57 column: 8 - parent: ~ + fix: + content: pass + location: + row: 54 + column: 0 + end_location: + row: 57 + column: 8 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_3.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_3.py.snap index 1d85c25a40fa0f..24455f9ad08af0 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_3.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_3.py.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 3 - column: 0 - end_location: - row: 10 - column: 28 - fix: - content: "print(\"py3\")\nfor item in range(10):\n print(f\"PY3-{item}\")" +- - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 3 column: 0 end_location: row: 10 column: 28 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 13 - column: 4 - end_location: - row: 20 - column: 32 - fix: - content: " print(\"py3\")\n for item in range(10):\n print(f\"PY3-{item}\")" + fix: + content: "print(\"py3\")\nfor item in range(10):\n print(f\"PY3-{item}\")" + location: + row: 3 + column: 0 + end_location: + row: 10 + column: 28 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 13 - column: 0 + column: 4 end_location: row: 20 column: 32 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 23 - column: 0 - end_location: - row: 24 - column: 50 - fix: - content: "print(\"PY3!\")" + fix: + content: " print(\"py3\")\n for item in range(10):\n print(f\"PY3-{item}\")" + location: + row: 13 + column: 0 + end_location: + row: 20 + column: 32 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 23 column: 0 end_location: row: 24 column: 50 - parent: ~ + fix: + content: "print(\"PY3!\")" + location: + row: 23 + column: 0 + end_location: + row: 24 + column: 50 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_4.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_4.py.snap index 0a3d0250356ee8..5874516bf22bba 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_4.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_4.py.snap @@ -2,164 +2,164 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 4 - column: 4 - end_location: - row: 5 - column: 53 - fix: - content: pass +- - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 4 column: 4 end_location: row: 5 column: 53 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 11 - column: 4 - end_location: - row: 12 - column: 53 - fix: - content: "" + fix: + content: pass + location: + row: 4 + column: 4 + end_location: + row: 5 + column: 53 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 11 - column: 0 + column: 4 end_location: - row: 13 - column: 0 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 17 - column: 4 - end_location: - row: 20 - column: 51 - fix: - content: "" + row: 12 + column: 53 + fix: + content: "" + location: + row: 11 + column: 0 + end_location: + row: 13 + column: 0 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 17 column: 4 end_location: - row: 19 - column: 4 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 24 - column: 4 - end_location: - row: 25 - column: 53 - fix: - content: "" + row: 20 + column: 51 + fix: + content: "" + location: + row: 17 + column: 4 + end_location: + row: 19 + column: 4 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 24 - column: 0 + column: 4 end_location: - row: 26 - column: 0 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 27 - column: 4 - end_location: - row: 28 - column: 53 - fix: - content: "" + row: 25 + column: 53 + fix: + content: "" + location: + row: 24 + column: 0 + end_location: + row: 26 + column: 0 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 27 - column: 0 + column: 4 end_location: - row: 29 - column: 0 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 32 - column: 4 - end_location: - row: 35 - column: 51 - fix: - content: "" + row: 28 + column: 53 + fix: + content: "" + location: + row: 27 + column: 0 + end_location: + row: 29 + column: 0 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 32 column: 4 end_location: - row: 34 - column: 4 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 37 - column: 4 - end_location: - row: 40 - column: 51 - fix: - content: " cmd = [sys.executable, \"-m\", \"test\", \"-j0\"]" + row: 35 + column: 51 + fix: + content: "" + location: + row: 32 + column: 4 + end_location: + row: 34 + column: 4 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 37 - column: 0 + column: 4 end_location: row: 40 column: 51 - parent: ~ -- kind: - name: OutdatedVersionBlock - body: Version block is outdated for minimum Python version - suggestion: Remove outdated version block - fixable: true - location: - row: 42 - column: 4 - end_location: - row: 45 - column: 51 - fix: - content: "" + fix: + content: " cmd = [sys.executable, \"-m\", \"test\", \"-j0\"]" + location: + row: 37 + column: 0 + end_location: + row: 40 + column: 51 + parent: ~ + - kind: + name: OutdatedVersionBlock + body: Version block is outdated for minimum Python version + suggestion: Remove outdated version block + fixable: true location: row: 42 column: 4 end_location: - row: 44 - column: 6 - parent: ~ + row: 45 + column: 51 + fix: + content: "" + location: + row: 42 + column: 4 + end_location: + row: 44 + column: 6 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP037.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP037.py.snap index 3f2affaa3a6fe7..d668e1c572f231 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP037.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP037.py.snap @@ -2,564 +2,564 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 18 - column: 13 - end_location: - row: 18 - column: 22 - fix: - content: MyClass +- - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 18 column: 13 end_location: row: 18 column: 22 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 18 - column: 27 - end_location: - row: 18 - column: 36 - fix: - content: MyClass + fix: + content: MyClass + location: + row: 18 + column: 13 + end_location: + row: 18 + column: 22 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 18 column: 27 end_location: row: 18 column: 36 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 19 - column: 7 - end_location: - row: 19 - column: 16 - fix: - content: MyClass + fix: + content: MyClass + location: + row: 18 + column: 27 + end_location: + row: 18 + column: 36 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 19 column: 7 end_location: row: 19 column: 16 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 22 - column: 20 - end_location: - row: 22 - column: 26 - fix: - content: bool + fix: + content: MyClass + location: + row: 19 + column: 7 + end_location: + row: 19 + column: 16 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 22 column: 20 end_location: row: 22 column: 26 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 26 - column: 15 - end_location: - row: 26 - column: 20 - fix: - content: str + fix: + content: bool + location: + row: 22 + column: 20 + end_location: + row: 22 + column: 26 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 26 column: 15 end_location: row: 26 column: 20 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 26 - column: 32 - end_location: - row: 26 - column: 37 - fix: - content: int + fix: + content: str + location: + row: 26 + column: 15 + end_location: + row: 26 + column: 20 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 26 column: 32 end_location: row: 26 column: 37 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 30 - column: 9 - end_location: - row: 30 - column: 18 - fix: - content: MyClass + fix: + content: int + location: + row: 26 + column: 32 + end_location: + row: 26 + column: 37 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 30 column: 9 end_location: row: 30 column: 18 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 32 - column: 13 - end_location: - row: 32 - column: 22 - fix: - content: MyClass + fix: + content: MyClass + location: + row: 30 + column: 9 + end_location: + row: 30 + column: 18 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 32 column: 13 end_location: row: 32 column: 22 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 36 - column: 7 - end_location: - row: 36 - column: 16 - fix: - content: MyClass + fix: + content: MyClass + location: + row: 32 + column: 13 + end_location: + row: 32 + column: 22 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 36 column: 7 end_location: row: 36 column: 16 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 40 - column: 26 - end_location: - row: 40 - column: 31 - fix: - content: int + fix: + content: MyClass + location: + row: 36 + column: 7 + end_location: + row: 36 + column: 16 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 40 column: 26 end_location: row: 40 column: 31 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 44 - column: 30 - end_location: - row: 44 - column: 35 - fix: - content: int + fix: + content: int + location: + row: 40 + column: 26 + end_location: + row: 40 + column: 31 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 44 column: 30 end_location: row: 44 column: 35 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 47 - column: 13 - end_location: - row: 47 - column: 18 - fix: - content: str + fix: + content: int + location: + row: 44 + column: 30 + end_location: + row: 44 + column: 35 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 47 column: 13 end_location: row: 47 column: 18 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 49 - column: 7 - end_location: - row: 49 - column: 12 - fix: - content: str + fix: + content: str + location: + row: 47 + column: 13 + end_location: + row: 47 + column: 18 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 49 column: 7 end_location: row: 49 column: 12 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 51 - column: 14 - end_location: - row: 51 - column: 19 - fix: - content: str + fix: + content: str + location: + row: 49 + column: 7 + end_location: + row: 49 + column: 12 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 51 column: 14 end_location: row: 51 column: 19 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 53 - column: 12 - end_location: - row: 53 - column: 17 - fix: - content: str + fix: + content: str + location: + row: 51 + column: 14 + end_location: + row: 51 + column: 19 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 53 column: 12 end_location: row: 53 column: 17 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 55 - column: 19 - end_location: - row: 55 - column: 24 - fix: - content: str + fix: + content: str + location: + row: 53 + column: 12 + end_location: + row: 53 + column: 17 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 55 column: 19 end_location: row: 55 column: 24 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 57 - column: 19 - end_location: - row: 57 - column: 24 - fix: - content: str + fix: + content: str + location: + row: 55 + column: 19 + end_location: + row: 55 + column: 24 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 57 column: 19 end_location: row: 57 column: 24 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 59 - column: 10 - end_location: - row: 59 - column: 15 - fix: - content: str + fix: + content: str + location: + row: 57 + column: 19 + end_location: + row: 57 + column: 24 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 59 column: 10 end_location: row: 59 column: 15 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 61 - column: 18 - end_location: - row: 61 - column: 27 - fix: - content: MyClass + fix: + content: str + location: + row: 59 + column: 10 + end_location: + row: 59 + column: 15 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 61 column: 18 end_location: row: 61 column: 27 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 63 - column: 28 - end_location: - row: 63 - column: 33 - fix: - content: int + fix: + content: MyClass + location: + row: 61 + column: 18 + end_location: + row: 61 + column: 27 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 63 column: 28 end_location: row: 63 column: 33 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 63 - column: 44 - end_location: - row: 63 - column: 49 - fix: - content: str + fix: + content: int + location: + row: 63 + column: 28 + end_location: + row: 63 + column: 33 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 63 column: 44 end_location: row: 63 column: 49 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 65 - column: 28 - end_location: - row: 65 - column: 33 - fix: - content: foo + fix: + content: str + location: + row: 63 + column: 44 + end_location: + row: 63 + column: 49 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 65 column: 28 end_location: row: 65 column: 33 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 65 - column: 35 - end_location: - row: 65 - column: 40 - fix: - content: int + fix: + content: foo + location: + row: 65 + column: 28 + end_location: + row: 65 + column: 33 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 65 column: 35 end_location: row: 65 column: 40 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 65 - column: 44 - end_location: - row: 65 - column: 49 - fix: - content: bar + fix: + content: int + location: + row: 65 + column: 35 + end_location: + row: 65 + column: 40 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 65 column: 44 end_location: row: 65 column: 49 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 65 - column: 51 - end_location: - row: 65 - column: 56 - fix: - content: str + fix: + content: bar + location: + row: 65 + column: 44 + end_location: + row: 65 + column: 49 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 65 column: 51 end_location: row: 65 column: 56 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 67 - column: 23 - end_location: - row: 67 - column: 26 - fix: - content: X + fix: + content: str + location: + row: 65 + column: 51 + end_location: + row: 65 + column: 56 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 67 column: 23 end_location: row: 67 column: 26 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 67 - column: 37 - end_location: - row: 67 - column: 42 - fix: - content: foo + fix: + content: X + location: + row: 67 + column: 23 + end_location: + row: 67 + column: 26 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 67 column: 37 end_location: row: 67 column: 42 - parent: ~ -- kind: - name: QuotedAnnotation - body: Remove quotes from type annotation - suggestion: Remove quotes - fixable: true - location: - row: 67 - column: 44 - end_location: - row: 67 - column: 49 - fix: - content: int + fix: + content: foo + location: + row: 67 + column: 37 + end_location: + row: 67 + column: 42 + parent: ~ + - kind: + name: QuotedAnnotation + body: Remove quotes from type annotation + suggestion: Remove quotes + fixable: true location: row: 67 column: 44 end_location: row: 67 column: 49 - parent: ~ + fix: + content: int + location: + row: 67 + column: 44 + end_location: + row: 67 + column: 49 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP038.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP038.py.snap index a67cf972548ec1..085f3cb9f824e2 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP038.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP038.py.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: IsinstanceWithTuple - body: "Use `X | Y` in `isinstance` call instead of `(X, Y)`" - suggestion: "Convert to `X | Y`" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 27 - fix: - content: int | float +- - kind: + name: IsinstanceWithTuple + body: "Use `X | Y` in `isinstance` call instead of `(X, Y)`" + suggestion: "Convert to `X | Y`" + fixable: true location: row: 1 - column: 14 + column: 0 end_location: row: 1 - column: 26 - parent: ~ -- kind: - name: IsinstanceWithTuple - body: "Use `X | Y` in `issubclass` call instead of `(X, Y)`" - suggestion: "Convert to `X | Y`" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 36 - fix: - content: int | float | str + column: 27 + fix: + content: int | float + location: + row: 1 + column: 14 + end_location: + row: 1 + column: 26 + parent: ~ + - kind: + name: IsinstanceWithTuple + body: "Use `X | Y` in `issubclass` call instead of `(X, Y)`" + suggestion: "Convert to `X | Y`" + fixable: true location: row: 2 - column: 18 + column: 0 end_location: row: 2 - column: 35 - parent: ~ + column: 36 + fix: + content: int | float | str + location: + row: 2 + column: 18 + end_location: + row: 2 + column: 35 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__datetime_utc_alias_py311.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__datetime_utc_alias_py311.snap index 823a873b0d886f..d277c2c3be73a0 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__datetime_utc_alias_py311.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__datetime_utc_alias_py311.snap @@ -2,63 +2,63 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: DatetimeTimezoneUTC - body: "Use `datetime.UTC` alias" - suggestion: ~ - fixable: false - location: - row: 7 - column: 6 - end_location: - row: 7 - column: 18 - fix: ~ - parent: ~ -- kind: - name: DatetimeTimezoneUTC - body: "Use `datetime.UTC` alias" - suggestion: ~ - fixable: false - location: - row: 8 - column: 6 - end_location: - row: 8 - column: 12 - fix: ~ - parent: ~ -- kind: - name: DatetimeTimezoneUTC - body: "Use `datetime.UTC` alias" - suggestion: "Convert to `datetime.UTC` alias" - fixable: true - location: - row: 10 - column: 6 - end_location: - row: 10 - column: 27 - fix: - content: datetime.UTC +- - kind: + name: DatetimeTimezoneUTC + body: "Use `datetime.UTC` alias" + suggestion: ~ + fixable: false + location: + row: 7 + column: 6 + end_location: + row: 7 + column: 18 + fix: ~ + parent: ~ + - kind: + name: DatetimeTimezoneUTC + body: "Use `datetime.UTC` alias" + suggestion: ~ + fixable: false + location: + row: 8 + column: 6 + end_location: + row: 8 + column: 12 + fix: ~ + parent: ~ + - kind: + name: DatetimeTimezoneUTC + body: "Use `datetime.UTC` alias" + suggestion: "Convert to `datetime.UTC` alias" + fixable: true location: row: 10 column: 6 end_location: row: 10 column: 27 - parent: ~ -- kind: - name: DatetimeTimezoneUTC - body: "Use `datetime.UTC` alias" - suggestion: ~ - fixable: false - location: - row: 11 - column: 6 - end_location: - row: 11 - column: 21 - fix: ~ - parent: ~ + fix: + content: datetime.UTC + location: + row: 10 + column: 6 + end_location: + row: 10 + column: 27 + parent: ~ + - kind: + name: DatetimeTimezoneUTC + body: "Use `datetime.UTC` alias" + suggestion: ~ + fixable: false + location: + row: 11 + column: 6 + end_location: + row: 11 + column: 21 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_p37.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_p37.snap index 244398082c3642..16b3b2059613ee 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_p37.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_p37.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: DeprecatedCollectionType - body: "Use `list` instead of `List` for type annotations" - suggestion: "Replace `List` with `list`" - fixable: true - location: - row: 34 - column: 17 - end_location: - row: 34 - column: 21 - fix: - content: list +- - kind: + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + suggestion: "Replace `List` with `list`" + fixable: true location: row: 34 column: 17 end_location: row: 34 column: 21 - parent: ~ + fix: + content: list + location: + row: 34 + column: 17 + end_location: + row: 34 + column: 21 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_py310.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_py310.snap index ec287ea82fbbfe..c57a3d53670a4f 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_py310.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_py310.snap @@ -2,84 +2,84 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: DeprecatedCollectionType - body: "Use `list` instead of `List` for type annotations" - suggestion: "Replace `List` with `list`" - fixable: true - location: - row: 34 - column: 17 - end_location: - row: 34 - column: 21 - fix: - content: list +- - kind: + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + suggestion: "Replace `List` with `list`" + fixable: true location: row: 34 column: 17 end_location: row: 34 column: 21 - parent: ~ -- kind: - name: DeprecatedCollectionType - body: "Use `list` instead of `List` for type annotations" - suggestion: "Replace `List` with `list`" - fixable: true - location: - row: 35 - column: 8 - end_location: - row: 35 - column: 12 - fix: - content: list + fix: + content: list + location: + row: 34 + column: 17 + end_location: + row: 34 + column: 21 + parent: ~ + - kind: + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + suggestion: "Replace `List` with `list`" + fixable: true location: row: 35 column: 8 end_location: row: 35 column: 12 - parent: ~ -- kind: - name: DeprecatedCollectionType - body: "Use `list` instead of `List` for type annotations" - suggestion: "Replace `List` with `list`" - fixable: true - location: - row: 42 - column: 26 - end_location: - row: 42 - column: 30 - fix: - content: list + fix: + content: list + location: + row: 35 + column: 8 + end_location: + row: 35 + column: 12 + parent: ~ + - kind: + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + suggestion: "Replace `List` with `list`" + fixable: true location: row: 42 column: 26 end_location: row: 42 column: 30 - parent: ~ -- kind: - name: DeprecatedCollectionType - body: "Use `list` instead of `List` for type annotations" - suggestion: "Replace `List` with `list`" - fixable: true - location: - row: 42 - column: 37 - end_location: - row: 42 - column: 41 - fix: - content: list + fix: + content: list + location: + row: 42 + column: 26 + end_location: + row: 42 + column: 30 + parent: ~ + - kind: + name: DeprecatedCollectionType + body: "Use `list` instead of `List` for type annotations" + suggestion: "Replace `List` with `list`" + fixable: true location: row: 42 column: 37 end_location: row: 42 column: 41 - parent: ~ + fix: + content: list + location: + row: 42 + column: 37 + end_location: + row: 42 + column: 41 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_p37.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_p37.snap index f70bedb2b0775f..3947f465314f93 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_p37.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_p37.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: TypingUnion - body: "Use `X | Y` for type annotations" - suggestion: "Convert to `X | Y`" - fixable: true - location: - row: 40 - column: 3 - end_location: - row: 40 - column: 16 - fix: - content: int | None +- - kind: + name: TypingUnion + body: "Use `X | Y` for type annotations" + suggestion: "Convert to `X | Y`" + fixable: true location: row: 40 column: 3 end_location: row: 40 column: 16 - parent: ~ + fix: + content: int | None + location: + row: 40 + column: 3 + end_location: + row: 40 + column: 16 + parent: ~ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap index d9898dacc86606..28c41222ca5798 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap @@ -2,44 +2,44 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs expression: diagnostics --- -- kind: - name: TypingUnion - body: "Use `X | Y` for type annotations" - suggestion: "Convert to `X | Y`" - fixable: true - location: - row: 40 - column: 3 - end_location: - row: 40 - column: 16 - fix: - content: int | None +- - kind: + name: TypingUnion + body: "Use `X | Y` for type annotations" + suggestion: "Convert to `X | Y`" + fixable: true location: row: 40 column: 3 end_location: row: 40 column: 16 - parent: ~ -- kind: - name: TypingUnion - body: "Use `X | Y` for type annotations" - suggestion: "Convert to `X | Y`" - fixable: true - location: - row: 42 - column: 20 - end_location: - row: 42 - column: 47 - fix: - content: "List[int] | List[str]" + fix: + content: int | None + location: + row: 40 + column: 3 + end_location: + row: 40 + column: 16 + parent: ~ + - kind: + name: TypingUnion + body: "Use `X | Y` for type annotations" + suggestion: "Convert to `X | Y`" + fixable: true location: row: 42 column: 20 end_location: row: 42 column: 47 - parent: ~ + fix: + content: "List[int] | List[str]" + location: + row: 42 + column: 20 + end_location: + row: 42 + column: 47 + parent: ~ diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF005_RUF005.py.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF005_RUF005.py.snap index 286f23045b0cbb..3448541276417c 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF005_RUF005.py.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF005_RUF005.py.snap @@ -2,277 +2,277 @@ source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- -- kind: - name: UnpackInsteadOfConcatenatingToCollectionLiteral - body: "Consider `[1, 2, 3, *foo]` instead of concatenation" - suggestion: "Replace with `[1, 2, 3, *foo]`" - fixable: true - location: - row: 10 - column: 6 - end_location: - row: 10 - column: 21 - fix: - content: "[1, 2, 3, *foo]" +- - kind: + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `[1, 2, 3, *foo]` instead of concatenation" + suggestion: "Replace with `[1, 2, 3, *foo]`" + fixable: true location: row: 10 column: 6 end_location: row: 10 column: 21 - parent: ~ -- kind: - name: UnpackInsteadOfConcatenatingToCollectionLiteral - body: "Consider `(7, 8, 9, *zoob)` instead of concatenation" - suggestion: "Replace with `(7, 8, 9, *zoob)`" - fixable: true - location: - row: 12 - column: 7 - end_location: - row: 12 - column: 23 - fix: - content: "(7, 8, 9, *zoob)" + fix: + content: "[1, 2, 3, *foo]" + location: + row: 10 + column: 6 + end_location: + row: 10 + column: 21 + parent: ~ + - kind: + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `(7, 8, 9, *zoob)` instead of concatenation" + suggestion: "Replace with `(7, 8, 9, *zoob)`" + fixable: true location: row: 12 column: 7 end_location: row: 12 column: 23 - parent: ~ -- kind: - name: UnpackInsteadOfConcatenatingToCollectionLiteral - body: "Consider `(*quux, 10, 11, 12)` instead of concatenation" - suggestion: "Replace with `(*quux, 10, 11, 12)`" - fixable: true - location: - row: 13 - column: 7 - end_location: - row: 13 - column: 26 - fix: - content: "(*quux, 10, 11, 12)" + fix: + content: "(7, 8, 9, *zoob)" + location: + row: 12 + column: 7 + end_location: + row: 12 + column: 23 + parent: ~ + - kind: + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `(*quux, 10, 11, 12)` instead of concatenation" + suggestion: "Replace with `(*quux, 10, 11, 12)`" + fixable: true location: row: 13 column: 7 end_location: row: 13 column: 26 - parent: ~ -- kind: - name: UnpackInsteadOfConcatenatingToCollectionLiteral - body: "Consider `[*spom, 13, 14, 15]` instead of concatenation" - suggestion: "Replace with `[*spom, 13, 14, 15]`" - fixable: true - location: - row: 15 - column: 7 - end_location: - row: 15 - column: 26 - fix: - content: "[*spom, 13, 14, 15]" + fix: + content: "(*quux, 10, 11, 12)" + location: + row: 13 + column: 7 + end_location: + row: 13 + column: 26 + parent: ~ + - kind: + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `[*spom, 13, 14, 15]` instead of concatenation" + suggestion: "Replace with `[*spom, 13, 14, 15]`" + fixable: true location: row: 15 column: 7 end_location: row: 15 column: 26 - parent: ~ -- kind: - name: UnpackInsteadOfConcatenatingToCollectionLiteral - body: "Consider `(\"we all say\", *yay())` instead of concatenation" - suggestion: "Replace with `(\"we all say\", *yay())`" - fixable: true - location: - row: 16 - column: 12 - end_location: - row: 16 - column: 36 - fix: - content: "(\"we all say\", *yay())" + fix: + content: "[*spom, 13, 14, 15]" + location: + row: 15 + column: 7 + end_location: + row: 15 + column: 26 + parent: ~ + - kind: + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `(\"we all say\", *yay())` instead of concatenation" + suggestion: "Replace with `(\"we all say\", *yay())`" + fixable: true location: row: 16 column: 12 end_location: row: 16 column: 36 - parent: ~ -- kind: - name: UnpackInsteadOfConcatenatingToCollectionLiteral - body: "Consider `(\"we all think\", *Fun().yay())` instead of concatenation" - suggestion: "Replace with `(\"we all think\", *Fun().yay())`" - fixable: true - location: - row: 17 - column: 13 - end_location: - row: 17 - column: 45 - fix: - content: "(\"we all think\", *Fun().yay())" + fix: + content: "(\"we all say\", *yay())" + location: + row: 16 + column: 12 + end_location: + row: 16 + column: 36 + parent: ~ + - kind: + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `(\"we all think\", *Fun().yay())` instead of concatenation" + suggestion: "Replace with `(\"we all think\", *Fun().yay())`" + fixable: true location: row: 17 column: 13 end_location: row: 17 column: 45 - parent: ~ -- kind: - name: UnpackInsteadOfConcatenatingToCollectionLiteral - body: "Consider `(\"we all feel\", *Fun.words)` instead of concatenation" - suggestion: "Replace with `(\"we all feel\", *Fun.words)`" - fixable: true - location: - row: 18 - column: 15 - end_location: - row: 18 - column: 44 - fix: - content: "(\"we all feel\", *Fun.words)" + fix: + content: "(\"we all think\", *Fun().yay())" + location: + row: 17 + column: 13 + end_location: + row: 17 + column: 45 + parent: ~ + - kind: + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `(\"we all feel\", *Fun.words)` instead of concatenation" + suggestion: "Replace with `(\"we all feel\", *Fun.words)`" + fixable: true location: row: 18 column: 15 end_location: row: 18 column: 44 - parent: ~ -- kind: - name: UnpackInsteadOfConcatenatingToCollectionLiteral - body: "Consider `[\"a\", \"b\", \"c\", *eggs]` instead of concatenation" - suggestion: "Replace with `[\"a\", \"b\", \"c\", *eggs]`" - fixable: true - location: - row: 20 - column: 8 - end_location: - row: 20 - column: 30 - fix: - content: "[\"a\", \"b\", \"c\", *eggs]" + fix: + content: "(\"we all feel\", *Fun.words)" + location: + row: 18 + column: 15 + end_location: + row: 18 + column: 44 + parent: ~ + - kind: + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `[\"a\", \"b\", \"c\", *eggs]` instead of concatenation" + suggestion: "Replace with `[\"a\", \"b\", \"c\", *eggs]`" + fixable: true location: row: 20 column: 8 end_location: row: 20 column: 30 - parent: ~ -- kind: - name: UnpackInsteadOfConcatenatingToCollectionLiteral - body: "Consider `[\"a\", \"b\", \"c\", *eggs, *list((\"yes\", \"no\", \"pants\", *zoob))]` instead of concatenation" - suggestion: "Replace with `[\"a\", \"b\", \"c\", *eggs, *list((\"yes\", \"no\", \"pants\", *zoob))]`" - fixable: true - location: - row: 20 - column: 8 - end_location: - row: 20 - column: 68 - fix: - content: "[\"a\", \"b\", \"c\", *eggs, *list((\"yes\", \"no\", \"pants\", *zoob))]" - location: - row: 20 - column: 8 - end_location: - row: 20 - column: 68 - parent: ~ -- kind: - name: UnpackInsteadOfConcatenatingToCollectionLiteral - body: "Consider `(\"yes\", \"no\", \"pants\", *zoob)` instead of concatenation" - suggestion: "Replace with `(\"yes\", \"no\", \"pants\", *zoob)`" - fixable: true - location: - row: 20 - column: 38 - end_location: - row: 20 - column: 67 - fix: - content: "(\"yes\", \"no\", \"pants\", *zoob)" + fix: + content: "[\"a\", \"b\", \"c\", *eggs]" + location: + row: 20 + column: 8 + end_location: + row: 20 + column: 30 + parent: ~ + - kind: + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `(\"yes\", \"no\", \"pants\", *zoob)` instead of concatenation" + suggestion: "Replace with `(\"yes\", \"no\", \"pants\", *zoob)`" + fixable: true location: row: 20 column: 38 end_location: row: 20 column: 67 - parent: ~ -- kind: - name: UnpackInsteadOfConcatenatingToCollectionLiteral - body: "Consider `(*zoob,)` instead of concatenation" - suggestion: "Replace with `(*zoob,)`" - fixable: true - location: - row: 22 - column: 6 - end_location: - row: 22 - column: 15 - fix: - content: "(*zoob,)" + fix: + content: "(\"yes\", \"no\", \"pants\", *zoob)" + location: + row: 20 + column: 38 + end_location: + row: 20 + column: 67 + parent: ~ + - kind: + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `(*zoob,)` instead of concatenation" + suggestion: "Replace with `(*zoob,)`" + fixable: true location: row: 22 column: 6 end_location: row: 22 column: 15 - parent: ~ -- kind: - name: UnpackInsteadOfConcatenatingToCollectionLiteral - body: "Consider `[*first, 4, 5, 6]` instead of concatenation" - suggestion: ~ - fixable: false - location: - row: 32 - column: 9 - end_location: - row: 39 - column: 1 - fix: ~ - parent: ~ -- kind: - name: UnpackInsteadOfConcatenatingToCollectionLiteral - body: "Consider `[*foo]` instead of concatenation" - suggestion: "Replace with `[*foo]`" - fixable: true - location: - row: 41 - column: 0 - end_location: - row: 41 - column: 8 - fix: - content: "[*foo]" + fix: + content: "(*zoob,)" + location: + row: 22 + column: 6 + end_location: + row: 22 + column: 15 + parent: ~ + - kind: + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `[*first, 4, 5, 6]` instead of concatenation" + suggestion: ~ + fixable: false + location: + row: 32 + column: 9 + end_location: + row: 39 + column: 1 + fix: ~ + parent: ~ + - kind: + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `[*foo]` instead of concatenation" + suggestion: "Replace with `[*foo]`" + fixable: true location: row: 41 column: 0 end_location: row: 41 column: 8 - parent: ~ -- kind: - name: UnpackInsteadOfConcatenatingToCollectionLiteral - body: "Consider `[*foo]` instead of concatenation" - suggestion: "Replace with `[*foo]`" - fixable: true - location: - row: 44 - column: 0 - end_location: - row: 44 - column: 8 - fix: - content: "[*foo]" + fix: + content: "[*foo]" + location: + row: 41 + column: 0 + end_location: + row: 41 + column: 8 + parent: ~ + - kind: + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `[*foo]` instead of concatenation" + suggestion: "Replace with `[*foo]`" + fixable: true location: row: 44 column: 0 end_location: row: 44 column: 8 - parent: ~ + fix: + content: "[*foo]" + location: + row: 44 + column: 0 + end_location: + row: 44 + column: 8 + parent: ~ +- - kind: + name: UnpackInsteadOfConcatenatingToCollectionLiteral + body: "Consider `[\"a\", \"b\", \"c\", *eggs, *list((\"yes\", \"no\", \"pants\", *zoob))]` instead of concatenation" + suggestion: "Replace with `[\"a\", \"b\", \"c\", *eggs, *list((\"yes\", \"no\", \"pants\", *zoob))]`" + fixable: true + location: + row: 20 + column: 8 + end_location: + row: 20 + column: 68 + fix: + content: "[\"a\", \"b\", \"c\", *eggs, *list((\"yes\", \"no\", \"pants\", *zoob))]" + location: + row: 20 + column: 8 + end_location: + row: 20 + column: 68 + parent: ~ diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF006_RUF006.py.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF006_RUF006.py.snap index c9fcfada6b7a1f..2eebbe5365a9e5 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF006_RUF006.py.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF006_RUF006.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- -- kind: - name: AsyncioDanglingTask - body: "Store a reference to the return value of `asyncio.create_task`" - suggestion: ~ - fixable: false - location: - row: 6 - column: 4 - end_location: - row: 6 - column: 49 - fix: ~ - parent: ~ -- kind: - name: AsyncioDanglingTask - body: "Store a reference to the return value of `asyncio.ensure_future`" - suggestion: ~ - fixable: false - location: - row: 11 - column: 4 - end_location: - row: 11 - column: 51 - fix: ~ - parent: ~ +- - kind: + name: AsyncioDanglingTask + body: "Store a reference to the return value of `asyncio.create_task`" + suggestion: ~ + fixable: false + location: + row: 6 + column: 4 + end_location: + row: 6 + column: 49 + fix: ~ + parent: ~ + - kind: + name: AsyncioDanglingTask + body: "Store a reference to the return value of `asyncio.ensure_future`" + suggestion: ~ + fixable: false + location: + row: 11 + column: 4 + end_location: + row: 11 + column: 51 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__confusables.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__confusables.snap index afe5d78ee5217b..9cbd29c382222e 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__confusables.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__confusables.snap @@ -2,64 +2,64 @@ source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- -- kind: - name: AmbiguousUnicodeCharacterString - body: "String contains ambiguous unicode character `𝐁` (did you mean `B`?)" - suggestion: "Replace `𝐁` with `B`" - fixable: true - location: - row: 1 - column: 5 - end_location: - row: 1 - column: 6 - fix: - content: B +- - kind: + name: AmbiguousUnicodeCharacterString + body: "String contains ambiguous unicode character `𝐁` (did you mean `B`?)" + suggestion: "Replace `𝐁` with `B`" + fixable: true location: row: 1 column: 5 end_location: row: 1 column: 6 - parent: ~ -- kind: - name: AmbiguousUnicodeCharacterDocstring - body: "Docstring contains ambiguous unicode character `)` (did you mean `)`?)" - suggestion: "Replace `)` with `)`" - fixable: true - location: - row: 6 - column: 55 - end_location: - row: 6 - column: 56 - fix: - content: ) + fix: + content: B + location: + row: 1 + column: 5 + end_location: + row: 1 + column: 6 + parent: ~ + - kind: + name: AmbiguousUnicodeCharacterDocstring + body: "Docstring contains ambiguous unicode character `)` (did you mean `)`?)" + suggestion: "Replace `)` with `)`" + fixable: true location: row: 6 column: 55 end_location: row: 6 column: 56 - parent: ~ -- kind: - name: AmbiguousUnicodeCharacterComment - body: "Comment contains ambiguous unicode character `᜵` (did you mean `/`?)" - suggestion: "Replace `᜵` with `/`" - fixable: true - location: - row: 7 - column: 61 - end_location: - row: 7 - column: 62 - fix: - content: / + fix: + content: ) + location: + row: 6 + column: 55 + end_location: + row: 6 + column: 56 + parent: ~ + - kind: + name: AmbiguousUnicodeCharacterComment + body: "Comment contains ambiguous unicode character `᜵` (did you mean `/`?)" + suggestion: "Replace `᜵` with `/`" + fixable: true location: row: 7 column: 61 end_location: row: 7 column: 62 - parent: ~ + fix: + content: / + location: + row: 7 + column: 61 + end_location: + row: 7 + column: 62 + parent: ~ diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__flake8_noqa.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__flake8_noqa.snap index f0a982393513de..e46c67db9ed1a8 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__flake8_noqa.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__flake8_noqa.snap @@ -1,6 +1,6 @@ --- -source: src/rules/ruff/mod.rs +source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__redirects.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__redirects.snap index f0a982393513de..e46c67db9ed1a8 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__redirects.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__redirects.snap @@ -1,6 +1,6 @@ --- -source: src/rules/ruff/mod.rs +source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_0.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_0.snap index a52e1d6cf8ad32..71ed25a74b3f67 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_0.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_0.snap @@ -2,455 +2,455 @@ source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- -- kind: - name: UnusedNOQA - body: "Unused blanket `noqa` directive" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 9 - column: 11 - end_location: - row: 9 - column: 17 - fix: - content: "" +- - kind: + name: UnusedNOQA + body: "Unused blanket `noqa` directive" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 9 - column: 9 + column: 11 end_location: row: 9 column: 17 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `d` is assigned to but never used" - suggestion: "Remove assignment to unused variable `d`" - fixable: true - location: - row: 13 - column: 4 - end_location: - row: 13 - column: 5 - fix: - content: "" - location: - row: 13 - column: 0 - end_location: - row: 14 - column: 0 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `E501`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 13 - column: 11 - end_location: - row: 13 - column: 23 - fix: - content: "" + fix: + content: "" + location: + row: 9 + column: 9 + end_location: + row: 9 + column: 17 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `E501`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 13 - column: 9 + column: 11 end_location: row: 13 column: 23 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `d` is assigned to but never used" - suggestion: "Remove assignment to unused variable `d`" - fixable: true - location: - row: 16 - column: 4 - end_location: - row: 16 - column: 5 - fix: - content: "" + fix: + content: "" + location: + row: 13 + column: 9 + end_location: + row: 13 + column: 23 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `F841`, `E501`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 16 - column: 0 - end_location: - row: 17 - column: 0 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `F841`, `E501`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 16 - column: 11 - end_location: - row: 16 - column: 29 - fix: - content: "" - location: - row: 16 - column: 9 + column: 11 end_location: row: 16 column: 29 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `d` is assigned to but never used" - suggestion: "Remove assignment to unused variable `d`" - fixable: true - location: - row: 19 - column: 4 - end_location: - row: 19 - column: 5 - fix: - content: "" - location: - row: 19 - column: 0 - end_location: - row: 20 - column: 0 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `F841`, `W191`; non-enabled: `F821`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 19 - column: 11 - end_location: - row: 19 - column: 35 - fix: - content: "" + fix: + content: "" + location: + row: 16 + column: 9 + end_location: + row: 16 + column: 29 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `F841`, `W191`; non-enabled: `F821`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 19 - column: 9 + column: 11 end_location: row: 19 column: 35 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `d` is assigned to but never used" - suggestion: "Remove assignment to unused variable `d`" - fixable: true - location: - row: 22 - column: 4 - end_location: - row: 22 - column: 5 - fix: - content: "" + fix: + content: "" + location: + row: 19 + column: 9 + end_location: + row: 19 + column: 35 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `F841`; unknown: `V101`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 22 - column: 0 - end_location: - row: 23 - column: 0 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `F841`; unknown: `V101`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 22 - column: 11 - end_location: - row: 22 - column: 29 - fix: - content: "" - location: - row: 22 - column: 9 + column: 11 end_location: row: 22 column: 29 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `d` is assigned to but never used" - suggestion: "Remove assignment to unused variable `d`" - fixable: true - location: - row: 26 - column: 4 - end_location: - row: 26 - column: 5 - fix: - content: "" - location: - row: 26 - column: 0 - end_location: - row: 27 - column: 0 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `E501`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 26 - column: 9 - end_location: - row: 26 - column: 21 - fix: - content: "" + fix: + content: "" + location: + row: 22 + column: 9 + end_location: + row: 22 + column: 29 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `E501`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 26 column: 9 end_location: row: 26 column: 21 - parent: ~ -- kind: - name: UnusedVariable - body: "Local variable `d` is assigned to but never used" - suggestion: "Remove assignment to unused variable `d`" - fixable: true - location: - row: 29 - column: 4 - end_location: - row: 29 - column: 5 - fix: - content: "" + fix: + content: "" + location: + row: 26 + column: 9 + end_location: + row: 26 + column: 21 + parent: ~ + - kind: + name: UnusedVariable + body: "Local variable `d` is assigned to but never used" + suggestion: "Remove assignment to unused variable `d`" + fixable: true location: row: 29 - column: 0 + column: 4 end_location: - row: 30 - column: 0 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `E501`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 29 - column: 32 - end_location: - row: 29 - column: 44 - fix: - content: "" + row: 29 + column: 5 + fix: + content: "" + location: + row: 29 + column: 0 + end_location: + row: 30 + column: 0 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `E501`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 29 - column: 9 + column: 32 end_location: row: 29 column: 44 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `F841`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 55 - column: 5 - end_location: - row: 55 - column: 23 - fix: - content: "# noqa: E501" + fix: + content: "" + location: + row: 29 + column: 9 + end_location: + row: 29 + column: 44 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `F841`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 55 column: 5 end_location: row: 55 column: 23 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `E501`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 63 - column: 5 - end_location: - row: 63 - column: 17 - fix: - content: "" + fix: + content: "# noqa: E501" + location: + row: 55 + column: 5 + end_location: + row: 55 + column: 23 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `E501`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 63 - column: 3 + column: 5 end_location: row: 63 column: 17 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused blanket `noqa` directive" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 71 - column: 5 - end_location: - row: 71 - column: 11 - fix: - content: "" + fix: + content: "" + location: + row: 63 + column: 3 + end_location: + row: 63 + column: 17 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused blanket `noqa` directive" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 71 - column: 3 + column: 5 end_location: row: 71 column: 11 - parent: ~ -- kind: - name: LineTooLong - body: Line too long (89 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 83 - column: 88 - end_location: - row: 83 - column: 89 - fix: ~ - parent: ~ -- kind: - name: LineTooLong - body: Line too long (89 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 84 - column: 88 - end_location: - row: 84 - column: 89 - fix: ~ - parent: ~ -- kind: - name: UnusedImport - body: "`shelve` imported but unused" - suggestion: "Remove unused import: `shelve`" - fixable: true - location: - row: 85 - column: 7 - end_location: - row: 85 - column: 13 - fix: - content: "" + fix: + content: "" + location: + row: 71 + column: 3 + end_location: + row: 71 + column: 11 + parent: ~ + - kind: + name: UnusedImport + body: "`shelve` imported but unused" + suggestion: "Remove unused import: `shelve`" + fixable: true location: row: 85 - column: 0 + column: 7 end_location: - row: 86 - column: 0 - parent: ~ -- kind: - name: LineTooLong - body: Line too long (89 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 85 - column: 88 - end_location: - row: 85 - column: 89 - fix: ~ - parent: ~ -- kind: - name: LineTooLong - body: Line too long (89 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 86 - column: 88 - end_location: - row: 86 - column: 89 - fix: ~ - parent: ~ -- kind: - name: LineTooLong - body: Line too long (89 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 87 - column: 88 - end_location: - row: 87 - column: 89 - fix: ~ - parent: ~ -- kind: - name: LineTooLong - body: Line too long (89 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 88 - column: 88 - end_location: - row: 88 - column: 89 - fix: ~ - parent: ~ -- kind: - name: LineTooLong - body: Line too long (103 > 88 characters) - suggestion: ~ - fixable: false - location: - row: 90 - column: 88 - end_location: - row: 90 - column: 103 - fix: ~ - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `F401`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 90 - column: 91 - end_location: - row: 90 - column: 103 - fix: - content: "" + row: 85 + column: 13 + fix: + content: "" + location: + row: 85 + column: 0 + end_location: + row: 86 + column: 0 + parent: ~ + - kind: + name: LineTooLong + body: Line too long (103 > 88 characters) + suggestion: ~ + fixable: false location: row: 90 - column: 89 + column: 88 end_location: row: 90 column: 103 - parent: ~ + fix: ~ + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `F401`)" + suggestion: "Remove unused `noqa` directive" + fixable: true + location: + row: 90 + column: 91 + end_location: + row: 90 + column: 103 + fix: + content: "" + location: + row: 90 + column: 89 + end_location: + row: 90 + column: 103 + parent: ~ +- - kind: + name: UnusedVariable + body: "Local variable `d` is assigned to but never used" + suggestion: "Remove assignment to unused variable `d`" + fixable: true + location: + row: 26 + column: 4 + end_location: + row: 26 + column: 5 + fix: + content: "" + location: + row: 26 + column: 0 + end_location: + row: 27 + column: 0 + parent: ~ + - kind: + name: LineTooLong + body: Line too long (89 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 88 + column: 88 + end_location: + row: 88 + column: 89 + fix: ~ + parent: ~ +- - kind: + name: UnusedVariable + body: "Local variable `d` is assigned to but never used" + suggestion: "Remove assignment to unused variable `d`" + fixable: true + location: + row: 22 + column: 4 + end_location: + row: 22 + column: 5 + fix: + content: "" + location: + row: 22 + column: 0 + end_location: + row: 23 + column: 0 + parent: ~ + - kind: + name: LineTooLong + body: Line too long (89 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 87 + column: 88 + end_location: + row: 87 + column: 89 + fix: ~ + parent: ~ +- - kind: + name: UnusedVariable + body: "Local variable `d` is assigned to but never used" + suggestion: "Remove assignment to unused variable `d`" + fixable: true + location: + row: 19 + column: 4 + end_location: + row: 19 + column: 5 + fix: + content: "" + location: + row: 19 + column: 0 + end_location: + row: 20 + column: 0 + parent: ~ + - kind: + name: LineTooLong + body: Line too long (89 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 86 + column: 88 + end_location: + row: 86 + column: 89 + fix: ~ + parent: ~ +- - kind: + name: UnusedVariable + body: "Local variable `d` is assigned to but never used" + suggestion: "Remove assignment to unused variable `d`" + fixable: true + location: + row: 16 + column: 4 + end_location: + row: 16 + column: 5 + fix: + content: "" + location: + row: 16 + column: 0 + end_location: + row: 17 + column: 0 + parent: ~ + - kind: + name: LineTooLong + body: Line too long (89 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 85 + column: 88 + end_location: + row: 85 + column: 89 + fix: ~ + parent: ~ +- - kind: + name: UnusedVariable + body: "Local variable `d` is assigned to but never used" + suggestion: "Remove assignment to unused variable `d`" + fixable: true + location: + row: 13 + column: 4 + end_location: + row: 13 + column: 5 + fix: + content: "" + location: + row: 13 + column: 0 + end_location: + row: 14 + column: 0 + parent: ~ + - kind: + name: LineTooLong + body: Line too long (89 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 84 + column: 88 + end_location: + row: 84 + column: 89 + fix: ~ + parent: ~ +- - kind: + name: LineTooLong + body: Line too long (89 > 88 characters) + suggestion: ~ + fixable: false + location: + row: 83 + column: 88 + end_location: + row: 83 + column: 89 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_1.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_1.snap index dbc4bc5de4a2f9..4130bd206ba42a 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_1.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_1.snap @@ -2,166 +2,166 @@ source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- -- kind: - name: UnusedImport - body: "`typing.Union` imported but unused" - suggestion: "Remove unused import: `typing.Union`" - fixable: true - location: - row: 37 - column: 8 - end_location: - row: 37 - column: 13 - fix: - content: "from typing import (\n Mapping, # noqa: F401\n )" +- - kind: + name: UnusedImport + body: "`typing.Union` imported but unused" + suggestion: "Remove unused import: `typing.Union`" + fixable: true location: + row: 37 + column: 8 + end_location: + row: 37 + column: 13 + fix: + content: "from typing import (\n Mapping, # noqa: F401\n )" + location: + row: 35 + column: 4 + end_location: + row: 38 + column: 5 + parent: row: 35 column: 4 - end_location: - row: 38 - column: 5 - parent: - row: 35 - column: 4 -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `F401`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 52 - column: 19 - end_location: - row: 52 - column: 31 - fix: - content: "" + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `F401`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 52 - column: 17 + column: 19 end_location: row: 52 column: 31 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `F401`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 59 - column: 19 - end_location: - row: 59 - column: 31 - fix: - content: "" + fix: + content: "" + location: + row: 52 + column: 17 + end_location: + row: 52 + column: 31 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `F401`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 59 - column: 17 + column: 19 end_location: row: 59 column: 31 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (non-enabled: `F501`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 66 - column: 15 - end_location: - row: 66 - column: 27 - fix: - content: "" + fix: + content: "" + location: + row: 59 + column: 17 + end_location: + row: 59 + column: 31 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (non-enabled: `F501`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 66 - column: 13 + column: 15 end_location: row: 66 column: 27 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (non-enabled: `F501`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 72 - column: 26 - end_location: - row: 72 - column: 38 - fix: - content: "" + fix: + content: "" + location: + row: 66 + column: 13 + end_location: + row: 66 + column: 27 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (non-enabled: `F501`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 72 - column: 24 + column: 26 end_location: row: 72 column: 38 - parent: ~ -- kind: - name: UnusedImport - body: "`typing.Awaitable` imported but unused" - suggestion: Remove unused import - fixable: true - location: - row: 89 - column: 23 - end_location: - row: 89 - column: 32 - fix: - content: pass + fix: + content: "" + location: + row: 72 + column: 24 + end_location: + row: 72 + column: 38 + parent: ~ + - kind: + name: UnusedImport + body: "`typing.Awaitable` imported but unused" + suggestion: Remove unused import + fixable: true location: row: 89 - column: 4 + column: 23 end_location: row: 89 - column: 52 - parent: ~ -- kind: - name: UnusedImport - body: "`typing.AwaitableGenerator` imported but unused" - suggestion: Remove unused import - fixable: true - location: - row: 89 - column: 34 - end_location: - row: 89 - column: 52 - fix: - content: pass + column: 32 + fix: + content: pass + location: + row: 89 + column: 4 + end_location: + row: 89 + column: 52 + parent: ~ + - kind: + name: UnusedImport + body: "`typing.AwaitableGenerator` imported but unused" + suggestion: Remove unused import + fixable: true location: row: 89 - column: 4 + column: 34 end_location: row: 89 column: 52 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (non-enabled: `F501`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 89 - column: 54 - end_location: - row: 89 - column: 66 - fix: - content: "" + fix: + content: pass + location: + row: 89 + column: 4 + end_location: + row: 89 + column: 52 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (non-enabled: `F501`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 89 - column: 52 + column: 54 end_location: row: 89 column: 66 - parent: ~ + fix: + content: "" + location: + row: 89 + column: 52 + end_location: + row: 89 + column: 66 + parent: ~ diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_2.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_2.snap index 04ceb69caafb9f..d60630f649f1a0 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_2.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_2.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `F401`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 1 - column: 18 - end_location: - row: 1 - column: 30 - fix: - content: "" +- - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `F401`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 1 - column: 16 + column: 18 end_location: row: 1 column: 30 - parent: ~ + fix: + content: "" + location: + row: 1 + column: 16 + end_location: + row: 1 + column: 30 + parent: ~ diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_3.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_3.snap index 9ed8cd078e28d2..db136b87110a56 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_3.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_3.snap @@ -2,204 +2,204 @@ source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- -- kind: - name: UnusedNOQA - body: "Unused blanket `noqa` directive" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 1 - column: 0 - end_location: - row: 1 - column: 6 - fix: - content: "" +- - kind: + name: UnusedNOQA + body: "Unused blanket `noqa` directive" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 1 column: 0 end_location: - row: 2 - column: 0 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused blanket `noqa` directive" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 2 - column: 0 - end_location: - row: 2 - column: 6 - fix: - content: "" + row: 1 + column: 6 + fix: + content: "" + location: + row: 1 + column: 0 + end_location: + row: 2 + column: 0 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused blanket `noqa` directive" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 2 column: 0 end_location: row: 2 - column: 7 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused blanket `noqa` directive" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 3 - column: 9 - end_location: - row: 3 - column: 15 - fix: - content: "" + column: 6 + fix: + content: "" + location: + row: 2 + column: 0 + end_location: + row: 2 + column: 7 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused blanket `noqa` directive" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 3 - column: 7 + column: 9 end_location: row: 3 column: 15 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused blanket `noqa` directive" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 4 - column: 9 - end_location: - row: 4 - column: 15 - fix: - content: "" + fix: + content: "" + location: + row: 3 + column: 7 + end_location: + row: 3 + column: 15 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused blanket `noqa` directive" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 4 column: 9 end_location: row: 4 - column: 16 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `E501`, `F821`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 8 - column: 0 - end_location: - row: 8 - column: 18 - fix: - content: "" + column: 15 + fix: + content: "" + location: + row: 4 + column: 9 + end_location: + row: 4 + column: 16 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `E501`, `F821`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 8 column: 0 end_location: - row: 9 - column: 0 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `E501`, `F821`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 9 - column: 0 - end_location: - row: 9 - column: 18 - fix: - content: "" + row: 8 + column: 18 + fix: + content: "" + location: + row: 8 + column: 0 + end_location: + row: 9 + column: 0 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `E501`, `F821`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 9 column: 0 end_location: row: 9 - column: 19 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `E501`, `F821`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 10 - column: 9 - end_location: - row: 10 - column: 27 - fix: - content: "" + column: 18 + fix: + content: "" + location: + row: 9 + column: 0 + end_location: + row: 9 + column: 19 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `E501`, `F821`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 10 - column: 7 + column: 9 end_location: row: 10 column: 27 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `E501`, `F821`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 11 - column: 9 - end_location: - row: 11 - column: 27 - fix: - content: "" + fix: + content: "" + location: + row: 10 + column: 7 + end_location: + row: 10 + column: 27 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `E501`, `F821`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 11 column: 9 end_location: row: 11 - column: 28 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `E501`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 12 - column: 10 - end_location: - row: 12 - column: 28 - fix: - content: "# noqa: F821" + column: 27 + fix: + content: "" + location: + row: 11 + column: 9 + end_location: + row: 11 + column: 28 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `E501`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 12 column: 10 end_location: row: 12 column: 28 - parent: ~ -- kind: - name: UnusedNOQA - body: "Unused `noqa` directive (unused: `E501`)" - suggestion: "Remove unused `noqa` directive" - fixable: true - location: - row: 13 - column: 10 - end_location: - row: 13 - column: 28 - fix: - content: "# noqa: F821" + fix: + content: "# noqa: F821" + location: + row: 12 + column: 10 + end_location: + row: 12 + column: 28 + parent: ~ + - kind: + name: UnusedNOQA + body: "Unused `noqa` directive (unused: `E501`)" + suggestion: "Remove unused `noqa` directive" + fixable: true location: row: 13 column: 10 end_location: row: 13 column: 28 - parent: ~ + fix: + content: "# noqa: F821" + location: + row: 13 + column: 10 + end_location: + row: 13 + column: 28 + parent: ~ diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_noqa.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_noqa.snap index f0a982393513de..e46c67db9ed1a8 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_noqa.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_noqa.snap @@ -1,6 +1,6 @@ --- -source: src/rules/ruff/mod.rs +source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- -[] +- [] diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_pairwise_over_zipped.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_pairwise_over_zipped.snap index 944d3bb391585f..b02f07b4f789f1 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_pairwise_over_zipped.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_pairwise_over_zipped.snap @@ -2,95 +2,95 @@ source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- -- kind: - name: PairwiseOverZipped - body: "Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs" - suggestion: ~ - fixable: false - location: - row: 13 - column: 0 - end_location: - row: 13 - column: 3 - fix: ~ - parent: ~ -- kind: - name: PairwiseOverZipped - body: "Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs" - suggestion: ~ - fixable: false - location: - row: 14 - column: 0 - end_location: - row: 14 - column: 3 - fix: ~ - parent: ~ -- kind: - name: PairwiseOverZipped - body: "Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs" - suggestion: ~ - fixable: false - location: - row: 15 - column: 0 - end_location: - row: 15 - column: 3 - fix: ~ - parent: ~ -- kind: - name: PairwiseOverZipped - body: "Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs" - suggestion: ~ - fixable: false - location: - row: 16 - column: 0 - end_location: - row: 16 - column: 3 - fix: ~ - parent: ~ -- kind: - name: PairwiseOverZipped - body: "Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs" - suggestion: ~ - fixable: false - location: - row: 17 - column: 0 - end_location: - row: 17 - column: 3 - fix: ~ - parent: ~ -- kind: - name: PairwiseOverZipped - body: "Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs" - suggestion: ~ - fixable: false - location: - row: 18 - column: 5 - end_location: - row: 18 - column: 8 - fix: ~ - parent: ~ -- kind: - name: PairwiseOverZipped - body: "Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs" - suggestion: ~ - fixable: false - location: - row: 19 - column: 5 - end_location: - row: 19 - column: 8 - fix: ~ - parent: ~ +- - kind: + name: PairwiseOverZipped + body: "Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs" + suggestion: ~ + fixable: false + location: + row: 13 + column: 0 + end_location: + row: 13 + column: 3 + fix: ~ + parent: ~ + - kind: + name: PairwiseOverZipped + body: "Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs" + suggestion: ~ + fixable: false + location: + row: 14 + column: 0 + end_location: + row: 14 + column: 3 + fix: ~ + parent: ~ + - kind: + name: PairwiseOverZipped + body: "Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs" + suggestion: ~ + fixable: false + location: + row: 15 + column: 0 + end_location: + row: 15 + column: 3 + fix: ~ + parent: ~ + - kind: + name: PairwiseOverZipped + body: "Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs" + suggestion: ~ + fixable: false + location: + row: 16 + column: 0 + end_location: + row: 16 + column: 3 + fix: ~ + parent: ~ + - kind: + name: PairwiseOverZipped + body: "Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs" + suggestion: ~ + fixable: false + location: + row: 17 + column: 0 + end_location: + row: 17 + column: 3 + fix: ~ + parent: ~ + - kind: + name: PairwiseOverZipped + body: "Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs" + suggestion: ~ + fixable: false + location: + row: 18 + column: 5 + end_location: + row: 18 + column: 8 + fix: ~ + parent: ~ + - kind: + name: PairwiseOverZipped + body: "Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs" + suggestion: ~ + fixable: false + location: + row: 19 + column: 5 + end_location: + row: 19 + column: 8 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_targeted_noqa.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_targeted_noqa.snap index 785e17d410cddf..d419ce3bfe65bf 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_targeted_noqa.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_targeted_noqa.snap @@ -2,24 +2,24 @@ source: crates/ruff/src/rules/ruff/mod.rs expression: diagnostics --- -- kind: - name: UnusedVariable - body: "Local variable `x` is assigned to but never used" - suggestion: "Remove assignment to unused variable `x`" - fixable: true - location: - row: 8 - column: 4 - end_location: - row: 8 - column: 5 - fix: - content: pass +- - kind: + name: UnusedVariable + body: "Local variable `x` is assigned to but never used" + suggestion: "Remove assignment to unused variable `x`" + fixable: true location: row: 8 column: 4 end_location: row: 8 - column: 9 - parent: ~ + column: 5 + fix: + content: pass + location: + row: 8 + column: 4 + end_location: + row: 8 + column: 9 + parent: ~ diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__error-instead-of-exception_TRY400.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__error-instead-of-exception_TRY400.py.snap index 0bba9d51340eeb..1132fb6ed6af30 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__error-instead-of-exception_TRY400.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__error-instead-of-exception_TRY400.py.snap @@ -2,108 +2,108 @@ source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- -- kind: - name: ErrorInsteadOfException - body: "Use `logging.exception` instead of `logging.error`" - suggestion: ~ - fixable: false - location: - row: 15 - column: 8 - end_location: - row: 15 - column: 45 - fix: ~ - parent: ~ -- kind: - name: ErrorInsteadOfException - body: "Use `logging.exception` instead of `logging.error`" - suggestion: ~ - fixable: false - location: - row: 18 - column: 12 - end_location: - row: 18 - column: 49 - fix: ~ - parent: ~ -- kind: - name: ErrorInsteadOfException - body: "Use `logging.exception` instead of `logging.error`" - suggestion: ~ - fixable: false - location: - row: 25 - column: 8 - end_location: - row: 25 - column: 44 - fix: ~ - parent: ~ -- kind: - name: ErrorInsteadOfException - body: "Use `logging.exception` instead of `logging.error`" - suggestion: ~ - fixable: false - location: - row: 28 - column: 12 - end_location: - row: 28 - column: 48 - fix: ~ - parent: ~ -- kind: - name: ErrorInsteadOfException - body: "Use `logging.exception` instead of `logging.error`" - suggestion: ~ - fixable: false - location: - row: 35 - column: 8 - end_location: - row: 35 - column: 41 - fix: ~ - parent: ~ -- kind: - name: ErrorInsteadOfException - body: "Use `logging.exception` instead of `logging.error`" - suggestion: ~ - fixable: false - location: - row: 38 - column: 12 - end_location: - row: 38 - column: 45 - fix: ~ - parent: ~ -- kind: - name: ErrorInsteadOfException - body: "Use `logging.exception` instead of `logging.error`" - suggestion: ~ - fixable: false - location: - row: 45 - column: 8 - end_location: - row: 45 - column: 49 - fix: ~ - parent: ~ -- kind: - name: ErrorInsteadOfException - body: "Use `logging.exception` instead of `logging.error`" - suggestion: ~ - fixable: false - location: - row: 48 - column: 12 - end_location: - row: 48 - column: 53 - fix: ~ - parent: ~ +- - kind: + name: ErrorInsteadOfException + body: "Use `logging.exception` instead of `logging.error`" + suggestion: ~ + fixable: false + location: + row: 15 + column: 8 + end_location: + row: 15 + column: 45 + fix: ~ + parent: ~ + - kind: + name: ErrorInsteadOfException + body: "Use `logging.exception` instead of `logging.error`" + suggestion: ~ + fixable: false + location: + row: 18 + column: 12 + end_location: + row: 18 + column: 49 + fix: ~ + parent: ~ + - kind: + name: ErrorInsteadOfException + body: "Use `logging.exception` instead of `logging.error`" + suggestion: ~ + fixable: false + location: + row: 25 + column: 8 + end_location: + row: 25 + column: 44 + fix: ~ + parent: ~ + - kind: + name: ErrorInsteadOfException + body: "Use `logging.exception` instead of `logging.error`" + suggestion: ~ + fixable: false + location: + row: 28 + column: 12 + end_location: + row: 28 + column: 48 + fix: ~ + parent: ~ + - kind: + name: ErrorInsteadOfException + body: "Use `logging.exception` instead of `logging.error`" + suggestion: ~ + fixable: false + location: + row: 35 + column: 8 + end_location: + row: 35 + column: 41 + fix: ~ + parent: ~ + - kind: + name: ErrorInsteadOfException + body: "Use `logging.exception` instead of `logging.error`" + suggestion: ~ + fixable: false + location: + row: 38 + column: 12 + end_location: + row: 38 + column: 45 + fix: ~ + parent: ~ + - kind: + name: ErrorInsteadOfException + body: "Use `logging.exception` instead of `logging.error`" + suggestion: ~ + fixable: false + location: + row: 45 + column: 8 + end_location: + row: 45 + column: 49 + fix: ~ + parent: ~ + - kind: + name: ErrorInsteadOfException + body: "Use `logging.exception` instead of `logging.error`" + suggestion: ~ + fixable: false + location: + row: 48 + column: 12 + end_location: + row: 48 + column: 53 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__prefer-type-error_TRY004.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__prefer-type-error_TRY004.py.snap index b7518c44fc72a6..5a909f10102ee3 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__prefer-type-error_TRY004.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__prefer-type-error_TRY004.py.snap @@ -2,446 +2,446 @@ source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 12 - column: 8 - end_location: - row: 12 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 19 - column: 8 - end_location: - row: 19 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 30 - column: 8 - end_location: - row: 30 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 37 - column: 8 - end_location: - row: 37 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 44 - column: 8 - end_location: - row: 44 - column: 36 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 51 - column: 8 - end_location: - row: 51 - column: 35 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 58 - column: 8 - end_location: - row: 58 - column: 35 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 65 - column: 8 - end_location: - row: 65 - column: 25 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 72 - column: 8 - end_location: - row: 72 - column: 29 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 79 - column: 8 - end_location: - row: 79 - column: 32 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 86 - column: 8 - end_location: - row: 86 - column: 32 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 95 - column: 8 - end_location: - row: 97 - column: 9 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 104 - column: 8 - end_location: - row: 104 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 111 - column: 8 - end_location: - row: 111 - column: 35 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 118 - column: 8 - end_location: - row: 118 - column: 33 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 125 - column: 8 - end_location: - row: 125 - column: 32 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 132 - column: 8 - end_location: - row: 132 - column: 32 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 139 - column: 8 - end_location: - row: 139 - column: 31 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 146 - column: 8 - end_location: - row: 146 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 153 - column: 8 - end_location: - row: 153 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 160 - column: 8 - end_location: - row: 160 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 167 - column: 8 - end_location: - row: 167 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 174 - column: 8 - end_location: - row: 174 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 181 - column: 8 - end_location: - row: 181 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 188 - column: 8 - end_location: - row: 188 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 195 - column: 8 - end_location: - row: 195 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 202 - column: 8 - end_location: - row: 202 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 209 - column: 8 - end_location: - row: 209 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 216 - column: 8 - end_location: - row: 216 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 223 - column: 8 - end_location: - row: 223 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 230 - column: 8 - end_location: - row: 230 - column: 30 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 267 - column: 8 - end_location: - row: 267 - column: 31 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 277 - column: 8 - end_location: - row: 277 - column: 31 - fix: ~ - parent: ~ -- kind: - name: PreferTypeError - body: "Prefer `TypeError` exception for invalid type" - suggestion: ~ - fixable: false - location: - row: 288 - column: 8 - end_location: - row: 288 - column: 31 - fix: ~ - parent: ~ +- - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 12 + column: 8 + end_location: + row: 12 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 19 + column: 8 + end_location: + row: 19 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 30 + column: 8 + end_location: + row: 30 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 37 + column: 8 + end_location: + row: 37 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 44 + column: 8 + end_location: + row: 44 + column: 36 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 51 + column: 8 + end_location: + row: 51 + column: 35 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 58 + column: 8 + end_location: + row: 58 + column: 35 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 65 + column: 8 + end_location: + row: 65 + column: 25 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 72 + column: 8 + end_location: + row: 72 + column: 29 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 79 + column: 8 + end_location: + row: 79 + column: 32 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 86 + column: 8 + end_location: + row: 86 + column: 32 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 95 + column: 8 + end_location: + row: 97 + column: 9 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 104 + column: 8 + end_location: + row: 104 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 111 + column: 8 + end_location: + row: 111 + column: 35 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 118 + column: 8 + end_location: + row: 118 + column: 33 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 125 + column: 8 + end_location: + row: 125 + column: 32 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 132 + column: 8 + end_location: + row: 132 + column: 32 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 139 + column: 8 + end_location: + row: 139 + column: 31 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 146 + column: 8 + end_location: + row: 146 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 153 + column: 8 + end_location: + row: 153 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 160 + column: 8 + end_location: + row: 160 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 167 + column: 8 + end_location: + row: 167 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 174 + column: 8 + end_location: + row: 174 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 181 + column: 8 + end_location: + row: 181 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 188 + column: 8 + end_location: + row: 188 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 195 + column: 8 + end_location: + row: 195 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 202 + column: 8 + end_location: + row: 202 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 209 + column: 8 + end_location: + row: 209 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 216 + column: 8 + end_location: + row: 216 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 223 + column: 8 + end_location: + row: 223 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 230 + column: 8 + end_location: + row: 230 + column: 30 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 267 + column: 8 + end_location: + row: 267 + column: 31 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 277 + column: 8 + end_location: + row: 277 + column: 31 + fix: ~ + parent: ~ + - kind: + name: PreferTypeError + body: "Prefer `TypeError` exception for invalid type" + suggestion: ~ + fixable: false + location: + row: 288 + column: 8 + end_location: + row: 288 + column: 31 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-args_TRY003.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-args_TRY003.py.snap index 4a0e766112f7d3..dc8a20484bb316 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-args_TRY003.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-args_TRY003.py.snap @@ -2,56 +2,56 @@ source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- -- kind: - name: RaiseVanillaArgs - body: Avoid specifying long messages outside the exception class - suggestion: ~ - fixable: false - location: - row: 8 - column: 14 - end_location: - row: 8 - column: 45 - fix: ~ - parent: ~ -- kind: - name: RaiseVanillaArgs - body: Avoid specifying long messages outside the exception class - suggestion: ~ - fixable: false - location: - row: 34 - column: 14 - end_location: - row: 34 - column: 68 - fix: ~ - parent: ~ -- kind: - name: RaiseVanillaArgs - body: Avoid specifying long messages outside the exception class - suggestion: ~ - fixable: false - location: - row: 39 - column: 14 - end_location: - row: 39 - column: 70 - fix: ~ - parent: ~ -- kind: - name: RaiseVanillaArgs - body: Avoid specifying long messages outside the exception class - suggestion: ~ - fixable: false - location: - row: 44 - column: 14 - end_location: - row: 44 - column: 69 - fix: ~ - parent: ~ +- - kind: + name: RaiseVanillaArgs + body: Avoid specifying long messages outside the exception class + suggestion: ~ + fixable: false + location: + row: 8 + column: 14 + end_location: + row: 8 + column: 45 + fix: ~ + parent: ~ + - kind: + name: RaiseVanillaArgs + body: Avoid specifying long messages outside the exception class + suggestion: ~ + fixable: false + location: + row: 34 + column: 14 + end_location: + row: 34 + column: 68 + fix: ~ + parent: ~ + - kind: + name: RaiseVanillaArgs + body: Avoid specifying long messages outside the exception class + suggestion: ~ + fixable: false + location: + row: 39 + column: 14 + end_location: + row: 39 + column: 70 + fix: ~ + parent: ~ + - kind: + name: RaiseVanillaArgs + body: Avoid specifying long messages outside the exception class + suggestion: ~ + fixable: false + location: + row: 44 + column: 14 + end_location: + row: 44 + column: 69 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-class_TRY002.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-class_TRY002.py.snap index db68e5dc9247f4..cc25611bad8c08 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-class_TRY002.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-class_TRY002.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- -- kind: - name: RaiseVanillaClass - body: Create your own exception - suggestion: ~ - fixable: false - location: - row: 13 - column: 14 - end_location: - row: 13 - column: 41 - fix: ~ - parent: ~ -- kind: - name: RaiseVanillaClass - body: Create your own exception - suggestion: ~ - fixable: false - location: - row: 17 - column: 14 - end_location: - row: 17 - column: 23 - fix: ~ - parent: ~ +- - kind: + name: RaiseVanillaClass + body: Create your own exception + suggestion: ~ + fixable: false + location: + row: 13 + column: 14 + end_location: + row: 13 + column: 41 + fix: ~ + parent: ~ + - kind: + name: RaiseVanillaClass + body: Create your own exception + suggestion: ~ + fixable: false + location: + row: 17 + column: 14 + end_location: + row: 17 + column: 23 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-within-try_TRY301.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-within-try_TRY301.py.snap index 34790bde96a926..c19ca6e9fdce69 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-within-try_TRY301.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-within-try_TRY301.py.snap @@ -2,82 +2,82 @@ source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- -- kind: - name: RaiseWithinTry - body: "Abstract `raise` to an inner function" - suggestion: ~ - fixable: false - location: - row: 9 - column: 12 - end_location: - row: 9 - column: 32 - fix: ~ - parent: ~ -- kind: - name: RaiseWithinTry - body: "Abstract `raise` to an inner function" - suggestion: ~ - fixable: false - location: - row: 11 - column: 8 - end_location: - row: 11 - column: 28 - fix: ~ - parent: ~ -- kind: - name: RaiseWithinTry - body: "Abstract `raise` to an inner function" - suggestion: ~ - fixable: false - location: - row: 16 - column: 16 - end_location: - row: 16 - column: 36 - fix: ~ - parent: ~ -- kind: - name: RaiseWithinTry - body: "Abstract `raise` to an inner function" - suggestion: ~ - fixable: false - location: - row: 27 - column: 12 - end_location: - row: 27 - column: 32 - fix: ~ - parent: ~ -- kind: - name: RaiseWithinTry - body: "Abstract `raise` to an inner function" - suggestion: ~ - fixable: false - location: - row: 29 - column: 8 - end_location: - row: 29 - column: 28 - fix: ~ - parent: ~ -- kind: - name: RaiseWithinTry - body: "Abstract `raise` to an inner function" - suggestion: ~ - fixable: false - location: - row: 34 - column: 16 - end_location: - row: 34 - column: 36 - fix: ~ - parent: ~ +- - kind: + name: RaiseWithinTry + body: "Abstract `raise` to an inner function" + suggestion: ~ + fixable: false + location: + row: 9 + column: 12 + end_location: + row: 9 + column: 32 + fix: ~ + parent: ~ + - kind: + name: RaiseWithinTry + body: "Abstract `raise` to an inner function" + suggestion: ~ + fixable: false + location: + row: 11 + column: 8 + end_location: + row: 11 + column: 28 + fix: ~ + parent: ~ + - kind: + name: RaiseWithinTry + body: "Abstract `raise` to an inner function" + suggestion: ~ + fixable: false + location: + row: 16 + column: 16 + end_location: + row: 16 + column: 36 + fix: ~ + parent: ~ + - kind: + name: RaiseWithinTry + body: "Abstract `raise` to an inner function" + suggestion: ~ + fixable: false + location: + row: 27 + column: 12 + end_location: + row: 27 + column: 32 + fix: ~ + parent: ~ + - kind: + name: RaiseWithinTry + body: "Abstract `raise` to an inner function" + suggestion: ~ + fixable: false + location: + row: 29 + column: 8 + end_location: + row: 29 + column: 28 + fix: ~ + parent: ~ + - kind: + name: RaiseWithinTry + body: "Abstract `raise` to an inner function" + suggestion: ~ + fixable: false + location: + row: 34 + column: 16 + end_location: + row: 34 + column: 36 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__reraise-no-cause_TRY200.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__reraise-no-cause_TRY200.py.snap index 7c2e4a7b85d5e3..a5bef4b0307299 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__reraise-no-cause_TRY200.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__reraise-no-cause_TRY200.py.snap @@ -2,30 +2,30 @@ source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- -- kind: - name: ReraiseNoCause - body: "Use `raise from` to specify exception cause" - suggestion: ~ - fixable: false - location: - row: 15 - column: 8 - end_location: - row: 15 - column: 27 - fix: ~ - parent: ~ -- kind: - name: ReraiseNoCause - body: "Use `raise from` to specify exception cause" - suggestion: ~ - fixable: false - location: - row: 23 - column: 12 - end_location: - row: 23 - column: 31 - fix: ~ - parent: ~ +- - kind: + name: ReraiseNoCause + body: "Use `raise from` to specify exception cause" + suggestion: ~ + fixable: false + location: + row: 15 + column: 8 + end_location: + row: 15 + column: 27 + fix: ~ + parent: ~ + - kind: + name: ReraiseNoCause + body: "Use `raise from` to specify exception cause" + suggestion: ~ + fixable: false + location: + row: 23 + column: 12 + end_location: + row: 23 + column: 31 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__try-consider-else_TRY300.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__try-consider-else_TRY300.py.snap index 5a9ace3f22476b..299183272c369e 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__try-consider-else_TRY300.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__try-consider-else_TRY300.py.snap @@ -2,17 +2,17 @@ source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- -- kind: - name: TryConsiderElse - body: "Consider moving this statement to an `else` block" - suggestion: ~ - fixable: false - location: - row: 20 - column: 8 - end_location: - row: 20 - column: 16 - fix: ~ - parent: ~ +- - kind: + name: TryConsiderElse + body: "Consider moving this statement to an `else` block" + suggestion: ~ + fixable: false + location: + row: 20 + column: 8 + end_location: + row: 20 + column: 16 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-log-message_TRY401.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-log-message_TRY401.py.snap index 40d54e98b3d6ca..69bed5078cefd7 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-log-message_TRY401.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-log-message_TRY401.py.snap @@ -2,134 +2,134 @@ source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- -- kind: - name: VerboseLogMessage - body: "Redundant exception object included in `logging.exception` call" - suggestion: ~ - fixable: false - location: - row: 8 - column: 44 - end_location: - row: 8 - column: 46 - fix: ~ - parent: ~ -- kind: - name: VerboseLogMessage - body: "Redundant exception object included in `logging.exception` call" - suggestion: ~ - fixable: false - location: - row: 19 - column: 52 - end_location: - row: 19 - column: 55 - fix: ~ - parent: ~ -- kind: - name: VerboseLogMessage - body: "Redundant exception object included in `logging.exception` call" - suggestion: ~ - fixable: false - location: - row: 21 - column: 44 - end_location: - row: 21 - column: 47 - fix: ~ - parent: ~ -- kind: - name: VerboseLogMessage - body: "Redundant exception object included in `logging.exception` call" - suggestion: ~ - fixable: false - location: - row: 21 - column: 50 - end_location: - row: 21 - column: 53 - fix: ~ - parent: ~ -- kind: - name: VerboseLogMessage - body: "Redundant exception object included in `logging.exception` call" - suggestion: ~ - fixable: false - location: - row: 23 - column: 44 - end_location: - row: 23 - column: 47 - fix: ~ - parent: ~ -- kind: - name: VerboseLogMessage - body: "Redundant exception object included in `logging.exception` call" - suggestion: ~ - fixable: false - location: - row: 24 - column: 44 - end_location: - row: 24 - column: 47 - fix: ~ - parent: ~ -- kind: - name: VerboseLogMessage - body: "Redundant exception object included in `logging.exception` call" - suggestion: ~ - fixable: false - location: - row: 27 - column: 48 - end_location: - row: 27 - column: 51 - fix: ~ - parent: ~ -- kind: - name: VerboseLogMessage - body: "Redundant exception object included in `logging.exception` call" - suggestion: ~ - fixable: false - location: - row: 39 - column: 46 - end_location: - row: 39 - column: 48 - fix: ~ - parent: ~ -- kind: - name: VerboseLogMessage - body: "Redundant exception object included in `logging.exception` call" - suggestion: ~ - fixable: false - location: - row: 46 - column: 52 - end_location: - row: 46 - column: 54 - fix: ~ - parent: ~ -- kind: - name: VerboseLogMessage - body: "Redundant exception object included in `logging.exception` call" - suggestion: ~ - fixable: false - location: - row: 53 - column: 46 - end_location: - row: 53 - column: 48 - fix: ~ - parent: ~ +- - kind: + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + suggestion: ~ + fixable: false + location: + row: 8 + column: 44 + end_location: + row: 8 + column: 46 + fix: ~ + parent: ~ + - kind: + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + suggestion: ~ + fixable: false + location: + row: 19 + column: 52 + end_location: + row: 19 + column: 55 + fix: ~ + parent: ~ + - kind: + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + suggestion: ~ + fixable: false + location: + row: 21 + column: 44 + end_location: + row: 21 + column: 47 + fix: ~ + parent: ~ + - kind: + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + suggestion: ~ + fixable: false + location: + row: 21 + column: 50 + end_location: + row: 21 + column: 53 + fix: ~ + parent: ~ + - kind: + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + suggestion: ~ + fixable: false + location: + row: 23 + column: 44 + end_location: + row: 23 + column: 47 + fix: ~ + parent: ~ + - kind: + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + suggestion: ~ + fixable: false + location: + row: 24 + column: 44 + end_location: + row: 24 + column: 47 + fix: ~ + parent: ~ + - kind: + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + suggestion: ~ + fixable: false + location: + row: 27 + column: 48 + end_location: + row: 27 + column: 51 + fix: ~ + parent: ~ + - kind: + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + suggestion: ~ + fixable: false + location: + row: 39 + column: 46 + end_location: + row: 39 + column: 48 + fix: ~ + parent: ~ + - kind: + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + suggestion: ~ + fixable: false + location: + row: 46 + column: 52 + end_location: + row: 46 + column: 54 + fix: ~ + parent: ~ + - kind: + name: VerboseLogMessage + body: "Redundant exception object included in `logging.exception` call" + suggestion: ~ + fixable: false + location: + row: 53 + column: 46 + end_location: + row: 53 + column: 48 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-raise_TRY201.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-raise_TRY201.py.snap index 4bb80043d18f2f..3fa1c391e38515 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-raise_TRY201.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-raise_TRY201.py.snap @@ -2,43 +2,43 @@ source: crates/ruff/src/rules/tryceratops/mod.rs expression: diagnostics --- -- kind: - name: VerboseRaise - body: "Use `raise` without specifying exception name" - suggestion: ~ - fixable: false - location: - row: 20 - column: 14 - end_location: - row: 20 - column: 15 - fix: ~ - parent: ~ -- kind: - name: VerboseRaise - body: "Use `raise` without specifying exception name" - suggestion: ~ - fixable: false - location: - row: 63 - column: 18 - end_location: - row: 63 - column: 19 - fix: ~ - parent: ~ -- kind: - name: VerboseRaise - body: "Use `raise` without specifying exception name" - suggestion: ~ - fixable: false - location: - row: 74 - column: 22 - end_location: - row: 74 - column: 23 - fix: ~ - parent: ~ +- - kind: + name: VerboseRaise + body: "Use `raise` without specifying exception name" + suggestion: ~ + fixable: false + location: + row: 20 + column: 14 + end_location: + row: 20 + column: 15 + fix: ~ + parent: ~ + - kind: + name: VerboseRaise + body: "Use `raise` without specifying exception name" + suggestion: ~ + fixable: false + location: + row: 63 + column: 18 + end_location: + row: 63 + column: 19 + fix: ~ + parent: ~ + - kind: + name: VerboseRaise + body: "Use `raise` without specifying exception name" + suggestion: ~ + fixable: false + location: + row: 74 + column: 22 + end_location: + row: 74 + column: 23 + fix: ~ + parent: ~ diff --git a/crates/ruff/src/test.rs b/crates/ruff/src/test.rs index c5c97d0ba7ff78..4258c5ab9887c4 100644 --- a/crates/ruff/src/test.rs +++ b/crates/ruff/src/test.rs @@ -21,7 +21,7 @@ pub fn test_resource_path(path: impl AsRef) -> std::path::PathBuf { /// A convenient wrapper around [`check_path`], that additionally /// asserts that autofixes converge after 10 iterations. -pub fn test_path(path: impl AsRef, settings: &Settings) -> Result> { +pub fn test_path(path: impl AsRef, settings: &Settings) -> Result>> { let path = test_resource_path("fixtures").join(path); let package = path .parent() @@ -50,7 +50,7 @@ pub fn test_path(path: impl AsRef, settings: &Settings) -> Result, settings: &Settings) -> Result, settings: &Settings) -> Result, settings: &Settings) -> Result