Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# The lexer doesn't emit a string token if it's unterminated
# The lexer emits a string token if it's unterminated
"a" "b
"a" "b" "c
"a" """b
c""" "d

# For f-strings, the `FStringRanges` won't contain the range for
# This is also true for
# unterminated f-strings.
Comment on lines +7 to 8
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this looks silly, but keeping the comment over two lines reduces the snapshot changes.

f"a" f"b
f"a" f"b" f"c
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
---
source: crates/ruff_linter/src/rules/flake8_implicit_str_concat/mod.rs
---
invalid-syntax: missing closing quote in string literal
--> ISC_syntax_error.py:2:5
ISC001 Implicitly concatenated string literals on one line
--> ISC_syntax_error.py:2:1
|
1 | # The lexer doesn't emit a string token if it's unterminated
1 | # The lexer emits a string token if it's unterminated
2 | "a" "b
| ^^
| ^^^^^^
3 | "a" "b" "c
4 | "a" """b
|
help: Combine string literals

invalid-syntax: Expected a statement
--> ISC_syntax_error.py:2:7
invalid-syntax: missing closing quote in string literal
--> ISC_syntax_error.py:2:5
|
1 | # The lexer doesn't emit a string token if it's unterminated
1 | # The lexer emits a string token if it's unterminated
2 | "a" "b
| ^
| ^^
3 | "a" "b" "c
4 | "a" """b
|

ISC001 Implicitly concatenated string literals on one line
--> ISC_syntax_error.py:3:1
|
1 | # The lexer doesn't emit a string token if it's unterminated
1 | # The lexer emits a string token if it's unterminated
2 | "a" "b
3 | "a" "b" "c
| ^^^^^^^
Expand All @@ -33,24 +34,25 @@ ISC001 Implicitly concatenated string literals on one line
|
help: Combine string literals

invalid-syntax: missing closing quote in string literal
--> ISC_syntax_error.py:3:9
ISC001 Implicitly concatenated string literals on one line
--> ISC_syntax_error.py:3:5
|
1 | # The lexer doesn't emit a string token if it's unterminated
1 | # The lexer emits a string token if it's unterminated
2 | "a" "b
3 | "a" "b" "c
| ^^
| ^^^^^^
4 | "a" """b
5 | c""" "d
|
help: Combine string literals

invalid-syntax: Expected a statement
--> ISC_syntax_error.py:3:11
invalid-syntax: missing closing quote in string literal
--> ISC_syntax_error.py:3:9
|
1 | # The lexer doesn't emit a string token if it's unterminated
1 | # The lexer emits a string token if it's unterminated
2 | "a" "b
3 | "a" "b" "c
| ^
| ^^
4 | "a" """b
5 | c""" "d
|
Expand All @@ -64,36 +66,39 @@ ISC001 Implicitly concatenated string literals on one line
5 | | c""" "d
| |____^
6 |
7 | # For f-strings, the `FStringRanges` won't contain the range for
7 | # This is also true for
|
help: Combine string literals

invalid-syntax: missing closing quote in string literal
--> ISC_syntax_error.py:5:6
ISC001 Implicitly concatenated string literals on one line
--> ISC_syntax_error.py:4:5
|
3 | "a" "b" "c
4 | "a" """b
5 | c""" "d
| ^^
2 | "a" "b
3 | "a" "b" "c
4 | "a" """b
| _____^
5 | | c""" "d
| |_______^
6 |
7 | # For f-strings, the `FStringRanges` won't contain the range for
7 | # This is also true for
|
help: Combine string literals

invalid-syntax: Expected a statement
--> ISC_syntax_error.py:5:8
invalid-syntax: missing closing quote in string literal
--> ISC_syntax_error.py:5:6
|
3 | "a" "b" "c
4 | "a" """b
5 | c""" "d
| ^
| ^^
6 |
7 | # For f-strings, the `FStringRanges` won't contain the range for
7 | # This is also true for
|

invalid-syntax: f-string: unterminated string
--> ISC_syntax_error.py:9:8
|
7 | # For f-strings, the `FStringRanges` won't contain the range for
7 | # This is also true for
8 | # unterminated f-strings.
9 | f"a" f"b
| ^
Expand All @@ -104,7 +109,7 @@ invalid-syntax: f-string: unterminated string
invalid-syntax: Expected FStringEnd, found newline
--> ISC_syntax_error.py:9:9
|
7 | # For f-strings, the `FStringRanges` won't contain the range for
7 | # This is also true for
8 | # unterminated f-strings.
9 | f"a" f"b
| ^
Expand Down Expand Up @@ -183,14 +188,6 @@ invalid-syntax: f-string: unterminated triple-quoted string
| |__^
|

invalid-syntax: unexpected EOF while parsing
--> ISC_syntax_error.py:30:1
|
28 | "i" "j"
29 | )
| ^
|

invalid-syntax: f-string: unterminated string
--> ISC_syntax_error.py:30:1
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,24 @@ source: crates/ruff_linter/src/rules/flake8_implicit_str_concat/mod.rs
invalid-syntax: missing closing quote in string literal
--> ISC_syntax_error.py:2:5
|
1 | # The lexer doesn't emit a string token if it's unterminated
1 | # The lexer emits a string token if it's unterminated
2 | "a" "b
| ^^
3 | "a" "b" "c
4 | "a" """b
|

