Skip to content

Commit 729e563

Browse files
committed
Update example configs for pre-commit hook in docs.
1 parent 5a4c88b commit 729e563

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

doc/validation.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,20 @@ command line options for this hook:
2222
2323
$ python -m numpydoc.hooks.validate_docstrings --help
2424
25-
Using a config file provides additional customization. Both
26-
``pyproject.toml`` and ``setup.cfg`` are supported; however, if the
27-
project contains both you must use the ``pyproject.toml`` file.
28-
The example below configures the pre-commit hook to ignore three checks
25+
Using a config file provides additional customization. Both ``pyproject.toml``
26+
and ``setup.cfg`` are supported; however, if the project contains both
27+
you must use the ``pyproject.toml`` file. The example below configures
28+
the pre-commit hook to ignore three checks (using the same logic as the
29+
:ref:`validation during Sphinx build <_validation_during_sphinx_build>`)
2930
and specifies exceptions to the checks ``SS05`` (allow docstrings to
3031
start with "Process ", "Assess ", or "Access ") and ``GL08`` (allow
3132
the class/method/function with name "__init__" to not have a docstring).
3233

3334
``pyproject.toml``::
3435

3536
[tool.numpydoc_validation]
36-
ignore = [
37+
checks = [
38+
"all", # run all checks, except the below
3739
"EX01",
3840
"SA01",
3941
"ES01",
@@ -44,7 +46,7 @@ the class/method/function with name "__init__" to not have a docstring).
4446
``setup.cfg``::
4547

4648
[tool:numpydoc_validation]
47-
ignore = EX01,SA01,ES01
49+
checks = all,EX01,SA01,ES01
4850
override_SS05 = ^((Process|Assess|Access) )
4951
override_GL08 = ^(__init__)$
5052

@@ -96,6 +98,8 @@ For an exhaustive validation of the formatting of the docstring, use the
9698
incorrect capitalization, wrong order of the sections, and many other
9799
issues.
98100

101+
.. _validation_during_sphinx_build
102+
99103
Docstring Validation during Sphinx Build
100104
----------------------------------------
101105

0 commit comments

Comments
 (0)