-
Notifications
You must be signed in to change notification settings - Fork 455
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
no ability to specifiy default fallback line ending for a repo with core.autocrlf=false #1559
Comments
Hmmm... You can do I wonder if we somehow broke it at somepoint... We still have a test for it, so I don't think so spotless/lib-extra/src/test/java/com/diffplug/spotless/extra/GitAttributesTest.java Lines 93 to 103 in 05b8779
|
basically checkout as is, check in as is, no line normalisation, let the user decide if they want unix line ends in a java source file locally or not. (some files will be forced by attributes to \r\n like in other words - if the users setup is by default not platform native but repository native... git may not have been explicitly told that default is |
My opinion on this is:
There is only one place within the spec that makes sense to me: unix everywhere -> But I'm happy to support any dark corner of the spec that users are willing to write features and unit tests for :) |
with spotless and a cross platform repository it is not easily possible to enable spotless for all (windows) users.
if a Windows user has
core.autocrlf=false
to disable line end conversion so they end up with exactly what the repository has, then spotless falls back to assuming that\r\n
should be used (which is incorrect in this case).you can force
\n
on everyone by adding a.gitattributes
to the repository but this will impact windows users whose default tooling may not cope well with linux line ends.in other words - this fallback should not fallback to
native
but a configurable option in spotbugs (ie Unix if not changed by local git config).If you are submitting a bug, please include the following:
Maven 3.8.6
Java 11.0.15
Windows 11
gradlew spotless[Apply/Check] --stacktrace
If you're just submitting a feature request or question, no need for the above.
The text was updated successfully, but these errors were encountered: