Skip to content

Commit cf5825b

Browse files
jongioCopilot
andcommitted
fix: suppress goconst for inline strings in CLI/TUI/data/platform
Newer golangci-lint versions flag intentionally inline strings (CLI flags, shell names, SQL fragments, UI labels, hex colors) as goconst candidates. These are deliberate design choices where extracting constants would hurt readability. Co-authored-by: Copilot <[email protected]>
1 parent 7a69b21 commit cf5825b

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

.golangci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ linters:
2727
goconst:
2828
min-len: 3
2929
min-occurrences: 3
30+
ignore-string-values: '(?i)^(#[0-9a-f]{6})$'
3031
exhaustive:
3132
default-signifies-exhaustive: true
3233
gocritic:
@@ -69,6 +70,31 @@ linters:
6970
- text: 'string `(windows|darwin|linux)` has'
7071
linters:
7172
- goconst
73+
# Theme/color definitions intentionally repeat hex values across
74+
# self-contained theme structs; extracting constants hurts readability.
75+
- path: internal/tui/styles/
76+
linters:
77+
- goconst
78+
# CLI flag strings in switch/case are idiomatic Go, not magic constants.
79+
- path: cmd/
80+
linters:
81+
- goconst
82+
# Shell definitions use inline names/args in struct literals by design.
83+
- path: internal/platform/shell\.go
84+
linters:
85+
- goconst
86+
# TUI labels and sort-field strings are intentionally inline.
87+
- path: internal/tui/
88+
linters:
89+
- goconst
90+
# Data layer uses inline SQL fragments and enum strings.
91+
- path: internal/data/
92+
linters:
93+
- goconst
94+
# Copilot client uses inline model names.
95+
- path: internal/copilot/
96+
linters:
97+
- goconst
7298
# os.Exit in main() is acceptable; defer cleanup is best-effort.
7399
- path: cmd/dispatch/main\.go
74100
text: exitAfterDefer

0 commit comments

Comments
 (0)