A Pylint plugin to check for the presence/absence of spacing after documentation strings.
Installing with pip
:
pip install pylint-doc-spacing
To use pylint-doc-spacing, it must be loaded as a plugin when running pylint:
pylint --load-plugins pylint_doc_spacing <module-or-package>
The consistency of doc spacing can be configured:
one-line
: enforces having exactly one empty line after the documentation (the default).none
: enforces no blank line after the documentation.any
: does not enforce anything.
You can decide on different spacing for different kind of documentation by changing the following Pylint configs:
module-doc-spacing
for the modules' documentation.class-doc-spacing
for the classes' documentation.function-doc-spacing
for the functions and methods documentation.
Example of configuration in .pylintrc
:
[MISCELLANEOUS]
function-doc-spacing=none
class-doc-spacing=only-one
module-doc-spacing=any