.golangci.yaml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. settings:
  34. goconst:
  35. min-len: 3
  36. min-occurrences: 3
  37. gocritic:
  38. enabled-tags:
  39. - diagnostic
  40. - experimental
  41. - opinionated
  42. - performance
  43. - style
  44. disabled-checks:
  45. - dupImport
  46. - ifElseChain
  47. - octalLiteral
  48. - whyNoLint
  49. - wrapperFunc
  50. - importShadow
  51. - unnamedResult
  52. - unnecessaryBlock
  53. settings:
  54. rangeValCopy:
  55. sizeThreshold: 512
  56. hugeParam:
  57. sizeThreshold: 512
  58. gocyclo:
  59. min-complexity: 16
  60. goheader:
  61. template-path: ./hack/boilerplate.go.txt
  62. dupl:
  63. threshold: 200
  64. govet:
  65. disable:
  66. - shadow
  67. lll:
  68. line-length: 300
  69. # staticcheck:
  70. # checks:
  71. # - QF1008
  72. misspell:
  73. locale: US
  74. exclusions:
  75. rules:
  76. # Exclude some linters from running on tests files.
  77. - path: _test(ing)?\.go
  78. linters:
  79. - gocyclo
  80. - errcheck
  81. - dupl
  82. - gosec
  83. - unparam
  84. - lll
  85. # Ease some gocritic warnings on test files.
  86. - path: _test\.go
  87. text: "(unnamedResult|exitAfterDefer)"
  88. linters:
  89. - gocritic
  90. # This is a "potential hardcoded credentials" warning. It's triggered by
  91. # any variable with 'secret' in the same, and thus hits a lot of false
  92. # positives in Kubernetes land where a Secret is an object type.
  93. - text: "G101:"
  94. linters:
  95. - gosec
  96. # The header check doesn't correctly parse the header as a code comment and is
  97. # triggered by the perceived diff. The header check still correctly detects missing
  98. # license headers and is useful for some cases.
  99. - text: "Actual:"
  100. linters:
  101. - goheader
  102. issues:
  103. # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
  104. max-issues-per-linter: 0
  105. # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
  106. max-same-issues: 0
  107. formatters:
  108. settings:
  109. golines:
  110. # Target maximum line length.
  111. # Default: 100
  112. max-len: 200
  113. gci:
  114. sections:
  115. - "standard"
  116. - "default"
  117. - "prefix(github.com/external-secrets/external-secrets)"
  118. - "blank"
  119. - "dot"