.golangci.yaml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. check-shadowing: false
  43. lll:
  44. line-length: 300
  45. misspell:
  46. locale: US
  47. linters:
  48. disable-all: true
  49. enable:
  50. - asciicheck
  51. - bodyclose
  52. - dogsled
  53. - dupl
  54. - errcheck
  55. - errorlint
  56. - exhaustive
  57. - exportloopref
  58. - gci
  59. - goheader
  60. - goconst
  61. - gocritic
  62. - godot
  63. - gofmt
  64. - goprintffuncname
  65. - gosec
  66. - gosimple
  67. - govet
  68. - ineffassign
  69. - lll
  70. - misspell
  71. - nakedret
  72. - nolintlint
  73. - prealloc
  74. - staticcheck
  75. - stylecheck
  76. - typecheck
  77. - unconvert
  78. - unparam
  79. - unused
  80. - whitespace
  81. issues:
  82. # Excluding configuration per-path and per-linter
  83. exclude-rules:
  84. # Exclude some linters from running on tests files.
  85. - path: _test(ing)?\.go
  86. linters:
  87. - gocyclo
  88. - errcheck
  89. - dupl
  90. - gosec
  91. - unparam
  92. - lll
  93. # Ease some gocritic warnings on test files.
  94. - path: _test\.go
  95. text: "(unnamedResult|exitAfterDefer)"
  96. linters:
  97. - gocritic
  98. # This is a "potential hardcoded credentials" warning. It's triggered by
  99. # any variable with 'secret' in the same, and thus hits a lot of false
  100. # positives in Kubernetes land where a Secret is an object type.
  101. - text: "G101:"
  102. linters:
  103. - gosec
  104. # The header check doesn't correctly parse the header as a code comment and is
  105. # triggered by the perceived diff. The header check still correctly detects missing
  106. # license headers and is useful for some cases.
  107. - text: "Actual:"
  108. linters:
  109. - goheader
  110. # excluding deprecation check introduced on purpose in #2884
  111. - path: pkg/provider/fake/fake.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. - path: pkg/provider/fake/fake_test.go
  114. text: 'SA1019: data.ValueMap is deprecated: ValueMap is deprecated and is intended to be removed in the future, use the `value` field instead.'
  115. # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
  116. max-per-linter: 0
  117. # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
  118. max-same-issues: 0