-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow no return section in docstring (#10)
- Loading branch information
Showing
9 changed files
with
236 additions
and
6 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
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
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 @@ | ||
from typing import Optional | ||
|
||
|
||
def func1(text: str) -> None: | ||
"""A return section can be omitted if requireReturnSectionWhenReturningNone | ||
is set to False. | ||
Args: | ||
text (str): Text for the function | ||
""" | ||
print(123) | ||
|
||
|
||
def func2(text: str) -> int: | ||
"""A return section is always required because it returns something | ||
Args: | ||
text (str): Text for the function | ||
""" | ||
return 1 | ||
|
||
|
||
def func3(text: str) -> Optional[int]: | ||
"""A return section is always required because it returns something | ||
Args: | ||
text (str): Text for the function | ||
""" | ||
return 1 | ||
|
||
|
||
def func4(text: str): | ||
"""A return section is always required because it has explicit "return" | ||
in the function body (even if it is "return None") | ||
Args: | ||
text (str): Text for the function | ||
""" | ||
return None | ||
|
||
|
||
def func5(text: str): | ||
"""A return section is always required because it has explicit "return" | ||
in the function body (even if it is just "return") | ||
Args: | ||
text (str): Text for the function | ||
""" | ||
return | ||
|
||
|
||
def func6(text: str): | ||
"""A return section is never necessary because it doesn't return | ||
anything and there is no return type annotation. | ||
Args: | ||
text (str): Text for the function | ||
""" | ||
print(123) |
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,71 @@ | ||
from typing import Optional | ||
|
||
|
||
def func1(text: str) -> None: | ||
"""A return section can be omitted if requireReturnSectionWhenReturningNone | ||
is set to False. | ||
Parameters | ||
---------- | ||
text : str | ||
Text for the function | ||
""" | ||
print(123) | ||
|
||
|
||
def func2(text: str) -> int: | ||
"""A return section is always required because it returns something | ||
Parameters | ||
---------- | ||
text : str | ||
Text for the function | ||
""" | ||
return 1 | ||
|
||
|
||
def func3(text: str) -> Optional[int]: | ||
"""A return section is always required because it returns something | ||
Parameters | ||
---------- | ||
text : str | ||
Text for the function | ||
""" | ||
return 1 | ||
|
||
|
||
def func4(text: str): | ||
"""A return section is always required because it has explicit "return" | ||
in the function body (even if it is "return None") | ||
Parameters | ||
---------- | ||
text : str | ||
Text for the function | ||
""" | ||
return None | ||
|
||
|
||
def func5(text: str): | ||
"""A return section is always required because it has explicit "return" | ||
in the function body (even if it is just "return") | ||
Parameters | ||
---------- | ||
text : str | ||
Text for the function | ||
""" | ||
return | ||
|
||
|
||
def func6(text: str): | ||
"""A return section is never necessary because it doesn't return | ||
anything and there is no return type annotation. | ||
Parameters | ||
---------- | ||
text : str | ||
Text for the function | ||
""" | ||
print(123) |
Oops, something went wrong.