.golangci.yaml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #issues:
  2. # # The list of ids of default excludes to include or disable.
  3. # include:
  4. # - EXC0002 # disable excluding of issues about comments from golint
  5. linters:
  6. # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
  7. disable-all: true
  8. enable:
  9. - asciicheck
  10. - bodyclose
  11. - depguard
  12. - dogsled
  13. - dupl
  14. - errcheck
  15. - exportloopref
  16. - funlen
  17. - gocognit
  18. - goconst
  19. - gocritic
  20. - gocyclo
  21. - gofmt
  22. - goprintffuncname
  23. - gosec
  24. - gosimple
  25. - govet
  26. - ineffassign
  27. - misspell
  28. - nakedret
  29. - nolintlint
  30. - revive
  31. - staticcheck
  32. - stylecheck
  33. - typecheck
  34. - unconvert
  35. - unparam
  36. - unused
  37. - whitespace
  38. # do not enable...
  39. # - gochecknoglobals
  40. # - gochecknoinits # this is too aggressive
  41. # - rowserrcheck disabled per generics https://github.com/golangci/golangci-lint/issues/2649
  42. # - godot
  43. # - godox
  44. # - goerr113
  45. # - goimports # we're using gosimports now instead to account for extra whitespaces (see https://github.com/golang/go/issues/20818)
  46. # - golint # deprecated
  47. # - gomnd # this is too aggressive
  48. # - interfacer # this is a good idea, but is no longer supported and is prone to false positives
  49. # - lll # without a way to specify per-line exception cases, this is not usable
  50. # - maligned # this is an excellent linter, but tricky to optimize and we are not sensitive to memory layout optimizations
  51. # - nestif
  52. # - prealloc # following this rule isn't consistently a good idea, as it sometimes forces unnecessary allocations that result in less idiomatic code
  53. # - scopelint # deprecated
  54. # - testpackage
  55. # - wsl # this doens't have an auto-fixer yet and is pretty noisy (https://github.com/bombsimon/wsl/issues/90)
  56. linters-settings:
  57. funlen:
  58. # Checks the number of lines in a function.
  59. # If lower than 0, disable the check.
  60. # Default: 60
  61. lines: 140
  62. # Checks the number of statements in a function.
  63. # If lower than 0, disable the check.
  64. # Default: 40
  65. statements: 100
  66. gocognit:
  67. # Minimal code complexity to report
  68. # Default: 30 (but we recommend 10-20)
  69. min-complexity: 80
  70. gocyclo:
  71. # Minimal code complexity to report.
  72. # Default: 30 (but we recommend 10-20)
  73. min-complexity: 50