Skip to content

Commit

Permalink
use the right path separator
Browse files Browse the repository at this point in the history
  • Loading branch information
dansanduleac committed Nov 15, 2019
1 parent 02c64a7 commit 4f43c3b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.palantir.baseline.extensions.BaselineErrorProneExtension;
import com.palantir.baseline.tasks.CompileRefasterTask;
import java.io.File;
import java.nio.file.Paths;
import java.util.AbstractList;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -186,8 +187,10 @@ private static void configureErrorProneOptions(

errorProneOptions.setEnabled(true);
errorProneOptions.setDisableWarningsInGeneratedCode(true);
String projectPath = project.getProjectDir().getPath();
String separator = Paths.get(projectPath).getFileSystem().getSeparator();

This comment has been minimized.

Copy link
@carterkozak

carterkozak Nov 15, 2019

Contributor

Oh, I think this needs to be escaped, otherwise it will escape our parens!

errorProneOptions.setExcludedPaths(
String.format("%s/(build|src/generated.*)/.*", Pattern.quote(project.getProjectDir().getPath())));
String.format("%s%s(build|src/generated.*)%s.*", separator, Pattern.quote(projectPath), separator));
errorProneOptions.check("UnusedVariable", CheckSeverity.OFF);
errorProneOptions.check("EqualsHashCode", CheckSeverity.ERROR);
errorProneOptions.check("EqualsIncompatibleType", CheckSeverity.ERROR);
Expand Down

0 comments on commit 4f43c3b

Please sign in to comment.