|
1 | | -# golangci-lint configuration for odek. |
2 | | -# |
3 | | -# Goal: enable a core set of linters in CI without requiring a one-shot |
4 | | -# refactor of the whole codebase. Test files are excluded from the noisiest |
5 | | -# rules (errcheck, unused) because setup helpers frequently ignore errors or |
6 | | -# are conditionally compiled. Pre-existing production issues are listed below |
7 | | -# with explicit excludes so CI stays green; they should be removed as the code |
8 | | -# is touched. |
| 1 | +version: "2" |
9 | 2 | run: |
10 | | - timeout: 10m |
11 | 3 | go: "1.25" |
12 | | - |
13 | 4 | linters: |
| 5 | + default: none |
14 | 6 | enable: |
15 | 7 | - errcheck |
16 | | - - gosimple |
17 | 8 | - govet |
18 | 9 | - ineffassign |
19 | 10 | - staticcheck |
20 | 11 | - unused |
21 | | - |
22 | | -linters-settings: |
23 | | - errcheck: |
24 | | - # Ignore common error-delegation patterns where the error is handled |
25 | | - # implicitly (e.g. fmt.Fprintf to stderr). |
26 | | - exclude-functions: |
27 | | - - fmt.Fprintf |
28 | | - - fmt.Fprintln |
29 | | - - io.WriteString |
30 | | - |
31 | | -issues: |
32 | | - exclude-rules: |
33 | | - # Test helpers commonly ignore setup errors, may define conditionally unused |
34 | | - # helpers, and often contain intentionally empty branches / identical |
35 | | - # comparison assertions. Keep govet enabled for tests; silence the rest. |
36 | | - - path: _test\.go |
37 | | - linters: |
38 | | - - errcheck |
39 | | - - gosimple |
40 | | - - ineffassign |
41 | | - - staticcheck |
42 | | - - unused |
43 | | - |
44 | | - # ------------------------------------------------------------------ |
45 | | - # Pre-existing production issues to be fixed incrementally. Each entry |
46 | | - # points to a concrete lint finding that existed before golangci-lint |
47 | | - # was enabled in CI. Contributors should remove the matching exclude |
48 | | - # when fixing the underlying code. |
49 | | - # ------------------------------------------------------------------ |
50 | | - |
51 | | - # cmd/odek/file_tool.go: unchecked filepath.Walk errors. |
52 | | - - path: cmd/odek/file_tool.go |
53 | | - linters: |
54 | | - - errcheck |
55 | | - |
56 | | - # cmd/odek/main.go: unchecked fmt.Sscanf/Scanf/store.Save/sl.RecordSkip. |
57 | | - - path: cmd/odek/main.go |
58 | | - linters: |
59 | | - - errcheck |
60 | | - |
61 | | - # cmd/odek/mcp.go: unchecked error return. |
62 | | - - path: cmd/odek/mcp.go |
63 | | - linters: |
64 | | - - errcheck |
65 | | - |
66 | | - # cmd/odek/perf_tools.go: unchecked Walk/Seek/io.Copy/Process.Kill. |
67 | | - - path: cmd/odek/perf_tools.go |
68 | | - linters: |
69 | | - - errcheck |
70 | | - |
71 | | - # cmd/odek/repl.go: unchecked store.Save. |
72 | | - - path: cmd/odek/repl.go |
73 | | - linters: |
74 | | - - errcheck |
75 | | - |
76 | | - # cmd/odek/repl_editor.go: unchecked terminal restore/read. |
77 | | - - path: cmd/odek/repl_editor.go |
78 | | - linters: |
79 | | - - errcheck |
80 | | - |
81 | | - # cmd/odek/serve.go: unchecked error returns + unused wsStreamWriter. |
82 | | - - path: cmd/odek/serve.go |
83 | | - linters: |
84 | | - - errcheck |
85 | | - - unused |
86 | | - |
87 | | - # cmd/odek/telegram.go: unchecked bot.* and os.MkdirAll error returns. |
88 | | - - path: cmd/odek/telegram.go |
89 | | - linters: |
90 | | - - errcheck |
91 | | - |
92 | | - # cmd/odek/wsapprover.go: unchecked rand.Read error. |
93 | | - - path: cmd/odek/wsapprover.go |
94 | | - linters: |
95 | | - - errcheck |
96 | | - |
97 | | - # cmd/odek/subagent.go: unchecked enc.Encode. |
98 | | - - path: cmd/odek/subagent.go |
99 | | - linters: |
100 | | - - errcheck |
101 | | - |
102 | | - # cmd/odek/vision_tool.go: unchecked fmt.Sscanf. |
103 | | - - path: cmd/odek/vision_tool.go |
104 | | - linters: |
105 | | - - errcheck |
106 | | - |
107 | | - # internal/memory/memory.go: unchecked episode write. |
108 | | - - path: internal/memory/memory.go |
109 | | - linters: |
110 | | - - errcheck |
111 | | - |
112 | | - # internal/skills/cache.go/tools.go/types.go: unchecked Rename/Unmarshal. |
113 | | - - path: internal/skills/cache.go |
114 | | - linters: |
115 | | - - errcheck |
116 | | - - path: internal/skills/tools.go |
117 | | - linters: |
118 | | - - errcheck |
119 | | - - path: internal/skills/types.go |
120 | | - linters: |
121 | | - - errcheck |
122 | | - |
123 | | - # internal/flock/flock.go: unchecked unlockFile. |
124 | | - - path: internal/flock/flock.go |
125 | | - linters: |
126 | | - - errcheck |
127 | | - |
128 | | - # internal/telegram/approver.go: unchecked EditMessageText/rand.Read. |
129 | | - - path: internal/telegram/approver.go |
130 | | - linters: |
131 | | - - errcheck |
132 | | - |
133 | | - # internal/telegram/health.go: unchecked json.Encode. |
134 | | - - path: internal/telegram/health.go |
135 | | - linters: |
136 | | - - errcheck |
137 | | - |
138 | | - # internal/llm/client.go: unused var + empty branch. |
139 | | - - path: internal/llm/client.go |
140 | | - linters: |
141 | | - - unused |
142 | | - - staticcheck |
143 | | - |
144 | | - # internal/loop/loop.go: unnecessary fmt.Sprintf. |
145 | | - - path: internal/loop/loop.go |
146 | | - linters: |
147 | | - - gosimple |
148 | | - |
149 | | - # internal/mcpclient/client.go: unused type/fields/function + unchecked Wait/Kill. |
150 | | - - path: internal/mcpclient/client.go |
151 | | - linters: |
152 | | - - errcheck |
153 | | - - unused |
154 | | - |
155 | | - # internal/memory/buffer.go: unnecessary fmt.Sprintf. |
156 | | - - path: internal/memory/buffer.go |
157 | | - linters: |
158 | | - - gosimple |
159 | | - |
160 | | - # internal/memory/memory.go: unused const. |
161 | | - - path: internal/memory/memory.go |
162 | | - linters: |
163 | | - - unused |
164 | | - |
165 | | - # internal/memory/merge.go: ineffectual assignments. |
166 | | - - path: internal/memory/merge.go |
167 | | - linters: |
168 | | - - ineffassign |
169 | | - |
170 | | - # internal/telegram/bot.go: deprecated netErr.Temporary. |
171 | | - - path: internal/telegram/bot.go |
172 | | - linters: |
173 | | - - staticcheck |
174 | | - |
175 | | - # internal/schedule/store.go: unchecked syscall.Flock. |
176 | | - - path: internal/schedule/store.go |
177 | | - linters: |
178 | | - - errcheck |
| 12 | + settings: |
| 13 | + errcheck: |
| 14 | + exclude-functions: |
| 15 | + - fmt.Fprintf |
| 16 | + - fmt.Fprintln |
| 17 | + - io.WriteString |
| 18 | + exclusions: |
| 19 | + generated: lax |
| 20 | + presets: |
| 21 | + - comments |
| 22 | + - common-false-positives |
| 23 | + - legacy |
| 24 | + - std-error-handling |
| 25 | + rules: |
| 26 | + - linters: |
| 27 | + - errcheck |
| 28 | + - ineffassign |
| 29 | + - staticcheck |
| 30 | + - unused |
| 31 | + path: _test\.go |
| 32 | + - linters: |
| 33 | + - errcheck |
| 34 | + path: cmd/odek/file_tool.go |
| 35 | + - linters: |
| 36 | + - errcheck |
| 37 | + path: cmd/odek/main.go |
| 38 | + - linters: |
| 39 | + - errcheck |
| 40 | + path: cmd/odek/mcp.go |
| 41 | + - linters: |
| 42 | + - errcheck |
| 43 | + path: cmd/odek/perf_tools.go |
| 44 | + - linters: |
| 45 | + - errcheck |
| 46 | + path: cmd/odek/repl.go |
| 47 | + - linters: |
| 48 | + - errcheck |
| 49 | + path: cmd/odek/repl_editor.go |
| 50 | + - linters: |
| 51 | + - errcheck |
| 52 | + - unused |
| 53 | + path: cmd/odek/serve.go |
| 54 | + - linters: |
| 55 | + - errcheck |
| 56 | + path: cmd/odek/telegram.go |
| 57 | + - linters: |
| 58 | + - errcheck |
| 59 | + path: cmd/odek/wsapprover.go |
| 60 | + - linters: |
| 61 | + - errcheck |
| 62 | + path: cmd/odek/subagent.go |
| 63 | + - linters: |
| 64 | + - errcheck |
| 65 | + path: cmd/odek/vision_tool.go |
| 66 | + - linters: |
| 67 | + - errcheck |
| 68 | + path: internal/memory/memory.go |
| 69 | + - linters: |
| 70 | + - errcheck |
| 71 | + path: internal/skills/cache.go |
| 72 | + - linters: |
| 73 | + - errcheck |
| 74 | + path: internal/skills/tools.go |
| 75 | + - linters: |
| 76 | + - errcheck |
| 77 | + path: internal/skills/types.go |
| 78 | + - linters: |
| 79 | + - errcheck |
| 80 | + path: internal/flock/flock.go |
| 81 | + - linters: |
| 82 | + - errcheck |
| 83 | + path: internal/telegram/approver.go |
| 84 | + - linters: |
| 85 | + - errcheck |
| 86 | + path: internal/telegram/health.go |
| 87 | + - linters: |
| 88 | + - staticcheck |
| 89 | + - unused |
| 90 | + path: internal/llm/client.go |
| 91 | + - linters: |
| 92 | + - staticcheck |
| 93 | + path: internal/loop/loop.go |
| 94 | + - linters: |
| 95 | + - errcheck |
| 96 | + - unused |
| 97 | + path: internal/mcpclient/client.go |
| 98 | + - linters: |
| 99 | + - staticcheck |
| 100 | + path: internal/memory/buffer.go |
| 101 | + - linters: |
| 102 | + - unused |
| 103 | + path: internal/memory/memory.go |
| 104 | + - linters: |
| 105 | + - ineffassign |
| 106 | + path: internal/memory/merge.go |
| 107 | + - linters: |
| 108 | + - staticcheck |
| 109 | + path: internal/telegram/bot.go |
| 110 | + - linters: |
| 111 | + - errcheck |
| 112 | + path: internal/schedule/store.go |
| 113 | + paths: |
| 114 | + - third_party$ |
| 115 | + - builtin$ |
| 116 | + - examples$ |
| 117 | +formatters: |
| 118 | + exclusions: |
| 119 | + generated: lax |
| 120 | + paths: |
| 121 | + - third_party$ |
| 122 | + - builtin$ |
| 123 | + - examples$ |
0 commit comments