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.4KB

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