Skip to content

ci(lint): exclude goconst linter from test files - #895

Merged
artek-koltun merged 1 commit into
opiproject:mainfrom
tfrankow-intel:fix/exclude-goconst-test-files
Jul 15, 2026
Merged

ci(lint): exclude goconst linter from test files#895
artek-koltun merged 1 commit into
opiproject:mainfrom
tfrankow-intel:fix/exclude-goconst-test-files

Conversation

@tfrankow-intel

Copy link
Copy Markdown
Contributor

Repeated string literals in table-driven tests are idiomatic Go and do not need to be extracted into constants. This suppresses 385 goconst warnings that only appear in _test.go files.

@tfrankow-intel
tfrankow-intel requested a review from a team as a code owner July 15, 2026 14:03
@tfrankow-intel
tfrankow-intel force-pushed the fix/exclude-goconst-test-files branch from 997dcad to 12a775b Compare July 15, 2026 14:09
Repeated string literals in table-driven tests are idiomatic Go
and do not need to be extracted into constants. This suppresses
385 goconst warnings that only appear in _test.go files.

Also set goconst ignore-tests so test-file occurrences are not
counted toward the threshold for production code strings, and
raise min-occurrences to 4 to avoid false positives on strings
like "TBD" that appear only a few times in production code.

Signed-off-by: Frankowski, Tomasz <tomasz.frankowski@intel.com>
@tfrankow-intel
tfrankow-intel force-pushed the fix/exclude-goconst-test-files branch from 12a775b to f1eb1c5 Compare July 15, 2026 14:53
@artek-koltun
artek-koltun merged commit a56a924 into opiproject:main Jul 15, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants