chore: fix all golangci-lint warnings
This commit is contained in:
+4
-16
@@ -7,7 +7,6 @@ output:
|
||||
linters:
|
||||
enable-all: true
|
||||
disable:
|
||||
- maligned
|
||||
- lll
|
||||
- gochecknoglobals
|
||||
- wsl
|
||||
@@ -17,11 +16,8 @@ linters:
|
||||
- goprintffuncname
|
||||
- paralleltest
|
||||
- nlreturn
|
||||
- goerr113
|
||||
- ifshort
|
||||
- testpackage
|
||||
- wrapcheck
|
||||
- exhaustivestruct
|
||||
- forbidigo
|
||||
- gci
|
||||
- godot
|
||||
@@ -29,9 +25,6 @@ linters:
|
||||
- cyclop
|
||||
- errorlint
|
||||
- nestif
|
||||
- golint
|
||||
- scopelint
|
||||
- interfacer
|
||||
- tagliatelle
|
||||
- thelper
|
||||
- godox
|
||||
@@ -41,18 +34,17 @@ linters:
|
||||
- exhaustruct
|
||||
- nonamedreturns
|
||||
- nilnil
|
||||
- nosnakecase # deprecated since v1.48.1
|
||||
- structcheck # deprecated since v1.49.0
|
||||
- deadcode # deprecated since v1.49.0
|
||||
- varcheck # deprecated since v1.49.0
|
||||
- depguard # nothing to guard against yet
|
||||
- tagalign # hurts readability of kong tags
|
||||
- mnd
|
||||
- perfsprint
|
||||
- err113
|
||||
- copyloopvar
|
||||
- intrange
|
||||
- execinquery
|
||||
|
||||
linters-settings:
|
||||
govet:
|
||||
check-shadowing: true
|
||||
# These govet checks are disabled by default, but they're useful.
|
||||
enable:
|
||||
- niliness
|
||||
@@ -90,7 +82,3 @@ issues:
|
||||
# Duplicate words are okay in tests.
|
||||
- linters: [dupword]
|
||||
path: _test\.go
|
||||
|
||||
- linters: [maintidx]
|
||||
path: context\.go
|
||||
text: 'Function name: trace'
|
||||
|
||||
+2
-1
@@ -347,6 +347,7 @@ func (c *Context) endParsing() {
|
||||
}
|
||||
}
|
||||
|
||||
//nolint:maintidx
|
||||
func (c *Context) trace(node *Node) (err error) { //nolint: gocyclo
|
||||
positional := 0
|
||||
node.Active = true
|
||||
@@ -758,7 +759,7 @@ func (e *unknownFlagError) Error() string { return e.Cause.Error() }
|
||||
// Call an arbitrary function filling arguments with bound values.
|
||||
func (c *Context) Call(fn any, binds ...interface{}) (out []interface{}, err error) {
|
||||
fv := reflect.ValueOf(fn)
|
||||
bindings := c.Kong.bindings.clone().add(binds...).add(c).merge(c.bindings) //nolint:govet
|
||||
bindings := c.Kong.bindings.clone().add(binds...).add(c).merge(c.bindings)
|
||||
return callAnyFunction(fv, bindings)
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ func New(grammar interface{}, options ...Option) (*Kong, error) {
|
||||
|
||||
// Embed any embedded structs.
|
||||
for _, embed := range k.embedded {
|
||||
tag, err := parseTagString(strings.Join(embed.tags, " ")) //nolint:govet
|
||||
tag, err := parseTagString(strings.Join(embed.tags, " "))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user