跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

.golangci.yml

179 行 · 4.5 KB历史下载
1# golangci-lint configuration file.
2# https://golangci-lint.run/usage/configuration/
3version: "2"
4run:
5 concurrency: 6
6linters:
7 default: none
8 enable:
9 - bodyclose
10 - copyloopvar
11 - depguard
12 - dupword
13 - errcheck
14 - errorlint
15 - forbidigo
16 - gocritic
17 - godot
18 - govet
19 - ineffassign
20 - intrange
21 - misspell
22 - modernize
23 - nakedret
24 - noctx
25 - nolintlint
26 - perfsprint
27 - revive
28 - staticcheck
29 - unconvert
30 - unused
31 - usetesting
32 - usestdlibvars
33 - whitespace
34 settings:
35 depguard:
36 rules:
37 main:
38 deny:
39 - pkg: golang.org/x/net/context
40 desc: use the 'context' package from the standard library
41 - pkg: math/rand$
42 desc: use the 'math/rand/v2' package
43 errorlint:
44 asserts: false
45 forbidigo:
46 forbid:
47 - pattern: ^print(ln)?$
48 msg: Do not use builtin print functions. It's for bootstrapping only and may be removed in the future.
49 - pattern: ^fmt\.Print.*$
50 msg: Do not use fmt.Print statements.
51 - pattern: ^testing.T.Fatal.*$
52 msg: Use assert functions from the gotest.tools/v3/assert package instead.
53 - pattern: ^sort.*$
54 msg: Use sorting functions from the slices package instead.
55 analyze-types: true
56 gocritic:
57 disabled-checks:
58 - appendCombine
59 - sloppyReassign
60 - unlabelStmt
61 - rangeValCopy
62 - hugeParam
63 - importShadow
64 - sprintfQuotedString
65 - builtinShadow
66 - filepathJoin
67 # See "Tags" section in https://github.com/go-critic/go-critic#usage
68 enabled-tags:
69 - diagnostic
70 - performance
71 - style
72 - opinionated
73 - experimental
74 settings:
75 ifElseChain:
76 # Min number of if-else blocks that makes the warning trigger.
77 minThreshold: 3
78 modernize:
79 disable:
80 - omitzero
81 perfsprint:
82 int-conversion: false
83 integer-format: false
84 err-error: false
85 errorf: true
86 sprintf1: false
87 strconcat: false
88 concat-loop: false
89 revive:
90 # Set below 0.8 to enable error-strings
91 confidence: 0.6
92 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
93 rules:
94 - name: bare-return
95 - name: blank-imports
96 - name: context-as-argument
97 - name: context-keys-type
98 - name: deep-exit
99 - name: dot-imports
100 arguments:
101 - allowedPackages:
102 - github.com/lima-vm/lima/v2/pkg/must
103 - name: empty-block
104 - name: error-naming
105 - name: error-return
106 - name: error-strings
107 - name: errorf
108 - name: exported
109 disabled: true
110 - name: increment-decrement
111 - name: indent-error-flow
112 - name: package-comments
113 disabled: true
114 - name: package-directory-mismatch
115 - name: range
116 - name: receiver-naming
117 - name: redefines-builtin-id
118 - name: superfluous-else
119 - name: time-naming
120 - name: unexported-return
121 - name: unnecessary-format
122 - name: unreachable-code
123 - name: unused-parameter
124 - name: use-any
125 - name: var-declaration
126 - name: var-naming
127 staticcheck:
128 # https://staticcheck.dev/docs/configuration/options/#checks
129 checks:
130 - all
131 - -QF1001 # apply De Morgan's law
132 - -QF1008 # remove embedded field from selector
133 - -SA3000 # false positive for Go 1.15+. See https://github.com/golang/go/issues/34129
134 - -ST1000
135 - -ST1001 # duplicates revive.dot-imports
136 - -ST1022
137 - -SA4023 # workaround for timing out https://github.com/golangci/golangci-lint/issues/6732
138 usestdlibvars:
139 http-method: false
140 time-date-month: true
141 time-layout: true
142 usetesting:
143 os-temp-dir: true
144 context-background: true
145 context-todo: true
146 exclusions:
147 presets:
148 - common-false-positives
149 - legacy
150 - std-error-handling
151 rules:
152 # Allow using Uid, Gid in pkg/osutil.
153 - path: pkg/osutil/
154 text: '(?i)(uid)|(gid)'
155 # Disable some linters for test files.
156 - linters:
157 - godot
158 path: _test\.go
159 # Allow "api" package names in hostagent and guestagent.
160 - linters:
161 - revive
162 path: pkg/(hostagent|guestagent)/api/
163 text: avoid meaningless package names
164issues:
165 # Maximum issues count per one linter.
166 max-issues-per-linter: 0
167 # Maximum count of issues with the same text.
168 max-same-issues: 0
169formatters:
170 enable:
171 - gci
172 - gofmt
173 - gofumpt
174 settings:
175 gci:
176 sections:
177 - standard
178 - default
179 - localmodule