.golangci.yaml 2.5 KB

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