-
Notifications
You must be signed in to change notification settings - Fork 462
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
Investigate git-diff windows line ending issues in Spotless 7.0+ #2404
Comments
I bet it is related to line endings. Could be that somebody's local git config is messed up, could be a bug in JGit or Spotless's integration with it is. We did make a change around how the system .gitconfig gets loaded by Spotless. The PR you linked is a very useful potential reproducer... I don't have time to dig in deeply right now, but my first thoughts are
|
Just trying to find some other examples. This run was from a dependabot dependency update: https://github.com/wiremock/wiremock/actions/runs/12781384145 You can see that the latest run passed all the checks (java 11 & 17 across all OS's). What is interesting is that the latest run was the second run because the first run failed: https://github.com/wiremock/wiremock/actions/runs/12781384145/attempts/1 The first run failed with the following errors (two jobs failed - both java 17 on windows):
So it isn't always consistent between multiple runs of the same PR. Once we got all the jobs to pass on that second run, we merged the PR into main. The build and test on the main branch then failed but only one of the jobs failed that time (still one of the java 17 on windows): https://github.com/wiremock/wiremock/actions/runs/12791234461 The error on the main build was:
|
When we updated to `7.x.x` we started having issues where files that hadn't been changed were reporting headers that needed updating. This has been reported here: diffplug/spotless#2404
Discussed in #2403
Originally posted by leeturner January 17, 2025
Hi
We have used spotless for quite a while now on the WireMock project. We use it to format files in the project and apply a license header (with a year or year range) to source files that are new or have changed.
We have recently started to see builds fail due to spotless thinking some of our java files need the license header updated to have a
2025
year in the header. The strange thing is that the files that it is failing on haven't changed. I have even see themain
build fail when the branch I just merged all passed. We are seeing the failures on our Windows java 17 builds (we build on java 11 and java 17 across mac os, ubuntu and windows)You can see in this PR that only one file has changed but the build is failing. The failure is:
We have updated to the latest spotless recently (
id 'com.diffplug.spotless' version '7.0.2'
) but I haven't yet correlated whether the issues started at the same time or not.We use gradle for our builds with the following config:
Is anyone else experiencing similar issues?
The text was updated successfully, but these errors were encountered: