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 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. enable-all: false
  20. disable-all: true
  21. fast: false
  22. run:
  23. timeout: 3m
  24. linters-settings:
  25. gocritic:
  26. disabled-checks:
  27. - ifElseChain
  28. - singleCaseSwitch # Every time this occurred in the code, there was no other way.
  29. issues:
  30. exclude-rules:
  31. # Exclude some linters from running on tests files.
  32. - path: _test\.go
  33. linters:
  34. - gocyclo
  35. - errcheck
  36. - dupl
  37. - gosec
  38. - unparam
  39. - staticcheck
  40. - path: models/migrations/v
  41. linters:
  42. - gocyclo
  43. - errcheck
  44. - dupl
  45. - gosec
  46. - linters:
  47. - dupl
  48. text: "webhook"
  49. - linters:
  50. - gocritic
  51. text: "`ID' should not be capitalized"
  52. - path: modules/templates/helper.go
  53. linters:
  54. - gocritic
  55. - linters:
  56. - unused
  57. - deadcode
  58. text: "swagger"
  59. - path: contrib/pr/checkout.go
  60. linters:
  61. - errcheck
  62. - path: models/issue.go
  63. linters:
  64. - errcheck
  65. - path: models/migrations/
  66. linters:
  67. - errcheck
  68. - path: modules/log/
  69. linters:
  70. - errcheck
  71. - path: routers/api/v1/repo/issue_subscription.go
  72. linters:
  73. - dupl
  74. - path: routers/repo/view.go
  75. linters:
  76. - dupl
  77. - path: models/migrations/
  78. linters:
  79. - unused
  80. - linters:
  81. - staticcheck
  82. text: "argument x is overwritten before first use"
  83. - path: modules/httplib/httplib.go
  84. linters:
  85. - staticcheck
  86. # Enabling this would require refactoring the methods and how they are called.
  87. - path: models/issue_comment_list.go
  88. linters:
  89. - dupl
  90. - linters:
  91. - misspell
  92. text: '`Unknwon` is a misspelling of `Unknown`'
  93. - path: models/update.go
  94. linters:
  95. - unused
  96. - path: cmd/dump.go
  97. linters:
  98. - dupl
  99. - path: services/webhook/webhook.go
  100. linters:
  101. - structcheck
  102. - text: "commentFormatting: put a space between `//` and comment text"
  103. linters:
  104. - gocritic
  105. - text: "exitAfterDefer:"
  106. linters:
  107. - gocritic
  108. - path: modules/graceful/manager_windows.go
  109. linters:
  110. - staticcheck
  111. text: "svc.IsAnInteractiveSession is deprecated: Use IsWindowsService instead."
  112. - path: models/user/openid.go
  113. linters:
  114. - golint