-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ci: update golangci-lint to v2 #1341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
ci: update golangci-lint to v2 #1341
Conversation
update method: ``` golangci-lint migrate golangci-lint run --fix ``` and fix the last ones manually
There was a problem hiding this comment.
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 updates golangci-lint from v1 to v2, applying automated linting fixes and migrating the configuration format. The changes align the codebase with modern Go conventions and golangci-lint v2 requirements.
- Updates golangci-lint configuration to v2 format with separated linters and formatters sections
- Standardizes error messages to follow Go conventions (lowercase start, no trailing periods)
- Modernizes string operations by replacing
strings.Replace(..., -1)withstrings.ReplaceAll()
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.golangci.yml |
Migrates configuration to v2 format, separates formatters from linters |
.github/workflows/ci.yaml |
Updates golangci-lint-action to v9 and version to v2.6.2 |
testing/docker.go |
Lowercases error message starts (5 instances) |
source/gitlab/gitlab.go |
Simplifies embedded struct field access |
internal/cli/commands.go |
Lowercases error messages and improves punctuation |
database/testing/testing.go |
Lowercases error message start |
database/sqlserver/sqlserver.go |
Removes trailing period from error message |
database/snowflake/snowflake.go |
Replaces strings.Replace with strings.ReplaceAll |
database/redshift/redshift.go |
Replaces strings.Replace with strings.ReplaceAll |
database/redshift/redshift_test.go |
Updates test code to use strings.ReplaceAll |
database/postgres/postgres.go |
Lowercases error messages and uses strings.ReplaceAll |
database/postgres/postgres_test.go |
Updates test code to use strings.ReplaceAll |
database/pgx/v5/pgx.go |
Lowercases error messages and uses strings.ReplaceAll (2 locations) |
database/pgx/v5/pgx_test.go |
Updates test code to use strings.ReplaceAll |
database/pgx/pgx.go |
Lowercases error messages and uses strings.ReplaceAll (3 locations) |
database/pgx/pgx_test.go |
Updates test code to use strings.ReplaceAll |
database/mysql/mysql.go |
Lowercases error message start |
database/clickhouse/clickhouse.go |
Replaces strings.Replace with strings.ReplaceAll |
database/cassandra/cassandra.go |
Lowercases error message start |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
update method:
and fix the last ones manually