Skip to content

Commit

Permalink
Pre-Commit: Docformatter
Browse files Browse the repository at this point in the history
Add [docformatter](https://github.com/PyCQA/docformatter) to
auto-format Function/Class docstrings according to numpy style.
  • Loading branch information
ax3l committed Mar 27, 2023
1 parent bca6994 commit 732de4c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[tool.docformatter]
wrap-summaries = 79
wrap-descriptions = 72
non-strict = false
syntax = "numpy"
black = true

0 comments on commit 732de4c

Please # to comment.