test: update snapshots with missing annotations

These updates center around the addition of annotations in the
diagnostic rendering. Previously, the annotation was just not rendered
at all. With the `annotate-snippets` upgrade, it is now rendered. I
examined a pseudo random sample of these, and they all look correct.

As will be true in future batches, some of these snapshots also have
changes to whitespace in them as well.
This commit is contained in:
Andrew Gallant 2025-01-07 12:16:26 -05:00 committed by Andrew Gallant
parent 0de8216a25
commit 3fa4479c85
85 changed files with 153 additions and 151 deletions

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_implicit_str_concat/mod.rs
snapshot_kind: text
---
ISC_syntax_error.py:2:5: SyntaxError: missing closing quote in string literal
|
@ -59,7 +58,7 @@ ISC_syntax_error.py:4:1: ISC001 Implicitly concatenated string literals on one l
4 | / "a" """b
5 | | c""" "d
| |____^ ISC001
6 |
6 |
7 | # For f-strings, the `FStringRanges` won't contain the range for
|
= help: Combine string literals
@ -70,7 +69,7 @@ ISC_syntax_error.py:5:6: SyntaxError: missing closing quote in string literal
4 | "a" """b
5 | c""" "d
| ^
6 |
6 |
7 | # For f-strings, the `FStringRanges` won't contain the range for
|
@ -80,7 +79,7 @@ ISC_syntax_error.py:5:8: SyntaxError: Expected a statement
4 | "a" """b
5 | c""" "d
| ^
6 |
6 |
7 | # For f-strings, the `FStringRanges` won't contain the range for
8 | # unterminated f-strings.
|
@ -144,7 +143,7 @@ ISC_syntax_error.py:11:1: ISC001 Implicitly concatenated string literals on one
11 | / f"a" f"""b
12 | | c""" f"d {e
| |____^ ISC001
13 |
13 |
14 | (
|
= help: Combine string literals
@ -173,10 +172,12 @@ ISC_syntax_error.py:30:1: SyntaxError: unexpected EOF while parsing
|
28 | "i" "j"
29 | )
| ^
|
ISC_syntax_error.py:30:1: SyntaxError: f-string: unterminated string
|
28 | "i" "j"
29 | )
| ^
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/flake8_implicit_str_concat/mod.rs
snapshot_kind: text
---
ISC_syntax_error.py:2:5: SyntaxError: missing closing quote in string literal
|
@ -47,7 +46,7 @@ ISC_syntax_error.py:5:6: SyntaxError: missing closing quote in string literal
4 | "a" """b
5 | c""" "d
| ^
6 |
6 |
7 | # For f-strings, the `FStringRanges` won't contain the range for
|
@ -57,7 +56,7 @@ ISC_syntax_error.py:5:8: SyntaxError: Expected a statement
4 | "a" """b
5 | c""" "d
| ^
6 |
6 |
7 | # For f-strings, the `FStringRanges` won't contain the range for
8 | # unterminated f-strings.
|
@ -127,10 +126,12 @@ ISC_syntax_error.py:30:1: SyntaxError: unexpected EOF while parsing
|
28 | "i" "j"
29 | )
| ^
|
ISC_syntax_error.py:30:1: SyntaxError: f-string: unterminated string
|
28 | "i" "j"
29 | )
| ^
|

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
separate_subpackage_first_and_third_party_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -12,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
separate_subpackage_first_and_third_party_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -12,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
add_newline_before_comments.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -11,6 +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
|
= help: Organize imports

View file

@ -1,24 +1,24 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
as_imports_comments.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / from foo import ( # Comment on `foo`
2 | | Member as Alias, # Comment on `Alias`
3 | | )
4 | |
4 | |
5 | | from bar import ( # Comment on `bar`
6 | | Member, # Comment on `Member`
7 | | )
8 | |
8 | |
9 | | from baz import ( # Comment on `baz`
10 | | Member as Alias # Comment on `Alias`
11 | | )
12 | |
12 | |
13 | | from bop import ( # Comment on `bop`
14 | | Member # Comment on `Member`
15 | | )
| |__^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
case_sensitive.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -13,6 +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
|
= help: Organize imports

View file

@ -1,12 +1,12 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
relative_imports_order.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / from ... import a
2 | | from .. import b
3 | | from . import c
| |________________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
combine_as_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -8,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
combine_as_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -8,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
combine_import_from.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -9,6 +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
|
= help: Organize imports

View file

@ -1,23 +1,22 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
comments.py:3:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | # Comment 1
2 | # Comment 2
3 | / import D
4 | |
4 | |
5 | | # Comment 3a
6 | | import C
7 | |
7 | |
8 | | # Comment 3b
9 | | import C
10 | |
10 | |
11 | | import B # Comment 4
12 | |
12 | |
13 | | # Comment 5
14 | |
14 | |
15 | | # Comment 6
16 | | from A import (
17 | | a, # Comment 7
@ -29,14 +28,15 @@ comments.py:3:1: I001 [*] Import block is un-sorted or un-formatted
23 | | b, # Comment 10
24 | | c, # Comment 11
25 | | )
26 | |
26 | |
27 | | from D import a_long_name_to_force_multiple_lines # Comment 12
28 | | from D import another_long_name_to_force_multiple_lines # Comment 13
29 | |
29 | |
30 | | from E import a # Comment 1
31 | |
31 | |
32 | | from F import a # Comment 1
33 | | from F import b
| |________________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
deduplicate_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -8,6 +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
|
= help: Organize imports

View file

@ -1,12 +1,12 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
bar.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / import os
2 | | import pandas
3 | | import foo.baz
| |_______________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
fit_line_length.py:7:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -13,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
fit_line_length_comment.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -12,6 +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💣29012ß9💣29012ß9💣29012ß9💣29012ß9💣29012ß9💣29012ß9💣2
7 | | # The next import doesn't fit on one line.
8 | | from h import i # 012ß9💣29012ß9💣29012ß9💣29012ß9💣29012ß9💣29012ß9💣29012ß9💣29
| |__________________________________________________________________________________________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
force_single_line.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -12,25 +11,26 @@ force_single_line.py:1:1: I001 [*] Import block is un-sorted or un-formatted
6 | | from json import load
7 | | from json import loads as json_loads
8 | | from logging.handlers import StreamHandler, FileHandler
9 | |
9 | |
10 | | # comment 1
11 | | from third_party import lib1, lib2, \
12 | | lib3, lib7, lib5, lib6
13 | | # comment 2
14 | | from third_party import lib4
15 | |
15 | |
16 | | from foo import bar # comment 3
17 | | from foo2 import bar2 # comment 4
18 | | from foo3 import bar3, baz3 # comment 5
19 | |
19 | |
20 | | # comment 6
21 | | from bar import (
22 | | a, # comment 7
23 | | b, # comment 8
24 | | )
25 | |
25 | |
26 | | # comment 9
27 | | from baz import * # comment 10
| |________________________________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
force_sort_within_sections.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -11,12 +10,13 @@ force_sort_within_sections.py:1:1: I001 [*] Import block is un-sorted or un-form
5 | | from z import z1
6 | | import b as b1 # import_as
7 | | import z
8 | |
8 | |
9 | | from ..parent import *
10 | | from .my import fn
11 | | from . import my
12 | | from .my.nested import fn2
13 | | from ...grandparent import fn3
| |_______________________________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
force_sort_within_sections.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -11,12 +10,13 @@ force_sort_within_sections.py:1:1: I001 [*] Import block is un-sorted or un-form
5 | | from z import z1
6 | | import b as b1 # import_as
7 | | import z
8 | |
8 | |
9 | | from ..parent import *
10 | | from .my import fn
11 | | from . import my
12 | | from .my.nested import fn2
13 | | from ...grandparent import fn3
| |_______________________________^ I001
|
= help: Organize imports

View file

@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
force_sort_within_sections_future.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / import __future__
2 | | from __future__ import annotations
| |___________________________________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
force_sort_within_sections_with_as_names.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -9,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
force_to_top.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -10,7 +9,7 @@ force_to_top.py:1:1: I001 [*] Import block is un-sorted or un-formatted
4 | | import lib1
5 | | import lib3
6 | | import lib4
7 | |
7 | |
8 | | import foo
9 | | import z
10 | | from foo import bar
@ -22,11 +21,12 @@ force_to_top.py:1:1: I001 [*] Import block is un-sorted or un-formatted
16 | | from lib5 import lib2
17 | | from lib4 import lib2
18 | | from lib5 import lib1
19 | |
19 | |
20 | | import lib3.lib4
21 | | import lib3.lib4.lib5
22 | | from lib3.lib4 import foo
23 | | from lib3.lib4.lib5 import foo
| |_______________________________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
force_to_top.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -10,7 +9,7 @@ force_to_top.py:1:1: I001 [*] Import block is un-sorted or un-formatted
4 | | import lib1
5 | | import lib3
6 | | import lib4
7 | |
7 | |
8 | | import foo
9 | | import z
10 | | from foo import bar
@ -22,11 +21,12 @@ force_to_top.py:1:1: I001 [*] Import block is un-sorted or un-formatted
16 | | from lib5 import lib2
17 | | from lib4 import lib2
18 | | from lib5 import lib1
19 | |
19 | |
20 | | import lib3.lib4
21 | | import lib3.lib4.lib5
22 | | from lib3.lib4 import foo
23 | | from lib3.lib4.lib5 import foo
| |_______________________________^ I001
|
= help: Organize imports

View file

@ -1,12 +1,12 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
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
|
= help: Organize imports

View file

@ -1,12 +1,12 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
forced_separate.py:3:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -12,6 +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
|
= help: Organize imports

View file

@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
future_from.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / import __future__
2 | | from __future__ import annotations
| |___________________________________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
separate_subpackage_first_and_third_party_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -12,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
if_elif_else.py:6:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -8,6 +7,7 @@ if_elif_else.py:6:1: I001 [*] Import block is un-sorted or un-formatted
5 | else:
6 | / from setuptools.command.sdist import sdist as _sdist
7 | | from distutils.command.sdist import sdist as _sdist
| |________________________________________________________^ I001
|
= help: Organize imports

View file

@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
import_from_after_import.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / from collections import Collection
2 | | import os
| |__________^ I001
|
= help: Organize imports

View file

@ -1,20 +1,20 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
inline_comments.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / from a.prometheus.metrics import ( # type:ignore[attr-defined]
2 | | TERMINAL_CURRENTLY_RUNNING_TOTAL,
3 | | )
4 | |
4 | |
5 | | from b.prometheus.metrics import (
6 | | TERMINAL_CURRENTLY_RUNNING_TOTAL, # type:ignore[attr-defined]
7 | | )
8 | |
8 | |
9 | | from c.prometheus.metrics import TERMINAL_CURRENTLY_RUNNING_TOTAL # type:ignore[attr-defined]
10 | |
10 | |
11 | | from d.prometheus.metrics import TERMINAL_CURRENTLY_RUNNING_TOTAL, OTHER_RUNNING_TOTAL # type:ignore[attr-defined]
| |____________________________________________________________________________________________________________________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
separate_local_folder_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -11,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
separate_local_folder_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -11,6 +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
|
= help: Organize imports

View file

@ -1,12 +1,12 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
length_sort_from_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / from mediuuuuuuuuuuum import a
2 | | from short import b
3 | | from loooooooooooooooooooooog import c
| |_______________________________________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
length_sort_non_ascii_members.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -15,6 +14,7 @@ length_sort_non_ascii_members.py:1:1: I001 [*] Import block is un-sorted or un-f
9 | | mediuuuuuum,
10 | | λοοοοοοοοοοοοοονγ,
11 | | )
| |__^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
length_sort_non_ascii_modules.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -13,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
length_sort_straight_and_from_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -10,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
length_sort_straight_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -8,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
length_sort_with_relative_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -11,6 +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
|
= help: Organize imports

View file

@ -1,12 +1,12 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
length_sort_from_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / from mediuuuuuuuuuuum import a
2 | | from short import b
3 | | from loooooooooooooooooooooog import c
| |_______________________________________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
length_sort_straight_and_from_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -10,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
length_sort_straight_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -8,6 +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
|
= help: Organize imports

View file

@ -1,18 +1,18 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
lines_after_imports_nothing_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
| |_____________________________________^ I001
|
= help: Organize imports

View file

