Browse Source

ci: freeze golangci action version (#5196)

## Description

This PR updates golang-ci to latest and stops looking at master for the action. 

Closes: #XXX
pull/5198/head
Marko 4 years ago
committed by GitHub
parent
commit
2d167aefcf
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 11 additions and 10 deletions
  1. +2
    -2
      .github/workflows/lint.yaml
  2. +3
    -4
      .golangci.yml
  3. +1
    -1
      crypto/merkle/proof_key_path_test.go
  4. +1
    -1
      libs/rand/random.go
  5. +1
    -0
      light/client.go
  6. +1
    -0
      proxy/client.go
  7. +1
    -1
      rpc/jsonrpc/server/http_server_test.go
  8. +1
    -1
      statesync/snapshots.go

+ 2
- 2
.github/workflows/lint.yaml View File

@ -20,10 +20,10 @@ jobs:
.go .go
.mod .mod
.sum .sum
- uses: golangci/golangci-lint-action@master
- uses: golangci/golangci-lint-action@v2.1.0
with: with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.28
version: v1.30
args: --timeout 10m args: --timeout 10m
github-token: ${{ secrets.github_token }} github-token: ${{ secrets.github_token }}
if: "env.GIT_DIFF != ''" if: "env.GIT_DIFF != ''"

+ 3
- 4
.golangci.yml View File

@ -44,6 +44,9 @@ linters:
issues: issues:
exclude-rules: exclude-rules:
- path: _test\.go
linters:
- gosec
- linters: - linters:
- lll - lll
source: "https://" source: "https://"
@ -58,7 +61,3 @@ linters-settings:
# check-shadowing: true # check-shadowing: true
golint: golint:
min-confidence: 0 min-confidence: 0
# gocyclo:
# min-complexity: 10
# misspell:
# locale: US

+ 1
- 1
crypto/merkle/proof_key_path_test.go View File

@ -26,7 +26,7 @@ func TestKeyPath(t *testing.T) {
keys[i][j] = alphanum[rand.Intn(len(alphanum))] keys[i][j] = alphanum[rand.Intn(len(alphanum))]
} }
case KeyEncodingHex: case KeyEncodingHex:
rand.Read(keys[i]) //nolint: gosec
rand.Read(keys[i])
default: default:
panic("Unexpected encoding") panic("Unexpected encoding")
} }


+ 1
- 1
libs/rand/random.go View File

@ -48,7 +48,7 @@ func (r *Rand) init() {
} }
func (r *Rand) reset(seed int64) { func (r *Rand) reset(seed int64) {
r.rand = mrand.New(mrand.NewSource(seed))
r.rand = mrand.New(mrand.NewSource(seed)) // nolint:gosec // G404: Use of weak random number generator
} }
//---------------------------------------- //----------------------------------------


+ 1
- 0
light/client.go View File

@ -1309,6 +1309,7 @@ func (c *Client) sendConflictingHeadersEvidence(ev *types.ConflictingHeadersEvid
// exponential backoff (with jitter) // exponential backoff (with jitter)
// 0.5s -> 2s -> 4.5s -> 8s -> 12.5 with 1s variation // 0.5s -> 2s -> 4.5s -> 8s -> 12.5 with 1s variation
func backoffTimeout(attempt uint16) time.Duration { func backoffTimeout(attempt uint16) time.Duration {
// nolint:gosec // G404: Use of weak random number generator
return time.Duration(500*attempt*attempt)*time.Millisecond + time.Duration(rand.Intn(1000))*time.Millisecond return time.Duration(500*attempt*attempt)*time.Millisecond + time.Duration(rand.Intn(1000))*time.Millisecond
} }


+ 1
- 0
proxy/client.go View File

@ -62,6 +62,7 @@ func (r *remoteClientCreator) NewABCIClient() (abcicli.Client, error) {
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to connect to proxy: %w", err) return nil, fmt.Errorf("failed to connect to proxy: %w", err)
} }
return remoteApp, nil return remoteApp, nil
} }


+ 1
- 1
rpc/jsonrpc/server/http_server_test.go View File

@ -88,7 +88,7 @@ func TestServeTLS(t *testing.T) {
go ServeTLS(ln, mux, "test.crt", "test.key", log.TestingLogger(), DefaultConfig()) go ServeTLS(ln, mux, "test.crt", "test.key", log.TestingLogger(), DefaultConfig())
tr := &http.Transport{ tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // nolint: gosec
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
} }
c := &http.Client{Transport: tr} c := &http.Client{Transport: tr}
res, err := c.Get("https://" + ln.Addr().String()) res, err := c.Get("https://" + ln.Addr().String())


+ 1
- 1
statesync/snapshots.go View File

@ -140,7 +140,7 @@ func (p *snapshotPool) GetPeer(snapshot *snapshot) p2p.Peer {
if len(peers) == 0 { if len(peers) == 0 {
return nil return nil
} }
return peers[rand.Intn(len(peers))]
return peers[rand.Intn(len(peers))] // nolint:gosec // G404: Use of weak random number generator
} }
// GetPeers returns the peers for a snapshot. // GetPeers returns the peers for a snapshot.


Loading…
Cancel
Save