-
-
Notifications
You must be signed in to change notification settings - Fork 169
Added "exclude_files" option for pyproject.toml config usage. #635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Added "exclude_files" option for pyproject.toml config usage. #635
Conversation
…onfig option `exclude_files` that allows regex path exclusions Solution to Issue numpy#497
…ion, which should have 0 findings
…tching exclude_files option
…k, to correct parameter order
I think ideally yes so that the hook and the Sphinx-based checking both function similarly. In principle they should use 99% of the same mechanics so hopefully it won't be too hard to add at the Sphinx end... |
…fg test cases for the `exclude_files` option
…iles` 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.
…n_exclude_files` option
…inx option to use `inspect`, and simplified path checking using `__file__`
…ate-if-`numpydoc_validation_checks`-is-not-empty): Mimicing same behaviour as `numpydoc_validation_exclude`
…oc_validation_exclude_files` for Sphinx and `exclude_files` for pyproject.toml
…o properly format
@larsoner Thanks mate. I've figure that out now. I think the implementation is succinct. I currently don't have any projects with a sphinx production (in the process of setting up my first) so it would be good if someone else can see if it behaves as intended. The new test cases work. I've also updated the documentation to mimic I have one concern about using the |
excluder = app.config.numpydoc_validation_files_excluder | ||
module = inspect.getmodule(obj) | ||
try: | ||
path = module.__file__ if module else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly problematic to get global path to module file, rather than relative path to a package root? Perhaps this is fine.
Added an option for a
exclude_files
option in pyproject.toml config that allowsre
regular expression path exclusions.Unfortunately, most yaml tags use
exclude
to refer to files, which perhaps doesn't apply to toml, but we already use theexclude
label to notate object exclusion. I have introducedexclude_files
instead to achieve the same purpose, which is almost processed identically toexclude
except being utilized instead when iterating over therun_hook
filepath list.I'm not familiar with the Sphinx build checking options that
exclude
currently uses. Do I/we need to implement a mapping for this in that location too?Solution to Issue #497