-
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.
Respect word boundaries when detecting function signature in docs (#1…
- Loading branch information
1 parent
dcfebaa
commit 7074895
Showing
4 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
crates/ruff_linter/resources/test/fixtures/pydocstyle/D402.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,8 @@ | ||
def foo(): | ||
"""Returns foo().""" | ||
|
||
def foo(): | ||
""""Use prefix_foo().""" | ||
|
||
def foo(): | ||
""""Use this function; foo().""" |
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
18 changes: 18 additions & 0 deletions
18
...r/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D402.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,18 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs | ||
--- | ||
D402.py:2:5: D402 First line should not be the function's signature | ||
| | ||
1 | def foo(): | ||
2 | """Returns foo().""" | ||
| ^^^^^^^^^^^^^^^^^^^^ D402 | ||
3 | | ||
4 | def foo(): | ||
| | ||
|
||
D402.py:8:5: D402 First line should not be the function's signature | ||
| | ||
7 | def foo(): | ||
8 | """"Use this function; foo().""" | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D402 | ||
| |