-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pycodestyle] Fix: Don't autofix if the first line ends in a question mark? (D400) #13399
Merged
MichaReiser
merged 9 commits into
astral-sh:main
from
yahayaohinoyi:d400-not-autofix-some-chars
Sep 20, 2024
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d43c3e4
fix
yahayaohinoyi a8c1523
fix
yahayaohinoyi 0c79501
reimplemented violation for end_with_period
yahayaohinoyi bf983db
fix
yahayaohinoyi 4f56c37
attemp to improve snapshot
yahayaohinoyi c297429
remove redundancy
yahayaohinoyi 35077e2
Discard changes to crates/ruff_linter/src/rules/pydocstyle/rules/ends…
MichaReiser 84af667
Revert "Discard changes to crates/ruff_linter/src/rules/pydocstyle/ru…
MichaReiser b1364c0
Run new tests for both D00 and D415
MichaReiser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
crates/ruff_linter/resources/test/fixtures/pydocstyle/D415.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,20 @@ | ||
def f(): | ||
"Here's a line ending in a question mark?" | ||
... | ||
|
||
|
||
def f(): | ||
"""Here's a line ending in an exclamation mark!""" | ||
... | ||
|
||
def f(): | ||
"""Here's a line ending in a colon:""" | ||
... | ||
|
||
def f(): | ||
"""Here's a line ending in a semi colon;""" | ||
... | ||
|
||
def f(): | ||
"""Here's a line ending with a whitespace """ | ||
... |
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
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
37 changes: 37 additions & 0 deletions
37
...r/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D415.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,37 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs | ||
--- | ||
D415.py:11:5: D415 First line should end with a period, question mark, or exclamation point | ||
| | ||
10 | def f(): | ||
11 | """Here's a line ending in a colon:""" | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D415 | ||
12 | ... | ||
| | ||
= help: Add closing punctuation | ||
|
||
D415.py:15:5: D415 First line should end with a period, question mark, or exclamation point | ||
| | ||
14 | def f(): | ||
15 | """Here's a line ending in a semi colon;""" | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D415 | ||
16 | ... | ||
| | ||
= help: Add closing punctuation | ||
|
||
D415.py:19:5: D415 [*] First line should end with a period, question mark, or exclamation point | ||
| | ||
18 | def f(): | ||
19 | """Here's a line ending with a whitespace """ | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D415 | ||
20 | ... | ||
| | ||
= help: Add closing punctuation | ||
|
||
ℹ Unsafe fix | ||
16 16 | ... | ||
17 17 | | ||
18 18 | def f(): | ||
19 |- """Here's a line ending with a whitespace """ | ||
19 |+ """Here's a line ending with a whitespace. """ | ||
20 20 | ... |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find