From 818d124affc9d9df47bca31ae68ba22a3923f53c Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Mon, 27 Mar 2023 09:53:49 -0700 Subject: [PATCH] Pre-Commit: pydocstyle Add [pydocstyle](https://github.com/PyCQA/pydocstyle) to auto-format Function/Class docstrings according to numpy style. Ref.: - http://www.pydocstyle.org - https://github.com/PyCQA/pydocstyle/issues/603 --- .pre-commit-config.yaml | 11 +++++++++++ pyproject.toml | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 pyproject.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0e809a77..7d4e1970 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -88,6 +88,17 @@ repos: # exclude: ^(docs/.*|tools/.*)$ # Alternatively: use autopep8? +# Docstring formatting according to numpy style +- repo: https://github.com/pycqa/pydocstyle + rev: 6.3.0 + hooks: + - id: pydocstyle + additional_dependencies: + - tomli +# args: +# - --select=D101,D2 +# - --ignore=D100,D203,D405 + # Python Formatting - repo: https://github.com/psf/black rev: 23.1.0 # Keep in sync with blacken-docs diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..a13f4f42 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,5 @@ +[tool.pydocstyle] +convention = "numpy" +#inherit = false +#ignore = D100,D203,D405 +#match = .*\.py