mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
chore: reformat golangci-lint config
I made some changes to the golangci-lint config and made it easier to read for those who will be adding or disabling rules. Updated version syntax and modified linter settings.
This commit is contained in:
parent
66134b35df
commit
44cddc8b23
1 changed files with 39 additions and 69 deletions
|
|
@ -1,7 +1,9 @@
|
||||||
# This file configures github.com/golangci/golangci-lint.
|
# This file configures github.com/golangci/golangci-lint.
|
||||||
version: '2'
|
version: "2"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
tests: true
|
tests: true
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
default: none
|
default: none
|
||||||
enable:
|
enable:
|
||||||
|
|
@ -20,77 +22,45 @@ linters:
|
||||||
- unused
|
- unused
|
||||||
- usetesting
|
- usetesting
|
||||||
- whitespace
|
- whitespace
|
||||||
### linters we tried and will not be using:
|
|
||||||
###
|
# Linters we tried and will not be using:
|
||||||
# - structcheck # lots of false positives
|
# - structcheck
|
||||||
# - errcheck #lot of false positives
|
# - errcheck
|
||||||
# - contextcheck
|
# - contextcheck
|
||||||
# - errchkjson # lots of false positives
|
# - errchkjson
|
||||||
# - errorlint # this check crashes
|
# - errorlint
|
||||||
# - exhaustive # silly check
|
# - exhaustive
|
||||||
# - makezero # false positives
|
# - makezero
|
||||||
# - nilerr # several intentional
|
# - nilerr
|
||||||
settings:
|
|
||||||
|
settings:
|
||||||
staticcheck:
|
staticcheck:
|
||||||
checks:
|
checks:
|
||||||
# disable Quickfixes
|
# disable Quickfixes
|
||||||
- -QF1*
|
- "-QF1*"
|
||||||
|
|
||||||
revive:
|
revive:
|
||||||
enable-all-rules: false
|
enable-all-rules: false
|
||||||
# here we enable specific useful rules
|
# see https://golangci-lint.run/usage/linters/#revive
|
||||||
# see https://golangci-lint.run/usage/linters/#revive for supported rules
|
|
||||||
rules:
|
rules:
|
||||||
- name: receiver-naming
|
- name: receiver-naming
|
||||||
severity: warning
|
severity: warning
|
||||||
disabled: false
|
disabled: false
|
||||||
exclude:
|
exclude:
|
||||||
- ''
|
- ""
|
||||||
exclusions:
|
|
||||||
|
exclusions:
|
||||||
generated: lax
|
generated: lax
|
||||||
presets:
|
|
||||||
- comments
|
|
||||||
- common-false-positives
|
|
||||||
- legacy
|
|
||||||
- std-error-handling
|
|
||||||
rules:
|
|
||||||
- linters:
|
|
||||||
- deadcode
|
|
||||||
- staticcheck
|
|
||||||
path: crypto/bn256/cloudflare/optate.go
|
|
||||||
- linters:
|
|
||||||
- revive
|
|
||||||
path: crypto/bn256/
|
|
||||||
- path: cmd/utils/flags.go
|
|
||||||
text: "SA1019: cfg.TxLookupLimit is deprecated: use 'TransactionHistory' instead."
|
|
||||||
- path: cmd/utils/flags.go
|
|
||||||
text: "SA1019: ethconfig.Defaults.TxLookupLimit is deprecated: use 'TransactionHistory' instead."
|
|
||||||
- path: internal/build/pgp.go
|
|
||||||
text: 'SA1019: "golang.org/x/crypto/openpgp" is deprecated: this package is unmaintained except for security fixes.'
|
|
||||||
- path: core/vm/contracts.go
|
|
||||||
text: 'SA1019: "golang.org/x/crypto/ripemd160" is deprecated: RIPEMD-160 is a legacy hash and should not be used for new applications.'
|
|
||||||
- path: (.+)\.go$
|
|
||||||
text: 'SA1019: event.TypeMux is deprecated: use Feed'
|
|
||||||
- path: (.+)\.go$
|
|
||||||
text: 'SA1019: strings.Title is deprecated'
|
|
||||||
- path: (.+)\.go$
|
|
||||||
text: 'SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.'
|
|
||||||
- path: (.+)\.go$
|
|
||||||
text: 'SA1029: should not use built-in type string as key for value'
|
|
||||||
paths:
|
paths:
|
||||||
- core/genesis_alloc.go
|
- core/genesis_alloc.go
|
||||||
- third_party$
|
- third_party$
|
||||||
- builtin$
|
- builtin$
|
||||||
- examples$
|
- examples$
|
||||||
|
|
||||||
formatters:
|
formatters:
|
||||||
enable:
|
enable:
|
||||||
- goimports
|
- goimports
|
||||||
|
|
||||||
settings:
|
settings:
|
||||||
gofmt:
|
gofmt:
|
||||||
simplify: true
|
simplify: true
|
||||||
exclusions:
|
|
||||||
generated: lax
|
|
||||||
paths:
|
|
||||||
- core/genesis_alloc.go
|
|
||||||
- third_party$
|
|
||||||
- builtin$
|
|
||||||
- examples$
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue