-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
False positive for goimports and gofmt when line ending is CRLF #580
Comments
ok, thank you for information! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I don't think this is a
For travis CI, you solve it with by adding this config to the
Maybe this needs to be added very clearly in the CI documentation section. It has solved 100% of my |
@codyleyhan agreed, I have been using the same settings, this is quite a common problem with vendoring as well. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The fix is from golangci/golangci-lint#580 (comment). Signed-off-by: Kazuyoshi Kato <[email protected]>
Hi,
I noticed that on Windows correctly formatted
.go
files that have CRLF line endings (\r\n
) are reported asFile is not 'goimports'-ed (goimports)
orFile is not 'gofmt'-ed with '-s'
.Applying the
--fix
flag changes the line endings to LF (\n
) and the errors disappear.The false positives however impact automated builds on Windows when files are downloaded from git (see for example https://dev.azure.com/scibonaedoardo/fsutils-go/_build/results?buildId=22).
I understand that this may not be golangci-lint fault (golang/go#16355), but I also wanted to post this for reference.
Thank you for your time.
Version of golangci-lint:
golangci-lint --version
(or git commit if you don't use binary distribution)1.17.1
, installed withgo get github.com/golangci/golangci-lint/cmd/[email protected]
Config file:
cat .golangci.yml
N/A
Go environment:
go version && go env
From my local machine
From Azure
golangci-lint run -v
From my local machine, with an example file
The text was updated successfully, but these errors were encountered: