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.

97 lines
2.3 KiB

  1. linters:
  2. enable:
  3. - gosimple
  4. - deadcode
  5. - typecheck
  6. - govet
  7. - errcheck
  8. - staticcheck
  9. - unused
  10. - structcheck
  11. - varcheck
  12. - golint
  13. - dupl
  14. #- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
  15. - gofmt
  16. - misspell
  17. - gocritic
  18. enable-all: false
  19. disable-all: true
  20. fast: false
  21. linters-settings:
  22. gocritic:
  23. disabled-checks:
  24. - ifElseChain
  25. - singleCaseSwitch # Every time this occured in the code, there was no other way.
  26. issues:
  27. exclude-rules:
  28. # Exclude some linters from running on tests files.
  29. - path: _test\.go
  30. linters:
  31. - gocyclo
  32. - errcheck
  33. - dupl
  34. - gosec
  35. - unparam
  36. - staticcheck
  37. - path: models/migrations/v
  38. linters:
  39. - gocyclo
  40. - errcheck
  41. - dupl
  42. - gosec
  43. - linters:
  44. - dupl
  45. text: "webhook"
  46. - linters:
  47. - gocritic
  48. text: "`ID' should not be capitalized"
  49. - path: modules/templates/helper.go
  50. linters:
  51. - gocritic
  52. - linters:
  53. - unused
  54. - deadcode
  55. text: "swagger"
  56. - path: contrib/pr/checkout.go
  57. linters:
  58. - errcheck
  59. - path: models/issue.go
  60. linters:
  61. - errcheck
  62. - path: models/migrations/
  63. linters:
  64. - errcheck
  65. - path: modules/log/
  66. linters:
  67. - errcheck
  68. - path: routers/routes/routes.go
  69. linters:
  70. - dupl
  71. - path: routers/repo/view.go
  72. linters:
  73. - dupl
  74. - path: models/migrations/
  75. linters:
  76. - unused
  77. - linters:
  78. - staticcheck
  79. text: "argument x is overwritten before first use"
  80. - path: modules/httplib/httplib.go
  81. linters:
  82. - staticcheck
  83. # Enabling this would require refactoring the methods and how they are called.
  84. - path: models/issue_comment_list.go
  85. linters:
  86. - dupl
  87. # "Destroy" is misspelled in github.com/go-macaron/session/session.go:213 so it's not our responsability to fix it
  88. - path: modules/session/virtual.go
  89. linters:
  90. - misspell
  91. text: '`Destory` is a misspelling of `Destroy`'
  92. - path: modules/session/memory.go
  93. linters:
  94. - misspell
  95. text: '`Destory` is a misspelling of `Destroy`'