.golangci.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # This file contains configuration options for golangci-lint.
  2. # https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
  3. run:
  4. # Timeout for analysis.
  5. timeout: 5m
  6. linters:
  7. enable-all: true
  8. disable:
  9. - cyclop
  10. - depguard
  11. - dupl
  12. - errname
  13. - errorlint
  14. - exhaustive
  15. - exhaustruct
  16. - forcetypeassert
  17. - funlen
  18. - gochecknoglobals
  19. - gocognit
  20. - goconst
  21. - gocyclo
  22. - goerr113
  23. - gomnd
  24. - gosec
  25. - inamedparam
  26. - ireturn
  27. - maintidx
  28. - nakedret
  29. - nestif
  30. - nlreturn
  31. - noctx
  32. - nonamedreturns
  33. - paralleltest
  34. - testableexamples
  35. - testpackage
  36. - thelper
  37. - tparallel
  38. - unparam
  39. - usestdlibvars
  40. - varnamelen
  41. - wrapcheck
  42. - wsl
  43. # Deprecated linters
  44. - deadcode
  45. - exhaustivestruct
  46. - golint
  47. - ifshort
  48. - interfacer
  49. - maligned
  50. - nosnakecase
  51. - scopelint
  52. - structcheck
  53. - varcheck
  54. linters-settings:
  55. revive:
  56. # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
  57. rules:
  58. - name: use-any
  59. lll:
  60. line-length: 130
  61. stylecheck:
  62. checks: [
  63. "all",
  64. "-ST1000", # at least one file in a package should have a package comment
  65. ]
  66. gocritic:
  67. enabled-tags:
  68. - diagnostic
  69. - experimental
  70. - opinionated
  71. - performance
  72. - style
  73. disabled-checks:
  74. - deferInLoop
  75. - importShadow
  76. - sloppyReassign
  77. - unnamedResult
  78. - whyNoLint
  79. govet:
  80. enable-all: true
  81. disable:
  82. - fieldalignment
  83. - shadow
  84. issues:
  85. # Show all issues from a linter.
  86. max-issues-per-linter: 0
  87. # Show all issues with the same text.
  88. max-same-issues: 0
  89. include:
  90. - EXC0011 # include issues about comments from `stylecheck`
  91. exclude-rules:
  92. # Exclude some linters from running on tests files.
  93. - path: _test\.go
  94. linters:
  95. - lll