aconrad / pycobertura

A code coverage diff tool for Cobertura reports
MIT License
116 stars 39 forks source link

Per directory stats? #108

Open dothebart opened 3 years ago

dothebart commented 3 years ago

I see that show can print out per file summary. I'd need this per directory - is there already a way to do this?

aconrad commented 3 years ago

Hi @dothebart, pycobertura treats all file paths as strings, so it's currently agnostic of what a file vs. a directory is.

Are you using pycobertura from the command line or as a library?

dothebart commented 3 years ago

I've did first experiments with the CLI. I'm thinking about copying the class TextReporter(Reporter): , keep the stats on the object, and print them out once the path component of filename changes?

aconrad commented 3 years ago

Wondering if Cobertura.files() could take a keyword argument to allow it to list only a subset of files from the report that would match a given pattern. 🤔

Cobertura.files(match="*.py")

# or

Cobertura.files(match="foo/bar/*")

Dunno, food for thought. 😃