-
Notifications
You must be signed in to change notification settings - Fork 749
Description
Problem description
While using flake8 package to validate the code which uses pydocstyle or pep257 as backend and combination of flake8-docstrings and pycodestyle, docstrings don't validate correctly.
This is due to absent ability of backend (pydocstyle or pep257) work with content from stdin. Because of this pycodestyle provides helper function named stdin_get_value to avoid this problem.
But in case of using flake8 there are several plugins can read from stdin, so when it's stdin_get_value's turn there is no data in stdin.
Testing
To test the issue you have to install flake8
and flake8-docstrings
packages, which will install dependent package including pycodestyle
.
After the package will installed, create sample file (/tmp/testcase.py
):
"""Module represent something."""
def main():
print("Main")
if __name__ == "__main__":
main()
While checking the file in regular way (flake8 /tmp/testcase.py
) should be displayed lines below:
stdin:4:1: D103 Missing docstring in public function
The same file will give different result in case of passing it to stdin (flake8 - < /tmp/testcase.py
):
stdin:1:1: D100 Missing docstring in public module
This is because pydocstyle
gets an empty string as a source.