Skip to content

Commit

Permalink
chore: Update golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Aug 21, 2024
1 parent 32ea903 commit 13e9338
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
FIND_TYPOS_VERSION: 0.0.3 # https://github.com/twpayne/find-typos/tags
GO_VERSION: 1.23.0 # https://go.dev/doc/devel/release
GOFUMPT_VERSION: 0.6.0 # https://github.com/mvdan/gofumpt/releases
GOLANGCI_LINT_VERSION: 1.60.1 # https://github.com/golangci/golangci-lint/releases
GOLANGCI_LINT_VERSION: 1.60.2 # https://github.com/golangci/golangci-lint/releases
GOLINES_VERSION: 0.12.2 # https://github.com/segmentio/golines/releases
GORELEASER_VERSION: 2.2.0 # https://github.com/goreleaser/goreleaser/releases
GOVERSIONINFO_VERSION: 1.4.0 # https://github.com/josephspurrier/goversioninfo/releases
Expand Down
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ linters:
- dupl
- exhaustive
- exhaustruct
- exportloopref
- funlen
- ginkgolinter
- gochecknoglobals
Expand Down
4 changes: 2 additions & 2 deletions internal/chezmoi/chezmoi.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/spf13/cobra"
vfs "github.com/twpayne/go-vfs/v5"
"golang.org/x/crypto/ripemd160" //nolint:staticcheck
"golang.org/x/crypto/ripemd160" //nolint:gosec,staticcheck

"github.com/twpayne/chezmoi/v2/internal/chezmoiset"
)
Expand Down Expand Up @@ -347,7 +347,7 @@ func modeTypeName(mode fs.FileMode) string {

// ripemd160Sum returns the RIPEMD-160 sum of data.
func ripemd160Sum(data []byte) []byte {
return ripemd160.New().Sum(data)
return ripemd160.New().Sum(data) //nolint:gosec
}

// sha1Sum returns the SHA1 sum of data.
Expand Down
2 changes: 1 addition & 1 deletion internal/chezmoi/chezmoi_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
const nativeLineEnding = "\n"

func init() {
Umask = fs.FileMode(unix.Umask(0))
Umask = fs.FileMode(unix.Umask(0)) //nolint:gosec
unix.Umask(int(Umask))
}

Expand Down
4 changes: 2 additions & 2 deletions internal/chezmoitest/chezmoitest.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ func WithTestFS(t *testing.T, root any, f func(vfs.FS)) {

// mustParseFileMode parses s as a fs.FileMode and panics on any error.
func mustParseFileMode(s string) fs.FileMode {
i, err := strconv.ParseInt(s, 0, 32)
u, err := strconv.ParseUint(s, 0, 32)
if err != nil {
panic(err)
}
return fs.FileMode(i)
return fs.FileMode(uint32(u)) //nolint:gosec
}
4 changes: 2 additions & 2 deletions internal/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ func (c *Config) colorAutoFunc() bool {
return false
}
if stdout, ok := c.stdout.(*os.File); ok {
return term.IsTerminal(int(stdout.Fd()))
return term.IsTerminal(int(stdout.Fd())) //nolint:gosec
}
return false
}
Expand Down Expand Up @@ -2269,7 +2269,7 @@ func (c *Config) persistentStateFile() (chezmoi.AbsPath, error) {
// progressAutoFunc detects whether progress bars should be displayed.
func (c *Config) progressAutoFunc() bool {
if stdout, ok := c.stdout.(*os.File); ok {
return term.IsTerminal(int(stdout.Fd()))
return term.IsTerminal(int(stdout.Fd())) //nolint:gosec
}
return false
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/initcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func (o gitCloneOptionsLogValuer) LogValue() slog.Value {
attrs = append(attrs, slog.Int("Depth", o.Depth))
}
if o.RecurseSubmodules != 0 {
attrs = append(attrs, slog.Int("RecurseSubmodules", int(o.RecurseSubmodules)))
attrs = append(attrs, slog.Uint64("RecurseSubmodules", uint64(o.RecurseSubmodules)))
}
if o.Tags != 0 {
attrs = append(attrs, slog.Int("Tags", int(o.Tags)))
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/inittemplatefuncs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (c *Config) stdinIsATTYInitTemplateFunc() bool {
if !ok {
return false
}
return term.IsTerminal(int(file.Fd()))
return term.IsTerminal(int(file.Fd())) //nolint:gosec
}

func (c *Config) writeToStdout(args ...string) string {
Expand Down

0 comments on commit 13e9338

Please sign in to comment.