* fix(CI): add golangci-lint to dependencies (#10112) * fix(CI): add golangci-lint to dependencies * update github workflow * tidy go.mod * add missing entries to go.mod * update deps * add missing run command * remove golint and use revive instead * fix workflow setup * lint only changed files * gofmt go tags * update comments * make lint-go Co-authored-by: Marko <marbar3778@yahoo.com> Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> * Update .golangci.yml * Update .golangci.yml * fix go.mod Co-authored-by: Marko <marbar3778@yahoo.com> Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
parent
1e4f5619f8
commit
3ee70996bf
|
@ -11,19 +11,17 @@ jobs:
|
||||||
golangci:
|
golangci:
|
||||||
name: golangci-lint
|
name: golangci-lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 6
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/setup-go@v2.1.4
|
||||||
- uses: technote-space/get-diff-action@v4
|
with:
|
||||||
|
go-version: 1.16
|
||||||
|
- uses: technote-space/get-diff-action@v5
|
||||||
|
id: git_diff
|
||||||
with:
|
with:
|
||||||
PATTERNS: |
|
PATTERNS: |
|
||||||
**/**.go
|
**/**.go
|
||||||
go.mod
|
go.mod
|
||||||
go.sum
|
go.sum
|
||||||
- uses: golangci/golangci-lint-action@master
|
- name: run go linters
|
||||||
with:
|
run: make lint-go
|
||||||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
|
||||||
version: v1.39
|
|
||||||
args: --timeout 10m
|
|
||||||
github-token: ${{ secrets.github_token }}
|
|
||||||
if: env.GIT_DIFF
|
if: env.GIT_DIFF
|
||||||
|
|
|
@ -15,7 +15,6 @@ linters:
|
||||||
- gocritic
|
- gocritic
|
||||||
- gofmt
|
- gofmt
|
||||||
- goimports
|
- goimports
|
||||||
- golint
|
|
||||||
- gosec
|
- gosec
|
||||||
- gosimple
|
- gosimple
|
||||||
- govet
|
- govet
|
||||||
|
@ -23,6 +22,7 @@ linters:
|
||||||
- misspell
|
- misspell
|
||||||
- nakedret
|
- nakedret
|
||||||
- prealloc
|
- prealloc
|
||||||
|
- revive
|
||||||
- exportloopref
|
- exportloopref
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- structcheck
|
- structcheck
|
||||||
|
|
15
Makefile
15
Makefile
|
@ -331,13 +331,18 @@ containerMarkdownLintImage=tmknom/markdownlint
|
||||||
containerMarkdownLint=cosmos-sdk-markdownlint
|
containerMarkdownLint=cosmos-sdk-markdownlint
|
||||||
containerMarkdownLintFix=cosmos-sdk-markdownlint-fix
|
containerMarkdownLintFix=cosmos-sdk-markdownlint-fix
|
||||||
|
|
||||||
lint:
|
golangci_lint_cmd=go run github.com/golangci/golangci-lint/cmd/golangci-lint
|
||||||
golangci-lint run --out-format=tab
|
|
||||||
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerMarkdownLint}$$"; then docker start -a $(containerMarkdownLint); else docker run --name $(containerMarkdownLint) -i -v "$(CURDIR):/work" $(containerMarkdownLintImage); fi
|
lint: lint-go
|
||||||
|
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerMarkdownLint}$$"; then docker start -a $(containerMarkdownLint); else docker run --name $(containerMarkdownLint) -i -v "$(CURDIR):/work" $(markdownLintImage); fi
|
||||||
|
|
||||||
lint-fix:
|
lint-fix:
|
||||||
golangci-lint run --fix --out-format=tab --issues-exit-code=0
|
$(golangci_lint_cmd) run --fix --out-format=tab --issues-exit-code=0
|
||||||
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerMarkdownLintFix}$$"; then docker start -a $(containerMarkdownLintFix); else docker run --name $(containerMarkdownLintFix) -i -v "$(CURDIR):/work" $(containerMarkdownLintImage) . --fix; fi
|
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerMarkdownLintFix}$$"; then docker start -a $(containerMarkdownLintFix); else docker run --name $(containerMarkdownLintFix) -i -v "$(CURDIR):/work" $(markdownLintImage) . --fix; fi
|
||||||
|
|
||||||
|
lint-go:
|
||||||
|
echo $(GIT_DIFF)
|
||||||
|
$(golangci_lint_cmd) run --out-format=tab $(GIT_DIFF)
|
||||||
|
|
||||||
.PHONY: lint lint-fix
|
.PHONY: lint lint-fix
|
||||||
|
|
||||||
|
|
22
go.mod
22
go.mod
|
@ -13,22 +13,25 @@ require (
|
||||||
github.com/cosmos/go-bip39 v1.0.0
|
github.com/cosmos/go-bip39 v1.0.0
|
||||||
github.com/cosmos/iavl v0.16.0
|
github.com/cosmos/iavl v0.16.0
|
||||||
github.com/cosmos/ledger-cosmos-go v0.11.1
|
github.com/cosmos/ledger-cosmos-go v0.11.1
|
||||||
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
|
|
||||||
github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25
|
github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25
|
||||||
github.com/gogo/gateway v1.1.0
|
github.com/gogo/gateway v1.1.0
|
||||||
github.com/gogo/protobuf v1.3.3
|
github.com/gogo/protobuf v1.3.3
|
||||||
github.com/golang/mock v1.6.0
|
github.com/golang/mock v1.6.0
|
||||||
github.com/golang/protobuf v1.5.2
|
github.com/golang/protobuf v1.5.2
|
||||||
|
github.com/golangci/golangci-lint v1.42.1 // indirect
|
||||||
github.com/gorilla/handlers v1.5.1
|
github.com/gorilla/handlers v1.5.1
|
||||||
github.com/gorilla/mux v1.8.0
|
github.com/gorilla/mux v1.8.0
|
||||||
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
|
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
|
||||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0
|
github.com/grpc-ecosystem/grpc-gateway v1.16.0
|
||||||
github.com/hashicorp/golang-lru v0.5.4
|
github.com/hashicorp/golang-lru v0.5.4
|
||||||
github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87
|
github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87
|
||||||
github.com/improbable-eng/grpc-web v0.14.0
|
github.com/improbable-eng/grpc-web v0.14.1
|
||||||
github.com/jhump/protoreflect v1.8.2
|
github.com/jhump/protoreflect v1.9.0
|
||||||
|
github.com/kr/text v0.2.0 // indirect
|
||||||
github.com/magiconair/properties v1.8.5
|
github.com/magiconair/properties v1.8.5
|
||||||
github.com/mattn/go-isatty v0.0.13
|
github.com/mattn/go-isatty v0.0.14
|
||||||
|
github.com/onsi/ginkgo v1.16.4 // indirect
|
||||||
|
github.com/onsi/gomega v1.13.0 // indirect
|
||||||
github.com/otiai10/copy v1.6.0
|
github.com/otiai10/copy v1.6.0
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/prometheus/client_golang v1.11.0
|
github.com/prometheus/client_golang v1.11.0
|
||||||
|
@ -37,21 +40,20 @@ require (
|
||||||
github.com/regen-network/cosmos-proto v0.3.1
|
github.com/regen-network/cosmos-proto v0.3.1
|
||||||
github.com/rs/zerolog v1.23.0
|
github.com/rs/zerolog v1.23.0
|
||||||
github.com/spf13/cast v1.3.1
|
github.com/spf13/cast v1.3.1
|
||||||
github.com/spf13/cobra v1.1.3
|
github.com/spf13/cobra v1.2.1
|
||||||
github.com/spf13/pflag v1.0.5
|
github.com/spf13/pflag v1.0.5
|
||||||
github.com/spf13/viper v1.8.0
|
github.com/spf13/viper v1.8.1
|
||||||
github.com/stretchr/testify v1.7.0
|
github.com/stretchr/testify v1.7.0
|
||||||
github.com/tendermint/btcd v0.1.1
|
github.com/tendermint/btcd v0.1.1
|
||||||
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15
|
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15
|
||||||
github.com/tendermint/go-amino v0.16.0
|
github.com/tendermint/go-amino v0.16.0
|
||||||
github.com/tendermint/tendermint v0.34.12
|
github.com/tendermint/tendermint v0.34.12
|
||||||
github.com/tendermint/tm-db v0.6.4
|
github.com/tendermint/tm-db v0.6.4
|
||||||
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
|
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a
|
||||||
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c
|
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c
|
||||||
google.golang.org/grpc v1.38.0
|
google.golang.org/grpc v1.40.0
|
||||||
google.golang.org/protobuf v1.26.0
|
google.golang.org/protobuf v1.27.1
|
||||||
gopkg.in/yaml.v2 v2.4.0
|
gopkg.in/yaml.v2 v2.4.0
|
||||||
nhooyr.io/websocket v1.8.6 // indirect
|
|
||||||
)
|
)
|
||||||
|
|
||||||
replace google.golang.org/grpc => google.golang.org/grpc v1.33.2
|
replace google.golang.org/grpc => google.golang.org/grpc v1.33.2
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !test_amino
|
||||||
// +build !test_amino
|
// +build !test_amino
|
||||||
|
|
||||||
package params
|
package params
|
||||||
|
|
Loading…
Reference in New Issue