.golangci.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. # Created based on v1.51.0
  2. # NOTE: Keep this in sync with the version in .github/workflows/linter.yml
  3. run:
  4. modules-download-mode: readonly
  5. skip-dirs-use-default: false
  6. skip-dirs:
  7. - internal
  8. output:
  9. sort-results: true
  10. linters-settings:
  11. errcheck:
  12. check-type-assertions: true
  13. check-blank: true
  14. disable-default-exclusions: true
  15. errchkjson:
  16. report-no-exported: true
  17. exhaustive:
  18. default-signifies-exhaustive: true
  19. forbidigo:
  20. forbid:
  21. - ^(fmt\.Print(|f|ln)|print|println)$
  22. - 'http\.Default(Client|Transport)'
  23. # TODO: Eventually enable these patterns
  24. # - 'time\.Sleep'
  25. # - 'panic'
  26. gocritic:
  27. disabled-checks:
  28. - ifElseChain
  29. gofumpt:
  30. module-path: github.com/gofiber/fiber
  31. extra-rules: true
  32. gosec:
  33. config:
  34. global:
  35. audit: true
  36. govet:
  37. check-shadowing: true
  38. enable-all: true
  39. disable:
  40. - shadow
  41. - fieldalignment
  42. - loopclosure
  43. grouper:
  44. import-require-single-import: true
  45. import-require-grouping: true
  46. misspell:
  47. locale: US
  48. nolintlint:
  49. require-explanation: true
  50. require-specific: true
  51. nonamedreturns:
  52. report-error-in-defer: true
  53. predeclared:
  54. q: true
  55. promlinter:
  56. strict: true
  57. revive:
  58. enable-all-rules: true
  59. rules:
  60. # Provided by gomnd linter
  61. - name: add-constant
  62. disabled: true
  63. - name: argument-limit
  64. disabled: true
  65. # Provided by bidichk
  66. - name: banned-characters
  67. disabled: true
  68. - name: cognitive-complexity
  69. disabled: true
  70. - name: cyclomatic
  71. disabled: true
  72. - name: early-return
  73. severity: warning
  74. disabled: true
  75. - name: exported
  76. disabled: true
  77. - name: file-header
  78. disabled: true
  79. - name: function-result-limit
  80. disabled: true
  81. - name: function-length
  82. disabled: true
  83. - name: line-length-limit
  84. disabled: true
  85. - name: max-public-structs
  86. disabled: true
  87. - name: modifies-parameter
  88. disabled: true
  89. - name: nested-structs
  90. disabled: true
  91. - name: package-comments
  92. disabled: true
  93. stylecheck:
  94. checks:
  95. - all
  96. - -ST1000
  97. - -ST1020
  98. - -ST1021
  99. - -ST1022
  100. tagliatelle:
  101. case:
  102. rules:
  103. json: snake
  104. #tenv:
  105. # all: true
  106. #unparam:
  107. # check-exported: true
  108. wrapcheck:
  109. ignorePackageGlobs:
  110. - github.com/gofiber/fiber/*
  111. - github.com/valyala/fasthttp
  112. issues:
  113. exclude-use-default: false
  114. linters:
  115. enable:
  116. - asasalint
  117. - asciicheck
  118. - bidichk
  119. - bodyclose
  120. - containedctx
  121. - contextcheck
  122. - depguard
  123. - dogsled
  124. - durationcheck
  125. - errcheck
  126. - errchkjson
  127. - errname
  128. - errorlint
  129. - execinquery
  130. - exhaustive
  131. - exportloopref
  132. - forbidigo
  133. - forcetypeassert
  134. - goconst
  135. - gocritic
  136. - gofmt
  137. - gofumpt
  138. - goimports
  139. - gomoddirectives
  140. - goprintffuncname
  141. - gosec
  142. - gosimple
  143. - govet
  144. - grouper
  145. - loggercheck
  146. - misspell
  147. - nakedret
  148. - nilerr
  149. - nilnil
  150. - noctx
  151. - nolintlint
  152. - nonamedreturns
  153. - nosprintfhostport
  154. - predeclared
  155. - promlinter
  156. - reassign
  157. - revive
  158. - rowserrcheck
  159. - sqlclosecheck
  160. - staticcheck
  161. - stylecheck
  162. - tagliatelle
  163. # - testpackage # TODO: Enable once https://github.com/gofiber/fiber/issues/2252 is implemented
  164. - thelper
  165. # - tparallel # TODO: Enable once https://github.com/gofiber/fiber/issues/2254 is implemented
  166. - typecheck
  167. - unconvert
  168. - unparam
  169. - unused
  170. - usestdlibvars
  171. - wastedassign
  172. - whitespace
  173. - wrapcheck