Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Unsanitized regex breaking errorprone on windows paths #1045

Merged
merged 6 commits into from
Nov 15, 2019

Conversation

dansanduleac
Copy link
Contributor

Before this PR

Errorprone was breaking due to an unsatinized regex exclusion when using windows paths.
https://ci.appveyor.com/project/CRogers/gradle-conjure/builds/28845076

Caused by: java.util.regex.PatternSyntaxException: Unknown character property name {r} near index 4
C:\projects\gradle-conjure\gradle-conjure-api/(build|src/generated.*)/.*
^
at com.google.errorprone.ErrorProneOptions.processArgs(ErrorProneOptions.java:428)
at com.google.errorprone.ErrorProneOptions.processArgs(ErrorProneOptions.java:448)
at com.google.errorprone.ErrorProneJavacPlugin.init(ErrorProneJavacPlugin.java:45)

After this PR

==COMMIT_MSG==
Fix using errorprone when running under Windows.
==COMMIT_MSG==

Possible downsides?

Copy link
Contributor

@carterkozak carterkozak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Dan

@@ -186,7 +187,7 @@ private static void configureErrorProneOptions(
errorProneOptions.setEnabled(true);
errorProneOptions.setDisableWarningsInGeneratedCode(true);
errorProneOptions.setExcludedPaths(
String.format("%s/(build|src/generated.*)/.*", project.getProjectDir().getPath()));
String.format("%s/(build|src/generated.*)/.*", Pattern.quote(project.getProjectDir().getPath())));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, this may produce a mix of forward and back slashes, but the jvm should handle that fine (assuming jre 1.5+!)

@iamdanfox iamdanfox changed the title Fix: Unsatinized regex breaking errorprone on windows paths Fix: Unsanitized regex breaking errorprone on windows paths Nov 15, 2019
@bulldozer-bot bulldozer-bot bot merged commit 42905a1 into develop Nov 15, 2019
@bulldozer-bot bulldozer-bot bot deleted the ds/unbreak-errorprone-windows branch November 15, 2019 17:09
@svc-autorelease
Copy link
Collaborator

Released 2.31.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants