SlatherOrg / slather

Generate test coverage reports for Xcode projects & hook it into CI.
MIT License
1.55k stars 233 forks source link

Include files (opposite of ignore) #544

Open sushant-here opened 9 months ago

sushant-here commented 9 months ago

Im working on a existing app with no unit tests. Im sure lots of people have been in this situation before!

All new functionality is unit tested - but I would like to track it. Overall it shows 3% but if I manually look at just my new files its closer to 100%.

I would like to track code coverage for the files that I have added. Is there any way to specify patterns for what files to include in the coverage report?

Eg only include files that contain ViewModel in their name.

dnedrow commented 5 months ago

@sushant-here Would you expect an "include" option to be exclusive of "ignore". That seems logical to me.

dnedrow commented 5 months ago

@ksuther Should source_files act as an include directive such that ONLY files in the source_files array are run through slather?

As @sushant-here noted, it would be nice to have a feature like this.

E.g.

source_files:
  - **/*ViewModel.swift

This would result in slather only scanning the files that match the glob. I could swear that's how source_files used to act, but now it doesn't seem to do anything.

sushant-here commented 5 months ago

@sushant-here Would you expect an "include" option to be exclusive of "ignore". That seems logical to me.

If a file has been matched by an include wildcard. We should still be able to exclude it with a ignore.