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

Update Error Prone -XepExcludedPaths flag to be Windows-compatible #927

Merged
merged 1 commit into from
Dec 24, 2023

Conversation

Stephan202
Copy link
Member

@Stephan202 Stephan202 commented Dec 18, 2023

See #925 (comment): -XepExcludedPaths:\Q${project.build.directory}${file.separator}\E.* doesn't work because Error Prone matches against a path that's derived from a file's URI, which in practice will always contain forward slashes.

Suggested commit message:

Update Error Prone `-XepExcludedPaths` flag to be Windows-compatible (#927)

Prior to these changes the provided pattern would never match on
Windows, as Error Prone matches against file URIs, which in practice
will always contain forward slashes, even on Windows.

Testing:

  1. In Add rewrite-templating annotation processor to also produce OpenRewrite recipes #925 I validated that these changes prevent Error Prone from flagging violations against OpenRewrite-generated recipes when running on Windows.
  2. (Tested locally on Linux:) Violations in non-generated source code are still reported, as validated by running the build after executing git show a0b1f7091ee4f902f4abdcc9649fe0e902669948 -- error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CollectorMutability.java | git apply -R.

Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Copy link
Contributor

@mohamedsamehsalah mohamedsamehsalah left a comment

Choose a reason for hiding this comment

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

🚀

Prior to these changes the provided pattern would never match on
Windows, as Error Prone matches against file URIs, which in practice
will always contain forward slashes, even on Windows.
@rickie rickie force-pushed the sschroevers/fix-window-path-exclusion branch from 1127e14 to 55637a7 Compare December 24, 2023 15:47
@rickie
Copy link
Member

rickie commented Dec 24, 2023

Nice fix! Just rebased, will merge once 🟢 .

Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@Stephan202 Stephan202 added chore A task not related to code (build, formatting, process, ...) and removed bug fix labels Dec 24, 2023
@Stephan202 Stephan202 merged commit 0109632 into master Dec 24, 2023
16 checks passed
@Stephan202 Stephan202 deleted the sschroevers/fix-window-path-exclusion branch December 24, 2023 17:52
@Stephan202
Copy link
Member Author

I updated the label, as this is a build improvement that doesn't impact users :)

@rickie
Copy link
Member

rickie commented Dec 24, 2023

Haha had dinner so didn't do the merging 😬. But yeah makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore A task not related to code (build, formatting, process, ...)
Development

Successfully merging this pull request may close these issues.

3 participants