.golangci.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Copyright 2013-2023 The Cobra Authors
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. version: "2"
  15. run:
  16. timeout: 5m
  17. formatters:
  18. enable:
  19. - gofmt
  20. - goimports
  21. linters:
  22. default: none
  23. enable:
  24. #- bodyclose
  25. #- depguard
  26. #- dogsled
  27. #- dupl
  28. - errcheck
  29. #- exhaustive
  30. #- funlen
  31. #- gochecknoinits
  32. - goconst
  33. - gocritic
  34. #- gocyclo
  35. #- goprintffuncname
  36. - gosec
  37. - govet
  38. - ineffassign
  39. #- lll
  40. - misspell
  41. #- mnd
  42. #- nakedret
  43. #- noctx
  44. - nolintlint
  45. #- rowserrcheck
  46. - staticcheck
  47. - unconvert
  48. #- unparam
  49. - unused
  50. #- whitespace
  51. exclusions:
  52. presets:
  53. - common-false-positives
  54. - legacy
  55. - std-error-handling
  56. settings:
  57. govet:
  58. # Disable buildtag check to allow dual build tag syntax (both //go:build and // +build).
  59. # This is necessary for Go 1.15 compatibility since //go:build was introduced in Go 1.17.
  60. # This can be removed once Cobra requires Go 1.17 or higher.
  61. disable:
  62. - buildtag