golangci-lint/test/testdata/nolintlint.go
Andrew Shannon Brown 306816ec85
Revert "Update nolintlint to fix nolint formatting and remove unused nolint statements (#1573)" (#1584)
This reverts commit aeb98303293570ba682ea933a4e9501a11a3aa99.

There are some cases that nolinter fixer wasn't handling properly or expectedly (#1579, #1580, #1581) so we'll fix those in a new attempt.
2020-12-27 11:49:58 -08:00

14 lines
634 B
Go

//args: -Enolintlint
//config: linters-settings.nolintlint.require-explanation=true
//config: linters-settings.nolintlint.require-specific=true
//config: linters-settings.nolintlint.allowing-leading-space=false
package testdata
import "fmt"
func Foo() {
fmt.Println("not specific") //nolint // ERROR "directive `.*` should mention specific linter such as `//nolint:my-linter`"
fmt.Println("not machine readable") // nolint // ERROR "directive `.*` should be written as `//nolint`"
fmt.Println("extra spaces") // nolint:deadcode // because // ERROR "directive `.*` should not have more than one leading space"
}