-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
flake8 the docstrings? #13813
Comments
I've had good experiences with using flake8-rst-docstrings too. Adding flake8 extensions has been one of my favorite strategies for Procrastination Driven Development (PDD). |
A related possibility would be to add an autoformatter for docstrings (and even reStructuredText files). At the moment, I haven't found a reStructuredText/numpydoc autoformatter that I'm happy enough with to add to pre-commit or CI. I'll probably post what I learn in the future in in PlasmaPy/PlasmaPy#1668 and PlasmaPy/PlasmaPy#1669. Also worth mentioning is pydocstyle. |
Ruff implements a lot of pydocstyle, so this would be very easy (to add, not to fix all the docstrings) |
A Python linter written in Rust? I'll have to check it out. That's way better than my idea for a Python linter written in Fortran! |
Ruff is implementing much of this functionality so we can close this issue. |
Description
Examples in the docstrings should be well formatted.
We can add
flake8-docstrings
to flake8's dependencies in pre-commit to enforce this.Additional context
See https://flake8.pycqa.org/en/latest/user/using-hooks.html#usage-with-the-pre-commit-git-hooks-framework.
There are other flake8 extensions we might enjoy.
The text was updated successfully, but these errors were encountered: