.golangci.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # This file configures github.com/golangci/golangci-lint.
  2. run:
  3. timeout: 20m
  4. tests: true
  5. # default is true. Enables skipping of directories:
  6. # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
  7. skip-dirs-use-default: true
  8. skip-files:
  9. - core/genesis_alloc.go
  10. linters:
  11. disable-all: true
  12. enable:
  13. - deadcode
  14. - goconst
  15. - goimports
  16. - gosimple
  17. - govet
  18. - ineffassign
  19. - misspell
  20. - unconvert
  21. - varcheck
  22. - typecheck
  23. - unused
  24. - staticcheck
  25. - bidichk
  26. - durationcheck
  27. - exportloopref
  28. - gosec
  29. - whitespace
  30. # - structcheck # lots of false positives
  31. # - errcheck #lot of false positives
  32. # - contextcheck
  33. # - errchkjson # lots of false positives
  34. # - errorlint # this check crashes
  35. # - exhaustive # silly check
  36. # - makezero # false positives
  37. # - nilerr # several intentional
  38. linters-settings:
  39. gofmt:
  40. simplify: true
  41. goconst:
  42. min-len: 3 # minimum length of string constant
  43. min-occurrences: 6 # minimum number of occurrences
  44. gosec:
  45. excludes:
  46. - G404 # Use of weak random number generator - lots of FP
  47. - G107 # Potential http request -- those are intentional
  48. - G306 # G306: Expect WriteFile permissions to be 0600 or less
  49. issues:
  50. exclude-rules:
  51. - path: crypto/bn256/cloudflare/optate.go
  52. linters:
  53. - deadcode
  54. - staticcheck
  55. - path: internal/build/pgp.go
  56. text: 'SA1019: package golang.org/x/crypto/openpgp is deprecated'
  57. - path: core/vm/contracts.go
  58. text: 'SA1019: package golang.org/x/crypto/ripemd160 is deprecated'
  59. - path: accounts/usbwallet/trezor.go
  60. text: 'SA1019: package github.com/golang/protobuf/proto is deprecated'
  61. - path: accounts/usbwallet/trezor/
  62. text: 'SA1019: package github.com/golang/protobuf/proto is deprecated'
  63. exclude:
  64. - 'SA1019: event.TypeMux is deprecated: use Feed'
  65. - 'SA1019: strings.Title is deprecated'
  66. - '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.'
  67. - 'SA1029: should not use built-in type string as key for value'
  68. - 'G306: Expect WriteFile permissions to be 0600 or less'