Skip to content

Commit

Permalink
fix(coverage): Hack for comma-delimited sources
Browse files Browse the repository at this point in the history
Make BruteForceSequenceMatcher only look at first path

Currently `BruteForceSequenceMatcher` doesn't handle multiple
comma-delimited sources provided in `sonar.sources`. One might specify
multiple comma-delimited source paths via `sonar.sources` in order to
analyze both Scala and JavaScript, for example.

This hack doesn't fix the root issue but makes the behavior a little
more straightforward, as right now it just treats a list of paths as a
single path.
  • Loading branch information
jamiely authored and Jamie Ly committed Mar 22, 2017
1 parent 4f7bdcf commit d79519f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ class BruteForceSequenceMatcher(baseDir: File, sourcePath: String) extends PathS
// mock able helpers that allow us to remove the dependency to the real file system during tests

private[pathcleaner] def initSourceDir(): File = {
val sourceDir = new File(baseDir, sourcePath)
sourceDir
sourcePath.split(",").headOption.map { first =>
val sourceDir = new File(baseDir, first)
sourceDir
}.getOrElse(null)
}

private[pathcleaner] def initFilesMap(): Map[String, Seq[PathSeq]] = {
Expand Down

0 comments on commit d79519f

Please sign in to comment.