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
If there are two issues that require //nolint directives that have different reasons, it is not possible to disctinguish the reason by having them on separate lines. This should work as directives are supposed to attach to the next token in the source.
Version of golangci-lint
$ golangci-lint --version
golangci-lint has version v1.45.2 built from (unknown, mod sum: "h1:9I3PzkvscJkFAQpTQi5Ga0V4qWdJERajX1UZ7QqkW+I=") on (unknown)
$ golangci-lint cache clean
$ golangci-lint run -v
main.go:5:5: `zombie` is unused (deadcode)
var zombie = "words" // TODO: Stuff explaining why this is important to work on later.
^
or
$ golangci-lint cache clean
$ golangci-lint run -v
main.go:5: main.go:5: Line contains TODO/BUG/FIXME: "TODO: Stuff explaining why this is impor..." (godox)
var zombie = "words" // TODO: Stuff explaining why this is important to work on later.
Depending on the ordering of the lines.
Code example or link to a public repository
package main
//nolint:deadcode,unused // Reasons why this is important to keep here.
//nolint:godox // Reasons why it's silly to complain about TODO notes.
var zombie = "words" // TODO: Stuff explaining why this is important to work on later.
func main() {}
or
package main
//nolint:godox // Reasons why it's silly to complain about TODO notes.
//nolint:deadcode,unused // Reasons why this is important to keep here.
var zombie = "words" // TODO: Stuff explaining why this is important to work on later.
func main() {}
The text was updated successfully, but these errors were encountered:
Currently, the behavior doesn't depend on comments: golangci-lint supports only 1 nolint directive on a section.
As this is the current global behavior, it's difficult to say that is a bug, so I put the label 'enhancement'.
Otherwise, even if I guess that is just an example, I recommend defining a different configuration for godox instead of adding nolint directives for TODOs, ex:
This is not an enhancement, it is a failure to follow the standard directive comment behaviour. Please see https://datatracker.ietf.org/doc/html/rfc9225 for why this is a broken approach to managing issues.
Welcome
Description of the problem
If there are two issues that require
//nolint
directives that have different reasons, it is not possible to disctinguish the reason by having them on separate lines. This should work as directives are supposed to attach to the next token in the source.Version of golangci-lint
Configuration file
Go environment
Verbose output of running
or
Depending on the ordering of the lines.
Code example or link to a public repository
or
The text was updated successfully, but these errors were encountered: