Skip to content

Commit ecf1565

Browse files
committed
test: update another improperly rendered range
This one almost looks like it fits into the other failure categories, but without identifying root causes, it's hard to say for sure. The span here does end after a line terminator, so it feels like it's like the rest. I also isolated this change since I found the snapshot diff pretty hard to read and wanted to look at it more closely. In this case, the before is: E204.py:31:2: E204 [*] Whitespace after decorator | 30 | # E204 31 | @ \ | __^ 32 | | foo | |_^ E204 33 | def baz(): 34 | print('baz') | = help: Remove whitespace And the after is: E204.py:31:2: E204 [*] Whitespace after decorator | 30 | # E204 31 | @ \ | ^^ E204 32 | foo 33 | def baz(): 34 | print('baz') | = help: Remove whitespace The updated rendering is clearly an improvement, since `foo` itself is not really the subject of the diagnostic. The whitespace is. Also, the new rendering matches the span fed to `annotate-snippets`, where as the old rendering does not.
1 parent 677c878 commit ecf1565

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E204_E204.py.snap

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
3-
snapshot_kind: text
43
---
54
E204.py:14:2: E204 [*] Whitespace after decorator
65
|
@@ -44,13 +43,12 @@ E204.py:25:6: E204 [*] Whitespace after decorator
4443

4544
E204.py:31:2: E204 [*] Whitespace after decorator
4645
|
47-
30 | # E204
48-
31 | @ \
49-
| __^
50-
32 | | foo
51-
| |_^ E204
52-
33 | def baz():
53-
34 | print('baz')
46+
30 | # E204
47+
31 | @ \
48+
| ^^ E204
49+
32 | foo
50+
33 | def baz():
51+
34 | print('baz')
5452
|
5553
= help: Remove whitespace
5654

0 commit comments

Comments
 (0)