Commit bad5c0b
authored
Added "exclude_files" option for pyproject.toml config usage. (#635)
* feat(numpydoc/hooks/validate_docstrings.py): Added a pyproject.toml config option `exclude_files` that allows regex path exclusions
Solution to Issue #497
* fix(test_validate_hook.py): Corrected test for exclude_files toml option, which should have 0 findings
* refactor(test_validate_hook.py): Added extra testcase to verify no-matching exclude_files option
* refactor(test_validate_hook.py): Modified toml exclude_files test mark, to correct parameter order
* refactor(test_validate_hook.py): Change string type
* test(test_validate_hook.py): Added correct pyproject.toml and setup.cfg test cases for the `exclude_files` option
* feat(numpydoc.py): Added config option `numpydoc_validation_exclude_files` for Sphinx plugin
Uses very similar regex processing to `numpydoc_validation_exclude` but instead applies to a module check before any numpydoc validation is performed.
* fix(numpydoc.py): Corrected module path check for `numpydoc_validation_exclude_files` option
* refactor(numpydoc.py): Changed `numpydoc_validation_exclue_files` sphinx option to use `inspect`, and simplified path checking using `__file__`
* fix(Modified-`numpydoc_validation_exclude_files`-option-to-only-activate-if-`numpydoc_validation_checks`-is-not-empty): Mimicing same behaviour as `numpydoc_validation_exclude`
* docs(validation.rst,-install.rst): Added docs for new feature `numpydoc_validation_exclude_files` for Sphinx and `exclude_files` for pyproject.toml
* docs(validation.rst,-install.rst): Fixed indentation and linebreaks to properly format
* chore(numpydoc.py): use package-relative filename instead of absolute.
* docs(validation.rst,-install.rst): indicate relative path not absolute path for `exclude_files` options1 parent 8c66165 commit bad5c0b
File tree
7 files changed
+229
-8
lines changed- doc
- numpydoc
- hooks
- tests
- hooks
7 files changed
+229
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
142 | 154 | | |
143 | 155 | | |
144 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
60 | 68 | | |
61 | 69 | | |
62 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
277 | 282 | | |
278 | 283 | | |
279 | 284 | | |
| |||
306 | 311 | | |
307 | 312 | | |
308 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
309 | 321 | | |
310 | 322 | | |
311 | 323 | | |
| |||
332 | 344 | | |
333 | 345 | | |
334 | 346 | | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
335 | 357 | | |
336 | 358 | | |
337 | 359 | | |
| |||
341 | 363 | | |
342 | 364 | | |
343 | 365 | | |
| 366 | + | |
344 | 367 | | |
345 | 368 | | |
346 | 369 | | |
| |||
395 | 418 | | |
396 | 419 | | |
397 | 420 | | |
| 421 | + | |
398 | 422 | | |
399 | 423 | | |
400 | 424 | | |
| 425 | + | |
| 426 | + | |
401 | 427 | | |
402 | 428 | | |
403 | 429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| |||
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | | - | |
| 59 | + | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
| |||
114 | 118 | | |
115 | 119 | | |
116 | 120 | | |
117 | | - | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
| |||
141 | 145 | | |
142 | 146 | | |
143 | 147 | | |
144 | | - | |
| 148 | + | |
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
| |||
161 | 165 | | |
162 | 166 | | |
163 | 167 | | |
164 | | - | |
| 168 | + | |
165 | 169 | | |
166 | 170 | | |
167 | 171 | | |
| |||
190 | 194 | | |
191 | 195 | | |
192 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
193 | 229 | | |
194 | 230 | | |
195 | 231 | | |
| |||
239 | 275 | | |
240 | 276 | | |
241 | 277 | | |
242 | | - | |
| 278 | + | |
243 | 279 | | |
244 | 280 | | |
245 | 281 | | |
| |||
273 | 309 | | |
274 | 310 | | |
275 | 311 | | |
276 | | - | |
| 312 | + | |
277 | 313 | | |
278 | 314 | | |
279 | 315 | | |
| |||
299 | 335 | | |
300 | 336 | | |
301 | 337 | | |
| 338 | + | |
302 | 339 | | |
303 | 340 | | |
304 | 341 | | |
| |||
309 | 346 | | |
310 | 347 | | |
311 | 348 | | |
312 | | - | |
| 349 | + | |
313 | 350 | | |
314 | 351 | | |
315 | 352 | | |
| |||
342 | 379 | | |
343 | 380 | | |
344 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
345 | 397 | | |
346 | 398 | | |
347 | 399 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1593 | 1593 | | |
1594 | 1594 | | |
1595 | 1595 | | |
| 1596 | + | |
1596 | 1597 | | |
1597 | 1598 | | |
1598 | 1599 | | |
| |||
0 commit comments