mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-17 13:57:25 +00:00
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:
parent
f29f58105b
commit
f49cfb6c28
35 changed files with 161 additions and 193 deletions
|
@ -1,13 +1,12 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_linter/src/rules/flake8_commas/mod.rs
|
source: crates/ruff_linter/src/rules/flake8_commas/mod.rs
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
COM81.py:4:18: COM812 [*] Trailing comma missing
|
COM81.py:4:18: COM812 [*] Trailing comma missing
|
||||||
|
|
|
|
||||||
2 | bad_function_call(
|
2 | bad_function_call(
|
||||||
3 | param1='test',
|
3 | param1='test',
|
||||||
4 | param2='test'
|
4 | param2='test'
|
||||||
| COM812
|
| ^ COM812
|
||||||
5 | )
|
5 | )
|
||||||
6 | # ==> bad_list.py <==
|
6 | # ==> bad_list.py <==
|
||||||
|
|
|
|
||||||
|
@ -28,7 +27,7 @@ COM81.py:10:6: COM812 [*] Trailing comma missing
|
||||||
8 | 1,
|
8 | 1,
|
||||||
9 | 2,
|
9 | 2,
|
||||||
10 | 3
|
10 | 3
|
||||||
| COM812
|
| ^ COM812
|
||||||
11 | ]
|
11 | ]
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -48,7 +47,7 @@ COM81.py:16:6: COM812 [*] Trailing comma missing
|
||||||
14 | 1,
|
14 | 1,
|
||||||
15 | 2,
|
15 | 2,
|
||||||
16 | 3
|
16 | 3
|
||||||
| COM812
|
| ^ COM812
|
||||||
17 | # still needs a comma!
|
17 | # still needs a comma!
|
||||||
18 | ]
|
18 | ]
|
||||||
|
|
|
|
||||||
|
@ -69,7 +68,7 @@ COM81.py:23:6: COM812 [*] Trailing comma missing
|
||||||
21 | 1,
|
21 | 1,
|
||||||
22 | 2,
|
22 | 2,
|
||||||
23 | 3
|
23 | 3
|
||||||
| COM812
|
| ^ COM812
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
|
||||||
|
@ -86,30 +85,30 @@ COM81.py:23:6: COM812 [*] Trailing comma missing
|
||||||
COM81.py:36:8: COM818 Trailing comma on bare tuple prohibited
|
COM81.py:36:8: COM818 Trailing comma on bare tuple prohibited
|
||||||
|
|
|
|
||||||
34 | foo = (1,)
|
34 | foo = (1,)
|
||||||
35 |
|
35 |
|
||||||
36 | foo = 1,
|
36 | foo = 1,
|
||||||
| ^ COM818
|
| ^ COM818
|
||||||
37 |
|
37 |
|
||||||
38 | bar = 1; foo = bar,
|
38 | bar = 1; foo = bar,
|
||||||
|
|
|
|
||||||
|
|
||||||
COM81.py:38:19: COM818 Trailing comma on bare tuple prohibited
|
COM81.py:38:19: COM818 Trailing comma on bare tuple prohibited
|
||||||
|
|
|
|
||||||
36 | foo = 1,
|
36 | foo = 1,
|
||||||
37 |
|
37 |
|
||||||
38 | bar = 1; foo = bar,
|
38 | bar = 1; foo = bar,
|
||||||
| ^ COM818
|
| ^ COM818
|
||||||
39 |
|
39 |
|
||||||
40 | foo = (
|
40 | foo = (
|
||||||
|
|
|
|
||||||
|
|
||||||
COM81.py:45:8: COM818 Trailing comma on bare tuple prohibited
|
COM81.py:45:8: COM818 Trailing comma on bare tuple prohibited
|
||||||
|
|
|
|
||||||
43 | )
|
43 | )
|
||||||
44 |
|
44 |
|
||||||
45 | foo = 3,
|
45 | foo = 3,
|
||||||
| ^ COM818
|
| ^ COM818
|
||||||
46 |
|
46 |
|
||||||
47 | class A(object):
|
47 | class A(object):
|
||||||
|
|
|
|
||||||
|
|
||||||
|
@ -125,20 +124,20 @@ COM81.py:49:10: COM818 Trailing comma on bare tuple prohibited
|
||||||
COM81.py:56:32: COM818 Trailing comma on bare tuple prohibited
|
COM81.py:56:32: COM818 Trailing comma on bare tuple prohibited
|
||||||
|
|
|
|
||||||
54 | from foo import bar, baz
|
54 | from foo import bar, baz
|
||||||
55 |
|
55 |
|
||||||
56 | group_by = function_call('arg'),
|
56 | group_by = function_call('arg'),
|
||||||
| ^ COM818
|
| ^ COM818
|
||||||
57 |
|
57 |
|
||||||
58 | group_by = ('foobar' * 3),
|
58 | group_by = ('foobar' * 3),
|
||||||
|
|
|
|
||||||
|
|
||||||
COM81.py:58:26: COM818 Trailing comma on bare tuple prohibited
|
COM81.py:58:26: COM818 Trailing comma on bare tuple prohibited
|
||||||
|
|
|
|
||||||
56 | group_by = function_call('arg'),
|
56 | group_by = function_call('arg'),
|
||||||
57 |
|
57 |
|
||||||
58 | group_by = ('foobar' * 3),
|
58 | group_by = ('foobar' * 3),
|
||||||
| ^ COM818
|
| ^ COM818
|
||||||
59 |
|
59 |
|
||||||
60 | def foo():
|
60 | def foo():
|
||||||
|
|
|
|
||||||
|
|
||||||
|
@ -147,7 +146,7 @@ COM81.py:61:17: COM818 Trailing comma on bare tuple prohibited
|
||||||
60 | def foo():
|
60 | def foo():
|
||||||
61 | return False,
|
61 | return False,
|
||||||
| ^ COM818
|
| ^ COM818
|
||||||
62 |
|
62 |
|
||||||
63 | # ==> callable_before_parenth_form.py <==
|
63 | # ==> callable_before_parenth_form.py <==
|
||||||
|
|
|
|
||||||
|
|
||||||
|
@ -155,7 +154,7 @@ COM81.py:70:8: COM812 [*] Trailing comma missing
|
||||||
|
|
|
|
||||||
69 | {'foo': foo}['foo'](
|
69 | {'foo': foo}['foo'](
|
||||||
70 | bar
|
70 | bar
|
||||||
| COM812
|
| ^ COM812
|
||||||
71 | )
|
71 | )
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -174,7 +173,7 @@ COM81.py:78:8: COM812 [*] Trailing comma missing
|
||||||
|
|
|
|
||||||
77 | (foo)(
|
77 | (foo)(
|
||||||
78 | bar
|
78 | bar
|
||||||
| COM812
|
| ^ COM812
|
||||||
79 | )
|
79 | )
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -193,7 +192,7 @@ COM81.py:86:8: COM812 [*] Trailing comma missing
|
||||||
|
|
|
|
||||||
85 | [foo][0](
|
85 | [foo][0](
|
||||||
86 | bar
|
86 | bar
|
||||||
| COM812
|
| ^ COM812
|
||||||
87 | )
|
87 | )
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -213,7 +212,7 @@ COM81.py:152:6: COM812 [*] Trailing comma missing
|
||||||
150 | # ==> keyword_before_parenth_form/base_bad.py <==
|
150 | # ==> keyword_before_parenth_form/base_bad.py <==
|
||||||
151 | from x import (
|
151 | from x import (
|
||||||
152 | y
|
152 | y
|
||||||
| COM812
|
| ^ COM812
|
||||||
153 | )
|
153 | )
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -233,7 +232,7 @@ COM81.py:158:11: COM812 [*] Trailing comma missing
|
||||||
156 | SyntaxWarning,
|
156 | SyntaxWarning,
|
||||||
157 | ThrownHere,
|
157 | ThrownHere,
|
||||||
158 | Anyway
|
158 | Anyway
|
||||||
| COM812
|
| ^ COM812
|
||||||
159 | )
|
159 | )
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -253,7 +252,7 @@ COM81.py:293:15: COM812 [*] Trailing comma missing
|
||||||
291 | # ==> multiline_bad_dict.py <==
|
291 | # ==> multiline_bad_dict.py <==
|
||||||
292 | multiline_bad_dict = {
|
292 | multiline_bad_dict = {
|
||||||
293 | "bad": 123
|
293 | "bad": 123
|
||||||
| COM812
|
| ^ COM812
|
||||||
294 | }
|
294 | }
|
||||||
295 | # ==> multiline_bad_function_def.py <==
|
295 | # ==> multiline_bad_function_def.py <==
|
||||||
|
|
|
|
||||||
|
@ -274,7 +273,7 @@ COM81.py:304:14: COM812 [*] Trailing comma missing
|
||||||
302 | def func_bad(
|
302 | def func_bad(
|
||||||
303 | a = 3,
|
303 | a = 3,
|
||||||
304 | b = 2
|
304 | b = 2
|
||||||
| COM812
|
| ^ COM812
|
||||||
305 | ):
|
305 | ):
|
||||||
306 | pass
|
306 | pass
|
||||||
|
|
|
|
||||||
|
@ -295,7 +294,7 @@ COM81.py:310:14: COM812 [*] Trailing comma missing
|
||||||
308 | # ==> multiline_bad_function_one_param.py <==
|
308 | # ==> multiline_bad_function_one_param.py <==
|
||||||
309 | def func(
|
309 | def func(
|
||||||
310 | a = 3
|
310 | a = 3
|
||||||
| COM812
|
| ^ COM812
|
||||||
311 | ):
|
311 | ):
|
||||||
312 | pass
|
312 | pass
|
||||||
|
|
|
|
||||||
|
@ -315,7 +314,7 @@ COM81.py:316:10: COM812 [*] Trailing comma missing
|
||||||
|
|
|
|
||||||
315 | func(
|
315 | func(
|
||||||
316 | a = 3
|
316 | a = 3
|
||||||
| COM812
|
| ^ COM812
|
||||||
317 | )
|
317 | )
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -335,7 +334,7 @@ COM81.py:322:15: COM812 [*] Trailing comma missing
|
||||||
320 | multiline_bad_or_dict = {
|
320 | multiline_bad_or_dict = {
|
||||||
321 | "good": True or False,
|
321 | "good": True or False,
|
||||||
322 | "bad": 123
|
322 | "bad": 123
|
||||||
| COM812
|
| ^ COM812
|
||||||
323 | }
|
323 | }
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -355,7 +354,7 @@ COM81.py:368:15: COM812 [*] Trailing comma missing
|
||||||
366 | multiline_index_access[
|
366 | multiline_index_access[
|
||||||
367 | "probably fine",
|
367 | "probably fine",
|
||||||
368 | "not good"
|
368 | "not good"
|
||||||
| COM812
|
| ^ COM812
|
||||||
369 | ]
|
369 | ]
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -375,7 +374,7 @@ COM81.py:375:15: COM812 [*] Trailing comma missing
|
||||||
373 | "fine",
|
373 | "fine",
|
||||||
374 | :
|
374 | :
|
||||||
375 | "not good"
|
375 | "not good"
|
||||||
| COM812
|
| ^ COM812
|
||||||
376 | ]
|
376 | ]
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -395,7 +394,7 @@ COM81.py:404:15: COM812 [*] Trailing comma missing
|
||||||
402 | "fine"
|
402 | "fine"
|
||||||
403 | :
|
403 | :
|
||||||
404 | "not fine"
|
404 | "not fine"
|
||||||
| COM812
|
| ^ COM812
|
||||||
405 | ]
|
405 | ]
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -415,7 +414,7 @@ COM81.py:432:15: COM812 [*] Trailing comma missing
|
||||||
430 | :
|
430 | :
|
||||||
431 | "fine",
|
431 | "fine",
|
||||||
432 | "not fine"
|
432 | "not fine"
|
||||||
| COM812
|
| ^ COM812
|
||||||
433 | ]
|
433 | ]
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -435,7 +434,7 @@ COM81.py:485:21: COM819 [*] Trailing comma prohibited
|
||||||
484 | # ==> prohibited.py <==
|
484 | # ==> prohibited.py <==
|
||||||
485 | foo = ['a', 'b', 'c',]
|
485 | foo = ['a', 'b', 'c',]
|
||||||
| ^ COM819
|
| ^ COM819
|
||||||
486 |
|
486 |
|
||||||
487 | bar = { a: b,}
|
487 | bar = { a: b,}
|
||||||
|
|
|
|
||||||
= help: Remove trailing comma
|
= help: Remove trailing comma
|
||||||
|
@ -453,10 +452,10 @@ COM81.py:485:21: COM819 [*] Trailing comma prohibited
|
||||||
COM81.py:487:13: COM819 [*] Trailing comma prohibited
|
COM81.py:487:13: COM819 [*] Trailing comma prohibited
|
||||||
|
|
|
|
||||||
485 | foo = ['a', 'b', 'c',]
|
485 | foo = ['a', 'b', 'c',]
|
||||||
486 |
|
486 |
|
||||||
487 | bar = { a: b,}
|
487 | bar = { a: b,}
|
||||||
| ^ COM819
|
| ^ COM819
|
||||||
488 |
|
488 |
|
||||||
489 | def bah(ham, spam,):
|
489 | def bah(ham, spam,):
|
||||||
|
|
|
|
||||||
= help: Remove trailing comma
|
= help: Remove trailing comma
|
||||||
|
@ -474,7 +473,7 @@ COM81.py:487:13: COM819 [*] Trailing comma prohibited
|
||||||
COM81.py:489:18: COM819 [*] Trailing comma prohibited
|
COM81.py:489:18: COM819 [*] Trailing comma prohibited
|
||||||
|
|
|
|
||||||
487 | bar = { a: b,}
|
487 | bar = { a: b,}
|
||||||
488 |
|
488 |
|
||||||
489 | def bah(ham, spam,):
|
489 | def bah(ham, spam,):
|
||||||
| ^ COM819
|
| ^ COM819
|
||||||
490 | pass
|
490 | pass
|
||||||
|
@ -494,10 +493,10 @@ COM81.py:489:18: COM819 [*] Trailing comma prohibited
|
||||||
COM81.py:494:6: COM819 [*] Trailing comma prohibited
|
COM81.py:494:6: COM819 [*] Trailing comma prohibited
|
||||||
|
|
|
|
||||||
492 | (0,)
|
492 | (0,)
|
||||||
493 |
|
493 |
|
||||||
494 | (0, 1,)
|
494 | (0, 1,)
|
||||||
| ^ COM819
|
| ^ COM819
|
||||||
495 |
|
495 |
|
||||||
496 | foo = ['a', 'b', 'c', ]
|
496 | foo = ['a', 'b', 'c', ]
|
||||||
|
|
|
|
||||||
= help: Remove trailing comma
|
= help: Remove trailing comma
|
||||||
|
@ -515,10 +514,10 @@ COM81.py:494:6: COM819 [*] Trailing comma prohibited
|
||||||
COM81.py:496:21: COM819 [*] Trailing comma prohibited
|
COM81.py:496:21: COM819 [*] Trailing comma prohibited
|
||||||
|
|
|
|
||||||
494 | (0, 1,)
|
494 | (0, 1,)
|
||||||
495 |
|
495 |
|
||||||
496 | foo = ['a', 'b', 'c', ]
|
496 | foo = ['a', 'b', 'c', ]
|
||||||
| ^ COM819
|
| ^ COM819
|
||||||
497 |
|
497 |
|
||||||
498 | bar = { a: b, }
|
498 | bar = { a: b, }
|
||||||
|
|
|
|
||||||
= help: Remove trailing comma
|
= help: Remove trailing comma
|
||||||
|
@ -536,10 +535,10 @@ COM81.py:496:21: COM819 [*] Trailing comma prohibited
|
||||||
COM81.py:498:13: COM819 [*] Trailing comma prohibited
|
COM81.py:498:13: COM819 [*] Trailing comma prohibited
|
||||||
|
|
|
|
||||||
496 | foo = ['a', 'b', 'c', ]
|
496 | foo = ['a', 'b', 'c', ]
|
||||||
497 |
|
497 |
|
||||||
498 | bar = { a: b, }
|
498 | bar = { a: b, }
|
||||||
| ^ COM819
|
| ^ COM819
|
||||||
499 |
|
499 |
|
||||||
500 | def bah(ham, spam, ):
|
500 | def bah(ham, spam, ):
|
||||||
|
|
|
|
||||||
= help: Remove trailing comma
|
= help: Remove trailing comma
|
||||||
|
@ -557,7 +556,7 @@ COM81.py:498:13: COM819 [*] Trailing comma prohibited
|
||||||
COM81.py:500:18: COM819 [*] Trailing comma prohibited
|
COM81.py:500:18: COM819 [*] Trailing comma prohibited
|
||||||
|
|
|
|
||||||
498 | bar = { a: b, }
|
498 | bar = { a: b, }
|
||||||
499 |
|
499 |
|
||||||
500 | def bah(ham, spam, ):
|
500 | def bah(ham, spam, ):
|
||||||
| ^ COM819
|
| ^ COM819
|
||||||
501 | pass
|
501 | pass
|
||||||
|
@ -577,10 +576,10 @@ COM81.py:500:18: COM819 [*] Trailing comma prohibited
|
||||||
COM81.py:505:6: COM819 [*] Trailing comma prohibited
|
COM81.py:505:6: COM819 [*] Trailing comma prohibited
|
||||||
|
|
|
|
||||||
503 | (0, )
|
503 | (0, )
|
||||||
504 |
|
504 |
|
||||||
505 | (0, 1, )
|
505 | (0, 1, )
|
||||||
| ^ COM819
|
| ^ COM819
|
||||||
506 |
|
506 |
|
||||||
507 | image[:, :, 0]
|
507 | image[:, :, 0]
|
||||||
|
|
|
|
||||||
= help: Remove trailing comma
|
= help: Remove trailing comma
|
||||||
|
@ -598,10 +597,10 @@ COM81.py:505:6: COM819 [*] Trailing comma prohibited
|
||||||
COM81.py:511:10: COM819 [*] Trailing comma prohibited
|
COM81.py:511:10: COM819 [*] Trailing comma prohibited
|
||||||
|
|
|
|
||||||
509 | image[:,]
|
509 | image[:,]
|
||||||
510 |
|
510 |
|
||||||
511 | image[:,:,]
|
511 | image[:,:,]
|
||||||
| ^ COM819
|
| ^ COM819
|
||||||
512 |
|
512 |
|
||||||
513 | lambda x, : x
|
513 | lambda x, : x
|
||||||
|
|
|
|
||||||
= help: Remove trailing comma
|
= help: Remove trailing comma
|
||||||
|
@ -619,10 +618,10 @@ COM81.py:511:10: COM819 [*] Trailing comma prohibited
|
||||||
COM81.py:513:9: COM819 [*] Trailing comma prohibited
|
COM81.py:513:9: COM819 [*] Trailing comma prohibited
|
||||||
|
|
|
|
||||||
511 | image[:,:,]
|
511 | image[:,:,]
|
||||||
512 |
|
512 |
|
||||||
513 | lambda x, : x
|
513 | lambda x, : x
|
||||||
| ^ COM819
|
| ^ COM819
|
||||||
514 |
|
514 |
|
||||||
515 | # ==> unpack.py <==
|
515 | # ==> unpack.py <==
|
||||||
|
|
|
|
||||||
= help: Remove trailing comma
|
= help: Remove trailing comma
|
||||||
|
@ -642,7 +641,7 @@ COM81.py:519:13: COM812 [*] Trailing comma missing
|
||||||
517 | foo,
|
517 | foo,
|
||||||
518 | bar,
|
518 | bar,
|
||||||
519 | **kwargs
|
519 | **kwargs
|
||||||
| COM812
|
| ^ COM812
|
||||||
520 | ):
|
520 | ):
|
||||||
521 | pass
|
521 | pass
|
||||||
|
|
|
|
||||||
|
@ -663,7 +662,7 @@ COM81.py:526:10: COM812 [*] Trailing comma missing
|
||||||
524 | foo,
|
524 | foo,
|
||||||
525 | bar,
|
525 | bar,
|
||||||
526 | *args
|
526 | *args
|
||||||
| COM812
|
| ^ COM812
|
||||||
527 | ):
|
527 | ):
|
||||||
528 | pass
|
528 | pass
|
||||||
|
|
|
|
||||||
|
@ -684,7 +683,7 @@ COM81.py:534:16: COM812 [*] Trailing comma missing
|
||||||
532 | bar,
|
532 | bar,
|
||||||
533 | *args,
|
533 | *args,
|
||||||
534 | extra_kwarg
|
534 | extra_kwarg
|
||||||
| COM812
|
| ^ COM812
|
||||||
535 | ):
|
535 | ):
|
||||||
536 | pass
|
536 | pass
|
||||||
|
|
|
|
||||||
|
@ -705,7 +704,7 @@ COM81.py:541:13: COM812 [*] Trailing comma missing
|
||||||
539 | foo,
|
539 | foo,
|
||||||
540 | bar,
|
540 | bar,
|
||||||
541 | **kwargs
|
541 | **kwargs
|
||||||
| COM812
|
| ^ COM812
|
||||||
542 | )
|
542 | )
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -725,7 +724,7 @@ COM81.py:547:24: COM812 [*] Trailing comma missing
|
||||||
545 | foo,
|
545 | foo,
|
||||||
546 | bar,
|
546 | bar,
|
||||||
547 | **not_called_kwargs
|
547 | **not_called_kwargs
|
||||||
| COM812
|
| ^ COM812
|
||||||
548 | )
|
548 | )
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -745,7 +744,7 @@ COM81.py:554:15: COM812 [*] Trailing comma missing
|
||||||
552 | spam,
|
552 | spam,
|
||||||
553 | *args,
|
553 | *args,
|
||||||
554 | kwarg_only
|
554 | kwarg_only
|
||||||
| COM812
|
| ^ COM812
|
||||||
555 | ):
|
555 | ):
|
||||||
556 | pass
|
556 | pass
|
||||||
|
|
|
|
||||||
|
@ -765,7 +764,7 @@ COM81.py:561:13: COM812 [*] Trailing comma missing
|
||||||
|
|
|
|
||||||
560 | foo(
|
560 | foo(
|
||||||
561 | **kwargs
|
561 | **kwargs
|
||||||
| COM812
|
| ^ COM812
|
||||||
562 | )
|
562 | )
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -784,7 +783,7 @@ COM81.py:565:13: COM812 [*] Trailing comma missing
|
||||||
|
|
|
|
||||||
564 | {
|
564 | {
|
||||||
565 | **kwargs
|
565 | **kwargs
|
||||||
| COM812
|
| ^ COM812
|
||||||
566 | }
|
566 | }
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -803,7 +802,7 @@ COM81.py:569:10: COM812 [*] Trailing comma missing
|
||||||
|
|
|
|
||||||
568 | {
|
568 | {
|
||||||
569 | *args
|
569 | *args
|
||||||
| COM812
|
| ^ COM812
|
||||||
570 | }
|
570 | }
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -822,7 +821,7 @@ COM81.py:573:10: COM812 [*] Trailing comma missing
|
||||||
|
|
|
|
||||||
572 | [
|
572 | [
|
||||||
573 | *args
|
573 | *args
|
||||||
| COM812
|
| ^ COM812
|
||||||
574 | ]
|
574 | ]
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -842,7 +841,7 @@ COM81.py:579:10: COM812 [*] Trailing comma missing
|
||||||
577 | ham,
|
577 | ham,
|
||||||
578 | spam,
|
578 | spam,
|
||||||
579 | *args
|
579 | *args
|
||||||
| COM812
|
| ^ COM812
|
||||||
580 | ):
|
580 | ):
|
||||||
581 | pass
|
581 | pass
|
||||||
|
|
|
|
||||||
|
@ -863,7 +862,7 @@ COM81.py:586:13: COM812 [*] Trailing comma missing
|
||||||
584 | ham,
|
584 | ham,
|
||||||
585 | spam,
|
585 | spam,
|
||||||
586 | **kwargs
|
586 | **kwargs
|
||||||
| COM812
|
| ^ COM812
|
||||||
587 | ):
|
587 | ):
|
||||||
588 | pass
|
588 | pass
|
||||||
|
|
|
|
||||||
|
@ -884,7 +883,7 @@ COM81.py:594:15: COM812 [*] Trailing comma missing
|
||||||
592 | spam,
|
592 | spam,
|
||||||
593 | *args,
|
593 | *args,
|
||||||
594 | kwarg_only
|
594 | kwarg_only
|
||||||
| COM812
|
| ^ COM812
|
||||||
595 | ):
|
595 | ):
|
||||||
596 | pass
|
596 | pass
|
||||||
|
|
|
|
||||||
|
@ -905,7 +904,7 @@ COM81.py:623:20: COM812 [*] Trailing comma missing
|
||||||
621 | foo,
|
621 | foo,
|
||||||
622 | bar,
|
622 | bar,
|
||||||
623 | **{'ham': spam}
|
623 | **{'ham': spam}
|
||||||
| COM812
|
| ^ COM812
|
||||||
624 | )
|
624 | )
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= 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.
|
626 | # Make sure the COM812 and UP034 rules don't fix simultaneously and cause a syntax error.
|
||||||
627 | the_first_one = next(
|
627 | the_first_one = next(
|
||||||
628 | (i for i in range(10) if i // 2 == 0) # COM812 fix should include the final bracket
|
628 | (i for i in range(10) if i // 2 == 0) # COM812 fix should include the final bracket
|
||||||
| COM812
|
| ^ COM812
|
||||||
629 | )
|
629 | )
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
@ -945,7 +944,7 @@ COM81.py:640:46: COM819 [*] Trailing comma prohibited
|
||||||
639 | # F-strings
|
639 | # F-strings
|
||||||
640 | kwargs.pop("remove", f"this {trailing_comma}",)
|
640 | kwargs.pop("remove", f"this {trailing_comma}",)
|
||||||
| ^ COM819
|
| ^ COM819
|
||||||
641 |
|
641 |
|
||||||
642 | raise Exception(
|
642 | raise Exception(
|
||||||
|
|
|
|
||||||
= help: Remove trailing comma
|
= help: Remove trailing comma
|
||||||
|
@ -964,7 +963,7 @@ COM81.py:643:49: COM812 [*] Trailing comma missing
|
||||||
|
|
|
|
||||||
642 | raise Exception(
|
642 | raise Exception(
|
||||||
643 | "first", extra=f"Add trailing comma here ->"
|
643 | "first", extra=f"Add trailing comma here ->"
|
||||||
| COM812
|
| ^ COM812
|
||||||
644 | )
|
644 | )
|
||||||
|
|
|
|
||||||
= help: Add trailing comma
|
= help: Add trailing comma
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
|
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
W292_0.py:2:9: W292 [*] No newline at end of file
|
W292_0.py:2:9: W292 [*] No newline at end of file
|
||||||
|
|
|
|
||||||
1 | def fn() -> None:
|
1 | def fn() -> None:
|
||||||
2 | pass
|
2 | pass
|
||||||
| W292
|
| ^ W292
|
||||||
|
|
|
|
||||||
= help: Add trailing newline
|
= help: Add trailing newline
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_linter/src/rules/pylint/mod.rs
|
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
|
invalid_characters.py:24:12: PLE2512 [*] Invalid unescaped character SUB, use "\x1A" instead
|
||||||
|
|
|
|
||||||
22 | cr_ok = f'\\r'
|
22 | cr_ok = f'\\r'
|
||||||
23 |
|
23 |
|
||||||
24 | sub = 'sub '
|
24 | sub = 'sub '
|
||||||
| PLE2512
|
| ^ PLE2512
|
||||||
25 | sub = f'sub '
|
25 | sub = f'sub '
|
||||||
|
|
|
|
||||||
= help: Replace with escape sequence
|
= help: Replace with escape sequence
|
||||||
|
@ -26,8 +25,8 @@ invalid_characters.py:25:13: PLE2512 [*] Invalid unescaped character SUB, use "\
|
||||||
|
|
|
|
||||||
24 | sub = 'sub '
|
24 | sub = 'sub '
|
||||||
25 | sub = f'sub '
|
25 | sub = f'sub '
|
||||||
| PLE2512
|
| ^ PLE2512
|
||||||
26 |
|
26 |
|
||||||
27 | sub_ok = '\x1a'
|
27 | sub_ok = '\x1a'
|
||||||
|
|
|
|
||||||
= help: Replace with escape sequence
|
= help: Replace with escape sequence
|
||||||
|
@ -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
|
invalid_characters.py:55:25: PLE2512 [*] Invalid unescaped character SUB, use "\x1A" instead
|
||||||
|
|
|
|
||||||
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
||||||
54 |
|
54 |
|
||||||
55 | nested_fstrings = f'␈{f'{f'␛'}'}'
|
55 | nested_fstrings = f'␈{f'{f'␛'}'}'
|
||||||
| PLE2512
|
| ^ PLE2512
|
||||||
56 |
|
56 |
|
||||||
57 | # https://github.com/astral-sh/ruff/issues/7455#issuecomment-1741998106
|
57 | # https://github.com/astral-sh/ruff/issues/7455#issuecomment-1741998106
|
||||||
|
|
|
|
||||||
= help: Replace with escape sequence
|
= help: Replace with escape sequence
|
||||||
|
@ -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
|
57 | # https://github.com/astral-sh/ruff/issues/7455#issuecomment-1741998106
|
||||||
58 | x = f"""}}ab"""
|
58 | x = f"""}}ab"""
|
||||||
| PLE2512
|
| ^ PLE2512
|
||||||
59 | # https://github.com/astral-sh/ruff/issues/7455#issuecomment-1741998256
|
59 | # https://github.com/astral-sh/ruff/issues/7455#issuecomment-1741998256
|
||||||
60 | x = f"""}}a␛b"""
|
60 | x = f"""}}a␛b"""
|
||||||
|
|
|
|
||||||
|
|
Binary file not shown.
|
@ -1,13 +1,12 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_linter/src/rules/pylint/mod.rs
|
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
|
invalid_characters.py:44:13: PLE2515 [*] Invalid unescaped character zero-width-space, use "\u200B" instead
|
||||||
|
|
|
|
||||||
42 | nul_ok = f'\0'
|
42 | nul_ok = f'\0'
|
||||||
43 |
|
43 |
|
||||||
44 | zwsp = 'zerowidth'
|
44 | zwsp = 'zerowidth'
|
||||||
| PLE2515
|
| ^ PLE2515
|
||||||
45 | zwsp = f'zerowidth'
|
45 | zwsp = f'zerowidth'
|
||||||
|
|
|
|
||||||
= help: Replace with escape sequence
|
= help: Replace with escape sequence
|
||||||
|
@ -26,8 +25,8 @@ invalid_characters.py:45:14: PLE2515 [*] Invalid unescaped character zero-width-
|
||||||
|
|
|
|
||||||
44 | zwsp = 'zerowidth'
|
44 | zwsp = 'zerowidth'
|
||||||
45 | zwsp = f'zerowidth'
|
45 | zwsp = f'zerowidth'
|
||||||
| PLE2515
|
| ^ PLE2515
|
||||||
46 |
|
46 |
|
||||||
47 | zwsp_ok = '\u200b'
|
47 | zwsp_ok = '\u200b'
|
||||||
|
|
|
|
||||||
= help: Replace with escape sequence
|
= help: Replace with escape sequence
|
||||||
|
@ -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
|
invalid_characters.py:50:36: PLE2515 [*] Invalid unescaped character zero-width-space, use "\u200B" instead
|
||||||
|
|
|
|
||||||
48 | zwsp_ok = f'\u200b'
|
48 | zwsp_ok = f'\u200b'
|
||||||
49 |
|
49 |
|
||||||
50 | zwsp_after_multibyte_character = "ಫ"
|
50 | zwsp_after_multibyte_character = "ಫ"
|
||||||
| PLE2515
|
| ^ PLE2515
|
||||||
51 | zwsp_after_multibyte_character = f"ಫ"
|
51 | zwsp_after_multibyte_character = f"ಫ"
|
||||||
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
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 = "ಫ"
|
50 | zwsp_after_multibyte_character = "ಫ"
|
||||||
51 | zwsp_after_multibyte_character = f"ಫ"
|
51 | zwsp_after_multibyte_character = f"ಫ"
|
||||||
| PLE2515
|
| ^ PLE2515
|
||||||
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
||||||
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
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 = "ಫ"
|
50 | zwsp_after_multibyte_character = "ಫ"
|
||||||
51 | zwsp_after_multibyte_character = f"ಫ"
|
51 | zwsp_after_multibyte_character = f"ಫ"
|
||||||
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
||||||
| PLE2515
|
| ^ PLE2515
|
||||||
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
||||||
|
|
|
|
||||||
= help: Replace with escape sequence
|
= 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 = "ಫ"
|
50 | zwsp_after_multibyte_character = "ಫ"
|
||||||
51 | zwsp_after_multibyte_character = f"ಫ"
|
51 | zwsp_after_multibyte_character = f"ಫ"
|
||||||
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
||||||
| PLE2515
|
| ^ PLE2515
|
||||||
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
||||||
|
|
|
|
||||||
= help: Replace with escape sequence
|
= help: Replace with escape sequence
|
||||||
|
@ -128,8 +127,8 @@ invalid_characters.py:53:61: PLE2515 [*] Invalid unescaped character zero-width-
|
||||||
51 | zwsp_after_multibyte_character = f"ಫ"
|
51 | zwsp_after_multibyte_character = f"ಫ"
|
||||||
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
||||||
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
||||||
| PLE2515
|
| ^ PLE2515
|
||||||
54 |
|
54 |
|
||||||
55 | nested_fstrings = f'␈{f'{f'␛'}'}'
|
55 | nested_fstrings = f'␈{f'{f'␛'}'}'
|
||||||
|
|
|
|
||||||
= help: Replace with escape sequence
|
= help: Replace with escape sequence
|
||||||
|
@ -149,8 +148,8 @@ invalid_characters.py:53:62: PLE2515 [*] Invalid unescaped character zero-width-
|
||||||
51 | zwsp_after_multibyte_character = f"ಫ"
|
51 | zwsp_after_multibyte_character = f"ಫ"
|
||||||
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
52 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
||||||
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
53 | zwsp_after_multicharacter_grapheme_cluster = f"ಫ್ರಾನ್ಸಿಸ್ಕೊ "
|
||||||
| PLE2515
|
| ^ PLE2515
|
||||||
54 |
|
54 |
|
||||||
55 | nested_fstrings = f'␈{f'{f'␛'}'}'
|
55 | nested_fstrings = f'␈{f'{f'␛'}'}'
|
||||||
|
|
|
|
||||||
= help: Replace with escape sequence
|
= help: Replace with escape sequence
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_linter/src/rules/pylint/mod.rs
|
source: crates/ruff_linter/src/rules/pylint/mod.rs
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
no_method_decorator.py:9:5: PLR0202 [*] Class method defined without decorator
|
no_method_decorator.py:9:5: PLR0202 [*] Class method defined without decorator
|
||||||
|
|
|
|
||||||
7 | self.color = color
|
7 | self.color = color
|
||||||
8 |
|
8 |
|
||||||
9 | def pick_colors(cls, *args): # [no-classmethod-decorator]
|
9 | def pick_colors(cls, *args): # [no-classmethod-decorator]
|
||||||
| PLR0202
|
| ^ PLR0202
|
||||||
10 | """classmethod to pick fruit colors"""
|
10 | """classmethod to pick fruit colors"""
|
||||||
11 | cls.COLORS = args
|
11 | cls.COLORS = args
|
||||||
|
|
|
|
||||||
|
@ -31,7 +30,7 @@ no_method_decorator.py:22:5: PLR0202 [*] Class method defined without decorator
|
||||||
|
|
|
|
||||||
21 | class Class:
|
21 | class Class:
|
||||||
22 | def class_method(cls):
|
22 | def class_method(cls):
|
||||||
| PLR0202
|
| ^ PLR0202
|
||||||
23 | pass
|
23 | pass
|
||||||
|
|
|
|
||||||
= help: Add @classmethod decorator
|
= help: Add @classmethod decorator
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_linter/src/rules/pylint/mod.rs
|
source: crates/ruff_linter/src/rules/pylint/mod.rs
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
no_method_decorator.py:15:5: PLR0203 [*] Static method defined without decorator
|
no_method_decorator.py:15:5: PLR0203 [*] Static method defined without decorator
|
||||||
|
|
|
|
||||||
13 | pick_colors = classmethod(pick_colors)
|
13 | pick_colors = classmethod(pick_colors)
|
||||||
14 |
|
14 |
|
||||||
15 | def pick_one_color(): # [no-staticmethod-decorator]
|
15 | def pick_one_color(): # [no-staticmethod-decorator]
|
||||||
| PLR0203
|
| ^ PLR0203
|
||||||
16 | """staticmethod to pick one fruit color"""
|
16 | """staticmethod to pick one fruit color"""
|
||||||
17 | return choice(Fruit.COLORS)
|
17 | return choice(Fruit.COLORS)
|
||||||
|
|
|
|
||||||
|
@ -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
|
no_method_decorator.py:27:5: PLR0203 [*] Static method defined without decorator
|
||||||
|
|
|
|
||||||
25 | class_method = classmethod(class_method);another_statement
|
25 | class_method = classmethod(class_method);another_statement
|
||||||
26 |
|
26 |
|
||||||
27 | def static_method():
|
27 | def static_method():
|
||||||
| PLR0203
|
| ^ PLR0203
|
||||||
28 | pass
|
28 | pass
|
||||||
|
|
|
|
||||||
= help: Add @staticmethod decorator
|
= help: Add @staticmethod decorator
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/attribute/no_member.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/attribute/no_member.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -77,7 +76,7 @@ Module(
|
||||||
2 | first.
|
2 | first.
|
||||||
| ^ Syntax Error: Expected an identifier
|
| ^ Syntax Error: Expected an identifier
|
||||||
3 | second
|
3 | second
|
||||||
4 |
|
4 |
|
||||||
5 | # No member access after the dot.
|
5 | # No member access after the dot.
|
||||||
|
|
|
|
||||||
|
|
||||||
|
@ -85,5 +84,5 @@ Module(
|
||||||
|
|
|
|
||||||
5 | # No member access after the dot.
|
5 | # No member access after the dot.
|
||||||
6 | last.
|
6 | last.
|
||||||
| Syntax Error: Expected an identifier
|
| ^ Syntax Error: Expected an identifier
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_0.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_0.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -76,7 +75,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | {x:
|
1 | {x:
|
||||||
2 |
|
2 |
|
||||||
3 | def foo():
|
3 | def foo():
|
||||||
| ^^^ Syntax Error: Expected an identifier, but found a keyword 'def' that cannot be used here
|
| ^^^ Syntax Error: Expected an identifier, but found a keyword 'def' that cannot be used here
|
||||||
4 | pass
|
4 | pass
|
||||||
|
@ -85,7 +84,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | {x:
|
1 | {x:
|
||||||
2 |
|
2 |
|
||||||
3 | def foo():
|
3 | def foo():
|
||||||
| ^^^ Syntax Error: Expected ',', found name
|
| ^^^ Syntax Error: Expected ',', found name
|
||||||
4 | pass
|
4 | pass
|
||||||
|
@ -102,5 +101,5 @@ Module(
|
||||||
|
|
|
|
||||||
3 | def foo():
|
3 | def foo():
|
||||||
4 | pass
|
4 | pass
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_1.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/dict/missing_closing_brace_1.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -63,7 +62,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | {x:
|
1 | {x:
|
||||||
2 |
|
2 |
|
||||||
3 | 1 + 2
|
3 | 1 + 2
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_0.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_0.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -38,7 +37,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | # Missing closing bracket 0: No elements
|
1 | # Missing closing bracket 0: No elements
|
||||||
2 |
|
2 |
|
||||||
3 | [
|
3 | [
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_1.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_1.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -51,7 +50,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
4 | [
|
4 | [
|
||||||
5 |
|
5 |
|
||||||
6 | x + y
|
6 | x + y
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_2.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/list/missing_closing_bracket_2.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -59,7 +58,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
4 | [1,
|
4 | [1,
|
||||||
5 |
|
5 |
|
||||||
6 | x + y
|
6 | x + y
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_0.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_0.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | # There are no parentheses, so this isn't parsed as named expression.
|
1 | # There are no parentheses, so this isn't parsed as named expression.
|
||||||
2 |
|
2 |
|
||||||
3 | x :=
|
3 | x :=
|
||||||
| ^^ Syntax Error: Expected a statement
|
| ^^ Syntax Error: Expected a statement
|
||||||
|
|
|
|
||||||
|
@ -38,7 +37,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | # There are no parentheses, so this isn't parsed as named expression.
|
1 | # There are no parentheses, so this isn't parsed as named expression.
|
||||||
2 |
|
2 |
|
||||||
3 | x :=
|
3 | x :=
|
||||||
| Syntax Error: Expected a statement
|
| ^ Syntax Error: Expected a statement
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_1.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_1.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -42,7 +41,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | # EOF after the `:=` token
|
1 | # EOF after the `:=` token
|
||||||
2 |
|
2 |
|
||||||
3 | (x :=
|
3 | (x :=
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_2.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_2.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -73,7 +72,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
3 | (x :=
|
3 | (x :=
|
||||||
4 |
|
4 |
|
||||||
5 | def foo():
|
5 | def foo():
|
||||||
| ^^^ Syntax Error: Expected an identifier, but found a keyword 'def' that cannot be used here
|
| ^^^ Syntax Error: Expected an identifier, but found a keyword 'def' that cannot be used here
|
||||||
6 | pass
|
6 | pass
|
||||||
|
@ -82,7 +81,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
3 | (x :=
|
3 | (x :=
|
||||||
4 |
|
4 |
|
||||||
5 | def foo():
|
5 | def foo():
|
||||||
| ^^^ Syntax Error: Expected ')', found name
|
| ^^^ Syntax Error: Expected ')', found name
|
||||||
6 | pass
|
6 | pass
|
||||||
|
@ -99,5 +98,5 @@ Module(
|
||||||
|
|
|
|
||||||
5 | def foo():
|
5 | def foo():
|
||||||
6 | pass
|
6 | pass
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_3.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/named/missing_expression_3.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -55,7 +54,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
4 | (x :=
|
4 | (x :=
|
||||||
5 |
|
5 |
|
||||||
6 | x + y
|
6 | x + y
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/generator.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/generator.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -141,5 +140,5 @@ Module(
|
||||||
|
|
|
|
||||||
1 | (*x for x in y)
|
1 | (*x for x in y)
|
||||||
2 | (x := 1, for x in y)
|
2 | (x := 1, for x in y)
|
||||||
| Syntax Error: Expected a statement
|
| ^ Syntax Error: Expected a statement
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_0.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_0.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | # Missing closing parentheses 0: No elements
|
1 | # Missing closing parentheses 0: No elements
|
||||||
2 |
|
2 |
|
||||||
3 | (
|
3 | (
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_1.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_1.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -43,7 +42,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
4 | (
|
4 | (
|
||||||
5 |
|
5 |
|
||||||
6 | x + y
|
6 | x + y
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_2.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/missing_closing_paren_2.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -60,7 +59,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
4 | (1,
|
4 | (1,
|
||||||
5 |
|
5 |
|
||||||
6 | x + y
|
6 | x + y
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_0.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_0.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -37,7 +36,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | # Missing closing curly brace 0: No elements
|
1 | # Missing closing curly brace 0: No elements
|
||||||
2 |
|
2 |
|
||||||
3 | {
|
3 | {
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_1.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_1.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -50,7 +49,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
4 | {
|
4 | {
|
||||||
5 |
|
5 |
|
||||||
6 | x + y
|
6 | x + y
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_2.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/set/missing_closing_curly_brace_2.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -58,7 +57,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
4 | {1,
|
4 | {1,
|
||||||
5 |
|
5 |
|
||||||
6 | x + y
|
6 | x + y
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/subscript/unclosed_slice_0.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/subscript/unclosed_slice_0.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -65,7 +64,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | x[:
|
1 | x[:
|
||||||
2 |
|
2 |
|
||||||
3 | x + y
|
3 | x + y
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/expressions/subscript/unclosed_slice_1.py
|
input_file: crates/ruff_python_parser/resources/invalid/expressions/subscript/unclosed_slice_1.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -83,7 +82,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | x[::
|
1 | x[::
|
||||||
2 |
|
2 |
|
||||||
3 | def foo():
|
3 | def foo():
|
||||||
| ^^^ Syntax Error: Expected an identifier, but found a keyword 'def' that cannot be used here
|
| ^^^ Syntax Error: Expected an identifier, but found a keyword 'def' that cannot be used here
|
||||||
4 | pass
|
4 | pass
|
||||||
|
@ -92,7 +91,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | x[::
|
1 | x[::
|
||||||
2 |
|
2 |
|
||||||
3 | def foo():
|
3 | def foo():
|
||||||
| ^^^ Syntax Error: Expected ']', found name
|
| ^^^ Syntax Error: Expected ']', found name
|
||||||
4 | pass
|
4 | pass
|
||||||
|
@ -109,5 +108,5 @@ Module(
|
||||||
|
|
|
|
||||||
3 | def foo():
|
3 | def foo():
|
||||||
4 | pass
|
4 | pass
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/inline/err/f_string_unclosed_lbrace.py
|
input_file: crates/ruff_python_parser/resources/inline/err/f_string_unclosed_lbrace.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -224,7 +223,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | f"{"
|
1 | f"{"
|
||||||
| Syntax Error: f-string: unterminated string
|
| ^ Syntax Error: f-string: unterminated string
|
||||||
2 | f"{foo!r"
|
2 | f"{foo!r"
|
||||||
3 | f"{foo="
|
3 | f"{foo="
|
||||||
|
|
|
|
||||||
|
@ -232,7 +231,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | f"{"
|
1 | f"{"
|
||||||
| Syntax Error: f-string: unterminated string
|
| ^ Syntax Error: f-string: unterminated string
|
||||||
2 | f"{foo!r"
|
2 | f"{foo!r"
|
||||||
3 | f"{foo="
|
3 | f"{foo="
|
||||||
|
|
|
|
||||||
|
@ -250,7 +249,7 @@ Module(
|
||||||
|
|
|
|
||||||
1 | f"{"
|
1 | f"{"
|
||||||
2 | f"{foo!r"
|
2 | f"{foo!r"
|
||||||
| Syntax Error: f-string: unterminated string
|
| ^ Syntax Error: f-string: unterminated string
|
||||||
3 | f"{foo="
|
3 | f"{foo="
|
||||||
4 | f"{"
|
4 | f"{"
|
||||||
|
|
|
|
||||||
|
@ -259,7 +258,7 @@ Module(
|
||||||
|
|
|
|
||||||
1 | f"{"
|
1 | f"{"
|
||||||
2 | f"{foo!r"
|
2 | f"{foo!r"
|
||||||
| Syntax Error: f-string: unterminated string
|
| ^ Syntax Error: f-string: unterminated string
|
||||||
3 | f"{foo="
|
3 | f"{foo="
|
||||||
4 | f"{"
|
4 | f"{"
|
||||||
|
|
|
|
||||||
|
@ -278,7 +277,7 @@ Module(
|
||||||
|
|
|
|
||||||
1 | f"{"
|
1 | f"{"
|
||||||
2 | f"{foo!r"
|
2 | f"{foo!r"
|
||||||
| Syntax Error: Expected FStringEnd, found Unknown
|
| ^ Syntax Error: Expected FStringEnd, found Unknown
|
||||||
3 | f"{foo="
|
3 | f"{foo="
|
||||||
4 | f"{"
|
4 | f"{"
|
||||||
|
|
|
|
||||||
|
@ -298,7 +297,7 @@ Module(
|
||||||
1 | f"{"
|
1 | f"{"
|
||||||
2 | f"{foo!r"
|
2 | f"{foo!r"
|
||||||
3 | f"{foo="
|
3 | f"{foo="
|
||||||
| Syntax Error: f-string: unterminated string
|
| ^ Syntax Error: f-string: unterminated string
|
||||||
4 | f"{"
|
4 | f"{"
|
||||||
5 | f"""{"""
|
5 | f"""{"""
|
||||||
|
|
|
|
||||||
|
@ -308,7 +307,7 @@ Module(
|
||||||
1 | f"{"
|
1 | f"{"
|
||||||
2 | f"{foo!r"
|
2 | f"{foo!r"
|
||||||
3 | f"{foo="
|
3 | f"{foo="
|
||||||
| Syntax Error: f-string: unterminated string
|
| ^ Syntax Error: f-string: unterminated string
|
||||||
4 | f"{"
|
4 | f"{"
|
||||||
5 | f"""{"""
|
5 | f"""{"""
|
||||||
|
|
|
|
||||||
|
@ -342,10 +341,12 @@ Module(
|
||||||
|
|
|
|
||||||
4 | f"{"
|
4 | f"{"
|
||||||
5 | f"""{"""
|
5 | f"""{"""
|
||||||
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
|
||||||
4 | f"{"
|
4 | f"{"
|
||||||
5 | f"""{"""
|
5 | f"""{"""
|
||||||
|
| ^ Syntax Error: f-string: unterminated string
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/inline/err/implicitly_concatenated_unterminated_string.py
|
input_file: crates/ruff_python_parser/resources/inline/err/implicitly_concatenated_unterminated_string.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -174,6 +173,6 @@ Module(
|
||||||
1 | 'hello' 'world
|
1 | 'hello' 'world
|
||||||
2 | 1 + 1
|
2 | 1 + 1
|
||||||
3 | 'hello' f'world {x}
|
3 | 'hello' f'world {x}
|
||||||
| Syntax Error: f-string: unterminated string
|
| ^ Syntax Error: f-string: unterminated string
|
||||||
4 | 2 + 2
|
4 | 2 + 2
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/inline/err/implicitly_concatenated_unterminated_string_multiline.py
|
input_file: crates/ruff_python_parser/resources/inline/err/implicitly_concatenated_unterminated_string_multiline.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -189,7 +188,7 @@ Module(
|
||||||
1 | (
|
1 | (
|
||||||
2 | 'hello'
|
2 | 'hello'
|
||||||
3 | f'world {x}
|
3 | f'world {x}
|
||||||
| Syntax Error: f-string: unterminated string
|
| ^ Syntax Error: f-string: unterminated string
|
||||||
4 | )
|
4 | )
|
||||||
5 | 1 + 1
|
5 | 1 + 1
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/re_lex_logical_token.py
|
input_file: crates/ruff_python_parser/resources/invalid/re_lex_logical_token.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -708,8 +707,8 @@ Module(
|
||||||
13 | # There are multiple non-logical newlines (blank lines) in the `if` body
|
13 | # There are multiple non-logical newlines (blank lines) in the `if` body
|
||||||
14 | if call(foo
|
14 | if call(foo
|
||||||
| ^ Syntax Error: Expected ')', found newline
|
| ^ Syntax Error: Expected ')', found newline
|
||||||
15 |
|
15 |
|
||||||
16 |
|
16 |
|
||||||
17 | def bar():
|
17 | def bar():
|
||||||
|
|
|
|
||||||
|
|
||||||
|
@ -775,7 +774,7 @@ Module(
|
||||||
|
|
|
|
||||||
49 | # F-strings uses normal list parsing, so test those as well
|
49 | # F-strings uses normal list parsing, so test those as well
|
||||||
50 | if call(f"hello {x
|
50 | if call(f"hello {x
|
||||||
| Syntax Error: f-string: unterminated string
|
| ^ Syntax Error: f-string: unterminated string
|
||||||
51 | def bar():
|
51 | def bar():
|
||||||
52 | pass
|
52 | pass
|
||||||
|
|
|
|
||||||
|
@ -793,7 +792,7 @@ Module(
|
||||||
|
|
|
|
||||||
49 | # F-strings uses normal list parsing, so test those as well
|
49 | # F-strings uses normal list parsing, so test those as well
|
||||||
50 | if call(f"hello {x
|
50 | if call(f"hello {x
|
||||||
| Syntax Error: Expected FStringEnd, found Unknown
|
| ^ Syntax Error: Expected FStringEnd, found Unknown
|
||||||
51 | def bar():
|
51 | def bar():
|
||||||
52 | pass
|
52 | pass
|
||||||
|
|
|
|
||||||
|
@ -835,5 +834,5 @@ Module(
|
||||||
55 | if call(f"hello
|
55 | if call(f"hello
|
||||||
56 | def bar():
|
56 | def bar():
|
||||||
57 | pass
|
57 | pass
|
||||||
| Syntax Error: Expected a statement
|
| ^ Syntax Error: Expected a statement
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/re_lex_logical_token_mac_eol.py
|
input_file: crates/ruff_python_parser/resources/invalid/re_lex_logical_token_mac_eol.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -101,5 +100,5 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | if call(foo, [a, b
def bar():
pass
|
1 | if call(foo, [a, b
def bar():
pass
|
||||||
| Syntax Error: Expected ']', found NonLogicalNewline
|
| ^ Syntax Error: Expected ']', found NonLogicalNewline
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/re_lexing/triple_quoted_fstring_1.py
|
input_file: crates/ruff_python_parser/resources/invalid/re_lexing/triple_quoted_fstring_1.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -65,7 +64,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
3 | # https://github.com/astral-sh/ruff/issues/11929
|
3 | # https://github.com/astral-sh/ruff/issues/11929
|
||||||
4 |
|
4 |
|
||||||
5 | f"""hello {x # comment
|
5 | f"""hello {x # comment
|
||||||
| ___________________________^
|
| ___________________________^
|
||||||
6 | | y = 1
|
6 | | y = 1
|
||||||
|
@ -82,7 +81,7 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
3 | # https://github.com/astral-sh/ruff/issues/11929
|
3 | # https://github.com/astral-sh/ruff/issues/11929
|
||||||
4 |
|
4 |
|
||||||
5 | f"""hello {x # comment
|
5 | f"""hello {x # comment
|
||||||
| ___________________________^
|
| ___________________________^
|
||||||
6 | | y = 1
|
6 | | y = 1
|
||||||
|
@ -93,5 +92,5 @@ Module(
|
||||||
|
|
|
|
||||||
5 | f"""hello {x # comment
|
5 | f"""hello {x # comment
|
||||||
6 | y = 1
|
6 | y = 1
|
||||||
| Syntax Error: Expected a statement
|
| ^ Syntax Error: Expected a statement
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/statements/with/unclosed_ambiguous_lpar.py
|
input_file: crates/ruff_python_parser/resources/invalid/statements/with/unclosed_ambiguous_lpar.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -65,14 +64,14 @@ Module(
|
||||||
|
|
|
|
||||||
1 | with (:
|
1 | with (:
|
||||||
| ^ Syntax Error: Expected an expression
|
| ^ Syntax Error: Expected an expression
|
||||||
2 |
|
2 |
|
||||||
3 | x + y
|
3 | x + y
|
||||||
|
|
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | with (:
|
1 | with (:
|
||||||
2 |
|
2 |
|
||||||
3 | x + y
|
3 | x + y
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/invalid/statements/with/unclosed_ambiguous_lpar_eof.py
|
input_file: crates/ruff_python_parser/resources/invalid/statements/with/unclosed_ambiguous_lpar_eof.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -38,5 +37,5 @@ Module(
|
||||||
|
|
||||||
|
|
|
|
||||||
1 | with (
|
1 | with (
|
||||||
| Syntax Error: unexpected EOF while parsing
|
| ^ Syntax Error: unexpected EOF while parsing
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/tests/fixtures.rs
|
source: crates/ruff_python_parser/tests/fixtures.rs
|
||||||
input_file: crates/ruff_python_parser/resources/inline/err/unterminated_fstring_newline_recovery.py
|
input_file: crates/ruff_python_parser/resources/inline/err/unterminated_fstring_newline_recovery.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
@ -316,7 +315,7 @@ Module(
|
||||||
1 | f"hello
|
1 | f"hello
|
||||||
2 | 1 + 1
|
2 | 1 + 1
|
||||||
3 | f"hello {x
|
3 | f"hello {x
|
||||||
| Syntax Error: f-string: unterminated string
|
| ^ Syntax Error: f-string: unterminated string
|
||||||
4 | 2 + 2
|
4 | 2 + 2
|
||||||
5 | f"hello {x:
|
5 | f"hello {x:
|
||||||
|
|
|
|
||||||
|
@ -336,7 +335,7 @@ Module(
|
||||||
1 | f"hello
|
1 | f"hello
|
||||||
2 | 1 + 1
|
2 | 1 + 1
|
||||||
3 | f"hello {x
|
3 | f"hello {x
|
||||||
| Syntax Error: Expected FStringEnd, found Unknown
|
| ^ Syntax Error: Expected FStringEnd, found Unknown
|
||||||
4 | 2 + 2
|
4 | 2 + 2
|
||||||
5 | f"hello {x:
|
5 | f"hello {x:
|
||||||
|
|
|
|
||||||
|
@ -346,7 +345,7 @@ Module(
|
||||||
3 | f"hello {x
|
3 | f"hello {x
|
||||||
4 | 2 + 2
|
4 | 2 + 2
|
||||||
5 | f"hello {x:
|
5 | f"hello {x:
|
||||||
| Syntax Error: f-string: unterminated string
|
| ^ Syntax Error: f-string: unterminated string
|
||||||
6 | 3 + 3
|
6 | 3 + 3
|
||||||
7 | f"hello {x}
|
7 | f"hello {x}
|
||||||
|
|
|
|
||||||
|
@ -356,6 +355,6 @@ Module(
|
||||||
5 | f"hello {x:
|
5 | f"hello {x:
|
||||||
6 | 3 + 3
|
6 | 3 + 3
|
||||||
7 | f"hello {x}
|
7 | f"hello {x}
|
||||||
| Syntax Error: f-string: unterminated string
|
| ^ Syntax Error: f-string: unterminated string
|
||||||
8 | 4 + 4
|
8 | 4 + 4
|
||||||
|
|
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue