mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-03 11:45:18 +00:00
lint: enable nolintlinter, disable on tests
## Description - enable nolintlint - disable linting on tests Closes: #XXX
This commit is contained in:
3
.github/workflows/lint.yaml
vendored
3
.github/workflows/lint.yaml
vendored
@@ -6,7 +6,8 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: golangci-lint
|
||||
uses: reviewdog/action-golangci-lint@v1
|
||||
uses: reviewdog/action-golangci-lint@master
|
||||
with:
|
||||
github_token: ${{ secrets.github_token }}
|
||||
reporter: github-pr-review
|
||||
golangci_lint_flags: "--timeout 30m"
|
||||
|
||||
@@ -38,6 +38,7 @@ linters:
|
||||
# - whitespace
|
||||
# - wsl
|
||||
# - gocognit
|
||||
# - nolintlint
|
||||
disable:
|
||||
- errcheck
|
||||
|
||||
@@ -46,6 +47,7 @@ issues:
|
||||
- linters:
|
||||
- lll
|
||||
source: "https://"
|
||||
max-same-issues: 50
|
||||
|
||||
linters-settings:
|
||||
dogsled:
|
||||
@@ -56,15 +58,7 @@ linters-settings:
|
||||
# check-shadowing: true
|
||||
golint:
|
||||
min-confidence: 0
|
||||
# gocyclo:
|
||||
# min-complexity: 10
|
||||
# misspell:
|
||||
# locale: US
|
||||
# gocritic:
|
||||
# enabled-tags:
|
||||
# - performance
|
||||
# - style
|
||||
# - experimental
|
||||
# disabled-checks:
|
||||
# - wrapperFunc
|
||||
# - commentFormatting # https://github.com/go-critic/go-critic/issues/755
|
||||
# gocyclo:
|
||||
# min-complexity: 10
|
||||
# misspell:
|
||||
# locale: US
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package types // nolint: goimports
|
||||
package types
|
||||
|
||||
import (
|
||||
context "golang.org/x/net/context"
|
||||
|
||||
@@ -149,7 +149,6 @@ type blockVerifier interface {
|
||||
VerifyCommit(chainID string, blockID types.BlockID, height int64, commit *types.Commit) error
|
||||
}
|
||||
|
||||
//nolint:deadcode
|
||||
type blockApplier interface {
|
||||
ApplyBlock(state state.State, blockID types.BlockID, block *types.Block) (state.State, int64, error)
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ func newRoutine(name string, handleFunc handleFunc, bufferSize int) *Routine {
|
||||
}
|
||||
}
|
||||
|
||||
// nolint: unused
|
||||
func (rt *Routine) setLogger(logger log.Logger) {
|
||||
rt.logger = logger
|
||||
}
|
||||
|
||||
@@ -392,7 +392,7 @@ func (dec *WALDecoder) Decode() (*TimedWALMessage, error) {
|
||||
return nil, DataCorruptionError{fmt.Errorf("checksums do not match: read: %v, actual: %v", crc, actualCRC)}
|
||||
}
|
||||
|
||||
var res = new(TimedWALMessage) // nolint: gosimple
|
||||
var res = new(TimedWALMessage)
|
||||
err = cdc.UnmarshalBinaryBare(data, res)
|
||||
if err != nil {
|
||||
return nil, DataCorruptionError{fmt.Errorf("failed to decode data: %v", err)}
|
||||
|
||||
@@ -160,7 +160,6 @@ func (pubKey PubKeyEd25519) String() string {
|
||||
return fmt.Sprintf("PubKeyEd25519{%X}", pubKey[:])
|
||||
}
|
||||
|
||||
// nolint: golint
|
||||
func (pubKey PubKeyEd25519) Equals(other crypto.PubKey) bool {
|
||||
if otherEd, ok := other.(PubKeyEd25519); ok {
|
||||
return bytes.Equal(pubKey[:], otherEd[:])
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// nolint: dupl
|
||||
package merkle
|
||||
|
||||
import (
|
||||
|
||||
@@ -47,12 +47,10 @@ func New(key []byte) (cipher.AEAD, error) {
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
// nolint
|
||||
func (c *xchacha20poly1305) NonceSize() int {
|
||||
return NonceSize
|
||||
}
|
||||
|
||||
// nolint
|
||||
func (c *xchacha20poly1305) Overhead() int {
|
||||
return TagSize
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// nolint: dupl
|
||||
// dupl is reading this as the same file as crypto/merkle/result.go
|
||||
package kv
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// nolint
|
||||
package query
|
||||
|
||||
//go:generate peg -inline -switch query.peg
|
||||
|
||||
@@ -20,7 +20,7 @@ func TestCacheRemove(t *testing.T) {
|
||||
for i := 0; i < numTxs; i++ {
|
||||
// probability of collision is 2**-256
|
||||
txBytes := make([]byte, 32)
|
||||
rand.Read(txBytes) // nolint: gosec
|
||||
rand.Read(txBytes)
|
||||
txs[i] = txBytes
|
||||
cache.Push(txBytes)
|
||||
// make sure its added to both the linked list and the map
|
||||
|
||||
@@ -213,7 +213,6 @@ func TestSnapshotPool_Reject(t *testing.T) {
|
||||
assert.True(t, added)
|
||||
}
|
||||
|
||||
// nolint: dupl
|
||||
func TestSnapshotPool_RejectFormat(t *testing.T) {
|
||||
stateProvider := &mocks.StateProvider{}
|
||||
stateProvider.On("AppHash", mock.Anything).Return([]byte("app_hash"), nil)
|
||||
|
||||
@@ -173,8 +173,8 @@ func makeBlockIDRandom() BlockID {
|
||||
blockHash = make([]byte, tmhash.Size)
|
||||
partSetHash = make([]byte, tmhash.Size)
|
||||
)
|
||||
rand.Read(blockHash) //nolint: gosec
|
||||
rand.Read(partSetHash) //nolint: gosec
|
||||
rand.Read(blockHash)
|
||||
rand.Read(partSetHash)
|
||||
return BlockID{blockHash, PartSetHeader{123, partSetHash}}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user