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

Add .gitattributes to work around spotless issue with eol #236

Merged
merged 2 commits into from
Oct 8, 2020

Conversation

dwalluck
Copy link
Contributor

@dwalluck dwalluck commented Oct 7, 2020

@dwalluck dwalluck requested a review from rnc October 7, 2020 19:08
@rnc
Copy link
Contributor

rnc commented Oct 8, 2020

Is spotless still causing an issue for you - I thought you were now on Linux? If this has no affects on Linux I'm fine with this.

@dwalluck
Copy link
Contributor Author

dwalluck commented Oct 8, 2020

Is spotless still causing an issue for you - I thought you were now on Linux? If this has no affects on Linux I'm fine with this.

This was happening while back. I am not sure I knew that it was spotless that was causing it until I saw the same behavior in another repository. That led me to that ticket saying that for some reason spotless will change all of the newlines and for some reason the only way to configure it seems to be through a .gitattributes file which it reads.

@dwalluck
Copy link
Contributor Author

dwalluck commented Oct 8, 2020

Unrelated to this specific issue, this file helps keep eols from changing accidentally. For example, it looks like the gradlew.bat file has an eol of lf even though it's a DOS file which would have crlf. Is this the only Windows file in the codebase? It looks like someone has accidentally changed the eol on the .bat file. I tried "upgrading" the gradle wrapper to the same version, and the new .bat file definitely has crlf, but it has also changed -all zip to -bin zip. Is that OK?

diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 4e9a67a..5028f28 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
-#Mon Apr 29 18:31:13 BST 2019
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

@rnc
Copy link
Contributor

rnc commented Oct 8, 2020

I'd rather keep the wrapper distribution type as all. See https://mrhaki.blogspot.com/2016/09/gradle-goodness-specify-wrapper-version.html

Unrelated to this specific issue, this file helps keep eols from changing accidentally. For example, it looks like the gradlew.bat file has an eol of lf even though it's a DOS file which would have crlf. Is this the only Windows file in the codebase? It looks like someone has accidentally changed the eol on the .bat file. I tried "upgrading" the gradle wrapper to the same version, and the new .bat file definitely has crlf, but it has also changed -all zip to -bin zip. Is that OK?

diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 4e9a67a..5028f28 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
-#Mon Apr 29 18:31:13 BST 2019
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

@dwalluck
Copy link
Contributor Author

dwalluck commented Oct 8, 2020

I'd rather keep the wrapper distribution type as all. See https://mrhaki.blogspot.com/2016/09/gradle-goodness-specify-wrapper-version.html

I figured out how to set it in the build file too. I will submit it as a separate PR I guess it's only tangentially related. See #239.

@dwalluck dwalluck merged commit 3e45c5a into project-ncl:master Oct 8, 2020
@dwalluck dwalluck deleted the git-attributes branch October 8, 2020 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants