-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
typehints_use_rtype
option (#218)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bernát Gábor <[email protected]>
- Loading branch information
1 parent
a022d1a
commit aa345ca
Showing
6 changed files
with
124 additions
and
2 deletions.
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
37 changes: 37 additions & 0 deletions
37
tests/roots/test-dummy/dummy_module_simple_no_use_rtype.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,37 @@ | ||
def function_no_returns(x: bool, y: int = 1) -> str: # noqa: U100 | ||
""" | ||
Function docstring. | ||
:param x: foo | ||
:param y: bar | ||
""" | ||
|
||
|
||
def function_returns_with_type(x: bool, y: int = 1) -> str: # noqa: U100 | ||
""" | ||
Function docstring. | ||
:param x: foo | ||
:param y: bar | ||
:returns: *CustomType* -- A string | ||
""" | ||
|
||
|
||
def function_returns_with_compound_type(x: bool, y: int = 1) -> str: # noqa: U100 | ||
""" | ||
Function docstring. | ||
:param x: foo | ||
:param y: bar | ||
:returns: Union[str, int] -- A string or int | ||
""" | ||
|
||
|
||
def function_returns_without_type(x: bool, y: int = 1) -> str: # noqa: U100 | ||
""" | ||
Function docstring. | ||
:param x: foo | ||
:param y: bar | ||
:returns: A string | ||
""" |
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,7 @@ | ||
Simple Module | ||
============= | ||
|
||
.. autofunction:: dummy_module_simple_no_use_rtype.function_no_returns | ||
.. autofunction:: dummy_module_simple_no_use_rtype.function_returns_with_type | ||
.. autofunction:: dummy_module_simple_no_use_rtype.function_returns_with_compound_type | ||
.. autofunction:: dummy_module_simple_no_use_rtype.function_returns_without_type |
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