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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. linters:
  2. enable-all: false
  3. disable-all: true
  4. fast: false
  5. enable:
  6. - bidichk
  7. - depguard
  8. - dupl
  9. - errcheck
  10. - forbidigo
  11. - gocritic
  12. - gofmt
  13. - gofumpt
  14. - gosimple
  15. - govet
  16. - ineffassign
  17. - nakedret
  18. - nolintlint
  19. - revive
  20. - staticcheck
  21. - stylecheck
  22. - typecheck
  23. - unconvert
  24. - unused
  25. - wastedassign
  26. run:
  27. timeout: 10m
  28. output:
  29. sort-results: true
  30. linters-settings:
  31. stylecheck:
  32. checks: ["all", "-ST1005", "-ST1003"]
  33. nakedret:
  34. max-func-lines: 0
  35. gocritic:
  36. disabled-checks:
  37. - ifElseChain
  38. - singleCaseSwitch # Every time this occurred in the code, there was no other way.
  39. revive:
  40. ignore-generated-header: false
  41. severity: warning
  42. confidence: 0.8
  43. errorCode: 1
  44. warningCode: 1
  45. rules:
  46. - name: atomic
  47. - name: bare-return
  48. - name: blank-imports
  49. - name: constant-logical-expr
  50. - name: context-as-argument
  51. - name: context-keys-type
  52. - name: dot-imports
  53. - name: duplicated-imports
  54. - name: empty-lines
  55. - name: error-naming
  56. - name: error-return
  57. - name: error-strings
  58. - name: errorf
  59. - name: exported
  60. - name: identical-branches
  61. - name: if-return
  62. - name: increment-decrement
  63. - name: indent-error-flow
  64. - name: modifies-value-receiver
  65. - name: package-comments
  66. - name: range
  67. - name: receiver-naming
  68. - name: redefines-builtin-id
  69. - name: string-of-int
  70. - name: superfluous-else
  71. - name: time-naming
  72. - name: unconditional-recursion
  73. - name: unexported-return
  74. - name: unreachable-code
  75. - name: var-declaration
  76. - name: var-naming
  77. gofumpt:
  78. extra-rules: true
  79. depguard:
  80. rules:
  81. main:
  82. deny:
  83. - pkg: encoding/json
  84. desc: use gitea's modules/json instead of encoding/json
  85. - pkg: github.com/unknwon/com
  86. desc: use gitea's util and replacements
  87. - pkg: io/ioutil
  88. desc: use os or io instead
  89. - pkg: golang.org/x/exp
  90. desc: it's experimental and unreliable
  91. - pkg: code.gitea.io/gitea/modules/git/internal
  92. desc: do not use the internal package, use AddXxx function instead
  93. - pkg: gopkg.in/ini.v1
  94. desc: do not use the ini package, use gitea's config system instead
  95. - pkg: gitea.com/go-chi/cache
  96. desc: do not use the go-chi cache package, use gitea's cache system
  97. issues:
  98. max-issues-per-linter: 0
  99. max-same-issues: 0
  100. exclude-dirs: [node_modules, public, web_src]
  101. exclude-case-sensitive: true
  102. exclude-rules:
  103. - path: _test\.go
  104. linters:
  105. - gocyclo
  106. - errcheck
  107. - dupl
  108. - gosec
  109. - unparam
  110. - staticcheck
  111. - path: models/migrations/v
  112. linters:
  113. - gocyclo
  114. - errcheck
  115. - dupl
  116. - gosec
  117. - path: cmd
  118. linters:
  119. - forbidigo
  120. - text: "webhook"
  121. linters:
  122. - dupl
  123. - text: "`ID' should not be capitalized"
  124. linters:
  125. - gocritic
  126. - text: "swagger"
  127. linters:
  128. - unused
  129. - deadcode
  130. - text: "argument x is overwritten before first use"
  131. linters:
  132. - staticcheck
  133. - text: "commentFormatting: put a space between `//` and comment text"
  134. linters:
  135. - gocritic
  136. - text: "exitAfterDefer:"
  137. linters:
  138. - gocritic