Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle text endings which end at quote
- Loading branch information
1 parent
e65d99f
commit 6c24c63
Showing
5 changed files
with
148 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...docstring_doubles_over_docstring_singles_mixed_quotes_module_singleline_var_1.py.snap.new
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_quotes/mod.rs | ||
assertion_line: 151 | ||
--- | ||
docstring_singles_mixed_quotes_module_singleline_var_1.py:1:1: Q002 Double quote docstring found but single quotes preferred | ||
| | ||
1 | ''"Start with empty string" ' and lint docstring safely' | ||
| ^^ Q002 | ||
2 | | ||
3 | def foo(): | ||
| | ||
= help: Replace double quotes docstring with single quotes | ||
|
||
docstring_singles_mixed_quotes_module_singleline_var_1.py:5:1: Q001 [*] Double quote multiline found but single quotes preferred | ||
| | ||
3 | def foo(): | ||
4 | pass | ||
5 | """ this is not a docstring """ | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Q001 | ||
| | ||
= help: Replace double multiline quotes with single quotes | ||
|
||
ℹ Safe fix | ||
2 2 | | ||
3 3 | def foo(): | ||
4 4 | pass | ||
5 |-""" this is not a docstring """ | ||
5 |+''' this is not a docstring ''' |
35 changes: 35 additions & 0 deletions
35
...docstring_doubles_over_docstring_singles_mixed_quotes_module_singleline_var_2.py.snap.new
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_quotes/mod.rs | ||
assertion_line: 151 | ||
--- | ||
docstring_singles_mixed_quotes_module_singleline_var_2.py:1:1: Q002 [*] Single quote docstring found but double quotes preferred | ||
| | ||
1 | 'Do not'" start with empty string" ' and lint docstring safely' | ||
| ^^^^^^^^ Q002 | ||
2 | | ||
3 | def foo(): | ||
| | ||
= help: Replace single quotes docstring with double quotes | ||
|
||
ℹ Safe fix | ||
1 |-'Do not'" start with empty string" ' and lint docstring safely' | ||
1 |+"Do not"" start with empty string" ' and lint docstring safely' | ||
2 2 | | ||
3 3 | def foo(): | ||
4 4 | pass | ||
|
||
docstring_singles_mixed_quotes_module_singleline_var_2.py:5:1: Q001 [*] Double quote multiline found but single quotes preferred | ||
| | ||
3 | def foo(): | ||
4 | pass | ||
5 | """ this is not a docstring """ | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Q001 | ||
| | ||
= help: Replace double multiline quotes with single quotes | ||
|
||
ℹ Safe fix | ||
2 2 | | ||
3 3 | def foo(): | ||
4 4 | pass | ||
5 |-""" this is not a docstring """ | ||
5 |+''' this is not a docstring ''' |
12 changes: 12 additions & 0 deletions
12
...docstring_singles_over_docstring_doubles_mixed_quotes_module_singleline_var_1.py.snap.new
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_quotes/mod.rs | ||
assertion_line: 186 | ||
--- | ||
docstring_doubles_mixed_quotes_module_singleline_var_1.py:1:1: Q002 Single quote docstring found but double quotes preferred | ||
| | ||
1 | ""'Start with empty string' ' and lint docstring safely' | ||
| ^^ Q002 | ||
2 | | ||
3 | def foo(): | ||
| | ||
= help: Replace single quotes docstring with double quotes |
19 changes: 19 additions & 0 deletions
19
...docstring_singles_over_docstring_doubles_mixed_quotes_module_singleline_var_2.py.snap.new
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_quotes/mod.rs | ||
assertion_line: 186 | ||
--- | ||
docstring_doubles_mixed_quotes_module_singleline_var_2.py:1:1: Q002 [*] Double quote docstring found but single quotes preferred | ||
| | ||
1 | "Do not"' start with empty string' ' and lint docstring safely' | ||
| ^^^^^^^^ Q002 | ||
2 | | ||
3 | def foo(): | ||
| | ||
= help: Replace double quotes docstring with single quotes | ||
|
||
ℹ Safe fix | ||
1 |-"Do not"' start with empty string' ' and lint docstring safely' | ||
1 |+'Do not'' start with empty string' ' and lint docstring safely' | ||
2 2 | | ||
3 3 | def foo(): | ||
4 4 | pass |