@ -1,25 +1,25 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
lines_between_types.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / from __future__ import annotations
2 | |
2 | |
3 | | import datetime
4 | | import json
5 | |
6 | |
5 | |
6 | |
7 | | from binascii import hexlify
8 | |
8 | |
9 | | import requests
10 | |
11 | |
10 | |
11 | |
12 | | from sanic import Sanic
13 | | from loguru import Logger
14 | |
14 | |
15 | | from . import config
16 | | from .data import Data
| |_______________________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
magic_trailing_comma.py:2:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -11,7 +10,7 @@ magic_trailing_comma.py:2:1: I001 [*] Import block is un-sorted or un-formatted
5 | | stdout,
6 | | exit,
7 | | )
8 | |
8 | |
9 | | # No magic comma, this will be rolled into one line.
10 | | from os import (
11 | | path,
@ -19,29 +18,30 @@ magic_trailing_comma.py:2:1: I001 [*] Import block is un-sorted or un-formatted
13 | | execl,
14 | | execv
15 | | )
16 | |
16 | |
17 | | from glob import (
18 | | glob,
19 | | iglob,
20 | | escape, # Ends with a comment, should still treat as magic trailing comma.
21 | | )
22 | |
22 | |
23 | | # These will be combined, but without a trailing comma.
24 | | from foo import bar
25 | | from foo import baz
26 | |
26 | |
27 | | # These will be combined, _with_ a trailing comma.
28 | | from module1 import member1
29 | | from module1 import (
30 | | member2,
31 | | member3,
32 | | )
33 | |
33 | |
34 | | # These will be combined, _with_ a trailing comma.
35 | | from module2 import member1, member2
36 | | from module2 import (
37 | | member3,
38 | | )
| |__^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
natural_order.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -20,6 +19,7 @@ natural_order.py:1:1: I001 [*] Import block is un-sorted or un-formatted
14 | | uint32,
15 | | uint64,
16 | | )
| |__^ I001
|
= help: Organize imports

View file

@ -1,12 +1,12 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
bar.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / import os
2 | | import pandas
3 | | import foo.baz
| |_______________^ I001
|
= help: Organize imports

View file

@ -1,18 +1,18 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
no_lines_before.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
| |_____________________________________^ I001
|
= help: Organize imports

View file

@ -1,18 +1,18 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
no_lines_before.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
| |_____________________________________^ I001
|
= help: Organize imports

View file

@ -1,12 +1,12 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
no_lines_before_with_empty_sections.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / from __future__ import annotations
2 | | from typing import Any
3 | | from . import my_local_folder_object
| |_____________________________________^ I001
|
= help: Organize imports

View file

@ -1,18 +1,18 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
no_standard_library.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / from __future__ import annotations
2 | |
2 | |
3 | | import os
4 | | import django.settings
5 | | from library import foo
6 | | import pytz
7 | |
7 | |
8 | | from . import local
9 | | import sys
| |___________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
order_by_type.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -16,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
order_by_type.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -16,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
order_by_type_with_custom_classes.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -8,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
order_by_type_with_custom_classes.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -8,6 +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
|
= help: Organize imports

View file

@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
order_by_type_with_custom_constants.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
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
|
= help: Organize imports

View file

@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
order_by_type_with_custom_constants.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
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
|
= help: Organize imports

View file

@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
order_by_type_with_custom_variables.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / from sklearn.svm import VAR, Class, MyVar, CONST, abc
2 | | from subprocess import utils, var_ABC, Variable, Klass, CONSTANT, exe
| |______________________________________________________________________^ I001
|
= help: Organize imports

View file

@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
order_by_type_with_custom_variables.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / from sklearn.svm import VAR, Class, MyVar, CONST, abc
2 | | from subprocess import utils, var_ABC, Variable, Klass, CONSTANT, exe
| |______________________________________________________________________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
order_relative_imports_by_level.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -8,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
preserve_comment_order.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -15,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
preserve_import_star.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -10,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
propagate_inline_comments.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -8,6 +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
|
= help: Organize imports

View file

@ -1,11 +1,11 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
reorder_within_section.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / import sys
2 | | import os
| |__________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
sections.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -11,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
sections.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -11,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
separate_first_party_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -9,6 +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
|
= help: Organize imports

View file

@ -1,12 +1,12 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
separate_future_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / import sys
2 | | import os
3 | | from __future__ import annotations
| |___________________________________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
separate_local_folder_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -11,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
separate_third_party_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -8,6 +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
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
sort_similar_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -19,17 +18,18 @@ sort_similar_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted
13 | | from a import b as y
14 | | from b import C
15 | | from b import c as d
16 | |
16 | |
17 | | import A
18 | | import a
19 | | import b
20 | | import B
21 | |
21 | |
22 | | import x as y
23 | | import x as A
24 | | import x as Y
25 | | import x
26 | | import x as a
| |______________^ I001
|
= help: Organize imports

