2019-11-18 09:49:18 +01:00
# This file configures github.com/golangci/golangci-lint.
run :
2022-01-31 13:17:18 +01:00
timeout : 20m
2019-11-18 09:49:18 +01:00
tests : true
# default is true. Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs-use-default : true
linters :
disable-all : true
enable :
- goimports
- gosimple
- govet
- ineffassign
- misspell
- unconvert
2022-06-13 16:24:45 +02:00
- typecheck
- unused
- staticcheck
- bidichk
- durationcheck
- exportloopref
2022-07-25 18:14:03 +08:00
- whitespace
2024-06-12 09:45:42 +02:00
- revive # only certain checks enabled
2022-06-13 16:24:45 +02:00
2024-05-29 15:31:27 +02:00
### linters we tried and will not be using:
###
2022-07-25 18:14:03 +08:00
# - structcheck # lots of false positives
# - errcheck #lot of false positives
# - contextcheck
# - errchkjson # lots of false positives
# - errorlint # this check crashes
# - exhaustive # silly check
# - makezero # false positives
# - nilerr # several intentional
2019-11-18 09:49:18 +01:00
linters-settings :
gofmt :
simplify : true
2024-06-12 09:45:42 +02:00
revive :
enable-all-rules : false
# here we enable specific useful rules
# see https://golangci-lint.run/usage/linters/#revive for supported rules
rules :
- name : receiver-naming
severity : warning
disabled : false
exclude : [ "" ]
2019-11-18 09:49:18 +01:00
issues :
2024-05-29 15:31:27 +02:00
exclude-files :
- core/genesis_alloc.go
2019-11-18 09:49:18 +01:00
exclude-rules :
2022-06-13 16:24:45 +02:00
- path : crypto/bn256/cloudflare/optate.go
2020-01-16 13:09:38 +01:00
linters :
- deadcode
2022-06-13 16:24:45 +02:00
- staticcheck
2024-06-12 09:45:42 +02:00
- path : crypto/bn256/
linters :
- revive
2024-08-15 10:11:03 +02:00
- path : cmd/utils/flags.go
text : "SA1019: cfg.TxLookupLimit is deprecated: use 'TransactionHistory' instead."
2024-08-15 11:42:39 +02:00
- path : cmd/utils/flags.go
text : "SA1019: ethconfig.Defaults.TxLookupLimit is deprecated: use 'TransactionHistory' instead."
2022-06-13 16:24:45 +02:00
- path : internal/build/pgp.go
2022-09-10 13:25:40 +02:00
text: 'SA1019 : "golang.org/x/crypto/openpgp" is deprecated : this package is unmaintained except for security fixes.'
2022-06-13 16:24:45 +02:00
- path : core/vm/contracts.go
2022-09-10 13:25:40 +02:00
text: 'SA1019 : "golang.org/x/crypto/ripemd160" is deprecated : RIPEMD-160 is a legacy hash and should not be used for new applications.'
2022-06-13 16:24:45 +02:00
exclude :
- 'SA1019: event.TypeMux is deprecated : use Feed'
- 'SA1019 : strings.Title is deprecated'
2022-06-29 20:49:04 +02:00
- '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.'
2022-06-13 16:24:45 +02:00
- 'SA1029 : should not use built-in type string as key for value'