dev: use directives instead of comments for tests (#2978)
This commit is contained in:
parent
0abb298136
commit
27f921fa14
@ -629,12 +629,12 @@ type WSLSettings struct {
|
|||||||
// CustomLinterSettings encapsulates the meta-data of a private linter.
|
// CustomLinterSettings encapsulates the meta-data of a private linter.
|
||||||
// For example, a private linter may be added to the golangci config file as shown below.
|
// For example, a private linter may be added to the golangci config file as shown below.
|
||||||
//
|
//
|
||||||
// linters-settings:
|
// linters-settings:
|
||||||
// custom:
|
// custom:
|
||||||
// example:
|
// example:
|
||||||
// path: /example.so
|
// path: /example.so
|
||||||
// description: The description of the linter
|
// description: The description of the linter
|
||||||
// original-url: github.com/golangci/example-linter
|
// original-url: github.com/golangci/example-linter
|
||||||
type CustomLinterSettings struct {
|
type CustomLinterSettings struct {
|
||||||
// Path to a plugin *.so file that implements the private linter.
|
// Path to a plugin *.so file that implements the private linter.
|
||||||
Path string
|
Path string
|
||||||
|
@ -310,7 +310,7 @@ index 2c9f78d..c0d5791 100644
|
|||||||
--- a/gofmt.go
|
--- a/gofmt.go
|
||||||
+++ b/gofmt.go
|
+++ b/gofmt.go
|
||||||
@@ -1,9 +1,9 @@
|
@@ -1,9 +1,9 @@
|
||||||
//args: -Egofmt
|
//golangcitest:args -Egofmt
|
||||||
package p
|
package p
|
||||||
|
|
||||||
- func gofmt(a, b int) int {
|
- func gofmt(a, b int) int {
|
||||||
|
@ -34,6 +34,7 @@ type jsonObject struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewRevive returns a new Revive linter.
|
// NewRevive returns a new Revive linter.
|
||||||
|
//
|
||||||
//nolint:dupl
|
//nolint:dupl
|
||||||
func NewRevive(settings *config.ReviveSettings) *goanalysis.Linter {
|
func NewRevive(settings *config.ReviveSettings) *goanalysis.Linter {
|
||||||
var mu sync.Mutex
|
var mu sync.Mutex
|
||||||
|
@ -84,6 +84,7 @@ type Node struct {
|
|||||||
// Visit method is invoked for each node encountered by Walk.
|
// Visit method is invoked for each node encountered by Walk.
|
||||||
// If the result visitor w is not nil, Walk visits each of the children
|
// If the result visitor w is not nil, Walk visits each of the children
|
||||||
// of node with the visitor w, followed by a call of w.Visit(nil).
|
// of node with the visitor w, followed by a call of w.Visit(nil).
|
||||||
|
//
|
||||||
//nolint:gocyclo,gocritic
|
//nolint:gocyclo,gocritic
|
||||||
func (f *Node) Visit(node ast.Node) ast.Visitor {
|
func (f *Node) Visit(node ast.Node) ast.Visitor {
|
||||||
switch typedNode := node.(type) {
|
switch typedNode := node.(type) {
|
||||||
@ -173,6 +174,7 @@ func (f *Node) Visit(node ast.Node) ast.Visitor {
|
|||||||
|
|
||||||
// The variadic arguments may start with link and category types,
|
// The variadic arguments may start with link and category types,
|
||||||
// and must end with a format string and any arguments.
|
// and must end with a format string and any arguments.
|
||||||
|
//
|
||||||
//nolint:interfacer
|
//nolint:interfacer
|
||||||
func (f *Node) errorf(n ast.Node, format string, args ...interface{}) {
|
func (f *Node) errorf(n ast.Node, format string, args ...interface{}) {
|
||||||
pos := f.fset.Position(n.Pos())
|
pos := f.fset.Position(n.Pos())
|
||||||
|
@ -24,6 +24,7 @@ var errorLineRx = regexp.MustCompile(`^\S+?: (.*)\((\S+?)\)$`)
|
|||||||
//
|
//
|
||||||
// Sources files are supplied as fullshort slice.
|
// Sources files are supplied as fullshort slice.
|
||||||
// It consists of pairs: full path to source file and its base name.
|
// It consists of pairs: full path to source file and its base name.
|
||||||
|
//
|
||||||
//nolint:gocyclo,funlen
|
//nolint:gocyclo,funlen
|
||||||
func errorCheck(outStr string, wantAuto bool, defaultWantedLinter string, fullshort ...string) (err error) {
|
func errorCheck(outStr string, wantAuto bool, defaultWantedLinter string, fullshort ...string) (err error) {
|
||||||
var errs []error
|
var errs []error
|
||||||
@ -179,6 +180,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// wantedErrors parses expected errors from comments in a file.
|
// wantedErrors parses expected errors from comments in a file.
|
||||||
|
//
|
||||||
//nolint:nakedret
|
//nolint:nakedret
|
||||||
func wantedErrors(file, short, defaultLinter string) (errs []wantedError) {
|
func wantedErrors(file, short, defaultLinter string) (errs []wantedError) {
|
||||||
cache := make(map[string]*regexp.Regexp)
|
cache := make(map[string]*regexp.Regexp)
|
||||||
|
@ -248,7 +248,7 @@ type runContext struct {
|
|||||||
|
|
||||||
func buildConfigFromShortRepr(t *testing.T, repr string, config map[string]interface{}) {
|
func buildConfigFromShortRepr(t *testing.T, repr string, config map[string]interface{}) {
|
||||||
kv := strings.Split(repr, "=")
|
kv := strings.Split(repr, "=")
|
||||||
require.Len(t, kv, 2)
|
require.Len(t, kv, 2, "repr: %s", repr)
|
||||||
|
|
||||||
keyParts := strings.Split(kv[0], ".")
|
keyParts := strings.Split(kv[0], ".")
|
||||||
require.True(t, len(keyParts) >= 2, len(keyParts))
|
require.True(t, len(keyParts) >= 2, len(keyParts))
|
||||||
@ -308,47 +308,55 @@ func extractRunContextFromComments(t *testing.T, sourcePath string) *runContext
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
line = strings.TrimLeft(strings.TrimPrefix(line, "//"), " ")
|
if !strings.HasPrefix(line, "//golangcitest:") {
|
||||||
if strings.HasPrefix(line, "args: ") {
|
require.Failf(t, "invalid prefix of comment line %s", line)
|
||||||
require.Nil(t, rc.args)
|
|
||||||
args := strings.TrimPrefix(line, "args: ")
|
|
||||||
require.NotEmpty(t, args)
|
|
||||||
rc.args = strings.Split(args, " ")
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(line, "config: ") {
|
// TODO(ldez) replace that by strings.Cut when we will drop go1.17
|
||||||
repr := strings.TrimPrefix(line, "config: ")
|
var before string
|
||||||
require.NotEmpty(t, repr)
|
var after string
|
||||||
|
if i := strings.Index(line, " "); i >= 0 {
|
||||||
|
before = line[:i]
|
||||||
|
after = strings.TrimSpace(line[i+len(" "):])
|
||||||
|
} else {
|
||||||
|
require.Failf(t, "invalid prefix of comment line %s", line)
|
||||||
|
}
|
||||||
|
|
||||||
|
switch before {
|
||||||
|
case "//golangcitest:args":
|
||||||
|
require.Nil(t, rc.args)
|
||||||
|
require.NotEmpty(t, after)
|
||||||
|
rc.args = strings.Split(after, " ")
|
||||||
|
continue
|
||||||
|
|
||||||
|
case "//golangcitest:config":
|
||||||
|
require.NotEmpty(t, after)
|
||||||
if rc.config == nil {
|
if rc.config == nil {
|
||||||
rc.config = map[string]interface{}{}
|
rc.config = map[string]interface{}{}
|
||||||
}
|
}
|
||||||
buildConfigFromShortRepr(t, repr, rc.config)
|
buildConfigFromShortRepr(t, after, rc.config)
|
||||||
continue
|
continue
|
||||||
}
|
|
||||||
|
|
||||||
if strings.HasPrefix(line, "config_path: ") {
|
case "//golangcitest:config_path":
|
||||||
configPath := strings.TrimPrefix(line, "config_path: ")
|
require.NotEmpty(t, after)
|
||||||
require.NotEmpty(t, configPath)
|
rc.configPath = after
|
||||||
rc.configPath = configPath
|
|
||||||
continue
|
continue
|
||||||
}
|
|
||||||
|
|
||||||
if strings.HasPrefix(line, "expected_linter: ") {
|
case "//golangcitest:expected_linter":
|
||||||
expectedLinter := strings.TrimPrefix(line, "expected_linter: ")
|
require.NotEmpty(t, after)
|
||||||
require.NotEmpty(t, expectedLinter)
|
rc.expectedLinter = after
|
||||||
rc.expectedLinter = expectedLinter
|
|
||||||
continue
|
continue
|
||||||
}
|
|
||||||
|
|
||||||
require.Fail(t, "invalid prefix of comment line %s", line)
|
default:
|
||||||
|
require.Failf(t, "invalid prefix of comment line %s", line)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// guess the expected linter if none is specified
|
// guess the expected linter if none is specified
|
||||||
if rc.expectedLinter == "" {
|
if rc.expectedLinter == "" {
|
||||||
for _, arg := range rc.args {
|
for _, arg := range rc.args {
|
||||||
if strings.HasPrefix(arg, "-E") && !strings.Contains(arg, ",") {
|
if strings.HasPrefix(arg, "-E") && !strings.Contains(arg, ",") {
|
||||||
require.Empty(t, rc.expectedLinter, "could not infer expected linter for errors because multiple linters are enabled. Please use the `expected_linter: ` directive in your test to indicate the linter-under-test.") //nolint:lll
|
require.Empty(t, rc.expectedLinter, "could not infer expected linter for errors because multiple linters are enabled. Please use the `//golangcitest:expected_linter ` directive in your test to indicate the linter-under-test.") //nolint:lll
|
||||||
rc.expectedLinter = arg[2:]
|
rc.expectedLinter = arg[2:]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
test/testdata/asciicheck.go
vendored
2
test/testdata/asciicheck.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Easciicheck
|
//golangcitest:args -Easciicheck
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
2
test/testdata/bidichk.go
vendored
2
test/testdata/bidichk.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Ebidichk
|
//golangcitest:args -Ebidichk
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
2
test/testdata/bodyclose.go
vendored
2
test/testdata/bodyclose.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Ebodyclose
|
//golangcitest:args -Ebodyclose
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
2
test/testdata/containedctx.go
vendored
2
test/testdata/containedctx.go
vendored
@ -1,4 +1,4 @@
|
|||||||
// args: -Econtainedctx
|
//golangcitest:args -Econtainedctx
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "context"
|
import "context"
|
||||||
|
2
test/testdata/contextcheck.go
vendored
2
test/testdata/contextcheck.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Econtextcheck
|
//golangcitest:args -Econtextcheck
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "context"
|
import "context"
|
||||||
|
4
test/testdata/cyclop.go
vendored
4
test/testdata/cyclop.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Ecyclop
|
//golangcitest:args -Ecyclop
|
||||||
//config: linters-settings.cyclop.max-complexity=15
|
//golangcitest:config linters-settings.cyclop.max-complexity=15
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
func cyclopComplexFunc(s string) { // ERROR "calculated cyclomatic complexity for function cyclopComplexFunc is 22, max is 15"
|
func cyclopComplexFunc(s string) { // ERROR "calculated cyclomatic complexity for function cyclopComplexFunc is 22, max is 15"
|
||||||
|
2
test/testdata/deadcode.go
vendored
2
test/testdata/deadcode.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Edeadcode
|
//golangcitest:args -Edeadcode
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
var y int
|
var y int
|
||||||
|
4
test/testdata/decorder.go
vendored
4
test/testdata/decorder.go
vendored
@ -1,5 +1,5 @@
|
|||||||
// args: -Edecorder
|
//golangcitest:args -Edecorder
|
||||||
// config_path: testdata/configs/decorder.yml
|
//golangcitest:config_path testdata/configs/decorder.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "math"
|
import "math"
|
||||||
|
2
test/testdata/decorder_default.go
vendored
2
test/testdata/decorder_default.go
vendored
@ -1,4 +1,4 @@
|
|||||||
// args: -Edecorder
|
//golangcitest:args -Edecorder
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "math"
|
import "math"
|
||||||
|
4
test/testdata/default_exclude.go
vendored
4
test/testdata/default_exclude.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Estylecheck,golint --internal-cmd-test
|
//golangcitest:args -Estylecheck,golint --internal-cmd-test
|
||||||
//config_path: testdata/configs/default_exclude.yml
|
//golangcitest:config_path testdata/configs/default_exclude.yml
|
||||||
|
|
||||||
/*Package testdata ...*/
|
/*Package testdata ...*/
|
||||||
package testdata
|
package testdata
|
||||||
|
4
test/testdata/depguard.go
vendored
4
test/testdata/depguard.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Edepguard
|
//golangcitest:args -Edepguard
|
||||||
//config_path: testdata/configs/depguard.yml
|
//golangcitest:config_path testdata/configs/depguard.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/depguard_additional_guards.go
vendored
4
test/testdata/depguard_additional_guards.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Edepguard
|
//golangcitest:args -Edepguard
|
||||||
//config_path: testdata/configs/depguard_additional_guards.yml
|
//golangcitest:config_path testdata/configs/depguard_additional_guards.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/depguard_ignore_file_rules.go
vendored
4
test/testdata/depguard_ignore_file_rules.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Edepguard
|
//golangcitest:args -Edepguard
|
||||||
//config_path: testdata/configs/depguard_ignore_file_rules.yml
|
//golangcitest:config_path testdata/configs/depguard_ignore_file_rules.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
// NOTE - No lint errors becuase this file is ignored
|
// NOTE - No lint errors becuase this file is ignored
|
||||||
|
2
test/testdata/dogsled.go
vendored
2
test/testdata/dogsled.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Edogsled
|
//golangcitest:args -Edogsled
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
func Dogsled() {
|
func Dogsled() {
|
||||||
|
4
test/testdata/dupl.go
vendored
4
test/testdata/dupl.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Edupl
|
//golangcitest:args -Edupl
|
||||||
//config: linters-settings.dupl.threshold=20
|
//golangcitest:config linters-settings.dupl.threshold=20
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
type DuplLogger struct{}
|
type DuplLogger struct{}
|
||||||
|
2
test/testdata/durationcheck.go
vendored
2
test/testdata/durationcheck.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Edurationcheck
|
//golangcitest:args -Edurationcheck
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
2
test/testdata/errcheck.go
vendored
2
test/testdata/errcheck.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Eerrcheck
|
//golangcitest:args -Eerrcheck
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
6
test/testdata/errcheck_exclude.go
vendored
6
test/testdata/errcheck_exclude.go
vendored
@ -1,6 +1,6 @@
|
|||||||
//args: -Eerrcheck
|
//golangcitest:args -Eerrcheck
|
||||||
//config: linters-settings.errcheck.check-blank=true
|
//golangcitest:config linters-settings.errcheck.check-blank=true
|
||||||
//config: linters-settings.errcheck.exclude=testdata/errcheck/exclude.txt
|
//golangcitest:config linters-settings.errcheck.exclude=testdata/errcheck/exclude.txt
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/errcheck_exclude_functions.go
vendored
4
test/testdata/errcheck_exclude_functions.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Eerrcheck
|
//golangcitest:args -Eerrcheck
|
||||||
//config_path: testdata/errcheck/exclude_functions.yml
|
//golangcitest:config_path testdata/errcheck/exclude_functions.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/errcheck_ignore.go
vendored
4
test/testdata/errcheck_ignore.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Eerrcheck
|
//golangcitest:args -Eerrcheck
|
||||||
//config_path: testdata/errcheck/ignore_config.yml
|
//golangcitest:config_path testdata/errcheck/ignore_config.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/errcheck_ignore_default.go
vendored
4
test/testdata/errcheck_ignore_default.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Eerrcheck
|
//golangcitest:args -Eerrcheck
|
||||||
//config: linters-settings.errcheck.check-blank=true
|
//golangcitest:config linters-settings.errcheck.check-blank=true
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/errcheck_type_assertions.go
vendored
4
test/testdata/errcheck_type_assertions.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Eerrcheck
|
//golangcitest:args -Eerrcheck
|
||||||
//config: linters-settings.errcheck.check-type-assertions=true
|
//golangcitest:config linters-settings.errcheck.check-type-assertions=true
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
func ErrorTypeAssertion(filter map[string]interface{}) bool {
|
func ErrorTypeAssertion(filter map[string]interface{}) bool {
|
||||||
|
4
test/testdata/errchkjson.go
vendored
4
test/testdata/errchkjson.go
vendored
@ -1,5 +1,5 @@
|
|||||||
// args: -Eerrchkjson
|
//golangcitest:args -Eerrchkjson
|
||||||
// config_path: testdata/configs/errchkjson.yml
|
//golangcitest:config_path testdata/configs/errchkjson.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// args: -Eerrchkjson
|
//golangcitest:args -Eerrchkjson
|
||||||
// config_path: testdata/configs/errchkjson_check_error_free_encoding.yml
|
//golangcitest:config_path testdata/configs/errchkjson_check_error_free_encoding.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/errchkjson_no_exported.go
vendored
4
test/testdata/errchkjson_no_exported.go
vendored
@ -1,5 +1,5 @@
|
|||||||
// args: -Eerrchkjson
|
//golangcitest:args -Eerrchkjson
|
||||||
// config_path: testdata/configs/errchkjson_no_exported.yml
|
//golangcitest:config_path testdata/configs/errchkjson_no_exported.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
2
test/testdata/errname.go
vendored
2
test/testdata/errname.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Eerrname
|
//golangcitest:args -Eerrname
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
2
test/testdata/errorlint.go
vendored
2
test/testdata/errorlint.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Eerrorlint
|
//golangcitest:args -Eerrorlint
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/errorlint_asserts.go
vendored
4
test/testdata/errorlint_asserts.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Eerrorlint
|
//golangcitest:args -Eerrorlint
|
||||||
//config_path: testdata/configs/errorlint_asserts.yml
|
//golangcitest:config_path testdata/configs/errorlint_asserts.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/errorlint_comparison.go
vendored
4
test/testdata/errorlint_comparison.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Eerrorlint
|
//golangcitest:args -Eerrorlint
|
||||||
//config_path: testdata/configs/errorlint_comparison.yml
|
//golangcitest:config_path testdata/configs/errorlint_comparison.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/errorlint_errorf.go
vendored
4
test/testdata/errorlint_errorf.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Eerrorlint
|
//golangcitest:args -Eerrorlint
|
||||||
//config_path: testdata/configs/errorlint_errorf.yml
|
//golangcitest:config_path testdata/configs/errorlint_errorf.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
2
test/testdata/execinquery.go
vendored
2
test/testdata/execinquery.go
vendored
@ -1,4 +1,4 @@
|
|||||||
// args: -Eexecinquery
|
//golangcitest:args -Eexecinquery
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
2
test/testdata/exhaustive.go
vendored
2
test/testdata/exhaustive.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Eexhaustive
|
//golangcitest:args -Eexhaustive
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
type Direction int
|
type Direction int
|
||||||
|
4
test/testdata/exhaustive_default.go
vendored
4
test/testdata/exhaustive_default.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Eexhaustive
|
//golangcitest:args -Eexhaustive
|
||||||
//config_path: testdata/configs/exhaustive_default.yml
|
//golangcitest:config_path testdata/configs/exhaustive_default.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
type Direction int
|
type Direction int
|
||||||
|
2
test/testdata/exhaustive_generated.go
vendored
2
test/testdata/exhaustive_generated.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Eexhaustive
|
//golangcitest:args -Eexhaustive
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
// Code generated by some program. DO NOT EDIT.
|
// Code generated by some program. DO NOT EDIT.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//args: -Eexhaustive
|
//golangcitest:args -Eexhaustive
|
||||||
//config_path: testdata/configs/exhaustive_ignore_enum_members.yml
|
//golangcitest:config_path testdata/configs/exhaustive_ignore_enum_members.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
type Direction int
|
type Direction int
|
||||||
|
2
test/testdata/exhaustivestruct.go
vendored
2
test/testdata/exhaustivestruct.go
vendored
@ -1,4 +1,4 @@
|
|||||||
// args: -Eexhaustivestruct --internal-cmd-test
|
//golangcitest:args -Eexhaustivestruct --internal-cmd-test
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
4
test/testdata/exhaustivestruct_custom.go
vendored
4
test/testdata/exhaustivestruct_custom.go
vendored
@ -1,5 +1,5 @@
|
|||||||
// args: -Eexhaustivestruct --internal-cmd-test
|
//golangcitest:args -Eexhaustivestruct --internal-cmd-test
|
||||||
// config_path: testdata/configs/exhaustivestruct.yml
|
//golangcitest:config_path testdata/configs/exhaustivestruct.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
2
test/testdata/exhaustruct.go
vendored
2
test/testdata/exhaustruct.go
vendored
@ -1,4 +1,4 @@
|
|||||||
// args: -Eexhaustruct
|
//golangcitest:args -Eexhaustruct
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
4
test/testdata/exhaustruct_custom.go
vendored
4
test/testdata/exhaustruct_custom.go
vendored
@ -1,5 +1,5 @@
|
|||||||
// args: -Eexhaustruct
|
//golangcitest:args -Eexhaustruct
|
||||||
// config_path: testdata/configs/exhaustruct.yml
|
//golangcitest:config_path testdata/configs/exhaustruct.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
2
test/testdata/exportloopref.go
vendored
2
test/testdata/exportloopref.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Eexportloopref
|
//golangcitest:args -Eexportloopref
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
4
test/testdata/fix/in/gci.go
vendored
4
test/testdata/fix/in/gci.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egci
|
//golangcitest:args -Egci
|
||||||
//config_path: testdata/configs/gci.yml
|
//golangcitest:config_path testdata/configs/gci.yml
|
||||||
package gci
|
package gci
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/fix/in/gocritic.go
vendored
4
test/testdata/fix/in/gocritic.go
vendored
@ -1,5 +1,5 @@
|
|||||||
// args: -Egocritic
|
//golangcitest:args -Egocritic
|
||||||
// config_path: testdata/configs/gocritic-fix.yml
|
//golangcitest:config_path testdata/configs/gocritic-fix.yml
|
||||||
package p
|
package p
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
2
test/testdata/fix/in/godot.go
vendored
2
test/testdata/fix/in/godot.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egodot
|
//golangcitest:args -Egodot
|
||||||
package p
|
package p
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
2
test/testdata/fix/in/gofmt.go
vendored
2
test/testdata/fix/in/gofmt.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egofmt
|
//golangcitest:args -Egofmt
|
||||||
package p
|
package p
|
||||||
|
|
||||||
func gofmt(a, b int) int {
|
func gofmt(a, b int) int {
|
||||||
|
4
test/testdata/fix/in/gofumpt.go
vendored
4
test/testdata/fix/in/gofumpt.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egofumpt
|
//golangcitest:args -Egofumpt
|
||||||
//config: linters-settings.gofumpt.extra-rules=true
|
//golangcitest:config linters-settings.gofumpt.extra-rules=true
|
||||||
package p
|
package p
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
2
test/testdata/fix/in/goimports.go
vendored
2
test/testdata/fix/in/goimports.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egofmt,goimports
|
//golangcitest:args -Egofmt,goimports
|
||||||
package p
|
package p
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
2
test/testdata/fix/in/misspell.go
vendored
2
test/testdata/fix/in/misspell.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Emisspell
|
//golangcitest:args -Emisspell
|
||||||
package p
|
package p
|
||||||
|
|
||||||
import "log"
|
import "log"
|
||||||
|
6
test/testdata/fix/in/nolintlint.go
vendored
6
test/testdata/fix/in/nolintlint.go
vendored
@ -1,6 +1,6 @@
|
|||||||
//args: -Enolintlint -Elll
|
//golangcitest:args -Enolintlint -Elll
|
||||||
//expected_linter: nolintlint
|
//golangcitest:expected_linter nolintlint
|
||||||
//config: linters-settings.nolintlint.allow-leading-space=false
|
//golangcitest:config linters-settings.nolintlint.allow-leading-space=false
|
||||||
package p
|
package p
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
6
test/testdata/fix/in/whitespace.go
vendored
6
test/testdata/fix/in/whitespace.go
vendored
@ -1,6 +1,6 @@
|
|||||||
//args: -Ewhitespace
|
//golangcitest:args -Ewhitespace
|
||||||
//config: linters-settings.whitespace.multi-if=true
|
//golangcitest:config linters-settings.whitespace.multi-if=true
|
||||||
//config: linters-settings.whitespace.multi-func=true
|
//golangcitest:config linters-settings.whitespace.multi-func=true
|
||||||
package p
|
package p
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
4
test/testdata/fix/out/gci.go
vendored
4
test/testdata/fix/out/gci.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egci
|
//golangcitest:args -Egci
|
||||||
//config_path: testdata/configs/gci.yml
|
//golangcitest:config_path testdata/configs/gci.yml
|
||||||
package gci
|
package gci
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/fix/out/gocritic.go
vendored
4
test/testdata/fix/out/gocritic.go
vendored
@ -1,5 +1,5 @@
|
|||||||
// args: -Egocritic
|
//golangcitest:args -Egocritic
|
||||||
// config_path: testdata/configs/gocritic-fix.yml
|
//golangcitest:config_path testdata/configs/gocritic-fix.yml
|
||||||
package p
|
package p
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
2
test/testdata/fix/out/godot.go
vendored
2
test/testdata/fix/out/godot.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egodot
|
//golangcitest:args -Egodot
|
||||||
package p
|
package p
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
2
test/testdata/fix/out/gofmt.go
vendored
2
test/testdata/fix/out/gofmt.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egofmt
|
//golangcitest:args -Egofmt
|
||||||
package p
|
package p
|
||||||
|
|
||||||
func gofmt(a, b int) int {
|
func gofmt(a, b int) int {
|
||||||
|
4
test/testdata/fix/out/gofumpt.go
vendored
4
test/testdata/fix/out/gofumpt.go
vendored
@ -1,5 +1,5 @@
|
|||||||
// args: -Egofumpt
|
//golangcitest:args -Egofumpt
|
||||||
// config: linters-settings.gofumpt.extra-rules=true
|
//golangcitest:config linters-settings.gofumpt.extra-rules=true
|
||||||
package p
|
package p
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
2
test/testdata/fix/out/goimports.go
vendored
2
test/testdata/fix/out/goimports.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egofmt,goimports
|
//golangcitest:args -Egofmt,goimports
|
||||||
package p
|
package p
|
||||||
|
|
||||||
func goimports(a, b int) int {
|
func goimports(a, b int) int {
|
||||||
|
2
test/testdata/fix/out/misspell.go
vendored
2
test/testdata/fix/out/misspell.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Emisspell
|
//golangcitest:args -Emisspell
|
||||||
package p
|
package p
|
||||||
|
|
||||||
import "log"
|
import "log"
|
||||||
|
6
test/testdata/fix/out/nolintlint.go
vendored
6
test/testdata/fix/out/nolintlint.go
vendored
@ -1,6 +1,6 @@
|
|||||||
//args: -Enolintlint -Elll
|
//golangcitest:args -Enolintlint -Elll
|
||||||
//expected_linter: nolintlint
|
//golangcitest:expected_linter nolintlint
|
||||||
//config: linters-settings.nolintlint.allow-leading-space=false
|
//golangcitest:config linters-settings.nolintlint.allow-leading-space=false
|
||||||
package p
|
package p
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
6
test/testdata/fix/out/whitespace.go
vendored
6
test/testdata/fix/out/whitespace.go
vendored
@ -1,6 +1,6 @@
|
|||||||
//args: -Ewhitespace
|
//golangcitest:args -Ewhitespace
|
||||||
//config: linters-settings.whitespace.multi-if=true
|
//golangcitest:config linters-settings.whitespace.multi-if=true
|
||||||
//config: linters-settings.whitespace.multi-func=true
|
//golangcitest:config linters-settings.whitespace.multi-func=true
|
||||||
package p
|
package p
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
4
test/testdata/forbidigo_example.go
vendored
4
test/testdata/forbidigo_example.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Eforbidigo
|
//golangcitest:args -Eforbidigo
|
||||||
//config_path: testdata/configs/forbidigo.yml
|
//golangcitest:config_path testdata/configs/forbidigo.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/forbidigo_example_test.go
vendored
4
test/testdata/forbidigo_example_test.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Eforbidigo
|
//golangcitest:args -Eforbidigo
|
||||||
//config_path: testdata/configs/forbidigo.yml
|
//golangcitest:config_path testdata/configs/forbidigo.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//args: -Eforbidigo
|
//golangcitest:args -Eforbidigo
|
||||||
//config: linters-settings.forbidigo.exclude-godoc-examples=false
|
//golangcitest:config linters-settings.forbidigo.exclude-godoc-examples=false
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
2
test/testdata/forcetypeassert.go
vendored
2
test/testdata/forcetypeassert.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Eforcetypeassert
|
//golangcitest:args -Eforcetypeassert
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
6
test/testdata/funlen.go
vendored
6
test/testdata/funlen.go
vendored
@ -1,6 +1,6 @@
|
|||||||
//args: -Efunlen
|
//golangcitest:args -Efunlen
|
||||||
//config: linters-settings.funlen.lines=20
|
//golangcitest:config linters-settings.funlen.lines=20
|
||||||
//config: linters-settings.funlen.statements=10
|
//golangcitest:config linters-settings.funlen.statements=10
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
func TooManyLines() { // ERROR `Function 'TooManyLines' is too long \(22 > 20\)`
|
func TooManyLines() { // ERROR `Function 'TooManyLines' is too long \(22 > 20\)`
|
||||||
|
4
test/testdata/gci.go
vendored
4
test/testdata/gci.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egci
|
//golangcitest:args -Egci
|
||||||
//config_path: testdata/configs/gci.yml
|
//golangcitest:config_path testdata/configs/gci.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/gci/gci.go
vendored
4
test/testdata/gci/gci.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egci
|
//golangcitest:args -Egci
|
||||||
//config_path: testdata/configs/gci.yml
|
//golangcitest:config_path testdata/configs/gci.yml
|
||||||
package gci
|
package gci
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/go-header_bad.go
vendored
4
test/testdata/go-header_bad.go
vendored
@ -1,5 +1,5 @@
|
|||||||
/*MY TITLE!*/ // ERROR `Expected:TITLE\., Actual: TITLE!`
|
/*MY TITLE!*/ // ERROR `Expected:TITLE\., Actual: TITLE!`
|
||||||
|
|
||||||
// args: -Egoheader
|
//golangcitest:args -Egoheader
|
||||||
// config_path: testdata/configs/go-header.yml
|
//golangcitest:config_path testdata/configs/go-header.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
4
test/testdata/go-header_good.go
vendored
4
test/testdata/go-header_good.go
vendored
@ -1,5 +1,5 @@
|
|||||||
/*MY TITLE.*/
|
/*MY TITLE.*/
|
||||||
|
|
||||||
// args: -Egoheader
|
//golangcitest:args -Egoheader
|
||||||
// config_path: testdata/configs/go-header.yml
|
//golangcitest:config_path testdata/configs/go-header.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
2
test/testdata/gochecknoglobals.go
vendored
2
test/testdata/gochecknoglobals.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egochecknoglobals
|
//golangcitest:args -Egochecknoglobals
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
2
test/testdata/gochecknoinits.go
vendored
2
test/testdata/gochecknoinits.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egochecknoinits
|
//golangcitest:args -Egochecknoinits
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
4
test/testdata/gocognit.go
vendored
4
test/testdata/gocognit.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egocognit
|
//golangcitest:args -Egocognit
|
||||||
//config: linters-settings.gocognit.min-complexity=2
|
//golangcitest:config linters-settings.gocognit.min-complexity=2
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
func GoCognit_CC4_GetWords(number int) string { // ERROR "cognitive complexity 4 of func .* is high .*"
|
func GoCognit_CC4_GetWords(number int) string { // ERROR "cognitive complexity 4 of func .* is high .*"
|
||||||
|
2
test/testdata/goconst.go
vendored
2
test/testdata/goconst.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egoconst
|
//golangcitest:args -Egoconst
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
4
test/testdata/goconst_calls_enabled.go
vendored
4
test/testdata/goconst_calls_enabled.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egoconst
|
//golangcitest:args -Egoconst
|
||||||
//config: linters-settings.goconst.ignore-calls=false
|
//golangcitest:config linters-settings.goconst.ignore-calls=false
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
4
test/testdata/goconst_dont_ignore_test.go
vendored
4
test/testdata/goconst_dont_ignore_test.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egoconst
|
//golangcitest:args -Egoconst
|
||||||
//config: linters-settings.goconst.ignore-tests=false
|
//golangcitest:config linters-settings.goconst.ignore-tests=false
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/goconst_ignore_test.go
vendored
4
test/testdata/goconst_ignore_test.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egoconst
|
//golangcitest:args -Egoconst
|
||||||
//config: linters-settings.goconst.ignore-tests=true
|
//golangcitest:config linters-settings.goconst.ignore-tests=true
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/gocritic.go
vendored
4
test/testdata/gocritic.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egocritic
|
//golangcitest:args -Egocritic
|
||||||
//config_path: testdata/configs/gocritic.yml
|
//golangcitest:config_path testdata/configs/gocritic.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/gocyclo.go
vendored
4
test/testdata/gocyclo.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egocyclo
|
//golangcitest:args -Egocyclo
|
||||||
//config: linters-settings.gocyclo.min-complexity=20
|
//golangcitest:config linters-settings.gocyclo.min-complexity=20
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "net/http"
|
import "net/http"
|
||||||
|
2
test/testdata/godot.go
vendored
2
test/testdata/godot.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egodot
|
//golangcitest:args -Egodot
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
// Godot checks top-level comments // ERROR "Comment should end in a period"
|
// Godot checks top-level comments // ERROR "Comment should end in a period"
|
||||||
|
4
test/testdata/godox.go
vendored
4
test/testdata/godox.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egodox
|
//golangcitest:args -Egodox
|
||||||
//config: linters-settings.godox.keywords=FIXME,TODO
|
//golangcitest:config linters-settings.godox.keywords=FIXME,TODO
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
func todoLeftInCode() {
|
func todoLeftInCode() {
|
||||||
|
2
test/testdata/goerr113.go
vendored
2
test/testdata/goerr113.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egoerr113
|
//golangcitest:args -Egoerr113
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "os"
|
import "os"
|
||||||
|
2
test/testdata/gofmt.go
vendored
2
test/testdata/gofmt.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egofmt
|
//golangcitest:args -Egofmt
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
4
test/testdata/gofmt_no_simplify.go
vendored
4
test/testdata/gofmt_no_simplify.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egofmt
|
//golangcitest:args -Egofmt
|
||||||
//config: linters-settings.gofmt.simplify=false
|
//golangcitest:config linters-settings.gofmt.simplify=false
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
2
test/testdata/gofumpt.go
vendored
2
test/testdata/gofumpt.go
vendored
@ -1,4 +1,4 @@
|
|||||||
// args: -Egofumpt
|
//golangcitest:args -Egofumpt
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
4
test/testdata/gofumpt_with_extra.go
vendored
4
test/testdata/gofumpt_with_extra.go
vendored
@ -1,5 +1,5 @@
|
|||||||
// args: -Egofumpt
|
//golangcitest:args -Egofumpt
|
||||||
// config: linters-settings.gofumpt.extra-rules=true
|
//golangcitest:config linters-settings.gofumpt.extra-rules=true
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
2
test/testdata/goimports.go
vendored
2
test/testdata/goimports.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egoimports
|
//golangcitest:args -Egoimports
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/goimports/goimports.go
vendored
4
test/testdata/goimports/goimports.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egoimports
|
//golangcitest:args -Egoimports
|
||||||
//config: linters-settings.goimports.local-prefixes=github.com/golangci/golangci-lint
|
//golangcitest:config linters-settings.goimports.local-prefixes=github.com/golangci/golangci-lint
|
||||||
package goimports
|
package goimports
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
2
test/testdata/golint.go
vendored
2
test/testdata/golint.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egolint --internal-cmd-test
|
//golangcitest:args -Egolint --internal-cmd-test
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
var Go_lint string // ERROR "don't use underscores in Go names; var `Go_lint` should be `GoLint`"
|
var Go_lint string // ERROR "don't use underscores in Go names; var `Go_lint` should be `GoLint`"
|
||||||
|
2
test/testdata/gomnd.go
vendored
2
test/testdata/gomnd.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egomnd
|
//golangcitest:args -Egomnd
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/gomodguard.go
vendored
4
test/testdata/gomodguard.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egomodguard
|
//golangcitest:args -Egomodguard
|
||||||
//config_path: testdata/configs/gomodguard.yml
|
//golangcitest:config_path testdata/configs/gomodguard.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
2
test/testdata/goprintffuncname.go
vendored
2
test/testdata/goprintffuncname.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egoprintffuncname
|
//golangcitest:args -Egoprintffuncname
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
func PrintfLikeFuncWithBadName(format string, args ...interface{}) { // ERROR "printf-like formatting function 'PrintfLikeFuncWithBadName' should be named 'PrintfLikeFuncWithBadNamef'"
|
func PrintfLikeFuncWithBadName(format string, args ...interface{}) { // ERROR "printf-like formatting function 'PrintfLikeFuncWithBadName' should be named 'PrintfLikeFuncWithBadNamef'"
|
||||||
|
2
test/testdata/gosec.go
vendored
2
test/testdata/gosec.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egosec
|
//golangcitest:args -Egosec
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/gosec_rules_config.go
vendored
4
test/testdata/gosec_rules_config.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egosec
|
//golangcitest:args -Egosec
|
||||||
//config_path: testdata/configs/gosec.yml
|
//golangcitest:config_path testdata/configs/gosec.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import "io/ioutil"
|
import "io/ioutil"
|
||||||
|
4
test/testdata/gosec_severity_confidence.go
vendored
4
test/testdata/gosec_severity_confidence.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egosec
|
//golangcitest:args -Egosec
|
||||||
//config_path: testdata/configs/gosec_severity_confidence.yml
|
//golangcitest:config_path testdata/configs/gosec_severity_confidence.yml
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
2
test/testdata/gosimple.go
vendored
2
test/testdata/gosimple.go
vendored
@ -1,4 +1,4 @@
|
|||||||
//args: -Egosimple
|
//golangcitest:args -Egosimple
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
4
test/testdata/govet.go
vendored
4
test/testdata/govet.go
vendored
@ -1,5 +1,5 @@
|
|||||||
//args: -Egovet
|
//golangcitest:args -Egovet
|
||||||
//config: linters-settings.govet.check-shadowing=true
|
//golangcitest:config linters-settings.govet.check-shadowing=true
|
||||||
package testdata
|
package testdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user