-
Notifications
You must be signed in to change notification settings - Fork 882
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Summary Add fix for `D300` ## Test Plan `cargo test` and manually
- Loading branch information
1 parent
dc6b4ad
commit 8a52992
Showing
6 changed files
with
205 additions
and
20 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
crates/ruff_linter/resources/test/fixtures/pydocstyle/D300.py
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,10 @@ | ||
def with_backslash(): | ||
"""Sum\\mary.""" | ||
|
||
|
||
def ends_in_quote(): | ||
'Sum\\mary."' | ||
|
||
|
||
def contains_quote(): | ||
'Sum"\\mary.' |
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
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
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
27 changes: 27 additions & 0 deletions
27
...r/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D300.py.snap
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,27 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs | ||
--- | ||
D300.py:6:5: D300 Use triple double quotes `"""` | ||
| | ||
5 | def ends_in_quote(): | ||
6 | 'Sum\\mary."' | ||
| ^^^^^^^^^^^^^ D300 | ||
| | ||
= help: Convert to triple double quotes | ||
|
||
D300.py:10:5: D300 [*] Use triple double quotes `"""` | ||
| | ||
9 | def contains_quote(): | ||
10 | 'Sum"\\mary.' | ||
| ^^^^^^^^^^^^^ D300 | ||
| | ||
= help: Convert to triple double quotes | ||
|
||
ℹ Fix | ||
7 7 | | ||
8 8 | | ||
9 9 | def contains_quote(): | ||
10 |- 'Sum"\\mary.' | ||
10 |+ """Sum"\\mary.""" | ||
7 changes: 6 additions & 1 deletion
7
...uff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__bom.snap
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 |
---|---|---|
@@ -1,10 +1,15 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs | ||
--- | ||
bom.py:1:1: D300 Use triple double quotes `"""` | ||
bom.py:1:1: D300 [*] Use triple double quotes `"""` | ||
| | ||
1 | ''' SAM macro definitions ''' | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D300 | ||
| | ||
= help: Convert to triple double quotes | ||
|
||
ℹ Fix | ||
1 |-''' SAM macro definitions ''' | ||
1 |+""" SAM macro definitions """ | ||
|
||
|