.golangci.yaml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. run:
  2. timeout: 10m
  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. dupl:
  35. threshold: 200
  36. govet:
  37. check-shadowing: false
  38. lll:
  39. line-length: 300
  40. misspell:
  41. locale: US
  42. linters:
  43. disable-all: true
  44. enable:
  45. - asciicheck
  46. - bodyclose
  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. - lll
  65. - misspell
  66. - nakedret
  67. - nolintlint
  68. - prealloc
  69. - revive
  70. - staticcheck
  71. - stylecheck
  72. - typecheck
  73. - unconvert
  74. - unparam
  75. - unused
  76. - whitespace
  77. service:
  78. golangci-lint-version: 1.33.x
  79. issues:
  80. # Excluding configuration per-path and per-linter
  81. exclude-rules:
  82. # Exclude some linters from running on tests files.
  83. - path: _test(ing)?\.go
  84. linters:
  85. - gocyclo
  86. - errcheck
  87. - dupl
  88. - gosec
  89. - unparam
  90. - lll
  91. # Ease some gocritic warnings on test files.
  92. - path: _test\.go
  93. text: "(unnamedResult|exitAfterDefer)"
  94. linters:
  95. - gocritic
  96. # This is a "potential hardcoded credentials" warning. It's triggered by
  97. # any variable with 'secret' in the same, and thus hits a lot of false
  98. # positives in Kubernetes land where a Secret is an object type.
  99. - text: "G101:"
  100. linters:
  101. - gosec
  102. # The header check doesn't correctly parse the header as a code comment and is
  103. # triggered by the perceived diff. The header check still correctly detects missing
  104. # license headers and is useful for some cases.
  105. - text: "Actual:"
  106. linters:
  107. - goheader
  108. # excluding deprecation check introduced on purpose in #2884
  109. - path: pkg/provider/fake/fake.go
  110. text: 'SA1019: data.ValueMap is deprecated: ValueMap is deprecated and is intended to be removed in the future, use the `value` field instead.'
  111. - path: pkg/provider/fake/fake_test.go
  112. text: 'SA1019: data.ValueMap is deprecated: ValueMap is deprecated and is intended to be removed in the future, use the `value` field instead.'
  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