You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
3.6KB

  1. linters-settings:
  2. depguard:
  3. list-type: blacklist
  4. packages:
  5. # logging is allowed only by logutils.Log, logrus
  6. # is allowed to use only in logutils package
  7. - github.com/sirupsen/logrus
  8. packages-with-error-message:
  9. - github.com/sirupsen/logrus: "logging is allowed only by logutils.Log"
  10. dupl:
  11. threshold: 100
  12. exhaustive:
  13. default-signifies-exhaustive: false
  14. funlen:
  15. lines: 100
  16. statements: 50
  17. gci:
  18. local-prefixes: github.com/golangci/golangci-lint
  19. goconst:
  20. min-len: 2
  21. min-occurrences: 2
  22. gocritic:
  23. enabled-tags:
  24. - diagnostic
  25. - experimental
  26. - opinionated
  27. - performance
  28. - style
  29. disabled-checks:
  30. - dupImport # https://github.com/go-critic/go-critic/issues/845
  31. - ifElseChain
  32. - octalLiteral
  33. - whyNoLint
  34. - wrapperFunc
  35. gocyclo:
  36. min-complexity: 15
  37. goimports:
  38. local-prefixes: github.com/golangci/golangci-lint
  39. golint:
  40. min-confidence: 0
  41. gomnd:
  42. settings:
  43. mnd:
  44. # don't include the "operation" and "assign"
  45. checks: argument,case,condition,return
  46. govet:
  47. check-shadowing: true
  48. settings:
  49. printf:
  50. funcs:
  51. - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
  52. - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
  53. - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
  54. - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
  55. lll:
  56. line-length: 140
  57. maligned:
  58. suggest-new: true
  59. misspell:
  60. locale: US
  61. nolintlint:
  62. allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
  63. allow-unused: false # report any unused nolint directives
  64. require-explanation: false # don't require an explanation for nolint directives
  65. require-specific: false # don't require nolint directives to be specific about which linter is being skipped
  66. linters:
  67. # please, do not use `enable-all`: it's deprecated and will be removed soon.
  68. # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
  69. disable-all: true
  70. enable:
  71. - bodyclose
  72. - deadcode
  73. - depguard
  74. - dogsled
  75. - dupl
  76. - errcheck
  77. - exhaustive
  78. - funlen
  79. - gochecknoinits
  80. - goconst
  81. - gocritic
  82. - gocyclo
  83. - gofmt
  84. - goimports
  85. - golint
  86. - gomnd
  87. - goprintffuncname
  88. - gosec
  89. - gosimple
  90. - govet
  91. - ineffassign
  92. - interfacer
  93. - lll
  94. - misspell
  95. - nakedret
  96. - noctx
  97. - nolintlint
  98. - rowserrcheck
  99. - scopelint
  100. - staticcheck
  101. - structcheck
  102. - stylecheck
  103. - typecheck
  104. - unconvert
  105. - unparam
  106. - unused
  107. - varcheck
  108. - whitespace
  109. # don't enable:
  110. # - asciicheck
  111. # - gochecknoglobals
  112. # - gocognit
  113. # - godot
  114. # - godox
  115. # - goerr113
  116. # - maligned
  117. # - nestif
  118. # - prealloc
  119. # - testpackage
  120. # - wsl
  121. issues:
  122. # Excluding configuration per-path, per-linter, per-text and per-source
  123. exclude-rules:
  124. - path: _test\.go
  125. linters:
  126. - gomnd
  127. # https://github.com/go-critic/go-critic/issues/926
  128. - linters:
  129. - gocritic
  130. text: "unnecessaryDefer:"
  131. - linters:
  132. - gocritic
  133. text: "commentedOutCode:"
  134. run:
  135. skip-dirs:
  136. - test/testdata_etc
  137. - internal/cache
  138. - internal/renameio
  139. - internal/robustio
  140. # golangci.com configuration
  141. # https://github.com/golangci/golangci/wiki/Configuration
  142. service:
  143. golangci-lint-version: 1.23.x # use the fixed version to not introduce new linters unexpectedly
  144. prepare:
  145. - echo "here I can run custom commands, but no preparation needed for this repo"