Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add target to validate docstrings with numpydoc #86

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ help:
@echo " check run code style and quality checks"
@echo " build build source and wheel distributions"
@echo " clean clean up build and generated files"
@echo " numpydoc validate docstrings using numpydoc"
@echo ""

build:
Expand Down Expand Up @@ -52,6 +53,10 @@ check-format:
check-style:
flake8 $(CHECK_STYLE)

numpydoc:
# With numpydoc>=1.8.0 this line could be replaced by `numpydoc lint`
python -m numpydoc.hooks.validate_docstrings $(wildcard ${PROJECT}/**/*.py)

clean:
find . -name "*.pyc" -exec rm -v {} \;
find . -name "*.orig" -exec rm -v {} \;
Expand Down
17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,20 @@ notice = '''
#
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#'''

# Validate docstrings using numpydoc
[tool.numpydoc_validation]
checks = [
"all", # report on all checks, except the below
"EX01",
"SA01",
"SS03",
"RT02",
"ES01", # no extended summary
]
exclude = [ # don't report on objects that match any of these regex
'\.undocumented_method$',
'\.__repr__$',
'_version',
'test_[a-z_]*', # exclude all tests
]
Loading