diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0e809a77..593244d7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -88,6 +88,13 @@ repos: # exclude: ^(docs/.*|tools/.*)$ # Alternatively: use autopep8? +# Docstring formatting according to numpy style +- repo: https://github.com/PyCQA/docformatter + rev: v1.5.1 + hooks: + - id: docformatter + args: [--in-place --config ./pyproject.toml] + # 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..24959604 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[tool.docformatter] +wrap-summaries = 79 +wrap-descriptions = 72 +non-strict = false +syntax = "numpy" +black = true