Skip to content

chore(lint): exclude goconst in test files#107

Merged
knight42 merged 1 commit into
mainfrom
fix-goconst-in-tests
Jul 1, 2026
Merged

chore(lint): exclude goconst in test files#107
knight42 merged 1 commit into
mainfrom
fix-goconst-in-tests

Conversation

@knight42

@knight42 knight42 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

The lint job started failing on every PR (e.g. #106) after golangci-lint latest resolved to v2.12.2, whose goconst linter now reports repeated string literals in _test.go files (7 issues in cmd/client/utils_test.go and pkg/ports/parser_test.go).

Repeated literals in table-driven tests are idiomatic, so exclude goconst in test files, following the existing errcheck exclusion.

Verified locally with golangci-lint v2.12.2: golangci-lint run reports 0 issues.

🤖 Generated with Claude Code

golangci-lint v2.12.2 (pulled via 'latest' in CI) now flags repeated
string literals in _test.go files, breaking lint for every PR.
Repeated literals in table-driven tests are idiomatic, so exclude
goconst there like errcheck.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 1, 2026 22:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes newly failing lint CI runs by excluding the goconst linter from _test.go files, aligning with the project’s existing approach of excluding certain linters in tests to avoid noisy/idiomatic false positives.

Changes:

  • Add goconst to the existing test-file linter exclusion rule (alongside errcheck) in .golangci.yaml.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@knight42 knight42 merged commit 322c40b into main Jul 1, 2026
3 checks passed
@knight42 knight42 deleted the fix-goconst-in-tests branch July 1, 2026 22:45
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