-
Notifications
You must be signed in to change notification settings - Fork 134
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
Exclude generated sources from error-prone #1571
Conversation
Generate changelog in
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thanks for rescuing this! I wanted to make those regexes really specific, because I figured there was a danger of someone defining a class com.palantir.foundry.build.Whatever
and getting it unintentionally excluded - tests definitely worth it
static String excludedPathsRegex() { | ||
// don't want backslashes on windows to break our regex | ||
String separator = File.separator.contains("\\") ? Pattern.quote("\\") : File.separator; | ||
return String.format(".*%s(build|generated_.*[sS]rc|src%sgenerated.*)%s.*", separator, separator, separator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iamdanfox we might be able to remove build
from regex here, or might want to constrain the pattern to avoid falsely matching say com/foo/build/Bar.java
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this feels a bit dangerous. I'd suggest we do something like build.*generated
since almost all code-gen plugins I've seen put source files on a path with a generated
component.
|
Before this PR
As seen in excavator bump PR palantir/tritium#925 , the changes in #1568 do not seem to handle cases that previously were excluded such as
build/metricSchema/generated_src
used bymetric-schema
which is causing the baseline bump excavator on tritium to fail compilation: https://app.circleci.com/pipelines/github/palantir/tritium/906/workflows/7c65b97b-b475-46fc-a1e1-b5a4bf7198a0/jobs/11565After this PR
==COMMIT_MSG==
Exclude generated sources from error-prone
==COMMIT_MSG==
Closes #1570
Possible downsides?
Probably want some additional test cases.