invalid-syntax: Expected a statement
--> ISC_syntax_error.py:2:7
|
1 | # The lexer doesn't emit a string token if it's unterminated
2 | "a" "b
| ^
3 | "a" "b" "c
4 | "a" """b
|

invalid-syntax: missing closing quote in string literal
--> ISC_syntax_error.py:3:9
|
1 | # The lexer doesn't emit a string token if it's unterminated
1 | # The lexer emits a string token if it's unterminated
2 | "a" "b
3 | "a" "b" "c
| ^^
4 | "a" """b
5 | c""" "d
|

invalid-syntax: Expected a statement
--> ISC_syntax_error.py:3:11
|
1 | # The lexer doesn't emit a string token if it's unterminated
2 | "a" "b
3 | "a" "b" "c
| ^
4 | "a" """b
5 | c""" "d
|

invalid-syntax: missing closing quote in string literal
--> ISC_syntax_error.py:5:6
|
Expand All @@ -51,24 +30,13 @@ invalid-syntax: missing closing quote in string literal
5 | c""" "d
| ^^
6 |
7 | # For f-strings, the `FStringRanges` won't contain the range for
|

invalid-syntax: Expected a statement
--> ISC_syntax_error.py:5:8
|
3 | "a" "b" "c
4 | "a" """b
5 | c""" "d
| ^
6 |
7 | # For f-strings, the `FStringRanges` won't contain the range for
7 | # This is also true for
|

invalid-syntax: f-string: unterminated string
--> ISC_syntax_error.py:9:8
|
7 | # For f-strings, the `FStringRanges` won't contain the range for
7 | # This is also true for
8 | # unterminated f-strings.
9 | f"a" f"b
| ^
Expand All @@ -79,7 +47,7 @@ invalid-syntax: f-string: unterminated string
invalid-syntax: Expected FStringEnd, found newline
--> ISC_syntax_error.py:9:9
|
7 | # For f-strings, the `FStringRanges` won't contain the range for
7 | # This is also true for
8 | # unterminated f-strings.
9 | f"a" f"b
| ^
Expand Down Expand Up @@ -133,14 +101,6 @@ invalid-syntax: f-string: unterminated triple-quoted string
| |__^
|

invalid-syntax: unexpected EOF while parsing
--> ISC_syntax_error.py:30:1
|
28 | "i" "j"
29 | )
| ^
|

invalid-syntax: f-string: unterminated string
--> ISC_syntax_error.py:30:1
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ invalid-syntax: missing closing quote in string literal
9 | # Unterminated f-string
|

invalid-syntax: Expected a statement
--> invalid_characters_syntax_error.py:7:7
PLE2510 Invalid unescaped character backspace, use "\b" instead
--> invalid_characters_syntax_error.py:7:6
|
5 | b = '␈'
6 | # Unterminated string
7 | b = '␈
| ^
| ^
8 | b = '␈'
9 | # Unterminated f-string
|
help: Replace with escape sequence

PLE2510 Invalid unescaped character backspace, use "\b" instead
--> invalid_characters_syntax_error.py:8:6
Expand All @@ -46,6 +47,18 @@ PLE2510 Invalid unescaped character backspace, use "\b" instead
|
help: Replace with escape sequence

PLE2510 Invalid unescaped character backspace, use "\b" instead
--> invalid_characters_syntax_error.py:10:7
|
8 | b = '␈'
9 | # Unterminated f-string
10 | b = f'␈
| ^
11 | b = f'␈'
12 | # Implicitly concatenated
|
help: Replace with escape sequence

invalid-syntax: f-string: unterminated string
--> invalid_characters_syntax_error.py:10:7
|
Expand Down Expand Up @@ -109,11 +122,12 @@ invalid-syntax: missing closing quote in string literal
| ^^
|

invalid-syntax: Expected a statement
--> invalid_characters_syntax_error.py:13:16
PLE2510 Invalid unescaped character backspace, use "\b" instead
--> invalid_characters_syntax_error.py:13:15
|
11 | b = f'␈'
12 | # Implicitly concatenated
13 | b = '␈' f'␈' '␈
| ^
| ^
|
help: Replace with escape sequence
Loading
Loading