mirror of https://github.com/astral-sh/ruff
test: another set of updates related to line terminator handling
This group of updates is similar to the last one, but they call out the
fact that while the change is an improvement, it does still seem to be a
little buggy.
As one example, previously we would have this:
|
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 | | class Thing(object):
| |_^ I001
14 | name: str
15 | def __init__(self, name: str):
|
= help: Organize imports
And now here's what it looks like after:
|
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 | |
| |__^ Organize imports
13 | class Thing(object):
14 | name: str
15 | def __init__(self, name: str):
|
= help: Organize imports
So at least now, the diagnostic is not pointing to a completely
unrelated thing (`class Thing`), but it's still not quite pointing to
the imports directly. And the `^` is a bit offset. After looking at
some examples more closely, I think this is probably more of a bug
with how we're generating offsets, since we are actually pointing to
a location that is a few empty lines _below_ the last import. And
`annotate-snippets` is rendering that part correctly. However, the
offset from the left (the `^` is pointing at `r` instead of `f` or even
at the end of `from . import my_local_folder_object`) appears to be a
problem with `annotate-snippets` itself.
We accept this under the reasoning that it's an improvement, albeit not
perfect.
This commit is contained in:
parent
79e71cbbcd
commit
eed0595b18
|
|
@ -1,23 +1,22 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/isort/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
lines_after_imports.pyi:1:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
1 | / from __future__ import annotations
|
||||
2 | |
|
||||
2 | |
|
||||
3 | | from typing import Any
|
||||
4 | |
|
||||
4 | |
|
||||
5 | | from requests import Session
|
||||
6 | |
|
||||
6 | |
|
||||
7 | | from my_first_party import my_first_party_object
|
||||
8 | |
|
||||
8 | |
|
||||
9 | | from . import my_local_folder_object
|
||||
10 | |
|
||||
11 | |
|
||||
12 | |
|
||||
13 | | class Thing(object):
|
||||
| |_^ I001
|
||||
10 | |
|
||||
11 | |
|
||||
12 | |
|
||||
| |__^ I001
|
||||
13 | class Thing(object):
|
||||
14 | name: str
|
||||
15 | def __init__(self, name: str):
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,31 +1,30 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/isort/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
lines_after_imports_func_after.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
1 | / from __future__ import annotations
|
||||
2 | |
|
||||
2 | |
|
||||
3 | | from typing import Any
|
||||
4 | |
|
||||
4 | |
|
||||
5 | | from requests import Session
|
||||
6 | |
|
||||
6 | |
|
||||
7 | | from my_first_party import my_first_party_object
|
||||
8 | |
|
||||
8 | |
|
||||
9 | | from . import my_local_folder_object
|
||||
10 | |
|
||||
11 | |
|
||||
12 | |
|
||||
13 | |
|
||||
14 | |
|
||||
15 | |
|
||||
16 | |
|
||||
17 | |
|
||||
18 | |
|
||||
19 | |
|
||||
20 | |
|
||||
21 | | def main():
|
||||
| |_^ I001
|
||||
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,23 +1,22 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/isort/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
lines_after_imports.pyi:1:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
1 | / from __future__ import annotations
|
||||
2 | |
|
||||
2 | |
|
||||
3 | | from typing import Any
|
||||
4 | |
|
||||
4 | |
|
||||
5 | | from requests import Session
|
||||
6 | |
|
||||
6 | |
|
||||
7 | | from my_first_party import my_first_party_object
|
||||
8 | |
|
||||
8 | |
|
||||
9 | | from . import my_local_folder_object
|
||||
10 | |
|
||||
11 | |
|
||||
12 | |
|
||||
13 | | class Thing(object):
|
||||
| |_^ I001
|
||||
10 | |
|
||||
11 | |
|
||||
12 | |
|
||||
| |__^ I001
|
||||
13 | class Thing(object):
|
||||
14 | name: str
|
||||
15 | def __init__(self, name: str):
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,31 +1,30 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/isort/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
lines_after_imports_func_after.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
1 | / from __future__ import annotations
|
||||
2 | |
|
||||
2 | |
|
||||
3 | | from typing import Any
|
||||
4 | |
|
||||
4 | |
|
||||
5 | | from requests import Session
|
||||
6 | |
|
||||
6 | |
|
||||
7 | | from my_first_party import my_first_party_object
|
||||
8 | |
|
||||
8 | |
|
||||
9 | | from . import my_local_folder_object
|
||||
10 | |
|
||||
11 | |
|
||||
12 | |
|
||||
13 | |
|
||||
14 | |
|
||||
15 | |
|
||||
16 | |
|
||||
17 | |
|
||||
18 | |
|
||||
19 | |
|
||||
20 | |
|
||||
21 | | def main():
|
||||
| |_^ I001
|
||||
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,18 +1,17 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/isort/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
main_first_party.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
1 | / import os
|
||||
2 | |
|
||||
2 | |
|
||||
3 | | import __main__
|
||||
4 | | import third_party
|
||||
5 | |
|
||||
5 | |
|
||||
6 | | import first_party
|
||||
7 | |
|
||||
8 | | os.a
|
||||
| |_^ I001
|
||||
7 | |
|
||||
| |__^ I001
|
||||
8 | os.a
|
||||
9 | third_party.a
|
||||
10 | __main__.a
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,21 +1,20 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/isort/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
trailing_comment.py:8:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
6 | pass
|
||||
7 |
|
||||
7 |
|
||||
8 | / from mylib import (
|
||||
9 | | MyClient,
|
||||
10 | | MyMgmtClient,
|
||||
11 | | ); from foo import (
|
||||
12 | | bar
|
||||
13 | | )# some comment
|
||||
14 | |
|
||||
15 | | pass
|
||||
| |_^ I001
|
||||
16 |
|
||||
14 | |
|
||||
| |__^ I001
|
||||
15 | pass
|
||||
16 |
|
||||
17 | from foo import (
|
||||
|
|
||||
= help: Organize imports
|
||||
|
|
@ -39,7 +38,7 @@ trailing_comment.py:8:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
trailing_comment.py:17:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
15 | pass
|
||||
16 |
|
||||
16 |
|
||||
17 | / from foo import (
|
||||
18 | | bar
|
||||
19 | | )
|
||||
|
|
@ -48,10 +47,10 @@ trailing_comment.py:17:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
22 | | MyMgmtClient,
|
||||
23 | | # some comment
|
||||
24 | | )
|
||||
25 | |
|
||||
26 | | pass
|
||||
| |_^ I001
|
||||
27 |
|
||||
25 | |
|
||||
| |__^ I001
|
||||
26 | pass
|
||||
27 |
|
||||
28 | from mylib import (
|
||||
|
|
||||
= help: Organize imports
|
||||
|
|
@ -71,15 +70,15 @@ trailing_comment.py:17:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
trailing_comment.py:35:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
33 | pass
|
||||
34 |
|
||||
34 |
|
||||
35 | / from mylib import (
|
||||
36 | | MyClient
|
||||
37 | | # some comment
|
||||
38 | | )
|
||||
39 | |
|
||||
40 | | pass
|
||||
| |_^ I001
|
||||
41 |
|
||||
39 | |
|
||||
| |__^ I001
|
||||
40 | pass
|
||||
41 |
|
||||
42 | from mylib import (
|
||||
|
|
||||
= help: Organize imports
|
||||
|
|
@ -100,15 +99,15 @@ trailing_comment.py:35:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
trailing_comment.py:42:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
40 | pass
|
||||
41 |
|
||||
41 |
|
||||
42 | / from mylib import (
|
||||
43 | | # some comment
|
||||
44 | | MyClient
|
||||
45 | | )
|
||||
46 | |
|
||||
47 | | pass
|
||||
| |_^ I001
|
||||
48 |
|
||||
46 | |
|
||||
| |__^ I001
|
||||
47 | pass
|
||||
48 |
|
||||
49 | # a
|
||||
|
|
||||
= help: Organize imports
|
||||
|
|
@ -134,6 +133,7 @@ trailing_comment.py:50:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
52 | | MyClient # d
|
||||
53 | | # e
|
||||
54 | | ) # f
|
||||
| |______^ I001
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/isort/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
unicode.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
|
|
@ -8,9 +7,9 @@ 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 | |
|
||||
6 | | h = 2 * π * ℏ
|
||||
| |_^ I001
|
||||
5 | |
|
||||
| |__^ I001
|
||||
6 | h = 2 * π * ℏ
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
1 | / import json
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
5 | | from typing import Any, Sequence
|
||||
6 | |
|
||||
7 | |
|
||||
8 | | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| |_^ I001
|
||||
6 | |
|
||||
7 | |
|
||||
| |__^ I001
|
||||
8 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
@ -28,10 +27,10 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
E30_isort.py:23:1: E302 [*] Expected 2 blank lines, found 1
|
||||
|
|
||||
21 | abcd.foo()
|
||||
22 |
|
||||
22 |
|
||||
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
|
||||
| ^^^ E302
|
||||
24 |
|
||||
24 |
|
||||
25 | if TYPE_CHECKING:
|
||||
|
|
||||
= help: Add missing blank line(s)
|
||||
|
|
@ -49,13 +48,13 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
|
|
||||
25 | if TYPE_CHECKING:
|
||||
26 | / import os
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
30 | | from typing_extensions import TypeAlias
|
||||
31 | |
|
||||
| |_^ I001
|
||||
32 |
|
||||
| |____________________________________________^ I001
|
||||
31 |
|
||||
32 |
|
||||
33 | abcd.foo()
|
||||
|
|
||||
= help: Organize imports
|
||||
|
|
@ -73,7 +72,7 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
E30_isort.py:35:1: E302 [*] Expected 2 blank lines, found 1
|
||||
|
|
||||
33 | abcd.foo()
|
||||
34 |
|
||||
34 |
|
||||
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
||||
| ^^^ E302
|
||||
36 | ...
|
||||
|
|
@ -92,7 +91,7 @@ E30_isort.py:35:1: E302 [*] Expected 2 blank lines, found 1
|
|||
E30_isort.py:41:1: E302 [*] Expected 2 blank lines, found 1
|
||||
|
|
||||
39 | from typing_extensions import TypeAlias
|
||||
40 |
|
||||
40 |
|
||||
41 | def __call__2(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
||||
| ^^^ E302
|
||||
42 | ...
|
||||
|
|
@ -111,9 +110,9 @@ 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 | |
|
||||
62 | | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| |_^ I001
|
||||
61 | |
|
||||
| |__^ I001
|
||||
62 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
@ -127,7 +126,7 @@ E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
E30_isort.py:62:1: E302 [*] Expected 2 blank lines, found 1
|
||||
|
|
||||
60 | from typing import Any, Sequence
|
||||
61 |
|
||||
61 |
|
||||
62 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| ^^^^^ E302
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
1 | / import json
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
5 | | from typing import Any, Sequence
|
||||
6 | |
|
||||
7 | |
|
||||
8 | | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| |_^ I001
|
||||
6 | |
|
||||
7 | |
|
||||
| |__^ I001
|
||||
8 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
@ -31,10 +30,10 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
E30_isort.py:23:1: E302 [*] Expected 2 blank lines, found 1
|
||||
|
|
||||
21 | abcd.foo()
|
||||
22 |
|
||||
22 |
|
||||
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
|
||||
| ^^^ E302
|
||||
24 |
|
||||
24 |
|
||||
25 | if TYPE_CHECKING:
|
||||
|
|
||||
= help: Add missing blank line(s)
|
||||
|
|
@ -52,13 +51,13 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
|
|
||||
25 | if TYPE_CHECKING:
|
||||
26 | / import os
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
30 | | from typing_extensions import TypeAlias
|
||||
31 | |
|
||||
| |_^ I001
|
||||
32 |
|
||||
| |____________________________________________^ I001
|
||||
31 |
|
||||
32 |
|
||||
33 | abcd.foo()
|
||||
|
|
||||
= help: Organize imports
|
||||
|
|
@ -76,7 +75,7 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
E30_isort.py:35:1: E302 [*] Expected 2 blank lines, found 1
|
||||
|
|
||||
33 | abcd.foo()
|
||||
34 |
|
||||
34 |
|
||||
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
||||
| ^^^ E302
|
||||
36 | ...
|
||||
|
|
@ -95,7 +94,7 @@ E30_isort.py:35:1: E302 [*] Expected 2 blank lines, found 1
|
|||
E30_isort.py:41:1: E302 [*] Expected 2 blank lines, found 1
|
||||
|
|
||||
39 | from typing_extensions import TypeAlias
|
||||
40 |
|
||||
40 |
|
||||
41 | def __call__2(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
||||
| ^^^ E302
|
||||
42 | ...
|
||||
|
|
@ -114,9 +113,9 @@ 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 | |
|
||||
62 | | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| |_^ I001
|
||||
61 | |
|
||||
| |__^ I001
|
||||
62 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
1 | / import json
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
5 | | from typing import Any, Sequence
|
||||
6 | |
|
||||
7 | |
|
||||
8 | | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| |_^ I001
|
||||
6 | |
|
||||
7 | |
|
||||
| |__^ I001
|
||||
8 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
@ -30,10 +29,10 @@ E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
E30_isort.py:23:1: E302 [*] Expected 2 blank lines, found 1
|
||||
|
|
||||
21 | abcd.foo()
|
||||
22 |
|
||||
22 |
|
||||
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
|
||||
| ^^^ E302
|
||||
24 |
|
||||
24 |
|
||||
25 | if TYPE_CHECKING:
|
||||
|
|
||||
= help: Add missing blank line(s)
|
||||
|
|
@ -51,13 +50,13 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
|
|
||||
25 | if TYPE_CHECKING:
|
||||
26 | / import os
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
30 | | from typing_extensions import TypeAlias
|
||||
31 | |
|
||||
| |_^ I001
|
||||
32 |
|
||||
| |____________________________________________^ I001
|
||||
31 |
|
||||
32 |
|
||||
33 | abcd.foo()
|
||||
|
|
||||
= help: Organize imports
|
||||
|
|
@ -75,7 +74,7 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
E30_isort.py:35:1: E302 [*] Expected 2 blank lines, found 1
|
||||
|
|
||||
33 | abcd.foo()
|
||||
34 |
|
||||
34 |
|
||||
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
||||
| ^^^ E302
|
||||
36 | ...
|
||||
|
|
@ -94,7 +93,7 @@ E30_isort.py:35:1: E302 [*] Expected 2 blank lines, found 1
|
|||
E30_isort.py:41:1: E302 [*] Expected 2 blank lines, found 1
|
||||
|
|
||||
39 | from typing_extensions import TypeAlias
|
||||
40 |
|
||||
40 |
|
||||
41 | def __call__2(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
||||
| ^^^ E302
|
||||
42 | ...
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
1 | / import json
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
5 | | from typing import Any, Sequence
|
||||
6 | |
|
||||
7 | |
|
||||
8 | | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| |_^ I001
|
||||
6 | |
|
||||
7 | |
|
||||
| |__^ I001
|
||||
8 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
@ -50,10 +49,10 @@ E30_isort.py:8:1: E302 [*] Expected 4 blank lines, found 2
|
|||
E30_isort.py:23:1: E302 [*] Expected 2 blank lines, found 1
|
||||
|
|
||||
21 | abcd.foo()
|
||||
22 |
|
||||
22 |
|
||||
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
|
||||
| ^^^ E302
|
||||
24 |
|
||||
24 |
|
||||
25 | if TYPE_CHECKING:
|
||||
|
|
||||
= help: Add missing blank line(s)
|
||||
|
|
@ -71,13 +70,13 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
|
|
||||
25 | if TYPE_CHECKING:
|
||||
26 | / import os
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
30 | | from typing_extensions import TypeAlias
|
||||
31 | |
|
||||
| |_^ I001
|
||||
32 |
|
||||
| |____________________________________________^ I001
|
||||
31 |
|
||||
32 |
|
||||
33 | abcd.foo()
|
||||
|
|
||||
= help: Organize imports
|
||||
|
|
@ -95,7 +94,7 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
E30_isort.py:35:1: E302 [*] Expected 2 blank lines, found 1
|
||||
|
|
||||
33 | abcd.foo()
|
||||
34 |
|
||||
34 |
|
||||
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
||||
| ^^^ E302
|
||||
36 | ...
|
||||
|
|
@ -114,7 +113,7 @@ E30_isort.py:35:1: E302 [*] Expected 2 blank lines, found 1
|
|||
E30_isort.py:41:1: E302 [*] Expected 2 blank lines, found 1
|
||||
|
|
||||
39 | from typing_extensions import TypeAlias
|
||||
40 |
|
||||
40 |
|
||||
41 | def __call__2(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
||||
| ^^^ E302
|
||||
42 | ...
|
||||
|
|
@ -133,9 +132,9 @@ 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 | |
|
||||
62 | | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| |_^ I001
|
||||
61 | |
|
||||
| |__^ I001
|
||||
62 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
@ -151,7 +150,7 @@ E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
E30_isort.py:62:1: E302 [*] Expected 4 blank lines, found 1
|
||||
|
|
||||
60 | from typing import Any, Sequence
|
||||
61 |
|
||||
61 |
|
||||
62 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| ^^^^^ E302
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
E30_isort.pyi:1:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
1 | / import json
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
5 | | from typing import Any, Sequence
|
||||
6 | |
|
||||
7 | |
|
||||
8 | | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| |_^ I001
|
||||
6 | |
|
||||
7 | |
|
||||
| |__^ I001
|
||||
8 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
@ -98,7 +97,7 @@ E30_isort.pyi:21:5: E303 [*] Too many blank lines (2)
|
|||
|
|
||||
21 | abcd.foo()
|
||||
| ^^^^ E303
|
||||
22 |
|
||||
22 |
|
||||
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
|
||||
|
|
||||
= help: Remove extraneous blank line(s)
|
||||
|
|
@ -116,13 +115,13 @@ E30_isort.pyi:26:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
|
|
||||
25 | if TYPE_CHECKING:
|
||||
26 | / import os
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
30 | | from typing_extensions import TypeAlias
|
||||
31 | |
|
||||
| |_^ I001
|
||||
32 |
|
||||
| |____________________________________________^ I001
|
||||
31 |
|
||||
32 |
|
||||
33 | abcd.foo()
|
||||
|
|
||||
= help: Organize imports
|
||||
|
|
@ -158,7 +157,7 @@ E30_isort.pyi:33:5: E303 [*] Too many blank lines (2)
|
|||
|
|
||||
33 | abcd.foo()
|
||||
| ^^^^ E303
|
||||
34 |
|
||||
34 |
|
||||
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
||||
|
|
||||
= help: Remove extraneous blank line(s)
|
||||
|
|
@ -256,7 +255,7 @@ E30_isort.pyi:60:1: E303 [*] Too many blank lines (2)
|
|||
|
|
||||
60 | from typing import Any, Sequence
|
||||
| ^^^^ E303
|
||||
61 |
|
||||
61 |
|
||||
62 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
|
|
||||
= help: Remove extraneous blank line(s)
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ W391.ipynb:5:1: W391 [*] Too many newlines at end of cell
|
|||
|
|
||||
3 | # just a comment in this cell
|
||||
4 | # a comment and some newlines
|
||||
5 | /
|
||||
6 | |
|
||||
7 | |
|
||||
8 | |
|
||||
| |_^ W391
|
||||
5 | /
|
||||
6 | |
|
||||
7 | |
|
||||
| |__^ W391
|
||||
8 |
|
||||
9 | 1 + 1
|
||||
10 | # a comment
|
||||
|
|
||||
|
|
@ -30,12 +30,12 @@ W391.ipynb:11:1: W391 [*] Too many newlines at end of cell
|
|||
|
|
||||
9 | 1 + 1
|
||||
10 | # a comment
|
||||
11 | /
|
||||
12 | |
|
||||
13 | |
|
||||
14 | |
|
||||
15 | |
|
||||
| |_^ W391
|
||||
11 | /
|
||||
12 | |
|
||||
13 | |
|
||||
14 | |
|
||||
| |__^ W391
|
||||
15 |
|
||||
16 | 1+1
|
||||
|
|
||||
= help: Remove trailing newlines
|
||||
|
|
@ -55,12 +55,12 @@ W391.ipynb:11:1: W391 [*] Too many newlines at end of cell
|
|||
W391.ipynb:17:1: W391 [*] Too many newlines at end of cell
|
||||
|
|
||||
16 | 1+1
|
||||
17 | /
|
||||
18 | |
|
||||
19 | |
|
||||
20 | |
|
||||
21 | |
|
||||
| |_^ W391
|
||||
17 | /
|
||||
18 | |
|
||||
19 | |
|
||||
20 | |
|
||||
| |__^ W391
|
||||
21 |
|
||||
|
|
||||
= help: Remove trailing newlines
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
1 | / import json
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
5 | | from typing import Any, Sequence
|
||||
6 | |
|
||||
7 | |
|
||||
8 | | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| |_^ I001
|
||||
6 | |
|
||||
7 | |
|
||||
| |__^ I001
|
||||
8 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
@ -45,7 +44,7 @@ E30_isort.py:21:5: E303 [*] Too many blank lines (2)
|
|||
|
|
||||
21 | abcd.foo()
|
||||
| ^^^^ E303
|
||||
22 |
|
||||
22 |
|
||||
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
|
||||
|
|
||||
= help: Remove extraneous blank line(s)
|
||||
|
|
@ -63,13 +62,13 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
|
|
||||
25 | if TYPE_CHECKING:
|
||||
26 | / import os
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
30 | | from typing_extensions import TypeAlias
|
||||
31 | |
|
||||
| |_^ I001
|
||||
32 |
|
||||
| |____________________________________________^ I001
|
||||
31 |
|
||||
32 |
|
||||
33 | abcd.foo()
|
||||
|
|
||||
= help: Organize imports
|
||||
|
|
@ -105,7 +104,7 @@ E30_isort.py:33:5: E303 [*] Too many blank lines (2)
|
|||
|
|
||||
33 | abcd.foo()
|
||||
| ^^^^ E303
|
||||
34 |
|
||||
34 |
|
||||
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
||||
|
|
||||
= help: Remove extraneous blank line(s)
|
||||
|
|
@ -122,9 +121,9 @@ 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 | |
|
||||
62 | | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| |_^ I001
|
||||
61 | |
|
||||
| |__^ I001
|
||||
62 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
1 | / import json
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
5 | | from typing import Any, Sequence
|
||||
6 | |
|
||||
7 | |
|
||||
8 | | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| |_^ I001
|
||||
6 | |
|
||||
7 | |
|
||||
| |__^ I001
|
||||
8 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
@ -65,7 +64,7 @@ E30_isort.py:21:5: E303 [*] Too many blank lines (2)
|
|||
|
|
||||
21 | abcd.foo()
|
||||
| ^^^^ E303
|
||||
22 |
|
||||
22 |
|
||||
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
|
||||
|
|
||||
= help: Remove extraneous blank line(s)
|
||||
|
|
@ -83,13 +82,13 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
|
|
||||
25 | if TYPE_CHECKING:
|
||||
26 | / import os
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
30 | | from typing_extensions import TypeAlias
|
||||
31 | |
|
||||
| |_^ I001
|
||||
32 |
|
||||
| |____________________________________________^ I001
|
||||
31 |
|
||||
32 |
|
||||
33 | abcd.foo()
|
||||
|
|
||||
= help: Organize imports
|
||||
|
|
@ -125,7 +124,7 @@ E30_isort.py:33:5: E303 [*] Too many blank lines (2)
|
|||
|
|
||||
33 | abcd.foo()
|
||||
| ^^^^ E303
|
||||
34 |
|
||||
34 |
|
||||
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
||||
|
|
||||
= help: Remove extraneous blank line(s)
|
||||
|
|
@ -142,9 +141,9 @@ 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 | |
|
||||
62 | | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| |_^ I001
|
||||
61 | |
|
||||
| |__^ I001
|
||||
62 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
@ -158,7 +157,7 @@ E30_isort.py:60:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
E30_isort.py:62:1: E303 [*] Too many blank lines (1)
|
||||
|
|
||||
60 | from typing import Any, Sequence
|
||||
61 |
|
||||
61 |
|
||||
62 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| ^^^^^ E303
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
1 | / import json
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
5 | | from typing import Any, Sequence
|
||||
6 | |
|
||||
7 | |
|
||||
8 | | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| |_^ I001
|
||||
6 | |
|
||||
7 | |
|
||||
| |__^ I001
|
||||
8 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
@ -63,7 +62,7 @@ E30_isort.py:21:5: E303 [*] Too many blank lines (2)
|
|||
|
|
||||
21 | abcd.foo()
|
||||
| ^^^^ E303
|
||||
22 |
|
||||
22 |
|
||||
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
|
||||
|
|
||||
= help: Remove extraneous blank line(s)
|
||||
|
|
@ -81,13 +80,13 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
|
|
||||
25 | if TYPE_CHECKING:
|
||||
26 | / import os
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
30 | | from typing_extensions import TypeAlias
|
||||
31 | |
|
||||
| |_^ I001
|
||||
32 |
|
||||
| |____________________________________________^ I001
|
||||
31 |
|
||||
32 |
|
||||
33 | abcd.foo()
|
||||
|
|
||||
= help: Organize imports
|
||||
|
|
@ -123,7 +122,7 @@ E30_isort.py:33:5: E303 [*] Too many blank lines (2)
|
|||
|
|
||||
33 | abcd.foo()
|
||||
| ^^^^ E303
|
||||
34 |
|
||||
34 |
|
||||
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
||||
|
|
||||
= help: Remove extraneous blank line(s)
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
E30_isort.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
||||
|
|
||||
1 | / import json
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
2 | |
|
||||
3 | |
|
||||
4 | |
|
||||
5 | | from typing import Any, Sequence
|
||||
6 | |
|
||||
7 | |
|
||||
8 | | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| |_^ I001
|
||||
6 | |
|
||||
7 | |
|
||||
| |__^ I001
|
||||
8 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
@ -34,7 +33,7 @@ E30_isort.py:21:5: E303 [*] Too many blank lines (2)
|
|||
|
|
||||
21 | abcd.foo()
|
||||
| ^^^^ E303
|
||||
22 |
|
||||
22 |
|
||||
23 | def __init__(self, backend_module: str, backend_obj: str | None) -> None: ...
|
||||
|
|
||||
= help: Remove extraneous blank line(s)
|
||||
|
|
@ -52,13 +51,13 @@ E30_isort.py:26:1: I001 [*] Import block is un-sorted or un-formatted
|
|||
|
|
||||
25 | if TYPE_CHECKING:
|
||||
26 | / import os
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
27 | |
|
||||
28 | |
|
||||
29 | |
|
||||
30 | | from typing_extensions import TypeAlias
|
||||
31 | |
|
||||
| |_^ I001
|
||||
32 |
|
||||
| |____________________________________________^ I001
|
||||
31 |
|
||||
32 |
|
||||
33 | abcd.foo()
|
||||
|
|
||||
= help: Organize imports
|
||||
|
|
@ -77,7 +76,7 @@ E30_isort.py:33:5: E303 [*] Too many blank lines (2)
|
|||
|
|
||||
33 | abcd.foo()
|
||||
| ^^^^ E303
|
||||
34 |
|
||||
34 |
|
||||
35 | def __call__(self, name: str, *args: Any, **kwargs: Any) -> Any:
|
||||
|
|
||||
= help: Remove extraneous blank line(s)
|
||||
|
|
@ -94,9 +93,9 @@ 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 | |
|
||||
62 | | class MissingCommand(TypeError): ... # noqa: N818
|
||||
| |_^ I001
|
||||
61 | |
|
||||
| |__^ I001
|
||||
62 | class MissingCommand(TypeError): ... # noqa: N818
|
||||
|
|
||||
= help: Organize imports
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue