From 2ad9498bdfbb7dcae73ae57508692826353a918d Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Tue, 20 Aug 2024 08:16:24 +1000 Subject: [PATCH] chore: bump go + golangci-lint --- .golangci.yml | 3 +++ bin/{.go-1.22.6.pkg => .go-1.23.0.pkg} | 0 bin/{.golangci-lint-1.55.2.pkg => .golangci-lint-1.60.1.pkg} | 0 bin/go | 2 +- bin/gofmt | 2 +- bin/golangci-lint | 2 +- context.go | 2 +- help_test.go | 2 +- kong_test.go | 2 +- levenshtein.go | 2 +- resolver.go | 2 +- 11 files changed, 11 insertions(+), 8 deletions(-) rename bin/{.go-1.22.6.pkg => .go-1.23.0.pkg} (100%) rename bin/{.golangci-lint-1.55.2.pkg => .golangci-lint-1.60.1.pkg} (100%) diff --git a/.golangci.yml b/.golangci.yml index 2c5bfe3..c922a37 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -47,6 +47,8 @@ linters: - varcheck # deprecated since v1.49.0 - depguard # nothing to guard against yet - tagalign # hurts readability of kong tags + - mnd + - perfsprint linters-settings: govet: @@ -76,6 +78,7 @@ issues: - 'bad syntax for struct tag key' - 'bad syntax for struct tag pair' - 'result .* \(error\) is always nil' + - 'Error return value of `fmt.Fprintln` is not checked' exclude-rules: # Don't warn on unused parameters. diff --git a/bin/.go-1.22.6.pkg b/bin/.go-1.23.0.pkg similarity index 100% rename from bin/.go-1.22.6.pkg rename to bin/.go-1.23.0.pkg diff --git a/bin/.golangci-lint-1.55.2.pkg b/bin/.golangci-lint-1.60.1.pkg similarity index 100% rename from bin/.golangci-lint-1.55.2.pkg rename to bin/.golangci-lint-1.60.1.pkg diff --git a/bin/go b/bin/go index fec23e2..4602254 120000 --- a/bin/go +++ b/bin/go @@ -1 +1 @@ -.go-1.22.6.pkg \ No newline at end of file +.go-1.23.0.pkg \ No newline at end of file diff --git a/bin/gofmt b/bin/gofmt index fec23e2..4602254 120000 --- a/bin/gofmt +++ b/bin/gofmt @@ -1 +1 @@ -.go-1.22.6.pkg \ No newline at end of file +.go-1.23.0.pkg \ No newline at end of file diff --git a/bin/golangci-lint b/bin/golangci-lint index 5b19a9d..4857716 120000 --- a/bin/golangci-lint +++ b/bin/golangci-lint @@ -1 +1 @@ -.golangci-lint-1.55.2.pkg \ No newline at end of file +.golangci-lint-1.60.1.pkg \ No newline at end of file diff --git a/context.go b/context.go index f5239c7..ea0ec1c 100644 --- a/context.go +++ b/context.go @@ -1015,7 +1015,7 @@ func checkXorDuplicatedAndAndMissing(paths []*Path) error { errs = append(errs, err.Error()) } if len(errs) > 0 { - return fmt.Errorf(strings.Join(errs, ", ")) + return errors.New(strings.Join(errs, ", ")) } return nil } diff --git a/help_test.go b/help_test.go index 38080a3..e43a073 100644 --- a/help_test.go +++ b/help_test.go @@ -600,7 +600,7 @@ func TestAutoGroup(t *testing.T) { if node, ok := parent.(*kong.Node); ok { return &kong.Group{ Key: node.Name, - Title: strings.Title(node.Name) + " flags:", //nolint + Title: strings.Title(node.Name) + " flags:", } } return nil diff --git a/kong_test.go b/kong_test.go index 0f0bb86..2ac9cbd 100644 --- a/kong_test.go +++ b/kong_test.go @@ -608,7 +608,7 @@ func TestMultilineMessage(t *testing.T) { w := &bytes.Buffer{} var cli struct{} p := mustNew(t, &cli, kong.Writers(w, w)) - p.Printf(test.text) + p.Printf("%s", test.text) assert.Equal(t, test.want, w.String()) }) } diff --git a/levenshtein.go b/levenshtein.go index 1816f30..6837d6c 100644 --- a/levenshtein.go +++ b/levenshtein.go @@ -31,7 +31,7 @@ func levenshtein(a, b string) int { return f[len(f)-1] } -func min(a, b int) int { +func min(a, b int) int { //nolint:predeclared if a <= b { return a } diff --git a/resolver.go b/resolver.go index 05be7f6..dca4309 100644 --- a/resolver.go +++ b/resolver.go @@ -63,6 +63,6 @@ func JSON(r io.Reader) (Resolver, error) { } func snakeCase(name string) string { - name = strings.Join(strings.Split(strings.Title(name), "-"), "") //nolint: staticcheck + name = strings.Join(strings.Split(strings.Title(name), "-"), "") return strings.ToLower(name[:1]) + name[1:] }