.golangci.yaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. run:
  2. timeout: 10m
  3. linters-settings:
  4. gci:
  5. sections:
  6. - "standard"
  7. - "default"
  8. - "prefix(github.com/external-secrets/external-secrets)"
  9. - "blank"
  10. - "dot"
  11. goconst:
  12. min-len: 3
  13. min-occurrences: 3
  14. gocritic:
  15. enabled-tags:
  16. - diagnostic
  17. - experimental
  18. - opinionated
  19. - performance
  20. - style
  21. disabled-checks:
  22. - dupImport
  23. - ifElseChain
  24. - octalLiteral
  25. - whyNoLint
  26. - wrapperFunc
  27. - importShadow
  28. - unnamedResult
  29. - unnecessaryBlock
  30. settings:
  31. rangeValCopy:
  32. sizeThreshold: 512
  33. hugeParam:
  34. sizeThreshold: 512
  35. gocyclo:
  36. min-complexity: 16
  37. goheader:
  38. template-path: ./hack/boilerplate.go.txt
  39. dupl:
  40. threshold: 200
  41. govet:
  42. disable:
  43. - shadow
  44. lll:
  45. line-length: 300
  46. misspell:
  47. locale: US
  48. linters:
  49. disable-all: true
  50. enable:
  51. - asciicheck
  52. - bodyclose
  53. - dogsled
  54. - dupl
  55. - errcheck
  56. - errorlint
  57. - exhaustive
  58. - copyloopvar
  59. - gci
  60. - goheader
  61. - goconst
  62. - gocritic
  63. - godot
  64. - gofmt
  65. - goprintffuncname
  66. - gosec
  67. - gosimple
  68. - govet
  69. - ineffassign
  70. - lll
  71. - misspell
  72. - nakedret
  73. - nolintlint
  74. - prealloc
  75. - staticcheck
  76. - stylecheck
  77. - typecheck
  78. - unconvert
  79. - unparam
  80. - unused
  81. - whitespace
  82. issues:
  83. # Excluding configuration per-path and per-linter
  84. exclude-rules:
  85. # Exclude some linters from running on tests files.
  86. - path: _test(ing)?\.go
  87. linters:
  88. - gocyclo
  89. - errcheck
  90. - dupl
  91. - gosec
  92. - unparam
  93. - lll
  94. # Ease some gocritic warnings on test files.
  95. - path: _test\.go
  96. text: "(unnamedResult|exitAfterDefer)"
  97. linters:
  98. - gocritic
  99. # This is a "potential hardcoded credentials" warning. It's triggered by
  100. # any variable with 'secret' in the same, and thus hits a lot of false
  101. # positives in Kubernetes land where a Secret is an object type.
  102. - text: "G101:"
  103. linters:
  104. - gosec
  105. # The header check doesn't correctly parse the header as a code comment and is
  106. # triggered by the perceived diff. The header check still correctly detects missing
  107. # license headers and is useful for some cases.
  108. - text: "Actual:"
  109. linters:
  110. - goheader
  111. # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
  112. max-issues-per-linter: 0
  113. # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
  114. max-same-issues: 0