-
-
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
v1.48: nolint
default config conlicts with go fmt
#3098
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
nolintlint
default config conlicts with go fmt
nolint
default config conlicts with go fmt
Hello, Due to a change of So the option The syntax of directives is: If you do that your IDE or go fmt will format the directive as a directive and it will not add extra space. Related to: |
Noted, thank you |
With recent changes `gofmt` [1] started reformatting godoc comments. This causes a problem wherein it reformats `//nolint: staticcheck` to `// nolint: staticcheck`. But it does ignore directives [2]. So let's change all our nolint to directive format. This avoids the conflict with `gofmt`. This fix was done by running: `grep -r --include="*.go" -E "//nolint: .*" -l | xargs sed -i 's/nolint: stylecheck/nolint:stylecheck/g'` as such, we can skip it from review. [1]: golangci/golangci-lint#1658 (comment) [2]: golangci/golangci-lint#3098 (comment)
Welcome
Description of the problem
Latest (v1.48) nolintlint default config has a conflict with 1.19 gofmt.
After #3002
nolintlint
complains about leading spaces in//nolint
commentsby default and the
gofmt
command re-adds the leading space.Version of golangci-lint
Configuration file
Go environment
Verbose output of running
Code example or link to a public repository
// nolint
The text was updated successfully, but these errors were encountered: