Skip to content

Exclude goconst linter from test files#60

Merged
gontzess merged 1 commit intomainfrom
gontzess/exclude-goconst-from-tests
Mar 9, 2026
Merged

Exclude goconst linter from test files#60
gontzess merged 1 commit intomainfrom
gontzess/exclude-goconst-from-tests

Conversation

@gontzess
Copy link
Copy Markdown
Contributor

@gontzess gontzess commented Mar 9, 2026

Why

Test files naturally repeat string literals ("user", "group", "expected", etc.) across test cases. Extracting these into constants hurts test readability without meaningful safety benefit. This is standard Go community practice.

What this changes

Adds an exclusion rule to .golangci.yml that skips goconst checks in *_test.go files:

exclusions:
  rules:
    - path: _test\.go$
      linters:
        - goconst

This affects all repos that use this config via the verify workflow.

@gontzess gontzess requested review from btipling, ggreer and kans March 9, 2026 13:57
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 9, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • .golangci.yml is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ce6ed5e8-7e9f-4e7c-8a87-5c78a39500b3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch gontzess/exclude-goconst-from-tests

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

@gontzess gontzess requested a review from johnallers March 9, 2026 14:23
Copy link
Copy Markdown
Contributor

@johnallers johnallers left a comment

Choose a reason for hiding this comment

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

Not sure how others feel, but it seems reasonable to me.

@gontzess gontzess merged commit 2761b91 into main Mar 9, 2026
2 checks passed
@gontzess gontzess deleted the gontzess/exclude-goconst-from-tests branch March 9, 2026 15:08
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