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

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