2019-06-12 21:41:28 +02:00
|
|
|
linters:
|
2024-04-22 13:48:42 +02:00
|
|
|
enable-all: false
|
|
|
|
|
disable-all: true
|
|
|
|
|
fast: false
|
2019-06-12 21:41:28 +02:00
|
|
|
enable:
|
2022-12-08 09:21:37 +01:00
|
|
|
- bidichk
|
|
|
|
|
- depguard
|
2019-06-12 21:41:28 +02:00
|
|
|
- dupl
|
2022-12-08 09:21:37 +01:00
|
|
|
- errcheck
|
2023-04-24 11:50:58 +02:00
|
|
|
- forbidigo
|
2022-03-21 06:22:34 +03:00
|
|
|
- gocritic
|
2022-12-08 09:21:37 +01:00
|
|
|
- gofmt
|
2022-01-20 18:46:10 +01:00
|
|
|
- gofumpt
|
2022-12-08 09:21:37 +01:00
|
|
|
- gosimple
|
|
|
|
|
- govet
|
|
|
|
|
- ineffassign
|
2022-06-20 12:02:49 +02:00
|
|
|
- nakedret
|
|
|
|
|
- nolintlint
|
2022-12-08 09:21:37 +01:00
|
|
|
- revive
|
|
|
|
|
- staticcheck
|
2022-06-20 12:02:49 +02:00
|
|
|
- stylecheck
|
2022-12-08 09:21:37 +01:00
|
|
|
- typecheck
|
|
|
|
|
- unconvert
|
|
|
|
|
- unused
|
2024-06-11 20:47:45 +02:00
|
|
|
- unparam
|
2023-04-22 20:53:00 +02:00
|
|
|
- wastedassign
|
2019-06-12 21:41:28 +02:00
|
|
|
|
2019-10-08 22:42:30 +02:00
|
|
|
run:
|
2022-03-16 03:50:26 +01:00
|
|
|
timeout: 10m
|
2019-10-08 22:42:30 +02:00
|
|
|
|
2024-04-22 13:48:42 +02:00
|
|
|
output:
|
|
|
|
|
sort-results: true
|
2024-05-18 10:53:28 +02:00
|
|
|
sort-order: [file]
|
|
|
|
|
show-stats: true
|
2024-04-22 13:48:42 +02:00
|
|
|
|
2019-06-12 21:41:28 +02:00
|
|
|
linters-settings:
|
2022-06-20 12:02:49 +02:00
|
|
|
stylecheck:
|
|
|
|
|
checks: ["all", "-ST1005", "-ST1003"]
|
|
|
|
|
nakedret:
|
2022-09-20 11:39:00 +02:00
|
|
|
max-func-lines: 0
|
2019-06-12 21:41:28 +02:00
|
|
|
gocritic:
|
|
|
|
|
disabled-checks:
|
|
|
|
|
- ifElseChain
|
2021-03-09 17:38:18 +09:00
|
|
|
- singleCaseSwitch # Every time this occurred in the code, there was no other way.
|
2022-01-03 03:30:40 +08:00
|
|
|
revive:
|
2024-05-18 10:53:28 +02:00
|
|
|
severity: error
|
2022-01-03 03:30:40 +08:00
|
|
|
rules:
|
2024-04-22 13:48:42 +02:00
|
|
|
- name: atomic
|
|
|
|
|
- name: bare-return
|
2022-01-03 03:30:40 +08:00
|
|
|
- name: blank-imports
|
2024-04-22 13:48:42 +02:00
|
|
|
- name: constant-logical-expr
|
2022-01-03 03:30:40 +08:00
|
|
|
- name: context-as-argument
|
|
|
|
|
- name: context-keys-type
|
|
|
|
|
- name: dot-imports
|
2024-04-22 13:48:42 +02:00
|
|
|
- name: duplicated-imports
|
|
|
|
|
- name: empty-lines
|
|
|
|
|
- name: error-naming
|
2022-01-03 03:30:40 +08:00
|
|
|
- name: error-return
|
|
|
|
|
- name: error-strings
|
2024-04-22 13:48:42 +02:00
|
|
|
- name: errorf
|
2022-01-03 03:30:40 +08:00
|
|
|
- name: exported
|
2024-04-22 13:48:42 +02:00
|
|
|
- name: identical-branches
|
2022-01-03 03:30:40 +08:00
|
|
|
- name: if-return
|
|
|
|
|
- name: increment-decrement
|
2024-04-22 13:48:42 +02:00
|
|
|
- name: indent-error-flow
|
|
|
|
|
- name: modifies-value-receiver
|
2022-01-03 03:30:40 +08:00
|
|
|
- name: package-comments
|
|
|
|
|
- name: range
|
|
|
|
|
- name: receiver-naming
|
2024-04-22 13:48:42 +02:00
|
|
|
- name: redefines-builtin-id
|
|
|
|
|
- name: string-of-int
|
|
|
|
|
- name: superfluous-else
|
2022-01-03 03:30:40 +08:00
|
|
|
- name: time-naming
|
2024-04-22 13:48:42 +02:00
|
|
|
- name: unconditional-recursion
|
2022-01-03 03:30:40 +08:00
|
|
|
- name: unexported-return
|
2024-04-22 13:48:42 +02:00
|
|
|
- name: unreachable-code
|
|
|
|
|
- name: var-declaration
|
|
|
|
|
- name: var-naming
|
2022-01-20 18:46:10 +01:00
|
|
|
gofumpt:
|
|
|
|
|
extra-rules: true
|
2022-04-01 16:47:50 +08:00
|
|
|
depguard:
|
2023-07-09 13:58:06 +02:00
|
|
|
rules:
|
|
|
|
|
main:
|
|
|
|
|
deny:
|
|
|
|
|
- pkg: encoding/json
|
|
|
|
|
desc: use gitea's modules/json instead of encoding/json
|
|
|
|
|
- pkg: github.com/unknwon/com
|
|
|
|
|
desc: use gitea's util and replacements
|
|
|
|
|
- pkg: io/ioutil
|
|
|
|
|
desc: use os or io instead
|
|
|
|
|
- pkg: golang.org/x/exp
|
|
|
|
|
desc: it's experimental and unreliable
|
|
|
|
|
- pkg: code.gitea.io/gitea/modules/git/internal
|
|
|
|
|
desc: do not use the internal package, use AddXxx function instead
|
|
|
|
|
- pkg: gopkg.in/ini.v1
|
|
|
|
|
desc: do not use the ini package, use gitea's config system instead
|
2024-04-13 16:38:44 +08:00
|
|
|
- pkg: gitea.com/go-chi/cache
|
|
|
|
|
desc: do not use the go-chi cache package, use gitea's cache system
|
2019-06-12 21:41:28 +02:00
|
|
|
|
|
|
|
|
issues:
|
2022-09-20 11:39:00 +02:00
|
|
|
max-issues-per-linter: 0
|
|
|
|
|
max-same-issues: 0
|
2024-04-11 04:40:03 +02:00
|
|
|
exclude-dirs: [node_modules, public, web_src]
|
2024-04-22 13:48:42 +02:00
|
|
|
exclude-case-sensitive: true
|
2019-06-12 21:41:28 +02:00
|
|
|
exclude-rules:
|
|
|
|
|
- path: _test\.go
|
|
|
|
|
linters:
|
|
|
|
|
- gocyclo
|
|
|
|
|
- errcheck
|
|
|
|
|
- dupl
|
|
|
|
|
- gosec
|
|
|
|
|
- unparam
|
|
|
|
|
- staticcheck
|
|
|
|
|
- path: models/migrations/v
|
|
|
|
|
linters:
|
|
|
|
|
- gocyclo
|
|
|
|
|
- errcheck
|
|
|
|
|
- dupl
|
|
|
|
|
- gosec
|
2023-04-24 11:50:58 +02:00
|
|
|
- path: cmd
|
|
|
|
|
linters:
|
|
|
|
|
- forbidigo
|
2024-04-22 13:48:42 +02:00
|
|
|
- text: "webhook"
|
|
|
|
|
linters:
|
2019-06-12 21:41:28 +02:00
|
|
|
- dupl
|
2024-04-22 13:48:42 +02:00
|
|
|
- text: "`ID' should not be capitalized"
|
|
|
|
|
linters:
|
2019-06-12 21:41:28 +02:00
|
|
|
- gocritic
|
2024-04-22 13:48:42 +02:00
|
|
|
- text: "swagger"
|
|
|
|
|
linters:
|
2019-06-12 21:41:28 +02:00
|
|
|
- unused
|
|
|
|
|
- deadcode
|
2024-04-22 13:48:42 +02:00
|
|
|
- text: "argument x is overwritten before first use"
|
|
|
|
|
linters:
|
2019-06-12 21:41:28 +02:00
|
|
|
- staticcheck
|
2020-10-11 22:27:20 +02:00
|
|
|
- text: "commentFormatting: put a space between `//` and comment text"
|
|
|
|
|
linters:
|
|
|
|
|
- gocritic
|
|
|
|
|
- text: "exitAfterDefer:"
|
|
|
|
|
linters:
|
|
|
|
|
- gocritic
|