Skip to content

Commit 0c20e87

Browse files
committed
Remove ignore comment logic from hook now that it is in validate().
1 parent 14ab50f commit 0c20e87

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

numpydoc/hooks/validate_docstrings.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,14 @@ class DocstringVisitor(ast.NodeVisitor):
133133
The absolute or relative path to the file to inspect.
134134
config : dict
135135
Configuration options for reviewing flagged issues.
136-
numpydoc_ignore_comments : dict
137-
A mapping of line number to checks to ignore.
138-
Derived from comments in the source code.
139136
"""
140137

141138
def __init__(
142139
self,
143140
filepath: str,
144141
config: dict,
145-
numpydoc_ignore_comments: dict,
146142
) -> None:
147143
self.config: dict = config
148-
self.numpydoc_ignore_comments = numpydoc_ignore_comments
149144
self.filepath: str = filepath
150145
self.module_name: str = Path(self.filepath).stem
151146
self.stack: list[str] = []
@@ -178,12 +173,6 @@ def _ignore_issue(self, node: ast.AST, check: str) -> bool:
178173
except KeyError:
179174
pass
180175

181-
try:
182-
if check in self.numpydoc_ignore_comments[getattr(node, "lineno", 1)]:
183-
return True
184-
except KeyError:
185-
pass
186-
187176
return False
188177

189178
def _get_numpydoc_issues(self, node: ast.AST) -> None:
@@ -346,11 +335,7 @@ def process_file(filepath: os.PathLike, config: dict) -> "list[list[str]]":
346335
with open(filepath) as file:
347336
module_node = ast.parse(file.read(), filepath)
348337

349-
docstring_visitor = DocstringVisitor(
350-
filepath=str(filepath),
351-
config=config,
352-
numpydoc_ignore_comments=validate.extract_ignore_validation_comments(filepath),
353-
)
338+
docstring_visitor = DocstringVisitor(filepath=str(filepath), config=config)
354339
docstring_visitor.visit(module_node)
355340

356341
return docstring_visitor.findings

0 commit comments

Comments
 (0)