Skip to content

Commit d1bca63

Browse files
committed
test: update snapshot with fixed annotation but carets include whitespace
I separated out this snapshot update since the string of `^` including whitespace looked a little odd. I investigated this one specifically, and indeed, our span in this case is telling `annotate-snippets` to point at the whitespace. So this is `annotate-snippets` doing what it's told with a mildly sub-optimal span. For clarity, the before rendering is: skip.py:34:1: 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 | = help: Organize imports And now after is: skip.py:34:1: 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 | = help: Organize imports This is a clear bug fix since it adds in the `I001` annotation, even though the carets look a little funny by including the whitespace preceding `import sys; import os`.
1 parent b11906d commit d1bca63

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__skip.py.snap

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
---
22
source: crates/ruff_linter/src/rules/isort/mod.rs
3-
snapshot_kind: text
43
---
54
skip.py:20:1: I001 [*] Import block is un-sorted or un-formatted
65
|
76
18 | import sys
87
19 | import os # isort: skip
98
20 | / import collections
109
21 | | import abc
11-
22 | |
12-
| |_^ I001
13-
23 |
10+
| |_______________^ I001
11+
22 |
12+
23 |
1413
24 | def f():
1514
|
1615
= help: Organize imports
@@ -32,9 +31,9 @@ skip.py:27:1: I001 [*] Import block is un-sorted or un-formatted
3231
26 | import os # isort:skip
3332
27 | / import collections
3433
28 | | import abc
35-
29 | |
36-
| |_^ I001
37-
30 |
34+
| |_______________^ I001
35+
29 |
36+
30 |
3837
31 | def f():
3938
|
4039
= help: Organize imports
@@ -52,9 +51,10 @@ skip.py:27:1: I001 [*] Import block is un-sorted or un-formatted
5251

5352
skip.py:34:1: I001 [*] Import block is un-sorted or un-formatted
5453
|
55-
32 | import sys; import os # isort:skip
56-
33 | import sys; import os # isort:skip # isort:skip
57-
34 | / import sys; import os
54+
32 | import sys; import os # isort:skip
55+
33 | import sys; import os # isort:skip # isort:skip
56+
34 | import sys; import os
57+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ I001
5858
|
5959
= help: Organize imports
6060

0 commit comments

Comments
 (0)