golangci-lint icon indicating copy to clipboard operation
golangci-lint copied to clipboard

lll: ignore comments containing only URL

Open ldez opened this issue 2 years ago • 1 comments
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

ldez avatar Aug 03 '23 07:08 ldez

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.

batazor avatar Nov 29 '23 19:11 batazor