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 ddef5ff
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ 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 ddef5ff

Please sign in to comment.