3

I would like to exclude a few directories form error prone. I was trying to use a XepExcludedPaths flag but it seems that it works only for the one path which is a regular expresion of excluded location.

options.errorprone.errorproneArgs.add("-XepExcludedPaths:.*/legacy/model/.*")

works

options.errorprone.errorproneArgs.add("-XepExcludedPaths:.*/new/model/.*,.*/build/.*")

doesn't

Is it possible? I used wrong separator?

tomasz-mer
  • 3,753
  • 10
  • 50
  • 69

1 Answers1

2

It's a single regular expression (literally compiled using Pattern.compile), so use a pipe instead of a comma:

options.errorprone.errorproneArgs.add("-XepExcludedPaths:(.*/new/model/.*|.*/build/.*)")

or

options.errorprone.errorproneArgs.add("-XepExcludedPaths:.*/(new/model|build)/.*")
Andy Turner
  • 137,514
  • 11
  • 162
  • 243