.golangci.yaml 2.6 KB

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