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