Skip to content
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

Allow skipping entire directories #503

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bgmeulem
Copy link

@bgmeulem bgmeulem commented Dec 2, 2024

See issue #312

This feature proposal allows skipping entire directories using autoapi_ignore.
Instead of recursing into the directory and then flagging every single file for skipping, it simply does not recurse into the directory.
Tested on a large-scale codebase and works.

Issue

I did encounter one weird edgecase during testing: faulty code is handled differently. I have one file with a handful of "X is not defined" errors that I haven't gotten around to fixing yet. autoapi did not used to complain about these and simply parsed out the docstrings.
With this change, I encountered

Handler <function run_autoapi at 0x7fbae49edc10> for event 'builder-inited' threw an exception (exception: Inference failed for all members of [<Call l.1902 at 0x7fba90784cd0>].)

L1902 points to roughly the second object in the file that is not defined. Both the first and second non-defined objects are inits of different non-existing classes from within a class init. So not only does the error handling change when skipping entire directories, it also appears to be inconsistent (the first undefined object yields no issues). I suppose this error originates from ast? I sadly don't know enough about how ast works to figure out exactly what changes and why skipping directories rather than files in those directories would be different.

I'm also using ast for the skip-member hook, which may also be at the cause. Again, i don't know enough about the order of events during docs building to investigate this further. I am willing to try if someone can direct me a little bit more to potential causes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant