Skip to content

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>
@rweisleder rweisleder requested a review from nedtwigg February 1, 2022 20:10
@nedtwigg nedtwigg enabled auto-merge February 1, 2022 20:49
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