From c9561ce269edf9860c0e20394033f7ea031ec078 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sat, 29 Oct 2022 09:11:18 -0400 Subject: [PATCH] ci: Fix linter complaint (backport #9645) (#9646) * ci: Fix linter complaint (#9645) Fixes a very silly linter complaint that makes absolutely no sense and is blocking the merging of several PRs. --- #### PR checklist - [x] Tests written/updated, or no tests needed - [x] `CHANGELOG_PENDING.md` updated, or no changelog entry needed - [x] Updated relevant documentation (`docs/`) and code comments, or no documentation updates needed (cherry picked from commit 83b7f4ad5bc77a56fdb51ec39ae13c1204dde6e0) # Conflicts: # .github/workflows/lint.yml # cmd/tendermint/commands/debug/util.go * Resolve conflicts Signed-off-by: Thane Thomson * Fix remaining lints Signed-off-by: Thane Thomson Signed-off-by: Thane Thomson Co-authored-by: Thane Thomson --- .github/workflows/lint.yml | 5 +---- .golangci.yml | 2 -- cmd/tendermint/commands/debug/util.go | 3 ++- libs/rand/random.go | 3 ++- node/node.go | 1 + 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bc038daf9..81e7330ee 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -31,10 +31,7 @@ jobs: go.sum - uses: golangci/golangci-lint-action@v3 with: - # Required: the version of golangci-lint is required and - # must be specified without patch version: we always use the - # latest patch version. - version: v1.47.3 + version: v1.50.1 args: --timeout 10m github-token: ${{ secrets.github_token }} if: env.GIT_DIFF diff --git a/.golangci.yml b/.golangci.yml index 7fa9f28aa..80e7214b2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,7 +2,6 @@ linters: enable: - asciicheck - bodyclose - - deadcode - depguard - dogsled - dupl @@ -26,7 +25,6 @@ linters: - typecheck - unconvert - unused - - varcheck issues: exclude-rules: diff --git a/cmd/tendermint/commands/debug/util.go b/cmd/tendermint/commands/debug/util.go index 089817f2f..f29fd5a81 100644 --- a/cmd/tendermint/commands/debug/util.go +++ b/cmd/tendermint/commands/debug/util.go @@ -67,7 +67,8 @@ func copyConfig(home, dir string) error { func dumpProfile(dir, addr, profile string, debug int) error { endpoint := fmt.Sprintf("%s/debug/pprof/%s?debug=%d", addr, profile, debug) - resp, err := http.Get(endpoint) //nolint: gosec + //nolint:gosec,nolintlint + resp, err := http.Get(endpoint) if err != nil { return fmt.Errorf("failed to query for %s profile: %w", profile, err) } diff --git a/libs/rand/random.go b/libs/rand/random.go index 05af30f1a..6f481c1a3 100644 --- a/libs/rand/random.go +++ b/libs/rand/random.go @@ -48,7 +48,8 @@ func (r *Rand) init() { } func (r *Rand) reset(seed int64) { - r.rand = mrand.New(mrand.NewSource(seed)) //nolint:gosec + //nolint:gosec,nolintlint + r.rand = mrand.New(mrand.NewSource(seed)) } //---------------------------------------- diff --git a/node/node.go b/node/node.go index e40b72e99..a2b7ed160 100644 --- a/node/node.go +++ b/node/node.go @@ -891,6 +891,7 @@ func NewNode(config *cfg.Config, if config.RPC.PprofListenAddress != "" { go func() { logger.Info("Starting pprof server", "laddr", config.RPC.PprofListenAddress) + //nolint:gosec,nolintlint // G114: Use of net/http serve function that has no support for setting timeouts logger.Error("pprof server error", "err", http.ListenAndServe(config.RPC.PprofListenAddress, nil)) }() }