scala code coverage using scct, how to exclude files by regex

905 views Asked by At

using scct in my project there are some files I would like to be excluded

my build file :

object myBuild extends Build {

  lazy val americanNinja1 = Project(id = "American-Ninja", base = file("americanNinja")).settings(ScctPlugin.instrumentSettings: _*)

 //more code .....
}

how can i add setting to the scct to exclude all .html files (for example)

looking at the github project of scct i see that there is a filter option

https://github.com/sqality/scct/blob/master/src/main/scala/com/sqality/scct/CoverageFilter.scala

and there was an issue that was solved for this matter :

https://github.com/mtkopone/scct/issues/60

any idea how to do this ?

Thanks!

2

There are 2 answers

4
sksamuel On

You could take a look at https://github.com/scoverage/sbt-scoverage which is a fork of SCCT and supports exclusions, but it does not support multi project builds at the moment.

0
Rado Buransky On

I have fixed similar problem two days ago, but I had to fork SCCT and SBT-SCCT as well and fix some things. First problem was that SBT-SCCT wasn't passing the "scctExcludePackages" setting to SCCT correctly. Also I have modified SCCT so that it excludes based on package name instead of file name. I know this doesn't solve your issue, but use this as an inspiration and feel free to contribute:

https://github.com/RadoBuransky/sbt-scct/commit/b301a9cb21447c3a531707437b95e5f39e9ce336 https://github.com/RadoBuransky/scct/commit/d6244d54ef00f01f6019d7cf1bd0fd927ce75e08