Skip to content

Commit

Permalink
chore: bump go + golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas committed Aug 19, 2024
1 parent 6292953 commit 2ad9498
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion bin/go
2 changes: 1 addition & 1 deletion bin/gofmt
2 changes: 1 addition & 1 deletion bin/golangci-lint
2 changes: 1 addition & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion help_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion kong_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
})
}
Expand Down
2 changes: 1 addition & 1 deletion levenshtein.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:]
}

0 comments on commit 2ad9498

Please sign in to comment.