Skip to content

Commit c5111bf

Browse files
committed
Modify updated config name to avoid sphinx warning.
1 parent 7d406ac commit c5111bf

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

numpydoc/numpydoc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def mangle_docstrings(app, what, name, obj, options, lines):
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
181-
excluder = app.config.numpydoc_validation_exclude
181+
excluder = app.config.numpydoc_validation_excluder
182182
exclude_from_validation = excluder.search(name) if excluder else False
183183
if not exclude_from_validation:
184184
# TODO: Currently, all validation checks are run and only those
@@ -324,11 +324,12 @@ def update_config(app, config=None):
324324
f"numpydoc_validation_exclude must be a container of strings, "
325325
f"e.g. [{config.numpydoc_validation_exclude!r}]."
326326
)
327+
config.numpydoc_validation_excluder = None
327328
if config.numpydoc_validation_exclude:
328329
exclude_expr = re.compile(
329330
r"|".join(exp for exp in config.numpydoc_validation_exclude)
330331
)
331-
config.numpydoc_validation_exclude = exclude_expr
332+
config.numpydoc_validation_excluder = exclude_expr
332333

333334

334335
# ------------------------------------------------------------------------------

numpydoc/tests/test_numpydoc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ def test_mangle_docstring_validation_warnings(
142142
# Set up config for test
143143
app.config.numpydoc_validate = numpydoc_validate
144144
app.config.numpydoc_validation_checks = numpydoc_validation_checks
145+
# Update configuration
146+
update_config(app)
145147
# Set up logging
146148
status, warning = StringIO(), StringIO()
147149
logging.setup(app, status, warning)

0 commit comments

Comments
 (0)