This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(checker): change D202 for inner funcs (#395)
Changes D202: "No blank lines allowed after function docstring" to allow space below function docstrings with inner functions. i.e. allows: ```python def outer(): """Valid docstring.""" def inner(): pass return pass ``` See comment from @cdeil in #361. feat(checker): add test case to test_definitions docs(changelog): add change to release notes
- Loading branch information
1 parent
49183a3
commit f8b9419
Showing
4 changed files
with
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
""" Function docstrings """ | ||
|
||
from .expected import Expectation | ||
|
||
expectation = Expectation() | ||
expect = expectation.expect | ||
|
||
|
||
@expect("D201: No blank lines allowed before docstring") | ||
def func_with_space_before(): | ||
|
||
"""Func with space before.""" | ||
pass | ||
|
||
|
||
@expect("D202: No blank lines allowed after docstring") | ||
def func_with_space_after(): | ||
"""Func with space after.""" | ||
|
||
pass | ||
|
||
|
||
def func_with_inner_func_after(): | ||
"""Func with inner after.""" | ||
|
||
def inner(): | ||
pass | ||
|
||
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