Skip to content

Commit

Permalink
test: update snapshots with missing ^
Browse files Browse the repository at this point in the history
The previous rendering just seems wrong in that a `^` is omitted. The
new version of `annotate-snippets` seems to get this right. I checked a
pseudo random sample of these, and it seems to only happen when the
position pointed at a line terminator.
  • Loading branch information
BurntSushi committed Jan 15, 2025
1 parent f29f581 commit f49cfb6
Show file tree
Hide file tree
Showing 35 changed files with 161 additions and 193 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
snapshot_kind: text
---
W292_0.py:2:9: W292 [*] No newline at end of file
|
1 | def fn() -> None:
2 | pass
| W292
| ^ W292
|
= help: Add trailing newline

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
snapshot_kind: text
---
invalid_characters.py:24:12: PLE2512 [*] Invalid unescaped character SUB, use "\x1A" instead
|
22 | cr_ok = f'\\r'
23 |
23 |
24 | sub = 'sub '
| PLE2512
| ^ PLE2512
25 | sub = f'sub '
|
= help: Replace with escape sequence
Expand All @@ -26,8 +25,8 @@ invalid_characters.py:25:13: PLE2512 [*] Invalid unescaped character SUB, use "\
|
24 | sub = 'sub '
25 | sub = f'sub '
| PLE2512
26 |
| ^ PLE2512
26 |
27 | sub_ok = '\x1a'
|
= help: Replace with escape sequence
Expand All @@ -45,10 +44,10 @@ invalid_characters.py:25:13: PLE2512 [*] Invalid unescaped character SUB, use "\
invalid_characters.py:55:25: PLE2512 [*] Invalid unescaped character SUB, use "\x1A" instead
|
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
54 |
54 |
55 | nested_fstrings = f'␈{f'{f''}'}'
| PLE2512
56 |
| ^ PLE2512
56 |
57 | # https://github.com/astral-sh/ruff/issues/7455#issuecomment-1741998106
|
= help: Replace with escape sequence
Expand All @@ -67,7 +66,7 @@ invalid_characters.py:58:12: PLE2512 [*] Invalid unescaped character SUB, use "\
|
57 | # https://github.com/astral-sh/ruff/issues/7455#issuecomment-1741998106
58 | x = f"""}}ab"""
| PLE2512
| ^ PLE2512
59 | # https://github.com/astral-sh/ruff/issues/7455#issuecomment-1741998256
60 | x = f"""}}a␛b"""
|
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
snapshot_kind: text
---
invalid_characters.py:44:13: PLE2515 [*] Invalid unescaped character zero-width-space, use "\u200B" instead
|
42 | nul_ok = f'\0'
43 |
43 |
44 | zwsp = 'zero​width'
| PLE2515
| ^ PLE2515
45 | zwsp = f'zero​width'
|
= help: Replace with escape sequence
Expand All @@ -26,8 +25,8 @@ invalid_characters.py:45:14: PLE2515 [*] Invalid unescaped character zero-width-
|
44 | zwsp = 'zero​width'
45 | zwsp = f'zero​width'
| PLE2515
46 |
| ^ PLE2515
46 |
47 | zwsp_ok = '\u200b'
|
= help: Replace with escape sequence
Expand All @@ -45,9 +44,9 @@ invalid_characters.py:45:14: PLE2515 [*] Invalid unescaped character zero-width-
invalid_characters.py:50:36: PLE2515 [*] Invalid unescaped character zero-width-space, use "\u200B" instead
|
48 | zwsp_ok = f'\u200b'
49 |
49 |
50 | zwsp_after_multibyte_character = "ಫ​"
| PLE2515
| ^ PLE2515
51 | zwsp_after_multibyte_character = f"ಫ​"
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
|
Expand All @@ -67,7 +66,7 @@ invalid_characters.py:51:37: PLE2515 [*] Invalid unescaped character zero-width-
|
50 | zwsp_after_multibyte_character = "ಫ​"
51 | zwsp_after_multibyte_character = f"ಫ​"
| PLE2515
| ^ PLE2515
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
|
Expand All @@ -88,7 +87,7 @@ invalid_characters.py:52:60: PLE2515 [*] Invalid unescaped character zero-width-
50 | zwsp_after_multibyte_character = "ಫ​"
51 | zwsp_after_multibyte_character = f"ಫ​"
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
| PLE2515
| ^ PLE2515
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
|
= help: Replace with escape sequence
Expand All @@ -108,7 +107,7 @@ invalid_characters.py:52:61: PLE2515 [*] Invalid unescaped character zero-width-
50 | zwsp_after_multibyte_character = "ಫ​"
51 | zwsp_after_multibyte_character = f"ಫ​"
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
| PLE2515
| ^ PLE2515
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
|
= help: Replace with escape sequence
Expand All @@ -128,8 +127,8 @@ invalid_characters.py:53:61: PLE2515 [*] Invalid unescaped character zero-width-
51 | zwsp_after_multibyte_character = f"ಫ​"
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
| PLE2515
54 |
| ^ PLE2515
54 |
55 | nested_fstrings = f'␈{f'{f''}'}'
|
= help: Replace with escape sequence
Expand All @@ -149,8 +148,8 @@ invalid_characters.py:53:62: PLE2515 [*] Invalid unescaped character zero-width-
51 | zwsp_after_multibyte_character = f"ಫ​"
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
| PLE2515
54 |
| ^ PLE2515
54 |
55 | nested_fstrings = f'␈{f'{f''}'}'
|
= help: Replace with escape sequence
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
snapshot_kind: text
---
no_method_decorator.py:9:5: PLR0202 [*] Class method defined without decorator
|
7 | self.color = color
8 |
8 |
9 | def pick_colors(cls, *args): # [no-classmethod-decorator]
| PLR0202
| ^ PLR0202
10 | """classmethod to pick fruit colors"""
11 | cls.COLORS = args
|
Expand All @@ -31,7 +30,7 @@ no_method_decorator.py:22:5: PLR0202 [*] Class method defined without decorator
|
21 | class Class:
22 | def class_method(cls):
| PLR0202
| ^ PLR0202
23 | pass
|
= help: Add @classmethod decorator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
snapshot_kind: text
---
no_method_decorator.py:15:5: PLR0203 [*] Static method defined without decorator
|
13 | pick_colors = classmethod(pick_colors)
14 |
14 |
15 | def pick_one_color(): # [no-staticmethod-decorator]
| PLR0203
| ^ PLR0203
16 | """staticmethod to pick one fruit color"""
17 | return choice(Fruit.COLORS)
|
Expand All @@ -30,9 +29,9 @@ no_method_decorator.py:15:5: PLR0203 [*] Static method defined without decorator
no_method_decorator.py:27:5: PLR0203 [*] Static method defined without decorator
|
25 | class_method = classmethod(class_method);another_statement
26 |
26 |
27 | def static_method():
| PLR0203
| ^ PLR0203
28 | pass
|
= help: Add @staticmethod decorator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/attribute/no_member.py
snapshot_kind: text
---
## AST

Expand Down Expand Up @@ -77,13 +76,13 @@ Module(
2 | first.
| ^ Syntax Error: Expected an identifier
3 | second
4 |
4 |
5 | # No member access after the dot.
|


|
5 | # No member access after the dot.
6 | last.
| Syntax Error: Expected an identifier
| ^ Syntax Error: Expected an identifier
|
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_0.py
snapshot_kind: text
---
## AST

Expand Down Expand Up @@ -76,7 +75,7 @@ Module(

|
1 | {x:
2 |
2 |
3 | def foo():
| ^^^ Syntax Error: Expected an identifier, but found a keyword 'def' that cannot be used here
4 | pass
Expand All @@ -85,7 +84,7 @@ Module(

|
1 | {x:
2 |
2 |
3 | def foo():
| ^^^ Syntax Error: Expected ',', found name
4 | pass
Expand All @@ -102,5 +101,5 @@ Module(
|
3 | def foo():
4 | pass
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_1.py
snapshot_kind: text
---
## AST

Expand Down Expand Up @@ -63,7 +62,7 @@ Module(

|
1 | {x:
2 |
2 |
3 | 1 + 2
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_0.py
snapshot_kind: text
---
## AST

Expand Down Expand Up @@ -38,7 +37,7 @@ Module(

|
1 | # Missing closing bracket 0: No elements
2 |
2 |
3 | [
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_1.py
snapshot_kind: text
---
## AST

Expand Down Expand Up @@ -51,7 +50,7 @@ Module(

|
4 | [
5 |
5 |
6 | x + y
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_2.py
snapshot_kind: text
---
## AST

Expand Down Expand Up @@ -59,7 +58,7 @@ Module(

|
4 | [1,
5 |
5 |
6 | x + y
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_0.py
snapshot_kind: text
---
## AST

Expand Down Expand Up @@ -30,15 +29,15 @@ Module(

|
1 | # There are no parentheses, so this isn't parsed as named expression.
2 |
2 |
3 | x :=
| ^^ Syntax Error: Expected a statement
|


|
1 | # There are no parentheses, so this isn't parsed as named expression.
2 |
2 |
3 | x :=
| Syntax Error: Expected a statement
| ^ Syntax Error: Expected a statement
|
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_1.py
snapshot_kind: text
---
## AST

Expand Down Expand Up @@ -42,7 +41,7 @@ Module(

|
1 | # EOF after the `:=` token
2 |
2 |
3 | (x :=
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|
Loading

0 comments on commit f49cfb6

Please sign in to comment.