golangci-lint
golangci-lint copied to clipboard
lll: ignore comments containing only URL
trafficstars
As illustrated in the following example, to ignore long URLs the nolint directive should be placed on the top of the comments but this ignores lll on the whole function.
.golangci.yml
linters:
disable-all: true
enable:
- lll
- typecheck
linters-settings:
lll:
line-length: 50
package main
import "fmt"
// main runs the app.
// https://github.com/walle/lll/blob/4438bccd245f7e87a5a69023625f01e7035c05c0/utils.go#L15
//
//nolint:lll
func main() {
fmt.Println("Foo")
}
$ golangci-lint run
$
Fixes #3983
Sometimes in the code you have to leave links to tasks in the tracker or links to discussion of some bugs - to understand why it was done this way.
And often they are long links, it would be cool to be able to skip such cases by default.