diff --git a/.golangci.yml b/.golangci.yml index 767184522f..063b1c8f07 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,6 +5,7 @@ linters: disable-all: true enable: - bodyclose + - copyloopvar - decorder - depguard - dogsled diff --git a/changelog.md b/changelog.md index 8f1390a8c2..9d5838e6b5 100644 --- a/changelog.md +++ b/changelog.md @@ -25,9 +25,6 @@ ### Changes - -- [#4162](https://github.com/ignite/cli/pull/4162) Enable errcheck linter and fix a bug in the way we test flags -- [#4159](https://github.com/ignite/cli/pull/4159) Enable gci linter - [#4157](https://github.com/ignite/cli/pull/4157) Upgrade golang to 1.22 - [#4094](https://github.com/ignite/cli/pull/4094) Scaffolding a multi-index map using `ignite s map foo bar baz --index foobar,foobaz` is no longer supported. Use one index instead of use `collections.IndexedMap`. - [#4058](https://github.com/ignite/cli/pull/4058) Simplify scaffolded modules by including `ValidateBasic()` logic in message handler. @@ -43,6 +40,9 @@ - [#4167](https://github.com/ignite/cli/pull/4167) Scaffold `int64` instead of `int32` when a field type is `int` - [#4168](https://github.com/ignite/cli/pull/4168) Bump IBC to `v8.3.1` - [#4178](https://github.com/ignite/cli/pull/4178) Bump cosmos-sdk to `v0.50.7` +- [#4159](https://github.com/ignite/cli/pull/4159) Enable gci linter +- [#4160](https://github.com/ignite/cli/pull/4160) Enable copyloopvar linter +- [#4162](https://github.com/ignite/cli/pull/4162) Enable errcheck linter ### Fixes diff --git a/go.mod b/go.mod index 9a0008354c..26274c922e 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/ignite/cli/v29 go 1.22 -toolchain go1.22.2 +toolchain go1.22.3 replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 diff --git a/ignite/cmd/chain.go b/ignite/cmd/chain.go index c18ad70eb7..c128b1ae43 100644 --- a/ignite/cmd/chain.go +++ b/ignite/cmd/chain.go @@ -288,7 +288,7 @@ func configMigrationPreRunHandler(cmd *cobra.Command, session *cliui.Session, ap return err } - if err := os.WriteFile(cfgPath, buf.Bytes(), 0o755); err != nil { + if err := os.WriteFile(cfgPath, buf.Bytes(), 0o600); err != nil { return errors.Errorf("config file migration failed: %w", err) } } diff --git a/ignite/pkg/cmdrunner/cmdrunner.go b/ignite/pkg/cmdrunner/cmdrunner.go index d49b107a0f..8883db157f 100644 --- a/ignite/pkg/cmdrunner/cmdrunner.go +++ b/ignite/pkg/cmdrunner/cmdrunner.go @@ -107,7 +107,6 @@ func (r *Runner) Run(ctx context.Context, steps ...*step.Step) error { step.Exec.Command, strings.Join(step.Exec.Args, " ")) } - step := step if err := ctx.Err(); err != nil { return err } diff --git a/ignite/pkg/cosmosgen/generate_composables.go b/ignite/pkg/cosmosgen/generate_composables.go index eca228d8a4..8e2f5aeecf 100644 --- a/ignite/pkg/cosmosgen/generate_composables.go +++ b/ignite/pkg/cosmosgen/generate_composables.go @@ -118,8 +118,6 @@ func (g *composablesGenerator) generateComposableTemplates(p generatePayload) er gg := &errgroup.Group{} for _, m := range p.Modules { - m := m - gg.Go(func() error { return g.generateComposableTemplate(m, p) }) diff --git a/ignite/pkg/cosmosgen/generate_typescript.go b/ignite/pkg/cosmosgen/generate_typescript.go index 8ed6893350..cbc3872e94 100644 --- a/ignite/pkg/cosmosgen/generate_typescript.go +++ b/ignite/pkg/cosmosgen/generate_typescript.go @@ -81,8 +81,6 @@ func (g *tsGenerator) generateModuleTemplates(ctx context.Context) error { dirCache := cache.New[[]byte](g.g.cacheStorage, dirchangeCacheNamespace) add := func(sourcePath string, modules []module.Module) { for _, m := range modules { - m := m - gg.Go(func() error { cacheKey := m.Pkg.Path paths := []string{m.Pkg.Path, g.g.opts.jsOut(m)} diff --git a/ignite/version/version_test.go b/ignite/version/version_test.go index ea2be8246a..78724ff8d7 100644 --- a/ignite/version/version_test.go +++ b/ignite/version/version_test.go @@ -44,7 +44,6 @@ func TestAssertSupportedCosmosSDKVersion(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { err := version.AssertSupportedCosmosSDKVersion(tc.version) if tc.errMsg == "" {