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 support for git's core.autocrlf #1114

Merged
merged 4 commits into from Feb 1, 2022
Merged

Add support for git's core.autocrlf #1114

merged 4 commits into from Feb 1, 2022

Conversation

rweisleder
Copy link
Contributor

Among others, Spotless uses .gitattributes to determine the line ending of files. In the absence of this file, Spotless falls back to core.eol from git config.

Before this commit, Spotless ignored the core.autocrlf property. Git behaves in such a way that it ignores core.eol if core.autocrlf is set to true or input. This commit aligns the behavior of Spotless to favor core.autocrlf over core.eol.

If merged, this fixes #540.

Among others, Spotless uses .gitattributes to determine the line ending
of files. In the absence of this file, Spotless falls back to `core.eol`
from git config.

Before this commit, Spotless ignored the `core.autocrlf` property. Git
behaves in such a way that it ignores `core.eol` if `core.autocrlf` is
set to `true` or `input`. This commit aligns the behavior of Spotless to
favor `core.autocrlf` over `core.eol`.

Fixes #540

Signed-off-by: Roland Weisleder <roland.weisleder@googlemail.com>
Signed-off-by: Roland Weisleder <roland.weisleder@googlemail.com>
Copy link
Member

@nedtwigg nedtwigg left a comment

Choose a reason for hiding this comment

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

Main thing is that you need to run spotlessApply so that CI passes. But also the code could be a tad more explicit.

Signed-off-by: Roland Weisleder <roland.weisleder@googlemail.com>
Signed-off-by: Roland Weisleder <roland.weisleder@googlemail.com>
Copy link
Member

@nedtwigg nedtwigg left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@nedtwigg nedtwigg merged commit 154b93c into diffplug:main Feb 1, 2022
@nedtwigg
Copy link
Member

nedtwigg commented Feb 1, 2022

Published in plugin-gradle 6.2.1 and plugin-maven 2.20.1.

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.

DiffPlug supports git core.eol, but does not support core.autocrlf
2 participants