@@ -133,19 +133,14 @@ class DocstringVisitor(ast.NodeVisitor):
133
133
The absolute or relative path to the file to inspect.
134
134
config : dict
135
135
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.
139
136
"""
140
137
141
138
def __init__ (
142
139
self ,
143
140
filepath : str ,
144
141
config : dict ,
145
- numpydoc_ignore_comments : dict ,
146
142
) -> None :
147
143
self .config : dict = config
148
- self .numpydoc_ignore_comments = numpydoc_ignore_comments
149
144
self .filepath : str = filepath
150
145
self .module_name : str = Path (self .filepath ).stem
151
146
self .stack : list [str ] = []
@@ -178,12 +173,6 @@ def _ignore_issue(self, node: ast.AST, check: str) -> bool:
178
173
except KeyError :
179
174
pass
180
175
181
- try :
182
- if check in self .numpydoc_ignore_comments [getattr (node , "lineno" , 1 )]:
183
- return True
184
- except KeyError :
185
- pass
186
-
187
176
return False
188
177
189
178
def _get_numpydoc_issues (self , node : ast .AST ) -> None :
@@ -346,11 +335,7 @@ def process_file(filepath: os.PathLike, config: dict) -> "list[list[str]]":
346
335
with open (filepath ) as file :
347
336
module_node = ast .parse (file .read (), filepath )
348
337
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 )
354
339
docstring_visitor .visit (module_node )
355
340
356
341
return docstring_visitor .findings
0 commit comments