mirror of https://github.com/astral-sh/ruff
test: add more missing carets
This update includes some missing `^` in the diagnostic annotations.
This update also includes some shifting of "syntax error" annotations to
the end of the preceding line. I believe this is technically a
regression, but fixing them has proven quite difficult. I *think* the
best way to do that might be to tweak the spans generated by the Python
parser errors, but I didn't want to dig into that. (Another approach
would be to change the `annotate-snippets` rendering, but when I tried
that and managed to fix these regressions, I ended up causing a bunch of
other regressions.)
Ref 77d454525e (r1915458616)
This commit is contained in:
parent
5021f32449
commit
17f01a4355
|
|
@ -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/fstring_format_spec_1.py
|
input_file: crates/ruff_python_parser/resources/invalid/re_lexing/fstring_format_spec_1.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
|
@ -347,7 +346,7 @@ Module(
|
||||||
6 | 'format spec'}
|
6 | 'format spec'}
|
||||||
7 |
|
7 |
|
||||||
8 | f'middle {'string':\\
|
8 | f'middle {'string':\\
|
||||||
| Syntax Error: f-string: unterminated string
|
| ^ Syntax Error: f-string: unterminated string
|
||||||
9 | 'format spec'}
|
9 | 'format spec'}
|
||||||
|
|
|
|
||||||
|
|
||||||
|
|
@ -383,8 +382,8 @@ Module(
|
||||||
|
|
|
|
||||||
9 | 'format spec'}
|
9 | 'format spec'}
|
||||||
10 |
|
10 |
|
||||||
|
| ^ Syntax Error: Expected a statement
|
||||||
11 | f'middle {'string':\\\
|
11 | f'middle {'string':\\\
|
||||||
| Syntax Error: Expected a statement
|
|
||||||
12 | 'format spec'}
|
12 | 'format spec'}
|
||||||
|
|
|
|
||||||
|
|
||||||
|
|
@ -420,5 +419,5 @@ Module(
|
||||||
|
|
|
|
||||||
11 | f'middle {'string':\\\
|
11 | f'middle {'string':\\\
|
||||||
12 | 'format spec'}
|
12 | 'format spec'}
|
||||||
| 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/if_extra_indent.py
|
input_file: crates/ruff_python_parser/resources/invalid/statements/if_extra_indent.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
|
@ -100,6 +99,6 @@ Module(
|
||||||
|
|
|
|
||||||
6 | pass
|
6 | pass
|
||||||
7 |
|
7 |
|
||||||
|
| ^ Syntax Error: Expected a statement
|
||||||
8 | a = 10
|
8 | a = 10
|
||||||
| 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/inline/err/try_stmt_misspelled_except.py
|
input_file: crates/ruff_python_parser/resources/inline/err/try_stmt_misspelled_except.py
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
## AST
|
## AST
|
||||||
|
|
||||||
|
|
@ -198,8 +197,8 @@ Module(
|
||||||
|
|
|
|
||||||
3 | exept: # spellchecker:disable-line
|
3 | exept: # spellchecker:disable-line
|
||||||
4 | pass
|
4 | pass
|
||||||
|
| ^ Syntax Error: Expected a statement
|
||||||
5 | finally:
|
5 | finally:
|
||||||
| Syntax Error: Expected a statement
|
|
||||||
6 | pass
|
6 | pass
|
||||||
7 | a = 1
|
7 | a = 1
|
||||||
|
|
|
|
||||||
|
|
@ -239,8 +238,8 @@ Module(
|
||||||
|
|
|
|
||||||
5 | finally:
|
5 | finally:
|
||||||
6 | pass
|
6 | pass
|
||||||
|
| ^ Syntax Error: Expected a statement
|
||||||
7 | a = 1
|
7 | a = 1
|
||||||
| Syntax Error: Expected a statement
|
|
||||||
8 | try:
|
8 | try:
|
||||||
9 | pass
|
9 | pass
|
||||||
|
|
|
|
||||||
|
|
@ -268,6 +267,6 @@ Module(
|
||||||
|
|
|
|
||||||
12 | exept: # spellchecker:disable-line
|
12 | exept: # spellchecker:disable-line
|
||||||
13 | pass
|
13 | pass
|
||||||
|
| ^ Syntax Error: Expected a statement
|
||||||
14 | b = 1
|
14 | b = 1
|
||||||
| Syntax Error: Expected a statement
|
|
||||||
|
|
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue