Skip to content

Commit a97e262

Browse files
committed
test: update snapshots with missing ^
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.
1 parent 95bb118 commit a97e262

File tree

35 files changed

+161
-193
lines changed

35 files changed

+161
-193
lines changed

crates/ruff_linter/src/rules/flake8_commas/snapshots/ruff_linter__rules__flake8_commas__tests__COM81.py.snap

Lines changed: 63 additions & 64 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
22
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
3-
snapshot_kind: text
43
---
54
W292_0.py:2:9: W292 [*] No newline at end of file
65
|
76
1 | def fn() -> None:
87
2 | pass
9-
| W292
8+
| ^ W292
109
|
1110
= help: Add trailing newline
1211

crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2512_invalid_characters.py.snap

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
22
source: crates/ruff_linter/src/rules/pylint/mod.rs
3-
snapshot_kind: text
43
---
54
invalid_characters.py:24:12: PLE2512 [*] Invalid unescaped character SUB, use "\x1A" instead
65
|
76
22 | cr_ok = f'\\r'
8-
23 |
7+
23 |
98
24 | sub = 'sub '
10-
| PLE2512
9+
| ^ PLE2512
1110
25 | sub = f'sub '
1211
|
1312
= help: Replace with escape sequence
@@ -26,8 +25,8 @@ invalid_characters.py:25:13: PLE2512 [*] Invalid unescaped character SUB, use "\
2625
|
2726
24 | sub = 'sub '
2827
25 | sub = f'sub '
29-
| PLE2512
30-
26 |
28+
| ^ PLE2512
29+
26 |
3130
27 | sub_ok = '\x1a'
3231
|
3332
= help: Replace with escape sequence
@@ -45,10 +44,10 @@ invalid_characters.py:25:13: PLE2512 [*] Invalid unescaped character SUB, use "\
4544
invalid_characters.py:55:25: PLE2512 [*] Invalid unescaped character SUB, use "\x1A" instead
4645
|
4746
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
48-
54 |
47+
54 |
4948
55 | nested_fstrings = f'␈{f'{f''}'}'
50-
| PLE2512
51-
56 |
49+
| ^ PLE2512
50+
56 |
5251
57 | # https://github.com/astral-sh/ruff/issues/7455#issuecomment-1741998106
5352
|
5453
= help: Replace with escape sequence
@@ -67,7 +66,7 @@ invalid_characters.py:58:12: PLE2512 [*] Invalid unescaped character SUB, use "\
6766
|
6867
57 | # https://github.com/astral-sh/ruff/issues/7455#issuecomment-1741998106
6968
58 | x = f"""}}ab"""
70-
| PLE2512
69+
| ^ PLE2512
7170
59 | # https://github.com/astral-sh/ruff/issues/7455#issuecomment-1741998256
7271
60 | x = f"""}}a␛b"""
7372
|

crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2515_invalid_characters.py.snap

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
22
source: crates/ruff_linter/src/rules/pylint/mod.rs
3-
snapshot_kind: text
43
---
54
invalid_characters.py:44:13: PLE2515 [*] Invalid unescaped character zero-width-space, use "\u200B" instead
65
|
76
42 | nul_ok = f'\0'
8-
43 |
7+
43 |
98
44 | zwsp = 'zero​width'
10-
| PLE2515
9+
| ^ PLE2515
1110
45 | zwsp = f'zero​width'
1211
|
1312
= help: Replace with escape sequence
@@ -26,8 +25,8 @@ invalid_characters.py:45:14: PLE2515 [*] Invalid unescaped character zero-width-
2625
|
2726
44 | zwsp = 'zero​width'
2827
45 | zwsp = f'zero​width'
29-
| PLE2515
30-
46 |
28+
| ^ PLE2515
29+
46 |
3130
47 | zwsp_ok = '\u200b'
3231
|
3332
= help: Replace with escape sequence
@@ -45,9 +44,9 @@ invalid_characters.py:45:14: PLE2515 [*] Invalid unescaped character zero-width-
4544
invalid_characters.py:50:36: PLE2515 [*] Invalid unescaped character zero-width-space, use "\u200B" instead
4645
|
4746
48 | zwsp_ok = f'\u200b'
48-
49 |
47+
49 |
4948
50 | zwsp_after_multibyte_character = "ಫ​"
50-
| PLE2515
49+
| ^ PLE2515
5150
51 | zwsp_after_multibyte_character = f"ಫ​"
5251
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
5352
|
@@ -67,7 +66,7 @@ invalid_characters.py:51:37: PLE2515 [*] Invalid unescaped character zero-width-
6766
|
6867
50 | zwsp_after_multibyte_character = "ಫ​"
6968
51 | zwsp_after_multibyte_character = f"ಫ​"
70-
| PLE2515
69+
| ^ PLE2515
7170
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
7271
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
7372
|
@@ -88,7 +87,7 @@ invalid_characters.py:52:60: PLE2515 [*] Invalid unescaped character zero-width-
8887
50 | zwsp_after_multibyte_character = "ಫ​"
8988
51 | zwsp_after_multibyte_character = f"ಫ​"
9089
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
91-
| PLE2515
90+
| ^ PLE2515
9291
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
9392
|
9493
= help: Replace with escape sequence
@@ -108,7 +107,7 @@ invalid_characters.py:52:61: PLE2515 [*] Invalid unescaped character zero-width-
108107
50 | zwsp_after_multibyte_character = "ಫ​"
109108
51 | zwsp_after_multibyte_character = f"ಫ​"
110109
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
111-
| PLE2515
110+
| ^ PLE2515
112111
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
113112
|
114113
= help: Replace with escape sequence
@@ -128,8 +127,8 @@ invalid_characters.py:53:61: PLE2515 [*] Invalid unescaped character zero-width-
128127
51 | zwsp_after_multibyte_character = f"ಫ​"
129128
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
130129
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
131-
| PLE2515
132-
54 |
130+
| ^ PLE2515
131+
54 |
133132
55 | nested_fstrings = f'␈{f'{f''}'}'
134133
|
135134
= help: Replace with escape sequence
@@ -149,8 +148,8 @@ invalid_characters.py:53:62: PLE2515 [*] Invalid unescaped character zero-width-
149148
51 | zwsp_after_multibyte_character = f"ಫ​"
150149
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
151150
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​"
152-
| PLE2515
153-
54 |
151+
| ^ PLE2515
152+
54 |
154153
55 | nested_fstrings = f'␈{f'{f''}'}'
155154
|
156155
= help: Replace with escape sequence

crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR0202_no_method_decorator.py.snap

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
22
source: crates/ruff_linter/src/rules/pylint/mod.rs
3-
snapshot_kind: text
43
---
54
no_method_decorator.py:9:5: PLR0202 [*] Class method defined without decorator
65
|
76
7 | self.color = color
8-
8 |
7+
8 |
98
9 | def pick_colors(cls, *args): # [no-classmethod-decorator]
10-
| PLR0202
9+
| ^ PLR0202
1110
10 | """classmethod to pick fruit colors"""
1211
11 | cls.COLORS = args
1312
|
@@ -31,7 +30,7 @@ no_method_decorator.py:22:5: PLR0202 [*] Class method defined without decorator
3130
|
3231
21 | class Class:
3332
22 | def class_method(cls):
34-
| PLR0202
33+
| ^ PLR0202
3534
23 | pass
3635
|
3736
= help: Add @classmethod decorator

crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR0203_no_method_decorator.py.snap

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
22
source: crates/ruff_linter/src/rules/pylint/mod.rs
3-
snapshot_kind: text
43
---
54
no_method_decorator.py:15:5: PLR0203 [*] Static method defined without decorator
65
|
76
13 | pick_colors = classmethod(pick_colors)
8-
14 |
7+
14 |
98
15 | def pick_one_color(): # [no-staticmethod-decorator]
10-
| PLR0203
9+
| ^ PLR0203
1110
16 | """staticmethod to pick one fruit color"""
1211
17 | return choice(Fruit.COLORS)
1312
|
@@ -30,9 +29,9 @@ no_method_decorator.py:15:5: PLR0203 [*] Static method defined without decorator
3029
no_method_decorator.py:27:5: PLR0203 [*] Static method defined without decorator
3130
|
3231
25 | class_method = classmethod(class_method);another_statement
33-
26 |
32+
26 |
3433
27 | def static_method():
35-
| PLR0203
34+
| ^ PLR0203
3635
28 | pass
3736
|
3837
= help: Add @staticmethod decorator

crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__no_member.py.snap

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/ruff_python_parser/tests/fixtures.rs
33
input_file: crates/ruff_python_parser/resources/invalid/expressions/attribute/no_member.py
4-
snapshot_kind: text
54
---
65
## AST
76

@@ -77,13 +76,13 @@ Module(
7776
2 | first.
7877
| ^ Syntax Error: Expected an identifier
7978
3 | second
80-
4 |
79+
4 |
8180
5 | # No member access after the dot.
8281
|
8382

8483

8584
|
8685
5 | # No member access after the dot.
8786
6 | last.
88-
| Syntax Error: Expected an identifier
87+
| ^ Syntax Error: Expected an identifier
8988
|

crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_0.py.snap

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/ruff_python_parser/tests/fixtures.rs
33
input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_0.py
4-
snapshot_kind: text
54
---
65
## AST
76

@@ -76,7 +75,7 @@ Module(
7675

7776
|
7877
1 | {x:
79-
2 |
78+
2 |
8079
3 | def foo():
8180
| ^^^ Syntax Error: Expected an identifier, but found a keyword 'def' that cannot be used here
8281
4 | pass
@@ -85,7 +84,7 @@ Module(
8584

8685
|
8786
1 | {x:
88-
2 |
87+
2 |
8988
3 | def foo():
9089
| ^^^ Syntax Error: Expected ',', found name
9190
4 | pass
@@ -102,5 +101,5 @@ Module(
102101
|
103102
3 | def foo():
104103
4 | pass
105-
| Syntax Error: unexpected EOF while parsing
104+
| ^ Syntax Error: unexpected EOF while parsing
106105
|

crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_1.py.snap

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/ruff_python_parser/tests/fixtures.rs
33
input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_1.py
4-
snapshot_kind: text
54
---
65
## AST
76

@@ -63,7 +62,7 @@ Module(
6362

6463
|
6564
1 | {x:
66-
2 |
65+
2 |
6766
3 | 1 + 2
68-
| Syntax Error: unexpected EOF while parsing
67+
| ^ Syntax Error: unexpected EOF while parsing
6968
|

0 commit comments

Comments
 (0)