Skip to content

Commit 55de340

Browse files
committed
Rm redundant numpydoc_validate config param.
1 parent a13705c commit 55de340

File tree

5 files changed

+9
-21
lines changed

5 files changed

+9
-21
lines changed

doc/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
numpydoc_xref_param_type = True
8686
numpydoc_xref_ignore = {'optional', 'type_without_description', 'BadException'}
8787
# Run docstring validation as part of build process
88-
numpydoc_validate = True
8988
numpydoc_validation_checks = {"all", "GL01", "SA04", "RT03"}
9089

9190
# The language for content autogenerated by Sphinx. Refer to documentation

doc/install.rst

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,10 @@ numpydoc_xref_ignore : set or ``"all"``
9696
desired cross reference mappings in ``numpydoc_xref_aliases`` and setting
9797
``numpydoc_xref_ignore="all"`` is more convenient than explicitly listing
9898
terms to ignore in a set.
99-
numpydoc_validate : bool
100-
Whether or not to run docstring validation during the sphinx-build process.
101-
Default is ``False``.
10299
numpydoc_validation_checks : set
103100
The set of validation checks to report during the sphinx build process.
104-
Only has an effect when ``numpydoc_validate = True``.
101+
The default is an empty set, so docstring validation is not run by
102+
default.
105103
If ``"all"`` is in the set, then the results of all of the
106104
:ref:`built-in validation checks <validation_checks>` are reported.
107105
If the set includes ``"all"`` and additional error codes, then all
@@ -118,9 +116,6 @@ numpydoc_validation_checks : set
118116

119117
# Only report warnings for the SA01 and EX01 checks
120118
numpydoc_validation_checks = {"SA01", "EX01"}
121-
122-
The default is an empty set, thus no warnings from docstring validation
123-
are reported.
124119
numpydoc_validation_exclude : set
125120
A container of strings using :py:mod:`re` syntax specifying patterns to
126121
ignore for docstring validation.
@@ -134,8 +129,9 @@ numpydoc_validation_exclude : set
134129
numpydoc_validation_exclude = {r"mypkg\.mymodule\.", r"MyClass\.get$"}
135130

136131
The default is an empty set meaning no objects are excluded from docstring
137-
validation by default.
138-
Only has an effect when ``numpydoc_validate = True``.
132+
validation.
133+
Only has an effect when docstring validation is activated, i.e.
134+
``numpydoc_validation_checks`` is not an empty set.
139135
numpydoc_edit_link : bool
140136
.. deprecated:: 0.7.0
141137

numpydoc/numpydoc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def mangle_docstrings(app, what, name, obj, options, lines):
174174
logger.error('[numpydoc] While processing docstring for %r', name)
175175
raise
176176

177-
if app.config.numpydoc_validate:
177+
if app.config.numpydoc_validation_checks:
178178
# If the user has supplied patterns to ignore via the
179179
# numpydoc_validation_exclude config option, skip validation for
180180
# any objs whose name matches any of the patterns
@@ -277,7 +277,6 @@ def setup(app, get_doc_object_=get_doc_object):
277277
app.add_config_value('numpydoc_xref_param_type', False, True)
278278
app.add_config_value('numpydoc_xref_aliases', dict(), True)
279279
app.add_config_value('numpydoc_xref_ignore', set(), True)
280-
app.add_config_value('numpydoc_validate', False, True)
281280
app.add_config_value('numpydoc_validation_checks', set(), True)
282281
app.add_config_value('numpydoc_validation_exclude', set(), False)
283282

numpydoc/tests/test_numpydoc.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class MockConfig():
2424
numpydoc_edit_link = False
2525
numpydoc_citation_re = '[a-z0-9_.-]+'
2626
numpydoc_attributes_as_param_list = True
27-
numpydoc_validate = False
2827
numpydoc_validation_checks = set()
2928
numpydoc_validation_exclude = set()
3029

@@ -117,30 +116,27 @@ def _function_without_seealso_and_examples():
117116

118117
@pytest.mark.parametrize(
119118
(
120-
'numpydoc_validate',
121119
'numpydoc_validation_checks',
122120
'expected_warn',
123121
'non_warnings',
124122
),
125123
(
126124
# Validation configured off - expect no warnings
127-
(False, set(['SA01', 'EX01']), [], []),
125+
(set(), [], []),
128126
# Validation on with expected warnings
129-
(True, set(['SA01', 'EX01']), ('SA01', 'EX01'), []),
127+
(set(['SA01', 'EX01']), ('SA01', 'EX01'), []),
130128
# Validation on with only one activated check
131-
(True, set(['SA01']), ('SA01',), ('EX01',)),
129+
(set(['SA01']), ('SA01',), ('EX01',)),
132130
),
133131
)
134132
def test_mangle_docstring_validation_warnings(
135133
f,
136-
numpydoc_validate,
137134
numpydoc_validation_checks,
138135
expected_warn,
139136
non_warnings,
140137
):
141138
app = MockApp()
142139
# Set up config for test
143-
app.config.numpydoc_validate = numpydoc_validate
144140
app.config.numpydoc_validation_checks = numpydoc_validation_checks
145141
# Update configuration
146142
update_config(app)
@@ -162,7 +158,6 @@ def function_with_bad_docstring():
162158
"""
163159
This docstring will raise docstring validation warnings."""
164160
app = MockApp()
165-
app.config.numpydoc_validate = True
166161
app.config.numpydoc_validation_checks = {"all"}
167162
app.config.numpydoc_validation_exclude = [r"_bad_"]
168163
# Call update_config to construct regexp from config value

numpydoc/tests/tinybuild/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@
2222
highlight_language = 'python3'
2323
numpydoc_class_members_toctree = False
2424
numpydoc_xref_param_type = True
25-
numpydoc_validate = True

0 commit comments

Comments
 (0)