mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
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.
This commit is contained in:
parent
9fdb1e9bc8
commit
59edee2aca
1 changed files with 6 additions and 8 deletions
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
E204.py:14:2: E204 [*] Whitespace after decorator
|
||||
|
|
||||
|
@ -44,13 +43,12 @@ E204.py:25:6: E204 [*] Whitespace after decorator
|
|||
|
||||
E204.py:31:2: E204 [*] Whitespace after decorator
|
||||
|
|
||||
30 | # E204
|
||||
31 | @ \
|
||||
| __^
|
||||
32 | | foo
|
||||
| |_^ E204
|
||||
33 | def baz():
|
||||
34 | print('baz')
|
||||
30 | # E204
|
||||
31 | @ \
|
||||
| ^^ E204
|
||||
32 | foo
|
||||
33 | def baz():
|
||||
34 | print('baz')
|
||||
|
|
||||
= help: Remove whitespace
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue