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

fix(lint): set core.autocrlf to input #178

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

ldez
Copy link
Contributor

@ldez ldez commented Nov 1, 2024

My PR #177 proves that the problem on Windows is not intermittent but consistent.
My initial guess was a problem with CRLF (Windows style) and I was right.

The problem is related to the git configuration core.autocrlf, by default, the GitHub Action on Windows uses core.autocrlf=true.
LF is converted to CRLF, and this produces file differences, so formatter like gofmt/gofumpt will report a problem.

Demo:

Related to golangci/golangci-lint#4004 (comment)

Copy link
Member

@aymanbagabas aymanbagabas left a comment

Choose a reason for hiding this comment

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

Oh wow, this is super! @ldez Thank you so much for your help here, and for your open source work. Specifically, golangci-lint and go-acme/lego.

@aymanbagabas aymanbagabas merged commit 3f9f586 into charmbracelet:main Nov 1, 2024
1 check passed
@ldez ldez deleted the fix/lint-windows branch November 1, 2024 17:16
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