[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
This commit is contained in:
Dylan
2025-01-18 11:08:58 -06:00
committed by GitHub
parent 001e5adec5
commit 8a50f3f361
102 changed files with 242 additions and 375 deletions

View File

@@ -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)
}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 |

View File

@@ -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

View File

@@ -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 |

View File

@@ -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 |

View File

@@ -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

View File

@@ -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 |

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

Some files were not shown because too many files have changed in this diff Show More