Skip to content

Commit

Permalink
Set explicit line endings for all *.java files
Browse files Browse the repository at this point in the history
Commit 5b250e2 introduced the Spotless plugin to our build process.
From this commit on I was not able to run `gradlew build` on my Windows
machine. Spotless failed because it expected all *.java files to have
the CRLF line endings (system default), but due to Git's
core.autocrlf=false these files had LF line endings.

Spotless uses by default the Git settings to determine the expected line
endings for the checked files. Instead of configure Spotless to use an
explicit line ending, their recommendation is to set them via the
.gitattributes file. [1]

[1] https://github.com/diffplug/spotless/tree/main/plugin-gradle#line-endings-and-encodings-invisible-stuff

Signed-off-by: Roland Weisleder <roland.weisleder@googlemail.com>
  • Loading branch information
rweisleder committed Sep 25, 2020
1 parent 17a0747 commit 3396ee3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.java text eol=lf

0 comments on commit 3396ee3

Please sign in to comment.