Skip to content

Commit 506f7f5

Browse files
committed
Check for exclusion before running checks.
1 parent d17ad65 commit 506f7f5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

numpydoc/hooks/validate_docstrings.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,6 @@ def _ignore_issue(self, node: ast.AST, check: str) -> bool:
176176
if check not in self.config["checks"]:
177177
return True
178178

179-
if self.config["exclude"] and re.search(
180-
self.config["exclude"], ".".join(self.stack)
181-
):
182-
return True
183-
184179
if self.config["overrides"]:
185180
try:
186181
pattern = self.config["overrides"][check]
@@ -233,7 +228,13 @@ def visit(self, node: ast.AST) -> None:
233228
self.stack.append(
234229
self.module_name if isinstance(node, ast.Module) else node.name
235230
)
236-
self._get_numpydoc_issues(node)
231+
232+
if not (
233+
self.config["exclude"]
234+
and re.search(self.config["exclude"], ".".join(self.stack))
235+
):
236+
self._get_numpydoc_issues(node)
237+
237238
self.generic_visit(node)
238239
_ = self.stack.pop()
239240

0 commit comments

Comments
 (0)