.golangci.yaml 2.7 KB

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