.golangci.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. version: "2"
  2. run:
  3. timeout: 10m
  4. allow-parallel-runners: true
  5. linters:
  6. default: none
  7. enable:
  8. - asciicheck
  9. - bodyclose
  10. - dogsled
  11. - dupl
  12. - errcheck
  13. - errorlint
  14. - exhaustive
  15. - copyloopvar
  16. - goheader
  17. - goconst
  18. - gocritic
  19. - godot
  20. - goprintffuncname
  21. - gosec
  22. - govet
  23. - ineffassign
  24. - misspell
  25. - nakedret
  26. - nolintlint
  27. - prealloc
  28. - lll
  29. - unconvert
  30. - unparam
  31. - unused
  32. - whitespace
  33. - revive
  34. settings:
  35. goconst:
  36. min-len: 3
  37. min-occurrences: 3
  38. gocritic:
  39. enabled-tags:
  40. - diagnostic
  41. - experimental
  42. - opinionated
  43. - performance
  44. - style
  45. disabled-checks:
  46. - dupImport
  47. - ifElseChain
  48. - octalLiteral
  49. - whyNoLint
  50. - wrapperFunc
  51. - importShadow
  52. - unnamedResult
  53. - unnecessaryBlock
  54. settings:
  55. rangeValCopy:
  56. sizeThreshold: 512
  57. hugeParam:
  58. sizeThreshold: 512
  59. gocyclo:
  60. min-complexity: 16
  61. goheader:
  62. template-path: ${config-path}/hack/boilerplate.go.txt
  63. dupl:
  64. threshold: 200
  65. govet:
  66. disable:
  67. - shadow
  68. lll:
  69. line-length: 300
  70. # staticcheck:
  71. # checks:
  72. # - QF1008
  73. misspell:
  74. locale: US
  75. exclusions:
  76. rules:
  77. # Exclude some linters from running on tests files.
  78. - path: _test(ing)?\.go
  79. linters:
  80. - gocyclo
  81. - errcheck
  82. - dupl
  83. - gosec
  84. - unparam
  85. - lll
  86. - revive
  87. # Allow dot imports for Ginkgo and Gomega in test files
  88. - path: _test\.go
  89. text: "dot-imports:"
  90. linters:
  91. - revive
  92. # Ease some gocritic warnings on test files.
  93. - path: _test\.go
  94. text: "(unnamedResult|exitAfterDefer)"
  95. linters:
  96. - gocritic
  97. # Exclude fake or mock packages from revive linter
  98. - path: /(fake|mock)/
  99. linters:
  100. - revive
  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. issues:
  114. # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
  115. max-issues-per-linter: 0
  116. # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
  117. max-same-issues: 0
  118. formatters:
  119. settings:
  120. golines:
  121. # Target maximum line length.
  122. # Default: 100
  123. max-len: 200
  124. gci:
  125. sections:
  126. - "standard"
  127. - "default"
  128. - "prefix(github.com/external-secrets/external-secrets)"
  129. - "blank"
  130. - "dot"