Skip to content

Commit

Permalink
ci: Fix linter complaint (backport #9645) (#9646)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Fix remaining lints

Signed-off-by: Thane Thomson <[email protected]>

Signed-off-by: Thane Thomson <[email protected]>
Co-authored-by: Thane Thomson <[email protected]>
  • Loading branch information
mergify[bot] and thanethomson authored Oct 29, 2022
1 parent 6f05a08 commit c9561ce
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ linters:
enable:
- asciicheck
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
Expand All @@ -26,7 +25,6 @@ linters:
- typecheck
- unconvert
- unused
- varcheck

issues:
exclude-rules:
Expand Down
3 changes: 2 additions & 1 deletion cmd/tendermint/commands/debug/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
3 changes: 2 additions & 1 deletion libs/rand/random.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

//----------------------------------------
Expand Down
1 change: 1 addition & 0 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}()
}
Expand Down

0 comments on commit c9561ce

Please sign in to comment.