From 8a50f3f36157a2b28dd83f7f79b77d7c0d1dc763 Mon Sep 17 00:00:00 2001 From: Dylan <53534755+dylwil3@users.noreply.github.com> Date: Sat, 18 Jan 2025 11:08:58 -0600 Subject: [PATCH] [`isort`] Omit trailing whitespace in `unsorted-imports` (`I001`) (#15518) ## Summary The fix range for sorting imports accounts for trailing whitespace, but we should only show the trimmed range to the user when displaying the diagnostic. So this PR changes the diagnostic range. Closes #15504 ## Test Plan Reviewed snapshot changes --- .../src/rules/isort/rules/organize_imports.rs | 7 ++-- ...kage_first_and_third_party_imports.py.snap | 2 +- ...kage_first_and_third_party_imports.py.snap | 2 +- ...tests__add_newline_before_comments.py.snap | 2 +- ..._isort__tests__as_imports_comments.py.snap | 2 +- ..._rules__isort__tests__bom_unsorted.py.snap | 2 +- ...sts__case_sensitive_case_sensitive.py.snap | 2 +- ...to_furthest_relative_imports_order.py.snap | 2 +- ...__isort__tests__combine_as_imports.py.snap | 2 +- ...bine_as_imports_combine_as_imports.py.snap | 2 +- ..._isort__tests__combine_import_from.py.snap | 2 +- ...ter__rules__isort__tests__comments.py.snap | 2 +- ..._isort__tests__deduplicate_imports.py.snap | 2 +- ...es__isort__tests__detect_same_package.snap | 2 +- ...les__isort__tests__fit_line_length.py.snap | 4 +- ...rt__tests__fit_line_length_comment.py.snap | 2 +- ...orce_single_line_force_single_line.py.snap | 2 +- ..._tests__force_sort_within_sections.py.snap | 2 +- ...ections_force_sort_within_sections.py.snap | 2 +- ..._force_sort_within_sections_future.py.snap | 2 +- ...sort_within_sections_with_as_names.py.snap | 2 +- ..._rules__isort__tests__force_to_top.py.snap | 2 +- ...__tests__force_to_top_force_to_top.py.snap | 2 +- ...__isort__tests__force_wrap_aliases.py.snap | 2 +- ...ce_wrap_aliases_force_wrap_aliases.py.snap | 2 +- ...les__isort__tests__forced_separate.py.snap | 2 +- ...__rules__isort__tests__future_from.py.snap | 2 +- ...kage_first_and_third_party_imports.py.snap | 2 +- ..._rules__isort__tests__if_elif_else.py.snap | 4 +- ...t__tests__import_from_after_import.py.snap | 2 +- ...les__isort__tests__inline_comments.py.snap | 2 +- ...__isort__tests__insert_empty_lines.py.snap | 20 ++++------ ..._isort__tests__insert_empty_lines.pyi.snap | 10 ++--- ...sest_separate_local_folder_imports.py.snap | 2 +- ...lder_separate_local_folder_imports.py.snap | 2 +- ...gth_sort__length_sort_from_imports.py.snap | 2 +- ...ort__length_sort_non_ascii_members.py.snap | 2 +- ...ort__length_sort_non_ascii_modules.py.snap | 2 +- ...gth_sort_straight_and_from_imports.py.snap | 2 +- ...sort__length_sort_straight_imports.py.snap | 2 +- ..._length_sort_with_relative_imports.py.snap | 2 +- ...straight__length_sort_from_imports.py.snap | 2 +- ...gth_sort_straight_and_from_imports.py.snap | 2 +- ...ight__length_sort_straight_imports.py.snap | 2 +- ...es__isort__tests__line_ending_crlf.py.snap | 1 - ...ules__isort__tests__line_ending_lf.py.snap | 1 - ...isort__tests__lines_after_imports.pyi.snap | 32 +++++++-------- ...s__lines_after_imports_class_after.py.snap | 3 +- ...ts__lines_after_imports_func_after.py.snap | 39 +++++++------------ ...after_imports_lines_after_imports.pyi.snap | 32 +++++++-------- ...ts_lines_after_imports_class_after.py.snap | 3 +- ...rts_lines_after_imports_func_after.py.snap | 39 +++++++------------ ..._lines_after_imports_nothing_after.py.snap | 2 +- ...s_between_typeslines_between_types.py.snap | 2 +- ...isort__tests__magic_trailing_comma.py.snap | 2 +- ...r__rules__isort__tests__match_case.py.snap | 9 ++--- ...rules__isort__tests__natural_order.py.snap | 2 +- ..._isort__tests__no_detect_same_package.snap | 2 +- ...les__isort__tests__no_lines_before.py.snap | 2 +- ...no_lines_before.py_no_lines_before.py.snap | 2 +- ...o_lines_before_with_empty_sections.py.snap | 2 +- ...andard_library_no_standard_library.py.snap | 2 +- ..._rules__isort__tests__no_wrap_star.py.snap | 2 +- ...rules__isort__tests__order_by_type.py.snap | 2 +- ..._order_by_type_false_order_by_type.py.snap | 2 +- ..._order_by_type_with_custom_classes.py.snap | 2 +- ..._order_by_type_with_custom_classes.py.snap | 2 +- ...rder_by_type_with_custom_constants.py.snap | 2 +- ...rder_by_type_with_custom_constants.py.snap | 2 +- ...rder_by_type_with_custom_variables.py.snap | 2 +- ...rder_by_type_with_custom_variables.py.snap | 2 +- ...s__order_relative_imports_by_level.py.snap | 2 +- ...ort__tests__preserve_comment_order.py.snap | 2 +- ...isort__tests__preserve_import_star.py.snap | 2 +- ...isort__tests__preserve_indentation.py.snap | 9 ++--- ...comments_propagate_inline_comments.py.snap | 2 +- ...ort__tests__reorder_within_section.py.snap | 2 +- ...ort__tests__section_order_sections.py.snap | 2 +- ...__tests__sections_main_first_party.py.snap | 26 ++++++------- ...s__isort__tests__sections_sections.py.snap | 2 +- ...ests__separate_first_party_imports.py.snap | 2 +- ...rt__tests__separate_future_imports.py.snap | 2 +- ...sts__separate_local_folder_imports.py.snap | 2 +- ...ests__separate_third_party_imports.py.snap | 2 +- ..._linter__rules__isort__tests__skip.py.snap | 18 +++------ ...isort__tests__sort_similar_imports.py.snap | 2 +- ...linter__rules__isort__tests__split.py.snap | 13 +++---- ...railing_comma_magic_trailing_comma.py.snap | 2 +- ...__isort__tests__star_before_others.py.snap | 2 +- ...es__isort__tests__trailing_comment.py.snap | 26 +++++-------- ...er__rules__isort__tests__two_space.py.snap | 4 +- ...nter__rules__isort__tests__unicode.py.snap | 4 +- ...patibility-lines-after(-1)-between(0).snap | 20 ++++------ ...mpatibility-lines-after(0)-between(0).snap | 20 ++++------ ...mpatibility-lines-after(1)-between(1).snap | 12 ++---- ...mpatibility-lines-after(4)-between(4).snap | 20 ++++------ ..._tests__blank_lines_typing_stub_isort.snap | 12 ++---- ...patibility-lines-after(-1)-between(0).snap | 20 ++++------ ...mpatibility-lines-after(0)-between(0).snap | 20 ++++------ ...mpatibility-lines-after(1)-between(1).snap | 12 ++---- ...mpatibility-lines-after(4)-between(4).snap | 20 ++++------ ...linter__linter__tests__import_sorting.snap | 15 +++---- 102 files changed, 242 insertions(+), 375 deletions(-) diff --git a/crates/ruff_linter/src/rules/isort/rules/organize_imports.rs b/crates/ruff_linter/src/rules/isort/rules/organize_imports.rs index 0a8ab9d758..fb1fb328f1 100644 --- a/crates/ruff_linter/src/rules/isort/rules/organize_imports.rs +++ b/crates/ruff_linter/src/rules/isort/rules/organize_imports.rs @@ -133,16 +133,15 @@ pub(crate) fn organize_imports( ); // Expand the span the entire range, including leading and trailing space. - let range = TextRange::new(locator.line_start(range.start()), trailing_line_end); - let actual = locator.slice(range); + let fix_range = TextRange::new(locator.line_start(range.start()), trailing_line_end); + let actual = locator.slice(fix_range); if matches_ignoring_indentation(actual, &expected) { return None; } - let mut diagnostic = Diagnostic::new(UnsortedImports, range); diagnostic.set_fix(Fix::safe_edit(Edit::range_replacement( indent(&expected, indentation).to_string(), - range, + fix_range, ))); Some(diagnostic) } diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__1_separate_subpackage_first_and_third_party_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__1_separate_subpackage_first_and_third_party_imports.py.snap index 96dd91f39b..b040527eaf 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__1_separate_subpackage_first_and_third_party_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__1_separate_subpackage_first_and_third_party_imports.py.snap @@ -11,7 +11,7 @@ separate_subpackage_first_and_third_party_imports.py:1:1: I001 [*] Import block 6 | | import foo 7 | | import foo.bar 8 | | import foo.bar.baz - | |___________________^ I001 + | |__________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__2_separate_subpackage_first_and_third_party_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__2_separate_subpackage_first_and_third_party_imports.py.snap index 2261dbec6d..2ab59bd971 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__2_separate_subpackage_first_and_third_party_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__2_separate_subpackage_first_and_third_party_imports.py.snap @@ -11,7 +11,7 @@ separate_subpackage_first_and_third_party_imports.py:1:1: I001 [*] Import block 6 | | import foo 7 | | import foo.bar 8 | | import foo.bar.baz - | |___________________^ I001 + | |__________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__add_newline_before_comments.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__add_newline_before_comments.py.snap index 7facab52b3..9d1391be60 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__add_newline_before_comments.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__add_newline_before_comments.py.snap @@ -10,7 +10,7 @@ add_newline_before_comments.py:1:1: I001 [*] Import block is un-sorted or un-for 5 | | # This is a comment, but it starts a new section, so we don't need to add a newline 6 | | # before it. 7 | | import leading_prefix - | |______________________^ I001 + | |_____________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__as_imports_comments.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__as_imports_comments.py.snap index 8cf3015dac..ce014c51f8 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__as_imports_comments.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__as_imports_comments.py.snap @@ -18,7 +18,7 @@ as_imports_comments.py:1:1: I001 [*] Import block is un-sorted or un-formatted 13 | | from bop import ( # Comment on `bop` 14 | | Member # Comment on `Member` 15 | | ) - | |__^ I001 + | |_^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__bom_unsorted.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__bom_unsorted.py.snap index 22eed47081..7caa0cade2 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__bom_unsorted.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__bom_unsorted.py.snap @@ -5,7 +5,7 @@ bom_unsorted.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import foo 2 | | import bar - | |___________^ I001 + | |__________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__case_sensitive_case_sensitive.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__case_sensitive_case_sensitive.py.snap index 4823f977bb..bcaa385eec 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__case_sensitive_case_sensitive.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__case_sensitive_case_sensitive.py.snap @@ -12,7 +12,7 @@ case_sensitive.py:1:1: I001 [*] Import block is un-sorted or un-formatted 7 | | import f 8 | | from g import a, B, c 9 | | from h import A, b, C - | |______________________^ I001 + | |_____________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap index 47fa779dc2..61df2c9ece 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap @@ -6,7 +6,7 @@ relative_imports_order.py:1:1: I001 [*] Import block is un-sorted or un-formatte 1 | / from ... import a 2 | | from .. import b 3 | | from . import c - | |________________^ I001 + | |_______________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_as_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_as_imports.py.snap index 5d94963222..e3ad645a87 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_as_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_as_imports.py.snap @@ -7,7 +7,7 @@ combine_as_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted 2 | | from module import CONSTANT 3 | | from module import function 4 | | from module import function as f - | |_________________________________^ I001 + | |________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap index 6a5076f49e..938f2be566 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap @@ -7,7 +7,7 @@ combine_as_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted 2 | | from module import CONSTANT 3 | | from module import function 4 | | from module import function as f - | |_________________________________^ I001 + | |________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_import_from.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_import_from.py.snap index db9adb08c3..336030d66a 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_import_from.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_import_from.py.snap @@ -8,7 +8,7 @@ combine_import_from.py:1:1: I001 [*] Import block is un-sorted or un-formatted 3 | | from collections import Collection 4 | | from collections import ChainMap 5 | | from collections import MutableSequence, MutableMapping - | |________________________________________________________^ I001 + | |_______________________________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__comments.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__comments.py.snap index d00129855d..c2fab23c8a 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__comments.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__comments.py.snap @@ -36,7 +36,7 @@ comments.py:3:1: I001 [*] Import block is un-sorted or un-formatted 31 | | 32 | | from F import a # Comment 1 33 | | from F import b - | |________________^ I001 + | |_______________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__deduplicate_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__deduplicate_imports.py.snap index bb92e7460b..330484dd87 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__deduplicate_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__deduplicate_imports.py.snap @@ -7,7 +7,7 @@ deduplicate_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted 2 | | import os 3 | | import os as os1 4 | | import os as os2 - | |_________________^ I001 + | |________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__detect_same_package.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__detect_same_package.snap index 09deae822f..999de4a0c2 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__detect_same_package.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__detect_same_package.snap @@ -6,7 +6,7 @@ bar.py:1:1: I001 [*] Import block is un-sorted or un-formatted 1 | / import os 2 | | import pandas 3 | | import foo.baz - | |_______________^ I001 + | |______________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__fit_line_length.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__fit_line_length.py.snap index 29f158aad3..2a2ad9b3c5 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__fit_line_length.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__fit_line_length.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff_linter/src/rules/isort/mod.rs --- -fit_line_length.py:7:1: I001 [*] Import block is un-sorted or un-formatted +fit_line_length.py:7:5: I001 [*] Import block is un-sorted or un-formatted | 6 | if indented: 7 | / from line_with_88 import aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa @@ -12,7 +12,7 @@ fit_line_length.py:7:1: I001 [*] Import block is un-sorted or un-formatted 12 | | from line_with_93 import ( 13 | | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 14 | | ) - | |______^ I001 + | |_____^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__fit_line_length_comment.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__fit_line_length_comment.py.snap index 85627547e9..830674f130 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__fit_line_length_comment.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__fit_line_length_comment.py.snap @@ -11,7 +11,7 @@ fit_line_length_comment.py:1:1: I001 [*] Import block is un-sorted or un-formatt 6 | | from f import g # 012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ 7 | | # The next import doesn't fit on one line. 8 | | from h import i # 012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9 - | |__________________________________________________________________________________________^ I001 + | |_______________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_single_line_force_single_line.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_single_line_force_single_line.py.snap index af21d3de8b..a13e203531 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_single_line_force_single_line.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_single_line_force_single_line.py.snap @@ -30,7 +30,7 @@ force_single_line.py:1:1: I001 [*] Import block is un-sorted or un-formatted 25 | | 26 | | # comment 9 27 | | from baz import * # comment 10 - | |________________________________^ I001 + | |_________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections.py.snap index 2f63beb457..6e4fabaa91 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections.py.snap @@ -16,7 +16,7 @@ force_sort_within_sections.py:1:1: I001 [*] Import block is un-sorted or un-form 11 | | from . import my 12 | | from .my.nested import fn2 13 | | from ...grandparent import fn3 - | |_______________________________^ I001 + | |______________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap index bc09ab5dc0..1df72338f5 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap @@ -16,7 +16,7 @@ force_sort_within_sections.py:1:1: I001 [*] Import block is un-sorted or un-form 11 | | from . import my 12 | | from .my.nested import fn2 13 | | from ...grandparent import fn3 - | |_______________________________^ I001 + | |______________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections_future.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections_future.py.snap index e7d9653e67..269e175c04 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections_future.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections_future.py.snap @@ -5,7 +5,7 @@ force_sort_within_sections_future.py:1:1: I001 [*] Import block is un-sorted or | 1 | / import __future__ 2 | | from __future__ import annotations - | |___________________________________^ I001 + | |__________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections_with_as_names.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections_with_as_names.py.snap index 98278842d3..8ef755569c 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections_with_as_names.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections_with_as_names.py.snap @@ -8,7 +8,7 @@ force_sort_within_sections_with_as_names.py:1:1: I001 [*] Import block is un-sor 3 | | from datetime import timedelta 4 | | import datetime as dt 5 | | import datetime - | |________________^ I001 + | |_______________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_to_top.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_to_top.py.snap index 6786ce2d70..fbf675285e 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_to_top.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_to_top.py.snap @@ -26,7 +26,7 @@ force_to_top.py:1:1: I001 [*] Import block is un-sorted or un-formatted 21 | | import lib3.lib4.lib5 22 | | from lib3.lib4 import foo 23 | | from lib3.lib4.lib5 import foo - | |_______________________________^ I001 + | |______________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_to_top_force_to_top.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_to_top_force_to_top.py.snap index ab4c3740c5..901bb0dc67 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_to_top_force_to_top.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_to_top_force_to_top.py.snap @@ -26,7 +26,7 @@ force_to_top.py:1:1: I001 [*] Import block is un-sorted or un-formatted 21 | | import lib3.lib4.lib5 22 | | from lib3.lib4 import foo 23 | | from lib3.lib4.lib5 import foo - | |_______________________________^ I001 + | |______________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_wrap_aliases.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_wrap_aliases.py.snap index 3a91cfccbf..0d6e330375 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_wrap_aliases.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_wrap_aliases.py.snap @@ -6,7 +6,7 @@ force_wrap_aliases.py:1:1: I001 [*] Import block is un-sorted or un-formatted 1 | / from .a import a1 as a1, a2 as a2 2 | | from .b import b1 as b1 3 | | from .c import c1 - | |__________________^ I001 + | |_________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap index dcd5c53e18..04739f35ab 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap @@ -6,7 +6,7 @@ force_wrap_aliases.py:1:1: I001 [*] Import block is un-sorted or un-formatted 1 | / from .a import a1 as a1, a2 as a2 2 | | from .b import b1 as b1 3 | | from .c import c1 - | |__________________^ I001 + | |_________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__forced_separate.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__forced_separate.py.snap index 7f568238e3..e645e85d2b 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__forced_separate.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__forced_separate.py.snap @@ -11,7 +11,7 @@ forced_separate.py:3:1: I001 [*] Import block is un-sorted or un-formatted 6 | | from experiments.starry import * 7 | | from experiments.weird import varieties 8 | | from office_helper.assistants import entity_registry as er - | |___________________________________________________________^ I001 + | |__________________________________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__future_from.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__future_from.py.snap index 1ce4c428d9..2481bb1775 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__future_from.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__future_from.py.snap @@ -5,7 +5,7 @@ future_from.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import __future__ 2 | | from __future__ import annotations - | |___________________________________^ I001 + | |__________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__glob_1_separate_subpackage_first_and_third_party_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__glob_1_separate_subpackage_first_and_third_party_imports.py.snap index 96dd91f39b..b040527eaf 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__glob_1_separate_subpackage_first_and_third_party_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__glob_1_separate_subpackage_first_and_third_party_imports.py.snap @@ -11,7 +11,7 @@ separate_subpackage_first_and_third_party_imports.py:1:1: I001 [*] Import block 6 | | import foo 7 | | import foo.bar 8 | | import foo.bar.baz - | |___________________^ I001 + | |__________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__if_elif_else.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__if_elif_else.py.snap index c6b216631f..3edbbf1dbd 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__if_elif_else.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__if_elif_else.py.snap @@ -1,13 +1,13 @@ --- source: crates/ruff_linter/src/rules/isort/mod.rs --- -if_elif_else.py:6:1: I001 [*] Import block is un-sorted or un-formatted +if_elif_else.py:6:5: I001 [*] Import block is un-sorted or un-formatted | 4 | from setuptools.command.sdist import sdist as _sdist 5 | else: 6 | / from setuptools.command.sdist import sdist as _sdist 7 | | from distutils.command.sdist import sdist as _sdist - | |________________________________________________________^ I001 + | |_______________________________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_from_after_import.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_from_after_import.py.snap index 18830525cd..b1d09d2b67 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_from_after_import.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_from_after_import.py.snap @@ -5,7 +5,7 @@ import_from_after_import.py:1:1: I001 [*] Import block is un-sorted or un-format | 1 | / from collections import Collection 2 | | import os - | |__________^ I001 + | |_________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__inline_comments.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__inline_comments.py.snap index aa5a257835..03df06aaa5 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__inline_comments.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__inline_comments.py.snap @@ -14,7 +14,7 @@ inline_comments.py:1:1: I001 [*] Import block is un-sorted or un-formatted 9 | | from c.prometheus.metrics import TERMINAL_CURRENTLY_RUNNING_TOTAL # type:ignore[attr-defined] 10 | | 11 | | from d.prometheus.metrics import TERMINAL_CURRENTLY_RUNNING_TOTAL, OTHER_RUNNING_TOTAL # type:ignore[attr-defined] - | |____________________________________________________________________________________________________________________^ I001 + | |______________________________________________________________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__insert_empty_lines.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__insert_empty_lines.py.snap index fa92501dd7..abd18b22f6 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__insert_empty_lines.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__insert_empty_lines.py.snap @@ -5,10 +5,9 @@ insert_empty_lines.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import a 2 | | import b - | |_________^ I001 + | |________^ I001 3 | x = 1 4 | import os -5 | import sys | = help: Organize imports @@ -26,10 +25,9 @@ insert_empty_lines.py:4:1: I001 [*] Import block is un-sorted or un-formatted 3 | x = 1 4 | / import os 5 | | import sys - | |___________^ I001 + | |__________^ I001 6 | def f(): 7 | pass -8 | if True: | = help: Organize imports @@ -49,10 +47,8 @@ insert_empty_lines.py:14:1: I001 [*] Import block is un-sorted or un-formatted 13 | y = 1 14 | / import os 15 | | import sys - | |___________^ I001 + | |__________^ I001 16 | """Docstring""" -17 | -18 | if True: | = help: Organize imports @@ -67,12 +63,10 @@ insert_empty_lines.py:14:1: I001 [*] Import block is un-sorted or un-formatted insert_empty_lines.py:52:1: I001 [*] Import block is un-sorted or un-formatted | -52 | / import os -53 | | - | |__^ I001 -54 | # Comment goes here. -55 | def f(): -56 | pass +52 | import os + | ^^^^^^^^^ I001 +53 | +54 | # Comment goes here. | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__insert_empty_lines.pyi.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__insert_empty_lines.pyi.snap index 7559c9bfb3..022f3c67cf 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__insert_empty_lines.pyi.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__insert_empty_lines.pyi.snap @@ -5,10 +5,9 @@ insert_empty_lines.pyi:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import a 2 | | import b - | |_________^ I001 + | |________^ I001 3 | x = 1 4 | import os -5 | import sys | = help: Organize imports @@ -26,10 +25,9 @@ insert_empty_lines.pyi:4:1: I001 [*] Import block is un-sorted or un-formatted 3 | x = 1 4 | / import os 5 | | import sys - | |___________^ I001 + | |__________^ I001 6 | def f(): 7 | pass -8 | if True: | = help: Organize imports @@ -48,10 +46,8 @@ insert_empty_lines.pyi:14:1: I001 [*] Import block is un-sorted or un-formatted 13 | y = 1 14 | / import os 15 | | import sys - | |___________^ I001 + | |__________^ I001 16 | """Docstring""" -17 | -18 | if True: | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__known_local_folder_closest_separate_local_folder_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__known_local_folder_closest_separate_local_folder_imports.py.snap index 885d2278a2..598f30f26c 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__known_local_folder_closest_separate_local_folder_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__known_local_folder_closest_separate_local_folder_imports.py.snap @@ -10,7 +10,7 @@ separate_local_folder_imports.py:1:1: I001 [*] Import block is un-sorted or un-f 5 | | from . import leading_prefix 6 | | from .. import trailing_prefix 7 | | from ruff import check - | |_______________________^ I001 + | |______________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap index e0a97a7a27..261c27be50 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap @@ -10,7 +10,7 @@ separate_local_folder_imports.py:1:1: I001 [*] Import block is un-sorted or un-f 5 | | from . import leading_prefix 6 | | from .. import trailing_prefix 7 | | from ruff import check - | |_______________________^ I001 + | |______________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_from_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_from_imports.py.snap index 8a435d4b47..880421c107 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_from_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_from_imports.py.snap @@ -6,7 +6,7 @@ length_sort_from_imports.py:1:1: I001 [*] Import block is un-sorted or un-format 1 | / from mediuuuuuuuuuuum import a 2 | | from short import b 3 | | from loooooooooooooooooooooog import c - | |_______________________________________^ I001 + | |______________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_non_ascii_members.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_non_ascii_members.py.snap index 15485adb20..386b16eb59 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_non_ascii_members.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_non_ascii_members.py.snap @@ -14,7 +14,7 @@ length_sort_non_ascii_members.py:1:1: I001 [*] Import block is un-sorted or un-f 9 | | mediuuuuuum, 10 | | λοοοοοοοοοοοοοονγ, 11 | | ) - | |__^ I001 + | |_^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_non_ascii_modules.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_non_ascii_modules.py.snap index 0835765830..b6081a6564 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_non_ascii_modules.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_non_ascii_modules.py.snap @@ -12,7 +12,7 @@ length_sort_non_ascii_modules.py:1:1: I001 [*] Import block is un-sorted or un-f 7 | | import λοοοοοοοοοοοοοονγ 8 | | import μεδιυυυυυμ 9 | | import looooooooooooooong - | |__________________________^ I001 + | |_________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_straight_and_from_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_straight_and_from_imports.py.snap index 1acdb72464..040722c463 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_straight_and_from_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_straight_and_from_imports.py.snap @@ -9,7 +9,7 @@ length_sort_straight_and_from_imports.py:1:1: I001 [*] Import block is un-sorted 4 | | from looooooooooooooong import a 5 | | from mediuuuum import c 6 | | from short import b - | |____________________^ I001 + | |___________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_straight_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_straight_imports.py.snap index 78f0c7db02..e78d25ef38 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_straight_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_straight_imports.py.snap @@ -7,7 +7,7 @@ length_sort_straight_imports.py:1:1: I001 [*] Import block is un-sorted or un-fo 2 | | import short 3 | | import looooooooooooooooong 4 | | import mediuuuuuuma - | |____________________^ I001 + | |___________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_with_relative_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_with_relative_imports.py.snap index 1c169709b5..c8dc6b1e84 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_with_relative_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_with_relative_imports.py.snap @@ -10,7 +10,7 @@ length_sort_with_relative_imports.py:1:1: I001 [*] Import block is un-sorted or 5 | | from . import d 6 | | from .mediuuuum import a 7 | | from ......short import b - | |__________________________^ I001 + | |_________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_from_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_from_imports.py.snap index 8fd13f7dcc..9d4e3641c2 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_from_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_from_imports.py.snap @@ -6,7 +6,7 @@ length_sort_from_imports.py:1:1: I001 [*] Import block is un-sorted or un-format 1 | / from mediuuuuuuuuuuum import a 2 | | from short import b 3 | | from loooooooooooooooooooooog import c - | |_______________________________________^ I001 + | |______________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_straight_and_from_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_straight_and_from_imports.py.snap index aace2c7a87..ad3fedea0c 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_straight_and_from_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_straight_and_from_imports.py.snap @@ -9,7 +9,7 @@ length_sort_straight_and_from_imports.py:1:1: I001 [*] Import block is un-sorted 4 | | from looooooooooooooong import a 5 | | from mediuuuum import c 6 | | from short import b - | |____________________^ I001 + | |___________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_straight_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_straight_imports.py.snap index 78f0c7db02..e78d25ef38 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_straight_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_straight_imports.py.snap @@ -7,7 +7,7 @@ length_sort_straight_imports.py:1:1: I001 [*] Import block is un-sorted or un-fo 2 | | import short 3 | | import looooooooooooooooong 4 | | import mediuuuuuuma - | |____________________^ I001 + | |___________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__line_ending_crlf.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__line_ending_crlf.py.snap index 7a82945f64..0a5efd8488 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__line_ending_crlf.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__line_ending_crlf.py.snap @@ -5,7 +5,6 @@ line_ending_crlf.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | from long_module_name import member_one, member_two, member_three, member_four, member_five | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I001 -2 | | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__line_ending_lf.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__line_ending_lf.py.snap index 88cb9c8fab..37e4e42e78 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__line_ending_lf.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__line_ending_lf.py.snap @@ -5,7 +5,6 @@ line_ending_lf.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | from long_module_name import member_one, member_two, member_three, member_four, member_five | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I001 -2 | | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports.pyi.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports.pyi.snap index 815f640a10..da09ee6218 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports.pyi.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports.pyi.snap @@ -2,25 +2,19 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- lines_after_imports.pyi:1:1: I001 [*] Import block is un-sorted or un-formatted - | - 1 | / from __future__ import annotations - 2 | | - 3 | | from typing import Any - 4 | | - 5 | | from requests import Session - 6 | | - 7 | | from my_first_party import my_first_party_object - 8 | | - 9 | | from . import my_local_folder_object -10 | | -11 | | -12 | | - | |__^ I001 -13 | class Thing(object): -14 | name: str -15 | def __init__(self, name: str): - | - = help: Organize imports + | +1 | / from __future__ import annotations +2 | | +3 | | from typing import Any +4 | | +5 | | from requests import Session +6 | | +7 | | from my_first_party import my_first_party_object +8 | | +9 | | from . import my_local_folder_object + | |____________________________________^ I001 + | + = help: Organize imports ℹ Safe fix 2 2 | diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_class_after.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_class_after.py.snap index d0524b5e0c..6327131ec0 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_class_after.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_class_after.py.snap @@ -12,10 +12,9 @@ lines_after_imports_class_after.py:1:1: I001 [*] Import block is un-sorted or un 7 | | from my_first_party import my_first_party_object 8 | | 9 | | from . import my_local_folder_object - | |_____________________________________^ I001 + | |____________________________________^ I001 10 | class Thing(object): 11 | name: str -12 | def __init__(self, name: str): | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_func_after.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_func_after.py.snap index 75a3dabea6..8ae7c8f04a 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_func_after.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_func_after.py.snap @@ -2,32 +2,19 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- lines_after_imports_func_after.py:1:1: I001 [*] Import block is un-sorted or un-formatted - | - 1 | / from __future__ import annotations - 2 | | - 3 | | from typing import Any - 4 | | - 5 | | from requests import Session - 6 | | - 7 | | from my_first_party import my_first_party_object - 8 | | - 9 | | from . import my_local_folder_object -10 | | -11 | | -12 | | -13 | | -14 | | -15 | | -16 | | -17 | | -18 | | -19 | | -20 | | - | |__^ I001 -21 | def main(): -22 | my_local_folder_object.get() - | - = help: Organize imports + | +1 | / from __future__ import annotations +2 | | +3 | | from typing import Any +4 | | +5 | | from requests import Session +6 | | +7 | | from my_first_party import my_first_party_object +8 | | +9 | | from . import my_local_folder_object + | |____________________________________^ I001 + | + = help: Organize imports ℹ Safe fix 2 2 | diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports.pyi.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports.pyi.snap index 815f640a10..da09ee6218 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports.pyi.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports.pyi.snap @@ -2,25 +2,19 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- lines_after_imports.pyi:1:1: I001 [*] Import block is un-sorted or un-formatted - | - 1 | / from __future__ import annotations - 2 | | - 3 | | from typing import Any - 4 | | - 5 | | from requests import Session - 6 | | - 7 | | from my_first_party import my_first_party_object - 8 | | - 9 | | from . import my_local_folder_object -10 | | -11 | | -12 | | - | |__^ I001 -13 | class Thing(object): -14 | name: str -15 | def __init__(self, name: str): - | - = help: Organize imports + | +1 | / from __future__ import annotations +2 | | +3 | | from typing import Any +4 | | +5 | | from requests import Session +6 | | +7 | | from my_first_party import my_first_party_object +8 | | +9 | | from . import my_local_folder_object + | |____________________________________^ I001 + | + = help: Organize imports ℹ Safe fix 2 2 | diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap index 19064fcfc5..2a56708eba 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap @@ -12,10 +12,9 @@ lines_after_imports_class_after.py:1:1: I001 [*] Import block is un-sorted or un 7 | | from my_first_party import my_first_party_object 8 | | 9 | | from . import my_local_folder_object - | |_____________________________________^ I001 + | |____________________________________^ I001 10 | class Thing(object): 11 | name: str -12 | def __init__(self, name: str): | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap index 46f737f9f4..b7764817d2 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap @@ -2,32 +2,19 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- lines_after_imports_func_after.py:1:1: I001 [*] Import block is un-sorted or un-formatted - | - 1 | / from __future__ import annotations - 2 | | - 3 | | from typing import Any - 4 | | - 5 | | from requests import Session - 6 | | - 7 | | from my_first_party import my_first_party_object - 8 | | - 9 | | from . import my_local_folder_object -10 | | -11 | | -12 | | -13 | | -14 | | -15 | | -16 | | -17 | | -18 | | -19 | | -20 | | - | |__^ I001 -21 | def main(): -22 | my_local_folder_object.get() - | - = help: Organize imports + | +1 | / from __future__ import annotations +2 | | +3 | | from typing import Any +4 | | +5 | | from requests import Session +6 | | +7 | | from my_first_party import my_first_party_object +8 | | +9 | | from . import my_local_folder_object + | |____________________________________^ I001 + | + = help: Organize imports ℹ Safe fix 2 2 | diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap index 738ecdc0a1..2765bd970c 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap @@ -12,7 +12,7 @@ lines_after_imports_nothing_after.py:1:1: I001 [*] Import block is un-sorted or 7 | | from my_first_party import my_first_party_object 8 | | 9 | | from . import my_local_folder_object - | |_____________________________________^ I001 + | |____________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_between_typeslines_between_types.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_between_typeslines_between_types.py.snap index 999eef9010..b76cee73ca 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_between_typeslines_between_types.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_between_typeslines_between_types.py.snap @@ -19,7 +19,7 @@ lines_between_types.py:1:1: I001 [*] Import block is un-sorted or un-formatted 14 | | 15 | | from . import config 16 | | from .data import Data - | |_______________________^ I001 + | |______________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__magic_trailing_comma.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__magic_trailing_comma.py.snap index d0c0490fd6..f64501a356 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__magic_trailing_comma.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__magic_trailing_comma.py.snap @@ -41,7 +41,7 @@ magic_trailing_comma.py:2:1: I001 [*] Import block is un-sorted or un-formatted 36 | | from module2 import ( 37 | | member3, 38 | | ) - | |__^ I001 + | |_^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__match_case.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__match_case.py.snap index 253619595f..950f0b4016 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__match_case.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__match_case.py.snap @@ -1,16 +1,15 @@ --- source: crates/ruff_linter/src/rules/isort/mod.rs --- -match_case.py:3:1: I001 [*] Import block is un-sorted or un-formatted +match_case.py:3:9: I001 [*] Import block is un-sorted or un-formatted | 1 | match 1: 2 | case 1: 3 | / import sys 4 | | import os - | |__________________^ I001 + | |_________________^ I001 5 | case 2: 6 | import collections -7 | import abc | = help: Organize imports @@ -24,13 +23,13 @@ match_case.py:3:1: I001 [*] Import block is un-sorted or un-formatted 6 6 | import collections 7 7 | import abc -match_case.py:6:1: I001 [*] Import block is un-sorted or un-formatted +match_case.py:6:9: I001 [*] Import block is un-sorted or un-formatted | 4 | import os 5 | case 2: 6 | / import collections 7 | | import abc - | |___________________^ I001 + | |__________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__natural_order.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__natural_order.py.snap index 365069c2d2..219f80d8d4 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__natural_order.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__natural_order.py.snap @@ -19,7 +19,7 @@ natural_order.py:1:1: I001 [*] Import block is un-sorted or un-formatted 14 | | uint32, 15 | | uint64, 16 | | ) - | |__^ I001 + | |_^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_detect_same_package.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_detect_same_package.snap index 0202de948a..679e8a9e8f 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_detect_same_package.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_detect_same_package.snap @@ -6,7 +6,7 @@ bar.py:1:1: I001 [*] Import block is un-sorted or un-formatted 1 | / import os 2 | | import pandas 3 | | import foo.baz - | |_______________^ I001 + | |______________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before.py.snap index c53337dca3..5f032e7590 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before.py.snap @@ -12,7 +12,7 @@ no_lines_before.py:1:1: I001 [*] Import block is un-sorted or un-formatted 7 | | from my_first_party import my_first_party_object 8 | | 9 | | from . import my_local_folder_object - | |_____________________________________^ I001 + | |____________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap index 4d4ad9b6f6..10a2a6f878 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap @@ -12,7 +12,7 @@ no_lines_before.py:1:1: I001 [*] Import block is un-sorted or un-formatted 7 | | from my_first_party import my_first_party_object 8 | | 9 | | from . import my_local_folder_object - | |_____________________________________^ I001 + | |____________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap index 0ea69c6c89..68559bec6f 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap @@ -6,7 +6,7 @@ no_lines_before_with_empty_sections.py:1:1: I001 [*] Import block is un-sorted o 1 | / from __future__ import annotations 2 | | from typing import Any 3 | | from . import my_local_folder_object - | |_____________________________________^ I001 + | |____________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_standard_library_no_standard_library.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_standard_library_no_standard_library.py.snap index 5ca5c30e5a..b860573af3 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_standard_library_no_standard_library.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_standard_library_no_standard_library.py.snap @@ -12,7 +12,7 @@ no_standard_library.py:1:1: I001 [*] Import block is un-sorted or un-formatted 7 | | 8 | | from . import local 9 | | import sys - | |___________^ I001 + | |__________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_wrap_star.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_wrap_star.py.snap index cdaf1e3466..5442ac6b7d 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_wrap_star.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_wrap_star.py.snap @@ -4,7 +4,7 @@ source: crates/ruff_linter/src/rules/isort/mod.rs no_wrap_star.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | from .subscription import * # type: ignore # some very long comment explaining why this needs a type ignore - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I001 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type.py.snap index 2d9a1bf2d6..598956bdd6 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type.py.snap @@ -15,7 +15,7 @@ order_by_type.py:1:1: I001 [*] Import block is un-sorted or un-formatted 10 | | import FOO 11 | | import BAR 12 | | import bar - | |___________^ I001 + | |__________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_false_order_by_type.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_false_order_by_type.py.snap index 01680ba831..dcbca8a0d1 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_false_order_by_type.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_false_order_by_type.py.snap @@ -15,7 +15,7 @@ order_by_type.py:1:1: I001 [*] Import block is un-sorted or un-formatted 10 | | import FOO 11 | | import BAR 12 | | import bar - | |___________^ I001 + | |__________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_classes.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_classes.py.snap index 165c2e0a4a..cb2a44f988 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_classes.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_classes.py.snap @@ -7,7 +7,7 @@ order_by_type_with_custom_classes.py:1:1: I001 [*] Import block is un-sorted or 2 | | from subprocess import N_CLASS, PIPE, Popen, STDOUT 3 | | from module import CLASS, Class, CONSTANT, function, BASIC, Apple 4 | | from torch.nn import SELU, AClass, A_CONSTANT - | |______________________________________________^ I001 + | |_____________________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap index da6c3f5a50..94aeabb4ad 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap @@ -7,7 +7,7 @@ order_by_type_with_custom_classes.py:1:1: I001 [*] Import block is un-sorted or 2 | | from subprocess import N_CLASS, PIPE, Popen, STDOUT 3 | | from module import CLASS, Class, CONSTANT, function, BASIC, Apple 4 | | from torch.nn import SELU, AClass, A_CONSTANT - | |______________________________________________^ I001 + | |_____________________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_constants.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_constants.py.snap index 89f11191c3..b17298eedc 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_constants.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_constants.py.snap @@ -5,7 +5,7 @@ order_by_type_with_custom_constants.py:1:1: I001 [*] Import block is un-sorted o | 1 | / from sklearn.svm import XYZ, func, variable, Const, Klass, constant 2 | | from subprocess import First, var, func, Class, konst, A_constant, Last, STDOUT - | |________________________________________________________________________________^ I001 + | |_______________________________________________________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap index 608e9c4225..4d696e30ae 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap @@ -5,7 +5,7 @@ order_by_type_with_custom_constants.py:1:1: I001 [*] Import block is un-sorted o | 1 | / from sklearn.svm import XYZ, func, variable, Const, Klass, constant 2 | | from subprocess import First, var, func, Class, konst, A_constant, Last, STDOUT - | |________________________________________________________________________________^ I001 + | |_______________________________________________________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_variables.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_variables.py.snap index 1662d9210f..82ed0e2cfe 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_variables.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_variables.py.snap @@ -5,7 +5,7 @@ order_by_type_with_custom_variables.py:1:1: I001 [*] Import block is un-sorted o | 1 | / from sklearn.svm import VAR, Class, MyVar, CONST, abc 2 | | from subprocess import utils, var_ABC, Variable, Klass, CONSTANT, exe - | |______________________________________________________________________^ I001 + | |_____________________________________________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap index ea153619f6..d60ac428d1 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap @@ -5,7 +5,7 @@ order_by_type_with_custom_variables.py:1:1: I001 [*] Import block is un-sorted o | 1 | / from sklearn.svm import VAR, Class, MyVar, CONST, abc 2 | | from subprocess import utils, var_ABC, Variable, Klass, CONSTANT, exe - | |______________________________________________________________________^ I001 + | |_____________________________________________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_relative_imports_by_level.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_relative_imports_by_level.py.snap index 15d86c10dc..78d9a2a789 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_relative_imports_by_level.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_relative_imports_by_level.py.snap @@ -7,7 +7,7 @@ order_relative_imports_by_level.py:1:1: I001 [*] Import block is un-sorted or un 2 | | from ..a import a 3 | | from ..b import a 4 | | from .b import a - | |_________________^ I001 + | |________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_comment_order.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_comment_order.py.snap index dea350e6ea..576c3cda04 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_comment_order.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_comment_order.py.snap @@ -14,7 +14,7 @@ preserve_comment_order.py:1:1: I001 [*] Import block is un-sorted or un-formatte 9 | | # EIEIO 10 | | from errno import EIO 11 | | import abc - | |___________^ I001 + | |__________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_import_star.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_import_star.py.snap index bf86607544..289ceba1ac 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_import_star.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_import_star.py.snap @@ -9,7 +9,7 @@ preserve_import_star.py:1:1: I001 [*] Import block is un-sorted or un-formatted 4 | | from some_module import some_class # Aside 5 | | # Above 6 | | from some_module import * # Aside - | |___________________________________^ I001 + | |_________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_indentation.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_indentation.py.snap index da983d3af7..2ecdea73ec 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_indentation.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_indentation.py.snap @@ -1,15 +1,14 @@ --- source: crates/ruff_linter/src/rules/isort/mod.rs --- -preserve_indentation.py:2:1: I001 [*] Import block is un-sorted or un-formatted +preserve_indentation.py:2:5: I001 [*] Import block is un-sorted or un-formatted | 1 | if True: 2 | / import sys 3 | | import os - | |______________^ I001 + | |_____________^ I001 4 | else: 5 | import sys -6 | import os | = help: Organize imports @@ -22,13 +21,13 @@ preserve_indentation.py:2:1: I001 [*] Import block is un-sorted or un-formatted 5 5 | import sys 6 6 | import os -preserve_indentation.py:5:1: I001 [*] Import block is un-sorted or un-formatted +preserve_indentation.py:5:5: I001 [*] Import block is un-sorted or un-formatted | 3 | import os 4 | else: 5 | / import sys 6 | | import os - | |______________^ I001 + | |_____________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__propagate_inline_comments_propagate_inline_comments.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__propagate_inline_comments_propagate_inline_comments.py.snap index c56a7b308d..40eb90e51b 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__propagate_inline_comments_propagate_inline_comments.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__propagate_inline_comments_propagate_inline_comments.py.snap @@ -7,7 +7,7 @@ propagate_inline_comments.py:1:1: I001 [*] Import block is un-sorted or un-forma 2 | | a_long_variable_name_that_causes_problems, 3 | | items, 4 | | ) - | |__^ I001 + | |_^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__reorder_within_section.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__reorder_within_section.py.snap index c507aba5c5..eb3789a4fc 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__reorder_within_section.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__reorder_within_section.py.snap @@ -5,7 +5,7 @@ reorder_within_section.py:1:1: I001 [*] Import block is un-sorted or un-formatte | 1 | / import sys 2 | | import os - | |__________^ I001 + | |_________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__section_order_sections.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__section_order_sections.py.snap index da111cf3ef..81ba140cce 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__section_order_sections.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__section_order_sections.py.snap @@ -10,7 +10,7 @@ sections.py:1:1: I001 [*] Import block is un-sorted or un-formatted 5 | | import django.settings 6 | | from library import foo 7 | | from . import local - | |____________________^ I001 + | |___________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sections_main_first_party.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sections_main_first_party.py.snap index db6abd2dde..2dee10681b 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sections_main_first_party.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sections_main_first_party.py.snap @@ -2,20 +2,18 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- main_first_party.py:1:1: I001 [*] Import block is un-sorted or un-formatted - | - 1 | / import os - 2 | | - 3 | | import __main__ - 4 | | import third_party - 5 | | - 6 | | import first_party - 7 | | - | |__^ I001 - 8 | os.a - 9 | third_party.a -10 | __main__.a - | - = help: Organize imports + | +1 | / import os +2 | | +3 | | import __main__ +4 | | import third_party +5 | | +6 | | import first_party + | |__________________^ I001 +7 | +8 | os.a + | + = help: Organize imports ℹ Safe fix 1 1 | import os diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sections_sections.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sections_sections.py.snap index 0e3a3aa836..3273e24cdb 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sections_sections.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sections_sections.py.snap @@ -10,7 +10,7 @@ sections.py:1:1: I001 [*] Import block is un-sorted or un-formatted 5 | | import django.settings 6 | | from library import foo 7 | | from . import local - | |____________________^ I001 + | |___________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_first_party_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_first_party_imports.py.snap index 16f3d827bb..65182f7e7e 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_first_party_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_first_party_imports.py.snap @@ -8,7 +8,7 @@ separate_first_party_imports.py:1:1: I001 [*] Import block is un-sorted or un-fo 3 | | import numpy as np 4 | | import os 5 | | from leading_prefix import Class - | |_________________________________^ I001 + | |________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_future_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_future_imports.py.snap index 1a5c98fada..6efad32da6 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_future_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_future_imports.py.snap @@ -6,7 +6,7 @@ separate_future_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatt 1 | / import sys 2 | | import os 3 | | from __future__ import annotations - | |___________________________________^ I001 + | |__________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_local_folder_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_local_folder_imports.py.snap index 51da602b4d..7ce3c297a0 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_local_folder_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_local_folder_imports.py.snap @@ -10,7 +10,7 @@ separate_local_folder_imports.py:1:1: I001 [*] Import block is un-sorted or un-f 5 | | from . import leading_prefix 6 | | from .. import trailing_prefix 7 | | from ruff import check - | |_______________________^ I001 + | |______________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_third_party_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_third_party_imports.py.snap index 1f7f90430e..99559f6244 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_third_party_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_third_party_imports.py.snap @@ -7,7 +7,7 @@ separate_third_party_imports.py:1:1: I001 [*] Import block is un-sorted or un-fo 2 | | import sys 3 | | import numpy as np 4 | | import os - | |__________^ I001 + | |_________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__skip.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__skip.py.snap index 9befa4c450..0bc57eae37 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__skip.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__skip.py.snap @@ -1,16 +1,13 @@ --- source: crates/ruff_linter/src/rules/isort/mod.rs --- -skip.py:20:1: I001 [*] Import block is un-sorted or un-formatted +skip.py:20:5: I001 [*] Import block is un-sorted or un-formatted | 18 | import sys 19 | import os # isort: skip 20 | / import collections 21 | | import abc - | |_______________^ I001 -22 | -23 | -24 | def f(): + | |______________^ I001 | = help: Organize imports @@ -25,16 +22,13 @@ skip.py:20:1: I001 [*] Import block is un-sorted or un-formatted 23 23 | 24 24 | def f(): -skip.py:27:1: I001 [*] Import block is un-sorted or un-formatted +skip.py:27:5: I001 [*] Import block is un-sorted or un-formatted | 25 | import sys 26 | import os # isort:skip 27 | / import collections 28 | | import abc - | |_______________^ I001 -29 | -30 | -31 | def f(): + | |______________^ I001 | = help: Organize imports @@ -49,12 +43,12 @@ skip.py:27:1: I001 [*] Import block is un-sorted or un-formatted 30 30 | 31 31 | def f(): -skip.py:34:1: I001 [*] Import block is un-sorted or un-formatted +skip.py:34:5: I001 [*] Import block is un-sorted or un-formatted | 32 | import sys; import os # isort:skip 33 | import sys; import os # isort:skip # isort:skip 34 | import sys; import os - | ^^^^^^^^^^^^^^^^^^^^^^^^^ I001 + | ^^^^^^^^^^^^^^^^^^^^^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sort_similar_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sort_similar_imports.py.snap index ecb5a76834..016fa99f05 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sort_similar_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sort_similar_imports.py.snap @@ -29,7 +29,7 @@ sort_similar_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted 24 | | import x as Y 25 | | import x 26 | | import x as a - | |______________^ I001 + | |_____________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__split.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__split.py.snap index 40de22a232..5b1a0f8e17 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__split.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__split.py.snap @@ -1,12 +1,12 @@ --- source: crates/ruff_linter/src/rules/isort/mod.rs --- -split.py:15:1: I001 [*] Import block is un-sorted or un-formatted +split.py:15:5: I001 [*] Import block is un-sorted or un-formatted | 14 | if True: 15 | / import C 16 | | import A - | |_____________^ I001 + | |____________^ I001 17 | 18 | # isort: split | @@ -23,16 +23,13 @@ split.py:15:1: I001 [*] Import block is un-sorted or un-formatted 18 18 | # isort: split 19 19 | -split.py:20:1: I001 [*] Import block is un-sorted or un-formatted +split.py:20:5: I001 [*] Import block is un-sorted or un-formatted | 18 | # isort: split 19 | 20 | / import D 21 | | import B - | |_____________^ I001 -22 | -23 | -24 | import e + | |____________^ I001 | = help: Organize imports @@ -53,7 +50,7 @@ split.py:30:1: I001 [*] Import block is un-sorted or un-formatted 29 | 30 | / import d 31 | | import c - | |_________^ I001 + | |________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap index 1a3b4bccd0..bb9cd3eb1e 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap @@ -41,7 +41,7 @@ magic_trailing_comma.py:2:1: I001 [*] Import block is un-sorted or un-formatted 36 | | from module2 import ( 37 | | member3, 38 | | ) - | |__^ I001 + | |_^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__star_before_others.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__star_before_others.py.snap index 97c473a7ef..0a1b4331c5 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__star_before_others.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__star_before_others.py.snap @@ -6,7 +6,7 @@ star_before_others.py:1:1: I001 [*] Import block is un-sorted or un-formatted 1 | / from .logging import config_logging 2 | | from .settings import ENV 3 | | from .settings import * - | |________________________^ I001 + | |_______________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__trailing_comment.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__trailing_comment.py.snap index c0decdf28b..07f62b85f8 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__trailing_comment.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__trailing_comment.py.snap @@ -11,11 +11,9 @@ trailing_comment.py:8:1: I001 [*] Import block is un-sorted or un-formatted 11 | | ); from foo import ( 12 | | bar 13 | | )# some comment -14 | | - | |__^ I001 + | |_^ I001 +14 | 15 | pass -16 | -17 | from foo import ( | = help: Organize imports @@ -47,11 +45,9 @@ trailing_comment.py:17:1: I001 [*] Import block is un-sorted or un-formatted 22 | | MyMgmtClient, 23 | | # some comment 24 | | ) -25 | | - | |__^ I001 + | |_^ I001 +25 | 26 | pass -27 | -28 | from mylib import ( | = help: Organize imports @@ -75,11 +71,9 @@ trailing_comment.py:35:1: I001 [*] Import block is un-sorted or un-formatted 36 | | MyClient 37 | | # some comment 38 | | ) -39 | | - | |__^ I001 + | |_^ I001 +39 | 40 | pass -41 | -42 | from mylib import ( | = help: Organize imports @@ -104,11 +98,9 @@ trailing_comment.py:42:1: I001 [*] Import block is un-sorted or un-formatted 43 | | # some comment 44 | | MyClient 45 | | ) -46 | | - | |__^ I001 + | |_^ I001 +46 | 47 | pass -48 | -49 | # a | = help: Organize imports @@ -133,7 +125,7 @@ trailing_comment.py:50:1: I001 [*] Import block is un-sorted or un-formatted 52 | | MyClient # d 53 | | # e 54 | | ) # f - | |______^ I001 + | |_^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__two_space.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__two_space.py.snap index 43598e0881..2e68e28eca 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__two_space.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__two_space.py.snap @@ -11,8 +11,8 @@ two_space.py:2:1: I001 [*] Import block is un-sorted or un-formatted 6 | | nan, 7 | | pi, 8 | | ) - 9 | | - | |__^ I001 + | |_^ I001 + 9 | 10 | del sin, cos, tan, pi, nan | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__unicode.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__unicode.py.snap index 66263fbc0b..e6b6c53fb9 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__unicode.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__unicode.py.snap @@ -7,8 +7,8 @@ unicode.py:1:1: I001 [*] Import block is un-sorted or un-formatted 2 | | from numpy import pi as π 3 | | import numpy as ℂℇℊℋℌℍℎℐℑℒℓℕℤΩℨKÅℬℭℯℰℱℹℴ 4 | | import numpy as CƐgHHHhIILlNZΩZKÅBCeEFio -5 | | - | |__^ I001 + | |________________________________________^ I001 +5 | 6 | h = 2 * π * ℏ | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(-1)-between(0).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(-1)-between(0).snap index 21756fb7eb..fa3511086f 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(-1)-between(0).snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(-1)-between(0).snap @@ -8,10 +8,7 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted 3 | | 4 | | 5 | | from typing import Any, Sequence -6 | | -7 | | - | |__^ I001 -8 | class MissingCommand(TypeError): ... # noqa: N818 + | |________________________________^ I001 | = help: Organize imports @@ -44,7 +41,7 @@ E30_isort.py:23:1: E302 [*] Expected 2 blank lines, found 1 24 25 | 25 26 | if TYPE_CHECKING: -E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted +E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted | 25 | if TYPE_CHECKING: 26 | / import os @@ -52,10 +49,7 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted 28 | | 29 | | 30 | | from typing_extensions import TypeAlias - | |____________________________________________^ I001 -31 | -32 | -33 | abcd.foo() + | |___________________________________________^ I001 | = help: Organize imports @@ -109,10 +103,10 @@ E30_isort.py:41:1: E302 [*] Expected 2 blank lines, found 1 E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted | -60 | / from typing import Any, Sequence -61 | | - | |__^ I001 -62 | class MissingCommand(TypeError): ... # noqa: N818 +60 | from typing import Any, Sequence + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I001 +61 | +62 | class MissingCommand(TypeError): ... # noqa: N818 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(0)-between(0).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(0)-between(0).snap index a74c8108fe..e66c54a48d 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(0)-between(0).snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(0)-between(0).snap @@ -8,10 +8,7 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted 3 | | 4 | | 5 | | from typing import Any, Sequence -6 | | -7 | | - | |__^ I001 -8 | class MissingCommand(TypeError): ... # noqa: N818 + | |________________________________^ I001 | = help: Organize imports @@ -47,7 +44,7 @@ E30_isort.py:23:1: E302 [*] Expected 2 blank lines, found 1 24 25 | 25 26 | if TYPE_CHECKING: -E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted +E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted | 25 | if TYPE_CHECKING: 26 | / import os @@ -55,10 +52,7 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted 28 | | 29 | | 30 | | from typing_extensions import TypeAlias - | |____________________________________________^ I001 -31 | -32 | -33 | abcd.foo() + | |___________________________________________^ I001 | = help: Organize imports @@ -112,10 +106,10 @@ E30_isort.py:41:1: E302 [*] Expected 2 blank lines, found 1 E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted | -60 | / from typing import Any, Sequence -61 | | - | |__^ I001 -62 | class MissingCommand(TypeError): ... # noqa: N818 +60 | from typing import Any, Sequence + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I001 +61 | +62 | class MissingCommand(TypeError): ... # noqa: N818 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(1)-between(1).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(1)-between(1).snap index 3dbb72872d..9434c2cc11 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(1)-between(1).snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(1)-between(1).snap @@ -8,10 +8,7 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted 3 | | 4 | | 5 | | from typing import Any, Sequence -6 | | -7 | | - | |__^ I001 -8 | class MissingCommand(TypeError): ... # noqa: N818 + | |________________________________^ I001 | = help: Organize imports @@ -46,7 +43,7 @@ E30_isort.py:23:1: E302 [*] Expected 2 blank lines, found 1 24 25 | 25 26 | if TYPE_CHECKING: -E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted +E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted | 25 | if TYPE_CHECKING: 26 | / import os @@ -54,10 +51,7 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted 28 | | 29 | | 30 | | from typing_extensions import TypeAlias - | |____________________________________________^ I001 -31 | -32 | -33 | abcd.foo() + | |___________________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(4)-between(4).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(4)-between(4).snap index b894647b71..1c6425457e 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(4)-between(4).snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(4)-between(4).snap @@ -8,10 +8,7 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted 3 | | 4 | | 5 | | from typing import Any, Sequence -6 | | -7 | | - | |__^ I001 -8 | class MissingCommand(TypeError): ... # noqa: N818 + | |________________________________^ I001 | = help: Organize imports @@ -66,7 +63,7 @@ E30_isort.py:23:1: E302 [*] Expected 2 blank lines, found 1 24 25 | 25 26 | if TYPE_CHECKING: -E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted +E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted | 25 | if TYPE_CHECKING: 26 | / import os @@ -74,10 +71,7 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted 28 | | 29 | | 30 | | from typing_extensions import TypeAlias - | |____________________________________________^ I001 -31 | -32 | -33 | abcd.foo() + | |___________________________________________^ I001 | = help: Organize imports @@ -131,10 +125,10 @@ E30_isort.py:41:1: E302 [*] Expected 2 blank lines, found 1 E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted | -60 | / from typing import Any, Sequence -61 | | - | |__^ I001 -62 | class MissingCommand(TypeError): ... # noqa: N818 +60 | from typing import Any, Sequence + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I001 +61 | +62 | class MissingCommand(TypeError): ... # noqa: N818 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_typing_stub_isort.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_typing_stub_isort.snap index af6b6e35f4..dc10a907bc 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_typing_stub_isort.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_typing_stub_isort.snap @@ -8,10 +8,7 @@ E30_isort.pyi:1:1: I001 [*] Import block is un-sorted or un-formatted 3 | | 4 | | 5 | | from typing import Any, Sequence -6 | | -7 | | - | |__^ I001 -8 | class MissingCommand(TypeError): ... # noqa: N818 + | |________________________________^ I001 | = help: Organize imports @@ -111,7 +108,7 @@ E30_isort.pyi:21:5: E303 [*] Too many blank lines (2) 22 21 | 23 22 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ... -E30_isort.pyi:26:1: I001 [*] Import block is un-sorted or un-formatted +E30_isort.pyi:26:5: I001 [*] Import block is un-sorted or un-formatted | 25 | if TYPE_CHECKING: 26 | / import os @@ -119,10 +116,7 @@ E30_isort.pyi:26:1: I001 [*] Import block is un-sorted or un-formatted 28 | | 29 | | 30 | | from typing_extensions import TypeAlias - | |____________________________________________^ I001 -31 | -32 | -33 | abcd.foo() + | |___________________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(-1)-between(0).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(-1)-between(0).snap index 03fe8c1308..8d895a4453 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(-1)-between(0).snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(-1)-between(0).snap @@ -8,10 +8,7 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted 3 | | 4 | | 5 | | from typing import Any, Sequence -6 | | -7 | | - | |__^ I001 -8 | class MissingCommand(TypeError): ... # noqa: N818 + | |________________________________^ I001 | = help: Organize imports @@ -58,7 +55,7 @@ E30_isort.py:21:5: E303 [*] Too many blank lines (2) 22 21 | 23 22 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ... -E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted +E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted | 25 | if TYPE_CHECKING: 26 | / import os @@ -66,10 +63,7 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted 28 | | 29 | | 30 | | from typing_extensions import TypeAlias - | |____________________________________________^ I001 -31 | -32 | -33 | abcd.foo() + | |___________________________________________^ I001 | = help: Organize imports @@ -120,10 +114,10 @@ E30_isort.py:33:5: E303 [*] Too many blank lines (2) E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted | -60 | / from typing import Any, Sequence -61 | | - | |__^ I001 -62 | class MissingCommand(TypeError): ... # noqa: N818 +60 | from typing import Any, Sequence + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I001 +61 | +62 | class MissingCommand(TypeError): ... # noqa: N818 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(0)-between(0).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(0)-between(0).snap index 4fd3cf8aed..2c2e5936b9 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(0)-between(0).snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(0)-between(0).snap @@ -8,10 +8,7 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted 3 | | 4 | | 5 | | from typing import Any, Sequence -6 | | -7 | | - | |__^ I001 -8 | class MissingCommand(TypeError): ... # noqa: N818 + | |________________________________^ I001 | = help: Organize imports @@ -78,7 +75,7 @@ E30_isort.py:21:5: E303 [*] Too many blank lines (2) 22 21 | 23 22 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ... -E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted +E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted | 25 | if TYPE_CHECKING: 26 | / import os @@ -86,10 +83,7 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted 28 | | 29 | | 30 | | from typing_extensions import TypeAlias - | |____________________________________________^ I001 -31 | -32 | -33 | abcd.foo() + | |___________________________________________^ I001 | = help: Organize imports @@ -140,10 +134,10 @@ E30_isort.py:33:5: E303 [*] Too many blank lines (2) E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted | -60 | / from typing import Any, Sequence -61 | | - | |__^ I001 -62 | class MissingCommand(TypeError): ... # noqa: N818 +60 | from typing import Any, Sequence + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I001 +61 | +62 | class MissingCommand(TypeError): ... # noqa: N818 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(1)-between(1).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(1)-between(1).snap index 2d8da6c2e2..1c152584a9 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(1)-between(1).snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(1)-between(1).snap @@ -8,10 +8,7 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted 3 | | 4 | | 5 | | from typing import Any, Sequence -6 | | -7 | | - | |__^ I001 -8 | class MissingCommand(TypeError): ... # noqa: N818 + | |________________________________^ I001 | = help: Organize imports @@ -76,7 +73,7 @@ E30_isort.py:21:5: E303 [*] Too many blank lines (2) 22 21 | 23 22 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ... -E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted +E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted | 25 | if TYPE_CHECKING: 26 | / import os @@ -84,10 +81,7 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted 28 | | 29 | | 30 | | from typing_extensions import TypeAlias - | |____________________________________________^ I001 -31 | -32 | -33 | abcd.foo() + | |___________________________________________^ I001 | = help: Organize imports diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(4)-between(4).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(4)-between(4).snap index fff03e5103..c6db5e7df6 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(4)-between(4).snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(4)-between(4).snap @@ -8,10 +8,7 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted 3 | | 4 | | 5 | | from typing import Any, Sequence -6 | | -7 | | - | |__^ I001 -8 | class MissingCommand(TypeError): ... # noqa: N818 + | |________________________________^ I001 | = help: Organize imports @@ -47,7 +44,7 @@ E30_isort.py:21:5: E303 [*] Too many blank lines (2) 22 21 | 23 22 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ... -E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted +E30_isort.py:26:5: I001 [*] Import block is un-sorted or un-formatted | 25 | if TYPE_CHECKING: 26 | / import os @@ -55,10 +52,7 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted 28 | | 29 | | 30 | | from typing_extensions import TypeAlias - | |____________________________________________^ I001 -31 | -32 | -33 | abcd.foo() + | |___________________________________________^ I001 | = help: Organize imports @@ -92,10 +86,10 @@ E30_isort.py:33:5: E303 [*] Too many blank lines (2) E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted | -60 | / from typing import Any, Sequence -61 | | - | |__^ I001 -62 | class MissingCommand(TypeError): ... # noqa: N818 +60 | from typing import Any, Sequence + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I001 +61 | +62 | class MissingCommand(TypeError): ... # noqa: N818 | = help: Organize imports diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__import_sorting.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__import_sorting.snap index 59672d19b8..283257a8d8 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__import_sorting.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__import_sorting.snap @@ -6,10 +6,7 @@ isort.ipynb:cell 1:1:1: I001 [*] Import block is un-sorted or un-formatted 1 | / from pathlib import Path 2 | | import random 3 | | import math - | |____________^ I001 -4 | from typing import Any -5 | import collections -6 | # Newline should be added here + | |___________^ I001 | = help: Organize imports @@ -27,10 +24,9 @@ isort.ipynb:cell 2:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from typing import Any 2 | | import collections - | |___________________^ I001 + | |__________________^ I001 3 | # Newline should be added here 4 | def foo(): -5 | pass | = help: Organize imports @@ -51,10 +47,9 @@ isort.ipynb:cell 3:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from pathlib import Path 2 | | import sys -3 | | - | |__^ I001 + | |__________^ I001 +3 | 4 | %matplotlib \ -5 | --inline | = help: Organize imports @@ -75,7 +70,7 @@ isort.ipynb:cell 3:7:1: I001 [*] Import block is un-sorted or un-formatted 6 | 7 | / import math 8 | | import abc - | |___________^ I001 + | |__________^ I001 | = help: Organize imports