.golangci.yaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. run:
  2. timeout: 5m
  3. linters-settings:
  4. gci:
  5. local-prefixes: github.com/external-secrets/external-secrets
  6. goconst:
  7. min-len: 3
  8. min-occurrences: 3
  9. gocritic:
  10. enabled-tags:
  11. - diagnostic
  12. - experimental
  13. - opinionated
  14. - performance
  15. - style
  16. disabled-checks:
  17. - dupImport
  18. - ifElseChain
  19. - octalLiteral
  20. - whyNoLint
  21. - wrapperFunc
  22. - importShadow
  23. - unnamedResult
  24. - unnecessaryBlock
  25. settings:
  26. rangeValCopy:
  27. sizeThreshold: 512
  28. hugeParam:
  29. sizeThreshold: 512
  30. gocyclo:
  31. min-complexity: 16
  32. goheader:
  33. template-path: ./hack/boilerplate.go.txt
  34. govet:
  35. check-shadowing: false
  36. lll:
  37. line-length: 300
  38. misspell:
  39. locale: US
  40. linters:
  41. disable-all: true
  42. enable:
  43. - asciicheck
  44. - bodyclose
  45. - deadcode
  46. - depguard
  47. - dogsled
  48. - dupl
  49. - errcheck
  50. - errorlint
  51. - exhaustive
  52. - exportloopref
  53. - gci
  54. - goheader
  55. - goconst
  56. - gocritic
  57. - godot
  58. - gofmt
  59. - goprintffuncname
  60. - gosec
  61. - gosimple
  62. - govet
  63. - ineffassign
  64. - lll
  65. - misspell
  66. - nakedret
  67. - nolintlint
  68. - prealloc
  69. - revive
  70. - rowserrcheck
  71. - sqlclosecheck
  72. - staticcheck
  73. - structcheck
  74. - stylecheck
  75. - typecheck
  76. - unconvert
  77. - unparam
  78. - unused
  79. - varcheck
  80. - whitespace
  81. service:
  82. golangci-lint-version: 1.33.x
  83. issues:
  84. # Excluding configuration per-path and per-linter
  85. exclude-rules:
  86. # Exclude some linters from running on tests files.
  87. - path: _test(ing)?\.go
  88. linters:
  89. - gocyclo
  90. - errcheck
  91. - dupl
  92. - gosec
  93. - unparam
  94. - lll
  95. # Ease some gocritic warnings on test files.
  96. - path: _test\.go
  97. text: "(unnamedResult|exitAfterDefer)"
  98. linters:
  99. - gocritic
  100. # This is a "potential hardcoded credentials" warning. It's triggered by
  101. # any variable with 'secret' in the same, and thus hits a lot of false
  102. # positives in Kubernetes land where a Secret is an object type.
  103. - text: "G101:"
  104. linters:
  105. - gosec
  106. # The header check doesn't correctly parse the header as a code comment and is
  107. # triggered by the perceived diff. The header check still correctly detects missing
  108. # license headers and is useful for some cases.
  109. - text: "Actual:"
  110. linters:
  111. - goheader
  112. # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
  113. max-per-linter: 0
  114. # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
  115. max-same-issues: 0