
1. Rename in a backward compatible way 2. Remove gosec default exclude list because gosec is already disabled by default. 3. Warn about unmatched linter names in //nolint directives 4. Process linter names in //nolint directives in upper case 5. Disable gosec for golangci-lint in .golangci.yml
52 lines
996 B
Go
52 lines
996 B
Go
package testdata
|
|
|
|
var nolintSpecific int // nolint:gofmt
|
|
var nolintSpace int // nolint: gofmt
|
|
var nolintSpaces int //nolint: gofmt, govet
|
|
var nolintAll int // nolint
|
|
var nolintAndAppendix int // nolint // another comment
|
|
|
|
//nolint
|
|
var nolintVarByPrecedingComment int
|
|
|
|
//nolint
|
|
|
|
var dontNolintVarByPrecedingCommentBecauseOfNewLine int
|
|
|
|
var nolintPrecedingVar string //nolint
|
|
var dontNolintVarByPrecedingCommentBecauseOfDifferentColumn int
|
|
|
|
//nolint
|
|
func nolintFuncByPrecedingComment() *string {
|
|
xv := "v"
|
|
return &xv
|
|
}
|
|
|
|
//nolint
|
|
// second line
|
|
func nolintFuncByPrecedingMultilineComment1() *string {
|
|
xv := "v"
|
|
return &xv
|
|
}
|
|
|
|
// first line
|
|
//nolint
|
|
func nolintFuncByPrecedingMultilineComment2() *string {
|
|
xv := "v"
|
|
return &xv
|
|
}
|
|
|
|
// first line
|
|
//nolint
|
|
// third line
|
|
func nolintFuncByPrecedingMultilineComment3() *string {
|
|
xv := "v"
|
|
return &xv
|
|
}
|
|
|
|
var nolintAliasGAS bool //nolint:gas
|
|
|
|
var nolintAliasGosec bool //nolint:gosec
|
|
|
|
var nolintAliasUpperCase int // nolint: GAS
|