Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enable copyloopvar linter #4160

Merged
merged 21 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ linters:
disable-all: true
enable:
- bodyclose
- copyloopvar
- decorder
- depguard
- dogsled
Expand Down Expand Up @@ -70,7 +71,5 @@ linters-settings:
issues:
exclude-dirs:
- ignite/ui
# # timeout for analysis, e.g. 30s, 5m, default is 1m
# timeout: 5m
max-issues-per-linter: 0
max-same-issues: 0
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

### Changes

- [#4160](https://github.com/ignite/cli/pull/4160) Enable copyloopvar linter
- [#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`.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ignite/cmd/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
return err
}

if err := os.WriteFile(cfgPath, buf.Bytes(), 0o755); err != nil {
if err := os.WriteFile(cfgPath, buf.Bytes(), 0o600); err != nil {

Check warning on line 291 in ignite/cmd/chain.go

View check run for this annotation

Codecov / codecov/patch

ignite/cmd/chain.go#L291

Added line #L291 was not covered by tests
return errors.Errorf("config file migration failed: %w", err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion ignite/cmd/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func TestLinkPluginCmds(t *testing.T) {
)

// helper to assert pluginInterface.Execute() calls
expectExecute := func(t *testing.T, ctx context.Context, p *mocks.PluginInterface, cmd *plugin.Command) {
expectExecute := func(t *testing.T, _ context.Context, p *mocks.PluginInterface, cmd *plugin.Command) {
t.Helper()
p.EXPECT().
Execute(
Expand Down
1 change: 0 additions & 1 deletion ignite/pkg/cmdrunner/cmdrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 0 additions & 2 deletions ignite/pkg/cosmosgen/generate_composables.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down
2 changes: 0 additions & 2 deletions ignite/pkg/cosmosgen/generate_typescript.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
Expand Down
4 changes: 0 additions & 4 deletions ignite/services/chain/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,6 @@ func (c *Chain) IsInitialized() (bool, error) {
if _, err := os.Stat(gentxDir); os.IsNotExist(err) {
return false, nil
}
if err != nil {
Pantani marked this conversation as resolved.
Show resolved Hide resolved
// Return error on other error
return false, err
}

return true, nil
}
Expand Down
1 change: 0 additions & 1 deletion ignite/version/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand Down
Loading