View file

@ -1,6 +1,5 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
magic_trailing_comma.py:2:1: I001 [*] Import block is un-sorted or un-formatted
|
@ -11,7 +10,7 @@ magic_trailing_comma.py:2:1: I001 [*] Import block is un-sorted or un-formatted
5 | | stdout,
6 | | exit,
7 | | )
8 | |
8 | |
9 | | # No magic comma, this will be rolled into one line.
10 | | from os import (
11 | | path,
@ -19,29 +18,30 @@ magic_trailing_comma.py:2:1: I001 [*] Import block is un-sorted or un-formatted
13 | | execl,
14 | | execv
15 | | )
16 | |
16 | |
17 | | from glob import (
18 | | glob,
19 | | iglob,
20 | | escape, # Ends with a comment, should still treat as magic trailing comma.
21 | | )
22 | |
22 | |
23 | | # These will be combined, but without a trailing comma.
24 | | from foo import bar
25 | | from foo import baz
26 | |
26 | |
27 | | # These will be combined, _with_ a trailing comma.
28 | | from module1 import member1
29 | | from module1 import (
30 | | member2,
31 | | member3,
32 | | )
33 | |
33 | |
34 | | # These will be combined, _with_ a trailing comma.
35 | | from module2 import member1, member2
36 | | from module2 import (
37 | | member3,
38 | | )
| |__^ I001
|
= help: Organize imports

View file

@ -1,12 +1,12 @@
---
source: crates/ruff_linter/src/rules/isort/mod.rs
snapshot_kind: text
---
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
|
= help: Organize imports

View file

@ -1,15 +1,15 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
snapshot_kind: text
---
W391_2.py:14:1: W391 [*] Too many newlines at end of file
|
12 | foo()
13 | bar()
14 | /
15 | |
16 | |
17 | |
14 | /
15 | |
16 | |
17 | |
| |__^ W391
|
= help: Remove trailing newlines

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/err/del_incomplete_target.py
snapshot_kind: text
---
## AST
@ -122,4 +121,5 @@ Module(
|
3 | del x, y[
4 | z
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/err/function_def_unclosed_parameter_list.py
snapshot_kind: text
---
## AST
@ -231,4 +230,5 @@ Module(
|
4 | def foo(a: int, b: str
5 | x = 10
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/err/match_stmt_expect_indented_block.py
snapshot_kind: text
---
## AST
@ -63,4 +62,5 @@ Module(
|
1 | match foo:
2 | case _: ...
| ^ Syntax Error: Expected dedent, found end of file
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/err/match_stmt_no_newline_before_case.py
snapshot_kind: text
---
## AST
@ -61,4 +60,5 @@ Module(
|
1 | match foo: case _: ...
| ^ Syntax Error: Expected dedent, found end of file
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/err/node_range_with_gaps.py
snapshot_kind: text
---
## AST
@ -120,4 +119,5 @@ Module(
|
2 | def bar(): ...
3 | def baz
| ^ Syntax Error: Expected ')', found end of file
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/statements/if_extra_closing_parentheses.py
snapshot_kind: text
---
## AST
@ -77,4 +76,5 @@ Module(
|
2 | if True)):
3 | pass
| ^ Syntax Error: Expected a statement
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_2.py
snapshot_kind: text
---
## AST
@ -124,4 +123,5 @@ Module(
|
4 | case x as y + 1j:
5 | pass
| ^ Syntax Error: Expected a statement
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_3.py
snapshot_kind: text
---
## AST
@ -152,4 +151,5 @@ Module(
|
4 | case {(x as y): 1}:
5 | pass
| ^ Syntax Error: Expected a statement
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/err/try_stmt_invalid_order.py
snapshot_kind: text
---
## AST
@ -81,4 +80,5 @@ Module(
|
5 | else:
6 | pass
| ^ Syntax Error: Expected a statement
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/err/try_stmt_missing_except_finally.py
snapshot_kind: text
---
## AST
@ -67,4 +66,5 @@ Module(
|
5 | else:
6 | pass
| ^ Syntax Error: Expected `except` or `finally` after `try` block
|