Do Not Remove Newline Following docstring in Stub Functions #154
Labels
C: style
Relates to docstring format style (e.g., Google, NumPy, Sphinx)
P: enhancement
Feature that is outside the scope of PEP 257
S: merged
Closed with work merged to repository
Milestone
In functions and methods with only a docstring, it is stylistically considered redundant to include a
pass
statement. See the pylint issue requesting the Unnecessary pass warning. However, PEP257 states, "There’s no blank line either before or after the docstring." Thus, in the following code snippet, the newline before the second function will be removed by docformatter which causes pylint to raise the W0107 warning (see here).Currently, including a
pass
statement in a_function will cause docformatter to retain the newline, However, docformatter should recognize a_function as a stub and retain the newline without the use of apass
statement.The text was updated successfully, but these errors were encountered: