Skip to content

Commit

Permalink
Add numpydoc pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar committed Feb 27, 2024
1 parent 6be44ef commit c67266a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ repos:
docs/.*|
)$
entry: pylint

- repo: https://github.com/numpy/numpydoc
rev: v1.6.0
hooks:
- id: numpydoc-validation
files: ^janus_core/
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
"sphinxcontrib.contentui",
]

numpydoc_validation_checks = {"all", "EX01", "SA01", "ES01"}
numpydoc_validation_exclude = {r"\.__weakref__$", r"\.__repr__$"}

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"ase": ("https://wiki.fysik.dtu.dk/ase/", None),
}

numpydoc_validation_checks = {"all", "EX01", "SA01", "ES01"}
numpydoc_validation_exclude = {r"\.__weakref__$", r"\.__repr__$"}

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,17 @@ source=["janus_core"]
line_length = 120
force_sort_within_sections = true
sections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'LOCALFOLDER']

[tool.numpydoc_validation]
# report on all checks, except the below
checks = [
"all",
"EX01",
"SA01",
"ES01",
]
# Don't report on objects that match any of these regex
exclude = [
".__weakref__$",
".__repr__$",
]

0 comments on commit c67266a

Please sign in to comment.