coveragepy icon indicating copy to clipboard operation
coveragepy copied to clipboard

Ability to specify "all but" ignore patterns in omit

Open plondino opened this issue 1 year ago • 0 comments

Is there any way to use omit to specify "all files except "?

For example, I have a generated package with some custom code in the __init__.py. The generated code is potentially thousands of lines and dwarfs the actual tested code in terms of a percentage, but I still want to ensure my custom code is tested.

Since omit can only exclude files after source/include, I couldn't figure out a way to do this without listing every single generated file in omit (which can be a lot of files) except for the init.py.

Does it make sense to either respect the order of omit/include, or use an approach like gitignore (using the ! to "reinclude" something, see https://git-scm.com/docs/gitignore#_pattern_format), or support some other pattern matching in the filename?

plondino avatar Mar 10 '23 02:03 plondino