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:
patridunk 2025-12-08 19:47:43 +01:00 committed by GitHub
parent 66134b35df
commit 44cddc8b23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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:
@ -14,83 +16,51 @@ linters:
- mirror - mirror
- misspell - misspell
- reassign - reassign
- revive # only certain checks enabled - revive # only certain checks enabled
- staticcheck - staticcheck
- unconvert - unconvert
- 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:
staticcheck: settings:
checks: staticcheck:
# disable Quickfixes checks:
- -QF1* # disable Quickfixes
revive: - "-QF1*"
enable-all-rules: false
# here we enable specific useful rules revive:
# see https://golangci-lint.run/usage/linters/#revive for supported rules enable-all-rules: false
rules: # see https://golangci-lint.run/usage/linters/#revive
- name: receiver-naming
severity: warning
disabled: false
exclude:
- ''
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules: rules:
- linters: - name: receiver-naming
- deadcode severity: warning
- staticcheck disabled: false
path: crypto/bn256/cloudflare/optate.go exclude:
- linters: - ""
- revive
path: crypto/bn256/ exclusions:
- path: cmd/utils/flags.go generated: lax
text: "SA1019: cfg.TxLookupLimit is deprecated: use 'TransactionHistory' instead." paths:
- path: cmd/utils/flags.go - core/genesis_alloc.go
text: "SA1019: ethconfig.Defaults.TxLookupLimit is deprecated: use 'TransactionHistory' instead." - third_party$
- path: internal/build/pgp.go - builtin$
text: 'SA1019: "golang.org/x/crypto/openpgp" is deprecated: this package is unmaintained except for security fixes.' - examples$
- 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:
- core/genesis_alloc.go
- third_party$
- builtin$
- 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$