@@ -182,14 +182,6 @@ def _ignore_issue(self, node: ast.AST, check: str) -> bool:
182
182
return True
183
183
184
184
if self .config ["overrides" ]:
185
- try :
186
- if check == "GL08" :
187
- pattern = self .config ["overrides" ].get ("GL08" )
188
- if pattern and re .match (pattern , node .name ):
189
- return True
190
- except AttributeError : # ast.Module nodes don't have a name
191
- pass
192
-
193
185
if check == "SS05" :
194
186
pattern = self .config ["overrides" ].get ("SS05" )
195
187
if pattern and re .match (pattern , ast .get_docstring (node )) is not None :
@@ -278,8 +270,15 @@ def parse_config(dir_path: os.PathLike = None) -> dict:
278
270
pyproject_toml = tomllib .load (toml_file )
279
271
config = pyproject_toml .get ("tool" , {}).get ("numpydoc_validation" , {})
280
272
options ["checks" ] = set (config .get ("checks" , options ["checks" ]))
281
- options ["exclude" ] = set (config .get ("exclude" , options ["exclude" ]))
282
- for check in ["SS05" , "GL08" ]:
273
+
274
+ global_exclusions = config .get ("exclude" , options ["exclude" ])
275
+ options ["exclude" ] = set (
276
+ global_exclusions
277
+ if isinstance (global_exclusions , list )
278
+ else [global_exclusions ]
279
+ )
280
+
281
+ for check in ["SS05" ]:
283
282
regex = config .get (f"override_{ check } " )
284
283
if regex :
285
284
options ["overrides" ][check ] = re .compile (regex )
@@ -312,12 +311,6 @@ def parse_config(dir_path: os.PathLike = None) -> dict:
312
311
)
313
312
except configparser .NoOptionError :
314
313
pass
315
- try :
316
- options ["overrides" ]["GL08" ] = re .compile (
317
- config .get (numpydoc_validation_config_section , "override_GL08" )
318
- )
319
- except configparser .NoOptionError :
320
- pass
321
314
except configparser .NoSectionError :
322
315
pass
323
316
0 commit comments