.golangci.yaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. run:
  2. timeout: 10m
  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. dupl:
  35. threshold: 200
  36. govet:
  37. check-shadowing: false
  38. lll:
  39. line-length: 300
  40. misspell:
  41. locale: US
  42. linters:
  43. disable-all: true
  44. enable:
  45. - asciicheck
  46. - bodyclose
  47. - depguard
  48. - dogsled
  49. - dupl
  50. - errcheck
  51. - errorlint
  52. - exhaustive
  53. - exportloopref
  54. - gci
  55. - goheader
  56. - goconst
  57. - gocritic
  58. - godot
  59. - gofmt
  60. - goprintffuncname
  61. - gosec
  62. - gosimple
  63. - govet
  64. - ineffassign
  65. - lll
  66. - misspell
  67. - nakedret
  68. - nolintlint
  69. - prealloc
  70. - revive
  71. - staticcheck
  72. - stylecheck
  73. - typecheck
  74. - unconvert
  75. - unparam
  76. - unused
  77. - whitespace
  78. service:
  79. golangci-lint-version: 1.33.x
  80. issues:
  81. # Excluding configuration per-path and per-linter
  82. exclude-rules:
  83. # Exclude some linters from running on tests files.
  84. - path: _test(ing)?\.go
  85. linters:
  86. - gocyclo
  87. - errcheck
  88. - dupl
  89. - gosec
  90. - unparam
  91. - lll
  92. # Ease some gocritic warnings on test files.
  93. - path: _test\.go
  94. text: "(unnamedResult|exitAfterDefer)"
  95. linters:
  96. - gocritic
  97. # This is a "potential hardcoded credentials" warning. It's triggered by
  98. # any variable with 'secret' in the same, and thus hits a lot of false
  99. # positives in Kubernetes land where a Secret is an object type.
  100. - text: "G101:"
  101. linters:
  102. - gosec
  103. # The header check doesn't correctly parse the header as a code comment and is
  104. # triggered by the perceived diff. The header check still correctly detects missing
  105. # license headers and is useful for some cases.
  106. - text: "Actual:"
  107. linters:
  108. - goheader
  109. # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
  110. max-per-linter: 0
  111. # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
  112. max-same-issues: 0