-
Notifications
You must be signed in to change notification settings - Fork 640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable flake-docstrings to check for pep257 #621
Conversation
.pre-commit-config.yaml
Outdated
@@ -5,3 +5,5 @@ repos: | |||
hooks: | |||
- id: flake8 | |||
language_version: python3 | |||
additional_dependencies: | |||
- flake8-docstrings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- flake8-docstrings | |
- flake8-docstrings |
.pre-commit-config.yaml
Outdated
@@ -5,3 +5,5 @@ repos: | |||
hooks: | |||
- id: flake8 | |||
language_version: python3 | |||
additional_dependencies: | |||
- flake8-docstrings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind integrating pydocstyle
too? http://www.pydocstyle.org/en/latest/usage.html#usage-with-the-pre-commit-git-hooks-framework
- flake8-docstrings | |
- flake8-docstrings | |
- repo: https://github.com/pycqa/pydocstyle | |
rev: 4.0.1 | |
hooks: | |
- id: pydocstyle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flake8-docstrings is calling pydocstyle without the need to setup a new hook, not something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd argue that it's more illustrative as a separate check.
D104 # D104 Missing docstring in public package | ||
D105 # D105 Missing docstring in magic method | ||
D107 # D107 Missing docstring in __init__ | ||
# W503 is incompatible with W504 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's preferable to have binary operators in the beginning of next lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not against but the W504/W504 should be addressed in a separate PR due to its own complexity. The only reason picked one is because it needed only 2 minor changes and the other one would have needed >10-15 and not simple, some of them being hideous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, please make a separate issue for this then.
@webknjaz My impression is that we should disable building docs with py38 as is currently broken, I raised sphinx-doc/sphinx#6803 and I doubt is had anything to do with my change. I got the same error locally as on CI. |
@ssbarnea that is correct. Python 3.8 under macOS specifically. But I haven't had time to figure out an elegant way to do this. |
Ideally, we need a way to apply |
Enables checking of docstrings in order to assure compliance with PEP257. Because the codebase was never checked for this we are forced to disable some of the rules and address them in follow-ups. This will ease code reviews and avoid having too wide changes. Fixes: E126 continuation line over-indented for hanging indent E123 closing bracket does not match indentation of opening bracket's line D300 Use """triple double quotes""" D400 First line should end with a period W503 line break before binary operator Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Enables checking of docstrings in order to assure compliance with
PEP257.
Because the codebase was never checked for this we are forced to disable
some of the rules and address them in follow-ups. This will ease code
reviews and avoid having too wide changes.
Signed-off-by: Sorin Sbarnea ssbarnea@redhat.com