Skip to content

chore(ci): Migrate Golangci-lint config from v1 to v2. Update Go version to 1.24.#14

Merged
davemarco merged 8 commits intoy-scope:mainfrom
davemarco:linter
Jan 23, 2026
Merged

chore(ci): Migrate Golangci-lint config from v1 to v2. Update Go version to 1.24.#14
davemarco merged 8 commits intoy-scope:mainfrom
davemarco:linter

Conversation

@davemarco
Copy link
Contributor

@davemarco davemarco commented Jan 19, 2026

Description

Golangci-lint introduced a new configuration format, so this PR migrates the config from v1 to v2 using the official migrate tool.

It also updates outdated versions for GitHub Actions, golangci-lint and Go.

No functional code changes are included.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

Ran golangci-lint run with no errors.

@davemarco davemarco requested a review from a team as a code owner January 19, 2026 18:23
@coderabbitai
Copy link

coderabbitai bot commented Jan 19, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

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


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@davemarco davemarco requested a review from davidlion January 19, 2026 18:26
Copy link
Member

@jackluo923 jackluo923 left a comment

Choose a reason for hiding this comment

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

Code Review

🟡 Medium Issues

1. Path exclusions reference non-existent directories

paths:
  - third_party$
  - builtin$
  - examples$

None of these directories exist on main:

  • No third_party or third-party directory
  • No builtin directory
  • No examples directory

These exclusions are harmless but suggest the config was copied from another project without adaptation. Consider removing them to avoid confusion, or add a comment explaining they're for future use.

2. stylecheck linter was silently dropped

The original config had stylecheck enabled with specific checks:

# Original (v1)
- "stylecheck"
stylecheck:
  checks:
    - "all"
    - "-ST1020"  # ...etc

The migrated config removes it entirely. The -ST1020, -ST1021, -ST1022, -ST1023 exclusions were moved to staticcheck, but stylecheck does more than just ST checks.

Was this intentional? If so, please mention it in the PR description.

🟢 Looks Good

Item Status
Action versions (checkout@v6, setup-go@v6, golangci-lint-action@v9) ✅ Valid and current
Go version 1.25.6 ✅ Good
golangci-lint v2 config structure ✅ Correct
Exclusion presets ✅ Good additions
goimports with local-prefixes ✅ Correctly migrated
README install command ✅ Updated correctly

Copy link
Member

@jackluo923 jackluo923 left a comment

Choose a reason for hiding this comment

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

Additional Suggestion: More Comprehensive Linting

Consider adopting the more comprehensive linting configuration from the irv2-beta branch. You can reference the config here:

Additional Linters (from irv2-beta)

Linter Purpose
errorlint Checks for errors that aren't wrapped properly with %w
exhaustive Ensures switch statements on enums are exhaustive
gosec Security-focused linter (detects hardcoded credentials, SQL injection, etc.)
misspell Catches common spelling mistakes in comments and strings
nilnil Detects returning both nil error and nil value
recvcheck Checks for receiver type consistency

Better Formatters (from irv2-beta)

Formatter Purpose
gci More configurable import ordering than goimports
gofumpt Stricter gofmt with additional rules
golines Automatically wraps long lines (respects 100 char limit)

Task-Based Linting Approach

The irv2-beta branch uses a task-based approach that allows running linters locally with the same configuration as CI:

# Run all linting checks (Go + YAML)
task lint:check

# Auto-fix formatting issues
task lint:fix

Benefits:

  • Local/CI parity: Same linting rules run locally and in CI
  • YAML linting: Includes yamllint for YAML files (not just Go)
  • Auto-install: Task automatically downloads golangci-lint and sets up Python venv for yamllint
  • Reproducible: Pinned tool versions ensure consistent results across developers

See CONTRIBUTING.md on irv2-beta for setup instructions.

This is optional but would improve the developer experience and catch more issues early.

@davemarco
Copy link
Contributor Author

davemarco commented Jan 19, 2026

  1. Path exclusions reference non-existent directories

the migration script added these, but i removed them and there are no issues

stylecheck linter was silently dropped

according to migration docs, this was merged into static check

More Comprehensive Linting

@davidlion set up initial linting config, maybe u 2 can discuss to see if u think more linters are needed. If so i can do in another PR, and fix any linter errors in existing code.

task scripts

This is good idea, but i think can be done in another pr. u can still lint locally with golangci-lint run

@davemarco davemarco changed the title Migrate Golangci-lint config from v1 to v2. Update Go version to 1.25.6 Migrate Golangci-lint config from v1 to v2. Update Go version to 1.24 Jan 19, 2026
Copy link
Member

@davidlion davidlion left a comment

Choose a reason for hiding this comment

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

The code lgtm. Let's update the title to follow our guidelines and change the description to complete sentences.

@davemarco davemarco changed the title Migrate Golangci-lint config from v1 to v2. Update Go version to 1.24 chore(ci): Migrate Golangci-lint config from v1 to v2. Update Go version to 1.24. Jan 22, 2026
@davemarco
Copy link
Contributor Author

updated title and description @davidlion

@davemarco davemarco requested a review from davidlion January 22, 2026 19:15
@davemarco davemarco merged commit b655567 into y-scope:main Jan 23, 2026
3 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.

3 participants