You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that gofmt can now conflict with nolintlint. For example, I have this code:
//nolint:maintidxfuncsomething() { ... }
When I run golangci-lint run the gofmt linter complains and says the file is not formatted properly.
filename:line: File is not `gofmt`-ed with `-s` (gofmt)
//nolint: maintidx
If I fix it (using --fix or manually), and run again, I get
filename:line: directive `// nolint: maintidx` should be written without leading space as `//nolint: maintidx` (nolintlint)
// nolint: maintidx
I have other //nolint: directives that are not impacted. It seems to be only this one, because it is on a function definition instead of in a function block. I think gofmt is considering it a godoc comment (even though the function is not exported).
Version of golangci-lint
$ golangci-lint --version
# Paste output here
Configuration file
$ cat .golangci.yml
# paste output here
Go environment
golangci-lint v1.48.0
golang v1.18.1
Verbose output of running
$ golangci-lint cache clean
$ golangci-lint run -v
# paste output here
Welcome
Description of the problem
I just upgraded to golangci-lint v1.48.0.
It seems that
gofmt
can now conflict withnolintlint
. For example, I have this code:When I run
golangci-lint run
thegofmt
linter complains and says the file is not formatted properly.If I fix it (using
--fix
or manually), and run again, I getI have other
//nolint:
directives that are not impacted. It seems to be only this one, because it is on a function definition instead of in a function block. I thinkgofmt
is considering it a godoc comment (even though the function is not exported).Version of golangci-lint
Configuration file
Go environment
Verbose output of running
Code example or link to a public repository
https://github.com/gotestyourself/gotest.tools/blob/fac3030b84c98b640417ebd23001567d5f3501f7/assert/cmd/gty-migrate-from-testify/migrate.go#L144-L145
The text was updated successfully, but these errors were encountered: