diff --git a/.golangci.yml b/.golangci.yml index c922a37..844092f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -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' diff --git a/context.go b/context.go index 8a8c2e1..77643ae 100644 --- a/context.go +++ b/context.go @@ -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) } diff --git a/kong.go b/kong.go index 45479be..764a994 100644 --- a/kong.go +++ b/kong.go @@ -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 }