diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 77515028995..169e2330427 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/.golangci.yml b/.golangci.yml index 620529e0546..057619125fc 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -84,7 +84,6 @@ linters: - dupl - exhaustive - exhaustruct - - exportloopref - funlen - ginkgolinter - gochecknoglobals diff --git a/internal/chezmoi/chezmoi.go b/internal/chezmoi/chezmoi.go index 172f80cee85..ebb5c1045cd 100644 --- a/internal/chezmoi/chezmoi.go +++ b/internal/chezmoi/chezmoi.go @@ -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" ) @@ -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. diff --git a/internal/chezmoi/chezmoi_unix.go b/internal/chezmoi/chezmoi_unix.go index 18c2e403734..a7427c3c111 100644 --- a/internal/chezmoi/chezmoi_unix.go +++ b/internal/chezmoi/chezmoi_unix.go @@ -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)) } diff --git a/internal/chezmoitest/chezmoitest.go b/internal/chezmoitest/chezmoitest.go index 1a20fdfb53f..cd4930c0f60 100644 --- a/internal/chezmoitest/chezmoitest.go +++ b/internal/chezmoitest/chezmoitest.go @@ -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 } diff --git a/internal/cmd/config.go b/internal/cmd/config.go index 79ca5f9dfe4..3333f426985 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -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 } @@ -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 } diff --git a/internal/cmd/initcmd.go b/internal/cmd/initcmd.go index 7c61b0e9c28..82eb8be2236 100644 --- a/internal/cmd/initcmd.go +++ b/internal/cmd/initcmd.go @@ -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))) diff --git a/internal/cmd/inittemplatefuncs.go b/internal/cmd/inittemplatefuncs.go index 89c45d36f92..0b5fefadb07 100644 --- a/internal/cmd/inittemplatefuncs.go +++ b/internal/cmd/inittemplatefuncs.go @@ -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 {