Skip to content

Commit 303f429

Browse files
author
Alex Johnson
authored
chore: lint and format (#2649)
* update golangci-lint version * update golangci runners * format and lint fixes
1 parent 3f02f5a commit 303f429

File tree

8 files changed

+22
-11
lines changed

8 files changed

+22
-11
lines changed

.golangci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ linters:
2222
- gosimple
2323
- govet
2424
- ineffassign
25-
- interfacer
25+
# - interfacer
2626
# - maligned
2727
- misspell
2828
- nakedret
29-
- scopelint
29+
- exportloopref
3030
- staticcheck
3131
- structcheck
3232
- stylecheck

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ format:
4242
## lint: Run Golang CI Lint.
4343
lint:
4444
@echo Running gocilint...
45-
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.2
45+
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.47.2
4646
@golangci-lint run --out-format=tab --issues-exit-code=0
4747

4848
## test-unit: Run the unit tests.

ignite/pkg/cache/cache.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func Key(keyParts ...string) string {
5151

5252
// Clear deletes all namespaces and cached values
5353
func (s Storage) Clear() error {
54-
db, err := openDb(s.storagePath)
54+
db, err := openDB(s.storagePath)
5555
if err != nil {
5656
return err
5757
}
@@ -67,7 +67,7 @@ func (s Storage) Clear() error {
6767
// Put sets key to value within the namespace
6868
// If the key already exists, it will be overwritten
6969
func (c Cache[T]) Put(key string, value T) error {
70-
db, err := openDb(c.storage.storagePath)
70+
db, err := openDB(c.storage.storagePath)
7171
if err != nil {
7272
return err
7373
}
@@ -92,7 +92,7 @@ func (c Cache[T]) Put(key string, value T) error {
9292
// Get fetches the value of key within the namespace.
9393
// If no value exists, it will return found == false
9494
func (c Cache[T]) Get(key string) (val T, err error) {
95-
db, err := openDb(c.storage.storagePath)
95+
db, err := openDB(c.storage.storagePath)
9696
if err != nil {
9797
return
9898
}
@@ -128,7 +128,7 @@ func (c Cache[T]) Get(key string) (val T, err error) {
128128

129129
// Delete removes a value for key within the namespace
130130
func (c Cache[T]) Delete(key string) error {
131-
db, err := openDb(c.storage.storagePath)
131+
db, err := openDB(c.storage.storagePath)
132132
if err != nil {
133133
return err
134134
}
@@ -144,6 +144,6 @@ func (c Cache[T]) Delete(key string) error {
144144
})
145145
}
146146

147-
func openDb(path string) (*bolt.DB, error) {
147+
func openDB(path string) (*bolt.DB, error) {
148148
return bolt.Open(path, 0640, &bolt.Options{Timeout: 1 * time.Minute})
149149
}

ignite/pkg/cliui/cliui.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ func (s Session) printLoop() {
172172

173173
case events.StatusNeutral:
174174
resume := s.PauseSpinner()
175-
fmt.Fprintf(s.out, event.Text())
175+
fmt.Fprint(s.out, event.Text())
176176
resume()
177177
}
178178

ignite/pkg/cosmosanalysis/app/testdata/app_minimal.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package foo
22

3+
import (
4+
sdk "github.com/cosmos/cosmos-sdk/types"
5+
abci "github.com/tendermint/tendermint/abci/types"
6+
)
7+
38
type Foo struct {
49
FooKeeper foo.keeper
510
}

ignite/pkg/cosmosanalysis/app/testdata/two_app.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package foo
22

3+
import (
4+
sdk "github.com/cosmos/cosmos-sdk/types"
5+
abci "github.com/tendermint/tendermint/abci/types"
6+
)
7+
38
type Foo struct {
49
FooKeeper foo.keeper
510
}

ignite/pkg/cosmosgen/generate.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import (
66
"path/filepath"
77
"strings"
88

9+
"github.com/pkg/errors"
10+
911
"github.com/ignite/cli/ignite/pkg/cache"
1012
"github.com/ignite/cli/ignite/pkg/cmdrunner"
1113
"github.com/ignite/cli/ignite/pkg/cmdrunner/step"
1214
"github.com/ignite/cli/ignite/pkg/cosmosanalysis/module"
1315
"github.com/ignite/cli/ignite/pkg/gomodule"
1416
"github.com/ignite/cli/ignite/pkg/xfilepath"
15-
"github.com/pkg/errors"
1617
)
1718

1819
const (

ignite/pkg/xurl/xurl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func parseURL(s string) (*url.URL, error) {
122122

123123
func addressPort(s string) (string, bool) {
124124
// Check that the value doesn't contain a URI path
125-
if strings.Index(s, "/") != -1 {
125+
if strings.Contains(s, "/") {
126126
return "", false
127127
}
128128

0 commit comments

Comments
 (0)