-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Summary This rule was just incorrect, it didn't match the examples in the docs. (It's a very rarely-used rule since it's not included in any of the conventions.) Closes #9452.
- Loading branch information
1 parent
d496c16
commit 157d5ba
Showing
5 changed files
with
304 additions
and
9 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
crates/ruff_linter/resources/test/fixtures/pydocstyle/D413.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,59 @@ | ||
"""Do something. | ||
Args: | ||
x: the value | ||
with a hanging indent | ||
Returns: | ||
the value | ||
""" | ||
|
||
|
||
def func(): | ||
"""Do something. | ||
Args: | ||
x: the value | ||
with a hanging indent | ||
Returns: | ||
the value | ||
""" | ||
|
||
|
||
def func(): | ||
"""Do something. | ||
Args: | ||
x: the value | ||
with a hanging indent | ||
Returns: | ||
the value | ||
""" | ||
|
||
|
||
def func(): | ||
"""Do something. | ||
Args: | ||
x: the value | ||
with a hanging indent | ||
Returns: | ||
the value | ||
""" | ||
|
||
|
||
def func(): | ||
"""Do something. | ||
Args: | ||
x: the value | ||
with a hanging indent | ||
Returns: | ||
the value""" |
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
80 changes: 80 additions & 0 deletions
80
...r/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D413_D413.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,80 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs | ||
--- | ||
D413.py:1:1: D413 [*] Missing blank line after last section ("Returns") | ||
| | ||
1 | / """Do something. | ||
2 | | | ||
3 | | Args: | ||
4 | | x: the value | ||
5 | | with a hanging indent | ||
6 | | | ||
7 | | Returns: | ||
8 | | the value | ||
9 | | """ | ||
| |___^ D413 | ||
| | ||
= help: Add blank line after "Returns" | ||
|
||
ℹ Safe fix | ||
6 6 | | ||
7 7 | Returns: | ||
8 8 | the value | ||
9 |+ | ||
10 |+ | ||
9 11 | """ | ||
10 12 | | ||
11 13 | | ||
|
||
D413.py:13:5: D413 [*] Missing blank line after last section ("Returns") | ||
| | ||
12 | def func(): | ||
13 | """Do something. | ||
| _____^ | ||
14 | | | ||
15 | | Args: | ||
16 | | x: the value | ||
17 | | with a hanging indent | ||
18 | | | ||
19 | | Returns: | ||
20 | | the value | ||
21 | | """ | ||
| |_______^ D413 | ||
| | ||
= help: Add blank line after "Returns" | ||
|
||
ℹ Safe fix | ||
18 18 | | ||
19 19 | Returns: | ||
20 20 | the value | ||
21 |+ | ||
21 22 | """ | ||
22 23 | | ||
23 24 | | ||
|
||
D413.py:52:5: D413 [*] Missing blank line after last section ("Returns") | ||
| | ||
51 | def func(): | ||
52 | """Do something. | ||
| _____^ | ||
53 | | | ||
54 | | Args: | ||
55 | | x: the value | ||
56 | | with a hanging indent | ||
57 | | | ||
58 | | Returns: | ||
59 | | the value""" | ||
| |____________________^ D413 | ||
| | ||
= help: Add blank line after "Returns" | ||
|
||
ℹ Safe fix | ||
56 56 | with a hanging indent | ||
57 57 | | ||
58 58 | Returns: | ||
59 |- the value""" | ||
59 |+ the value | ||
60 |+ | ||
61 |+ """ | ||
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