From 976a97234ff4bef865c1698540587722dd348e45 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Tue, 21 Nov 2023 04:57:52 +0000 Subject: [PATCH] Fix lint errors (which are actually bugs in linting dependencies) (#114) Work around bug https://github.com/golangci/golangci-lint/issues/3906 and https://github.com/cachix/install-nix-action/issues/161 and address other lint/CI issues. Reviewed-on: https://git.vdb.to/cerc-io/laconicd/pulls/114 Co-authored-by: Thomas E Lackey Co-committed-by: Thomas E Lackey --- .github/workflows/dependencies.yml | 7 ++++--- .github/workflows/lint.yml | 2 +- .golangci.yml | 4 ++-- Makefile | 2 +- go.mod | 1 + go.sum | 6 ++++++ x/registry/client/testutil/grpc.go | 22 ++++++++++++---------- 7 files changed, 27 insertions(+), 17 deletions(-) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 8ab944a1..6c2fe470 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -23,6 +23,7 @@ jobs: - name: "Dependency Review" uses: actions/dependency-review-action@v3 if: env.GIT_DIFF - - name: "Go vulnerability check" - run: make vulncheck - if: env.GIT_DIFF +# TODO: https://git.vdb.to/cerc-io/laconicd/issues/115 +# - name: "Go vulnerability check" +# run: make vulncheck +# if: env.GIT_DIFF diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5823407a..b79a434d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: cachix/install-nix-action@v18 + - uses: cachix/install-nix-action@v20 - uses: cachix/cachix-action@v12 with: name: ethermint diff --git a/.golangci.yml b/.golangci.yml index 1d0df1c3..84dea2d3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,14 +6,14 @@ run: linters: enable: - bodyclose - - depguard +# - depguard # 20231120 disable until https://github.com/golangci/golangci-lint/issues/3906 is released - dogsled - dupl - errcheck - goconst - gocritic - gofumpt - - revive +# - revive # 20231120 overly sensitive unused detection - gosec - gosimple - govet diff --git a/Makefile b/Makefile index bda401f7..6c5b09b4 100644 --- a/Makefile +++ b/Makefile @@ -237,7 +237,7 @@ endif ifeq (, $(shell which go-bindata)) @echo "Installing go-bindata..." - @go get github.com/kevinburke/go-bindata/go-bindata + @go get github.com/kevinburke/go-bindata/go-bindata@v3 else @echo "go-bindata already installed; skipping..." endif diff --git a/go.mod b/go.mod index eab4a2be..1a3ee790 100644 --- a/go.mod +++ b/go.mod @@ -134,6 +134,7 @@ require ( github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect + github.com/kevinburke/go-bindata v3.24.0+incompatible // indirect github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect github.com/klauspost/compress v1.15.11 // indirect github.com/klauspost/cpuid/v2 v2.0.9 // indirect diff --git a/go.sum b/go.sum index 69369469..536629fe 100644 --- a/go.sum +++ b/go.sum @@ -836,6 +836,12 @@ github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/kevinburke/go-bindata v1.1.0 h1:JZ8XIdxtkAszuYkgf17qwQzcU/RgsGSVLSULJdN+5bU= +github.com/kevinburke/go-bindata v1.1.0/go.mod h1:UJ72WTOoRKzbz+vwtKgARJwsy+1ZGUukVBUCc197TJo= +github.com/kevinburke/go-bindata v3.22.0+incompatible h1:/JmqEhIWQ7GRScV0WjX/0tqBrC5D21ALg0H0U/KZ/ts= +github.com/kevinburke/go-bindata v3.22.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM= +github.com/kevinburke/go-bindata v3.24.0+incompatible h1:qajFA3D0pH94OTLU4zcCCKCDgR+Zr2cZK/RPJHDdFoY= +github.com/kevinburke/go-bindata v3.24.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM= github.com/kevinmbeaulieu/eq-go v1.0.0/go.mod h1:G3S8ajA56gKBZm4UB9AOyoOS37JO3roToPzKNM8dtdM= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= diff --git a/x/registry/client/testutil/grpc.go b/x/registry/client/testutil/grpc.go index 143dab90..bd6a570f 100644 --- a/x/registry/client/testutil/grpc.go +++ b/x/registry/client/testutil/grpc.go @@ -15,6 +15,8 @@ import ( tmcli "github.com/tendermint/tendermint/libs/cli" ) +const badPath = "/asdasd" + func (s *IntegrationTestSuite) TestGRPCQueryParams() { val := s.network.Validators[0] sr := s.Require() @@ -28,7 +30,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryParams() { }{ { "invalid url", - reqURL + "/asdasd", + reqURL + badPath, true, "", }, @@ -75,7 +77,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryWhoIs() { }{ { "invalid url", - reqUrl + "/asdasd", + reqUrl + badPath, true, "", func(authorityName string) { @@ -143,7 +145,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryLookup() { }{ { "invalid url", - reqURL + "/asdasd", + reqURL + badPath, true, "", func(authorityName string) { @@ -195,7 +197,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryRecordExpiryQueue() { }{ { "invalid url", - reqUrl + "/asdasd", + reqUrl + badPath, true, "", func(bondId string) { @@ -267,7 +269,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() { }{ { "invalid url", - reqUrl + "/asdasd", + reqUrl + badPath, true, "", func(authorityName string) { @@ -339,7 +341,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryListRecords() { }{ { "invalid url", - reqUrl + "/asdasd", + reqUrl + badPath, true, "", func(bondId string) { @@ -409,7 +411,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByID() { }{ { "invalid url", - reqURL + "/asdasd", + reqURL + badPath, true, "", func(bondId string) string { @@ -478,7 +480,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByBondID() { }{ { "invalid url", - reqURL + "/asdasd", + reqURL + badPath, true, "", func(bondId string) { @@ -532,7 +534,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRegistryModuleBalance() { }{ { "invalid url", - reqURL + "/asdasd", + reqURL + badPath, true, "", func(bondId string) { @@ -583,7 +585,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryNamesList() { }{ { "invalid url", - reqURL + "/asdasd", + reqURL + badPath, true, "", func(authorityName string) {