sphinx-autobuild icon indicating copy to clipboard operation
sphinx-autobuild copied to clipboard

Support recursive ** globs in --ignore

Open asmeurer opened this issue 2 years ago • 3 comments

Description / Summary

Currently the --ignore flag supports globs, but doesn't support recursive **-style globs. This makes it hard to ignore directories generated by autosummary.

Value / benefit

I have to come up with a regular expression to emulate this, which is annoying.

Implementation details

I looked at the implementation and it wasn't straightforward to add because the way it is currently implemented it uses fnmatch, and for whatever reason, recursive globs are not supported by fnmatch. They are only supported by glob, which reads the filesystem, but the current implementation uses a function that doesn't read the file system, presumably to be easier to test. Presumably the only reasonable fix here is to use some external fnmatch module that supports recursive globbing (I don't know of one, but presumably something like it exists), or to somehow automatically convert a recursive glob into a regex.

Tasks to complete

No response

asmeurer avatar Dec 03 '21 02:12 asmeurer