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.

.golangci.yml 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. linters:
  2. enable:
  3. - gosimple
  4. - deadcode
  5. - typecheck
  6. - govet
  7. - errcheck
  8. - staticcheck
  9. - unused
  10. - structcheck
  11. - varcheck
  12. - dupl
  13. #- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
  14. - gofmt
  15. - misspell
  16. - gocritic
  17. - bidichk
  18. - ineffassign
  19. - revive
  20. - gofumpt
  21. enable-all: false
  22. disable-all: true
  23. fast: false
  24. run:
  25. timeout: 3m
  26. skip-dirs:
  27. - node_modules
  28. - public
  29. - web_src
  30. linters-settings:
  31. gocritic:
  32. disabled-checks:
  33. - ifElseChain
  34. - singleCaseSwitch # Every time this occurred in the code, there was no other way.
  35. revive:
  36. ignore-generated-header: false
  37. severity: warning
  38. confidence: 0.8
  39. errorCode: 1
  40. warningCode: 1
  41. rules:
  42. - name: blank-imports
  43. - name: context-as-argument
  44. - name: context-keys-type
  45. - name: dot-imports
  46. - name: error-return
  47. - name: error-strings
  48. - name: error-naming
  49. - name: exported
  50. - name: if-return
  51. - name: increment-decrement
  52. - name: var-naming
  53. - name: var-declaration
  54. - name: package-comments
  55. - name: range
  56. - name: receiver-naming
  57. - name: time-naming
  58. - name: unexported-return
  59. - name: indent-error-flow
  60. - name: errorf
  61. - name: duplicated-imports
  62. - name: modifies-value-receiver
  63. gofumpt:
  64. extra-rules: true
  65. lang-version: 1.16
  66. issues:
  67. exclude-rules:
  68. # Exclude some linters from running on tests files.
  69. - path: _test\.go
  70. linters:
  71. - gocyclo
  72. - errcheck
  73. - dupl
  74. - gosec
  75. - unparam
  76. - staticcheck
  77. - path: models/migrations/v
  78. linters:
  79. - gocyclo
  80. - errcheck
  81. - dupl
  82. - gosec
  83. - linters:
  84. - dupl
  85. text: "webhook"
  86. - linters:
  87. - gocritic
  88. text: "`ID' should not be capitalized"
  89. - path: modules/templates/helper.go
  90. linters:
  91. - gocritic
  92. - linters:
  93. - unused
  94. - deadcode
  95. text: "swagger"
  96. - path: contrib/pr/checkout.go
  97. linters:
  98. - errcheck
  99. - path: models/issue.go
  100. linters:
  101. - errcheck
  102. - path: models/migrations/
  103. linters:
  104. - errcheck
  105. - path: modules/log/
  106. linters:
  107. - errcheck
  108. - path: routers/api/v1/repo/issue_subscription.go
  109. linters:
  110. - dupl
  111. - path: routers/repo/view.go
  112. linters:
  113. - dupl
  114. - path: models/migrations/
  115. linters:
  116. - unused
  117. - linters:
  118. - staticcheck
  119. text: "argument x is overwritten before first use"
  120. - path: modules/httplib/httplib.go
  121. linters:
  122. - staticcheck
  123. # Enabling this would require refactoring the methods and how they are called.
  124. - path: models/issue_comment_list.go
  125. linters:
  126. - dupl
  127. - linters:
  128. - misspell
  129. text: '`Unknwon` is a misspelling of `Unknown`'
  130. - path: models/update.go
  131. linters:
  132. - unused
  133. - path: cmd/dump.go
  134. linters:
  135. - dupl
  136. - path: services/webhook/webhook.go
  137. linters:
  138. - structcheck
  139. - text: "commentFormatting: put a space between `//` and comment text"
  140. linters:
  141. - gocritic
  142. - text: "exitAfterDefer:"
  143. linters:
  144. - gocritic
  145. - path: modules/graceful/manager_windows.go
  146. linters:
  147. - staticcheck
  148. text: "svc.IsAnInteractiveSession is deprecated: Use IsWindowsService instead."
  149. - path: models/user/openid.go
  150. linters:
  151. - golint