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.
This commit is contained in:
Andrew Gallant 2025-01-07 14:16:46 -05:00 committed by Andrew Gallant
parent f29f58105b
commit f49cfb6c28
35 changed files with 161 additions and 193 deletions

View file

@ -1,13 +1,12 @@
---
source: crates/ruff_linter/src/rules/flake8_commas/mod.rs
snapshot_kind: text
---
COM81.py:4:18: COM812 [*] Trailing comma missing
|
2 | bad_function_call(
3 | param1='test',
4 | param2='test'
| COM812
| ^ COM812
5 | )
6 | # ==> bad_list.py <==
|
@ -28,7 +27,7 @@ COM81.py:10:6: COM812 [*] Trailing comma missing
8 | 1,
9 | 2,
10 | 3
| COM812
| ^ COM812
11 | ]
|
= help: Add trailing comma
@ -48,7 +47,7 @@ COM81.py:16:6: COM812 [*] Trailing comma missing
14 | 1,
15 | 2,
16 | 3
| COM812
| ^ COM812
17 | # still needs a comma!
18 | ]
|
@ -69,7 +68,7 @@ COM81.py:23:6: COM812 [*] Trailing comma missing
21 | 1,
22 | 2,
23 | 3
| COM812
| ^ COM812
|
= help: Add trailing comma
@ -155,7 +154,7 @@ COM81.py:70:8: COM812 [*] Trailing comma missing
|
69 | {'foo': foo}['foo'](
70 | bar
| COM812
| ^ COM812
71 | )
|
= help: Add trailing comma
@ -174,7 +173,7 @@ COM81.py:78:8: COM812 [*] Trailing comma missing
|
77 | (foo)(
78 | bar
| COM812
| ^ COM812
79 | )
|
= help: Add trailing comma
@ -193,7 +192,7 @@ COM81.py:86:8: COM812 [*] Trailing comma missing
|
85 | [foo][0](
86 | bar
| COM812
| ^ COM812
87 | )
|
= help: Add trailing comma
@ -213,7 +212,7 @@ COM81.py:152:6: COM812 [*] Trailing comma missing
150 | # ==> keyword_before_parenth_form/base_bad.py <==
151 | from x import (
152 | y
| COM812
| ^ COM812
153 | )
|
= help: Add trailing comma
@ -233,7 +232,7 @@ COM81.py:158:11: COM812 [*] Trailing comma missing
156 | SyntaxWarning,
157 | ThrownHere,
158 | Anyway
| COM812
| ^ COM812
159 | )
|
= help: Add trailing comma
@ -253,7 +252,7 @@ COM81.py:293:15: COM812 [*] Trailing comma missing
291 | # ==> multiline_bad_dict.py <==
292 | multiline_bad_dict = {
293 | "bad": 123
| COM812
| ^ COM812
294 | }
295 | # ==> multiline_bad_function_def.py <==
|
@ -274,7 +273,7 @@ COM81.py:304:14: COM812 [*] Trailing comma missing
302 | def func_bad(
303 | a = 3,
304 | b = 2
| COM812
| ^ COM812
305 | ):
306 | pass
|
@ -295,7 +294,7 @@ COM81.py:310:14: COM812 [*] Trailing comma missing
308 | # ==> multiline_bad_function_one_param.py <==
309 | def func(
310 | a = 3
| COM812
| ^ COM812
311 | ):
312 | pass
|
@ -315,7 +314,7 @@ COM81.py:316:10: COM812 [*] Trailing comma missing
|
315 | func(
316 | a = 3
| COM812
| ^ COM812
317 | )
|
= help: Add trailing comma
@ -335,7 +334,7 @@ COM81.py:322:15: COM812 [*] Trailing comma missing
320 | multiline_bad_or_dict = {
321 | "good": True or False,
322 | "bad": 123
| COM812
| ^ COM812
323 | }
|
= help: Add trailing comma
@ -355,7 +354,7 @@ COM81.py:368:15: COM812 [*] Trailing comma missing
366 | multiline_index_access[
367 | "probably fine",
368 | "not good"
| COM812
| ^ COM812
369 | ]
|
= help: Add trailing comma
@ -375,7 +374,7 @@ COM81.py:375:15: COM812 [*] Trailing comma missing
373 | "fine",
374 | :
375 | "not good"
| COM812
| ^ COM812
376 | ]
|
= help: Add trailing comma
@ -395,7 +394,7 @@ COM81.py:404:15: COM812 [*] Trailing comma missing
402 | "fine"
403 | :
404 | "not fine"
| COM812
| ^ COM812
405 | ]
|
= help: Add trailing comma
@ -415,7 +414,7 @@ COM81.py:432:15: COM812 [*] Trailing comma missing
430 | :
431 | "fine",
432 | "not fine"
| COM812
| ^ COM812
433 | ]
|
= help: Add trailing comma
@ -642,7 +641,7 @@ COM81.py:519:13: COM812 [*] Trailing comma missing
517 | foo,
518 | bar,
519 | **kwargs
| COM812
| ^ COM812
520 | ):
521 | pass
|
@ -663,7 +662,7 @@ COM81.py:526:10: COM812 [*] Trailing comma missing
524 | foo,
525 | bar,
526 | *args
| COM812
| ^ COM812
527 | ):
528 | pass
|
@ -684,7 +683,7 @@ COM81.py:534:16: COM812 [*] Trailing comma missing
532 | bar,
533 | *args,
534 | extra_kwarg
| COM812
| ^ COM812
535 | ):
536 | pass
|
@ -705,7 +704,7 @@ COM81.py:541:13: COM812 [*] Trailing comma missing
539 | foo,
540 | bar,
541 | **kwargs
| COM812
| ^ COM812
542 | )
|
= help: Add trailing comma
@ -725,7 +724,7 @@ COM81.py:547:24: COM812 [*] Trailing comma missing
545 | foo,
546 | bar,
547 | **not_called_kwargs
| COM812
| ^ COM812
548 | )
|
= help: Add trailing comma
@ -745,7 +744,7 @@ COM81.py:554:15: COM812 [*] Trailing comma missing
552 | spam,
553 | *args,
554 | kwarg_only
| COM812
| ^ COM812
555 | ):
556 | pass
|
@ -765,7 +764,7 @@ COM81.py:561:13: COM812 [*] Trailing comma missing
|
560 | foo(
561 | **kwargs
| COM812
| ^ COM812
562 | )
|
= help: Add trailing comma
@ -784,7 +783,7 @@ COM81.py:565:13: COM812 [*] Trailing comma missing
|
564 | {
565 | **kwargs
| COM812
| ^ COM812
566 | }
|
= help: Add trailing comma
@ -803,7 +802,7 @@ COM81.py:569:10: COM812 [*] Trailing comma missing
|
568 | {
569 | *args
| COM812
| ^ COM812
570 | }
|
= help: Add trailing comma
@ -822,7 +821,7 @@ COM81.py:573:10: COM812 [*] Trailing comma missing
|
572 | [
573 | *args
| COM812
| ^ COM812
574 | ]
|
= help: Add trailing comma
@ -842,7 +841,7 @@ COM81.py:579:10: COM812 [*] Trailing comma missing
577 | ham,
578 | spam,
579 | *args
| COM812
| ^ COM812
580 | ):
581 | pass
|
@ -863,7 +862,7 @@ COM81.py:586:13: COM812 [*] Trailing comma missing
584 | ham,
585 | spam,
586 | **kwargs
| COM812
| ^ COM812
587 | ):
588 | pass
|
@ -884,7 +883,7 @@ COM81.py:594:15: COM812 [*] Trailing comma missing
592 | spam,
593 | *args,
594 | kwarg_only
| COM812
| ^ COM812
595 | ):
596 | pass
|
@ -905,7 +904,7 @@ COM81.py:623:20: COM812 [*] Trailing comma missing
621 | foo,
622 | bar,
623 | **{'ham': spam}
| COM812
| ^ COM812
624 | )
|
= help: Add trailing comma
@ -925,7 +924,7 @@ COM81.py:628:42: COM812 [*] Trailing comma missing
626 | # Make sure the COM812 and UP034 rules don't fix simultaneously and cause a syntax error.
627 | the_first_one = next(
628 | (i for i in range(10) if i // 2 == 0) # COM812 fix should include the final bracket
| COM812
| ^ COM812
629 | )
|
= help: Add trailing comma
@ -964,7 +963,7 @@ COM81.py:643:49: COM812 [*] Trailing comma missing
|
642 | raise Exception(
643 | "first", extra=f"Add trailing comma here ->"
| COM812
| ^ COM812
644 | )
|
= help: Add trailing comma

View file

@ -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

View file

@ -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 |
24 | sub = 'sub '
| PLE2512
| ^ PLE2512
25 | sub = f'sub '
|
= help: Replace with escape sequence
@ -26,7 +25,7 @@ invalid_characters.py:25:13: PLE2512 [*] Invalid unescaped character SUB, use "\
|
24 | sub = 'sub '
25 | sub = f'sub '
| PLE2512
| ^ PLE2512
26 |
27 | sub_ok = '\x1a'
|
@ -47,7 +46,7 @@ invalid_characters.py:55:25: PLE2512 [*] Invalid unescaped character SUB, use "\
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ "
54 |
55 | nested_fstrings = f'␈{f'{f'␛'}'}'
| PLE2512
| ^ PLE2512
56 |
57 | # https://github.com/astral-sh/ruff/issues/7455#issuecomment-1741998106
|
@ -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"""
|

View file

@ -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 |
44 | zwsp = 'zerowidth'
| PLE2515
| ^ PLE2515
45 | zwsp = f'zerowidth'
|
= help: Replace with escape sequence
@ -26,7 +25,7 @@ invalid_characters.py:45:14: PLE2515 [*] Invalid unescaped character zero-width-
|
44 | zwsp = 'zerowidth'
45 | zwsp = f'zerowidth'
| PLE2515
| ^ PLE2515
46 |
47 | zwsp_ok = '\u200b'
|
@ -47,7 +46,7 @@ invalid_characters.py:50:36: PLE2515 [*] Invalid unescaped character zero-width-
48 | zwsp_ok = f'\u200b'
49 |
50 | zwsp_after_multibyte_character = "ಫ​"
| PLE2515
| ^ PLE2515
51 | zwsp_after_multibyte_character = f"ಫ​"
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
@ -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"ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
@ -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
@ -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
@ -128,7 +127,7 @@ 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
| ^ PLE2515
54 |
55 | nested_fstrings = f'␈{f'{f'␛'}'}'
|
@ -149,7 +148,7 @@ 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
| ^ PLE2515
54 |
55 | nested_fstrings = f'␈{f'{f'␛'}'}'
|

View file

@ -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 |
9 | def pick_colors(cls, *args): # [no-classmethod-decorator]
| PLR0202
| ^ PLR0202
10 | """classmethod to pick fruit colors"""
11 | cls.COLORS = args
|
@ -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

View file

@ -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 |
15 | def pick_one_color(): # [no-staticmethod-decorator]
| PLR0203
| ^ PLR0203
16 | """staticmethod to pick one fruit color"""
17 | return choice(Fruit.COLORS)
|
@ -32,7 +31,7 @@ no_method_decorator.py:27:5: PLR0203 [*] Static method defined without decorator
25 | class_method = classmethod(class_method);another_statement
26 |
27 | def static_method():
| PLR0203
| ^ PLR0203
28 | pass
|
= help: Add @staticmethod decorator

View file

@ -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
@ -85,5 +84,5 @@ Module(
|
5 | # No member access after the dot.
6 | last.
| Syntax Error: Expected an identifier
| ^ Syntax Error: Expected an identifier
|

View file

@ -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
@ -102,5 +101,5 @@ Module(
|
3 | def foo():
4 | pass
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -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
@ -65,5 +64,5 @@ Module(
1 | {x:
2 |
3 | 1 + 2
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -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
@ -40,5 +39,5 @@ Module(
1 | # Missing closing bracket 0: No elements
2 |
3 | [
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -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
@ -53,5 +52,5 @@ Module(
4 | [
5 |
6 | x + y
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -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
@ -61,5 +60,5 @@ Module(
4 | [1,
5 |
6 | x + y
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -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
@ -40,5 +39,5 @@ Module(
1 | # There are no parentheses, so this isn't parsed as named expression.
2 |
3 | x :=
| Syntax Error: Expected a statement
| ^ Syntax Error: Expected a statement
|

View file

@ -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
@ -44,5 +43,5 @@ Module(
1 | # EOF after the `:=` token
2 |
3 | (x :=
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_2.py
snapshot_kind: text
---
## AST
@ -99,5 +98,5 @@ Module(
|
5 | def foo():
6 | pass
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_3.py
snapshot_kind: text
---
## AST
@ -57,5 +56,5 @@ Module(
4 | (x :=
5 |
6 | x + y
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/generator.py
snapshot_kind: text
---
## AST
@ -141,5 +140,5 @@ Module(
|
1 | (*x for x in y)
2 | (x := 1, for x in y)
| Syntax Error: Expected a statement
| ^ Syntax Error: Expected a statement
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_0.py
snapshot_kind: text
---
## AST
@ -32,5 +31,5 @@ Module(
1 | # Missing closing parentheses 0: No elements
2 |
3 | (
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_1.py
snapshot_kind: text
---
## AST
@ -45,5 +44,5 @@ Module(
4 | (
5 |
6 | x + y
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_2.py
snapshot_kind: text
---
## AST
@ -62,5 +61,5 @@ Module(
4 | (1,
5 |
6 | x + y
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_0.py
snapshot_kind: text
---
## AST
@ -39,5 +38,5 @@ Module(
1 | # Missing closing curly brace 0: No elements
2 |
3 | {
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_1.py
snapshot_kind: text
---
## AST
@ -52,5 +51,5 @@ Module(
4 | {
5 |
6 | x + y
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_2.py
snapshot_kind: text
---
## AST
@ -60,5 +59,5 @@ Module(
4 | {1,
5 |
6 | x + y
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/subscript/unclosed_slice_0.py
snapshot_kind: text
---
## AST
@ -67,5 +66,5 @@ Module(
1 | x[:
2 |
3 | x + y
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/subscript/unclosed_slice_1.py
snapshot_kind: text
---
## AST
@ -109,5 +108,5 @@ Module(
|
3 | def foo():
4 | pass
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/err/f_string_unclosed_lbrace.py
snapshot_kind: text
---
## AST
@ -224,7 +223,7 @@ Module(
|
1 | f"{"
| Syntax Error: f-string: unterminated string
| ^ Syntax Error: f-string: unterminated string
2 | f"{foo!r"
3 | f"{foo="
|
@ -232,7 +231,7 @@ Module(
|
1 | f"{"
| Syntax Error: f-string: unterminated string
| ^ Syntax Error: f-string: unterminated string
2 | f"{foo!r"
3 | f"{foo="
|
@ -250,7 +249,7 @@ Module(
|
1 | f"{"
2 | f"{foo!r"
| Syntax Error: f-string: unterminated string
| ^ Syntax Error: f-string: unterminated string
3 | f"{foo="
4 | f"{"
|
@ -259,7 +258,7 @@ Module(
|
1 | f"{"
2 | f"{foo!r"
| Syntax Error: f-string: unterminated string
| ^ Syntax Error: f-string: unterminated string
3 | f"{foo="
4 | f"{"
|
@ -278,7 +277,7 @@ Module(
|
1 | f"{"
2 | f"{foo!r"
| Syntax Error: Expected FStringEnd, found Unknown
| ^ Syntax Error: Expected FStringEnd, found Unknown
3 | f"{foo="
4 | f"{"
|
@ -298,7 +297,7 @@ Module(
1 | f"{"
2 | f"{foo!r"
3 | f"{foo="
| Syntax Error: f-string: unterminated string
| ^ Syntax Error: f-string: unterminated string
4 | f"{"
5 | f"""{"""
|
@ -308,7 +307,7 @@ Module(
1 | f"{"
2 | f"{foo!r"
3 | f"{foo="
| Syntax Error: f-string: unterminated string
| ^ Syntax Error: f-string: unterminated string
4 | f"{"
5 | f"""{"""
|
@ -342,10 +341,12 @@ Module(
|
4 | f"{"
5 | f"""{"""
| ^ Syntax Error: unexpected EOF while parsing
|
|
4 | f"{"
5 | f"""{"""
| ^ Syntax Error: f-string: unterminated string
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/err/implicitly_concatenated_unterminated_string.py
snapshot_kind: text
---
## AST
@ -174,6 +173,6 @@ Module(
1 | 'hello' 'world
2 | 1 + 1
3 | 'hello' f'world {x}
| Syntax Error: f-string: unterminated string
| ^ Syntax Error: f-string: unterminated string
4 | 2 + 2
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/err/implicitly_concatenated_unterminated_string_multiline.py
snapshot_kind: text
---
## AST
@ -189,7 +188,7 @@ Module(
1 | (
2 | 'hello'
3 | f'world {x}
| Syntax Error: f-string: unterminated string
| ^ Syntax Error: f-string: unterminated string
4 | )
5 | 1 + 1
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/re_lex_logical_token.py
snapshot_kind: text
---
## AST
@ -775,7 +774,7 @@ Module(
|
49 | # F-strings uses normal list parsing, so test those as well
50 | if call(f"hello {x
| Syntax Error: f-string: unterminated string
| ^ Syntax Error: f-string: unterminated string
51 | def bar():
52 | pass
|
@ -793,7 +792,7 @@ Module(
|
49 | # F-strings uses normal list parsing, so test those as well
50 | if call(f"hello {x
| Syntax Error: Expected FStringEnd, found Unknown
| ^ Syntax Error: Expected FStringEnd, found Unknown
51 | def bar():
52 | pass
|
@ -835,5 +834,5 @@ Module(
55 | if call(f"hello
56 | def bar():
57 | pass
| Syntax Error: Expected a statement
| ^ Syntax Error: Expected a statement
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/re_lex_logical_token_mac_eol.py
snapshot_kind: text
---
## AST
@ -101,5 +100,5 @@ Module(
|
1 | if call(foo, [a, b def bar(): pass
| Syntax Error: Expected ']', found NonLogicalNewline
| ^ Syntax Error: Expected ']', found NonLogicalNewline
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/re_lexing/triple_quoted_fstring_1.py
snapshot_kind: text
---
## AST
@ -93,5 +92,5 @@ Module(
|
5 | f"""hello {x # comment
6 | y = 1
| Syntax Error: Expected a statement
| ^ Syntax Error: Expected a statement
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/statements/with/unclosed_ambiguous_lpar.py
snapshot_kind: text
---
## AST
@ -74,5 +73,5 @@ Module(
1 | with (:
2 |
3 | x + y
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/statements/with/unclosed_ambiguous_lpar_eof.py
snapshot_kind: text
---
## AST
@ -38,5 +37,5 @@ Module(
|
1 | with (
| Syntax Error: unexpected EOF while parsing
| ^ Syntax Error: unexpected EOF while parsing
|

View file

@ -1,7 +1,6 @@
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/err/unterminated_fstring_newline_recovery.py
snapshot_kind: text
---
## AST
@ -316,7 +315,7 @@ Module(
1 | f"hello
2 | 1 + 1
3 | f"hello {x
| Syntax Error: f-string: unterminated string
| ^ Syntax Error: f-string: unterminated string
4 | 2 + 2
5 | f"hello {x:
|
@ -336,7 +335,7 @@ Module(
1 | f"hello
2 | 1 + 1
3 | f"hello {x
| Syntax Error: Expected FStringEnd, found Unknown
| ^ Syntax Error: Expected FStringEnd, found Unknown
4 | 2 + 2
5 | f"hello {x:
|
@ -346,7 +345,7 @@ Module(
3 | f"hello {x
4 | 2 + 2
5 | f"hello {x:
| Syntax Error: f-string: unterminated string
| ^ Syntax Error: f-string: unterminated string
6 | 3 + 3
7 | f"hello {x}
|
@ -356,6 +355,6 @@ Module(
5 | f"hello {x:
6 | 3 + 3
7 | f"hello {x}
| Syntax Error: f-string: unterminated string
| ^ Syntax Error: f-string: unterminated string
8 | 4 + 4
|