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

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