-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix false positive DOC405 & DOC201 for bare returns (#205)
- Loading branch information
Showing
6 changed files
with
175 additions
and
1 deletion.
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
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
34 changes: 34 additions & 0 deletions
34
tests/data/edge_cases/23_bare_return_stmt_with_yield/google.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,34 @@ | ||
# From: https://github.com/jsh9/pydoclint/issues/126 | ||
|
||
from contextlib import contextmanager | ||
|
||
|
||
@contextmanager | ||
def my_func_1(db: Optional[int]) -> Iterator[int]: | ||
"""Test a function. | ||
Args: | ||
db: the database | ||
Yields: | ||
Some stuff. | ||
""" | ||
if db is not None: | ||
yield db | ||
return | ||
|
||
db = ... | ||
yield db | ||
|
||
|
||
def my_func_2(arg1: int) -> None: | ||
""" | ||
Test a function. | ||
Args: | ||
arg1: some argument | ||
Returns: | ||
The return value | ||
""" | ||
pass |
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