From 9a18b57c7cca54352dac7497a608925691b8d0bd Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 18 Jul 2020 12:28:44 +0300 Subject: [PATCH] Enforce some pydocstyle lints with flake8-docstrings There are some ones we *would* like to enforce, like D401 First line should be in imperative mood but have too many false positives, so I left them out. --- .pre-commit-config.yaml | 4 +++- tox.ini | 12 +++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 817cee604..6068a2d32 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,9 @@ repos: hooks: - id: flake8 language_version: python3 - additional_dependencies: [flake8-typing-imports==1.9.0] + additional_dependencies: + - flake8-typing-imports==1.9.0 + - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports rev: v2.3.0 hooks: diff --git a/tox.ini b/tox.ini index c8165a3c3..30aeb27be 100644 --- a/tox.ini +++ b/tox.ini @@ -154,7 +154,17 @@ commands = python scripts/publish-gh-release-notes.py {posargs} [flake8] max-line-length = 120 -extend-ignore = E203 +extend-ignore = + ; whitespace before ':' + E203 + ; Missing Docstrings + D100,D101,D102,D103,D104,D105,D106,D107 + ; Whitespace Issues + D202,D203,D204,D205,D209,D213 + ; Quotes Issues + D302 + ; Docstring Content Issues + D400,D401,D401,D402,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414,D415,D416,D417 [isort] ; This config mimics what reorder-python-imports does.