Skip to content
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

[#310] upgrade to latest golangci-lint and enable new linters #311

Merged
merged 14 commits into from
Jun 26, 2024

Conversation

sahilm
Copy link
Member

@sahilm sahilm commented Jun 26, 2024

There's a degree of subjectivity to linting. Each commit represents an atomic decision and is open to change/discussion. Please refer to the commit in question if you'd like to discuss/change any decision.

Resolves #310

@sahilm sahilm changed the base branch from main to sahilm/upgrade-to-go-1.22 June 26, 2024 02:51
@sahilm sahilm changed the base branch from sahilm/upgrade-to-go-1.22 to main June 26, 2024 03:08
@sahilm sahilm force-pushed the sahilm/upgrade-to-latest-golangci-lint branch from 1e014dc to 3de9e13 Compare June 26, 2024 03:09
@sahilm sahilm force-pushed the sahilm/upgrade-to-latest-golangci-lint branch from cabe2cd to 4621fbb Compare June 26, 2024 03:59
@sahilm sahilm requested review from morgo and kolbe June 26, 2024 05:29
@sahilm sahilm marked this pull request as ready for review June 26, 2024 05:29
@sahilm sahilm changed the title [#310] upgrade to latest golangci lint [#310] upgrade to latest golangci-lint Jun 26, 2024
See warnings like: level=warning msg="[config_reader] The output format `github-actions` is deprecated, please use `colored-line-number`"
@sahilm sahilm changed the title [#310] upgrade to latest golangci-lint [#310] upgrade to latest golangci-lint and enable new linters Jun 26, 2024
@@ -292,10 +292,10 @@ func (c *Checker) replaceChunk(chunk *table.Chunk) error {
c.recopyLock.Lock()
defer c.recopyLock.Unlock()

if _, err := dbconn.RetryableTransaction(context.TODO(), c.db, false, dbconn.NewDBConfig(), deleteStmt); err != nil {
if _, err := dbconn.RetryableTransaction(ctx, c.db, false, dbconn.NewDBConfig(), deleteStmt); err != nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

Hope there's no unintended side effects here. I don't think this is a problem but want to highlight this change. It's to satisfy the contextcheck linter.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks good to me. I think this is a code improvement.

@@ -2368,7 +2368,7 @@ func TestSkipDropAfterCutover(t *testing.T) {
var tableCount int
err = m.db.QueryRow(sql).Scan(&tableCount)
assert.NoError(t, err)
assert.Equal(t, tableCount, 1)
assert.Equal(t, 1, tableCount)
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@morgo morgo left a comment

Choose a reason for hiding this comment

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

All look good to me. No issues.

@@ -292,10 +292,10 @@ func (c *Checker) replaceChunk(chunk *table.Chunk) error {
c.recopyLock.Lock()
defer c.recopyLock.Unlock()

if _, err := dbconn.RetryableTransaction(context.TODO(), c.db, false, dbconn.NewDBConfig(), deleteStmt); err != nil {
if _, err := dbconn.RetryableTransaction(ctx, c.db, false, dbconn.NewDBConfig(), deleteStmt); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks good to me. I think this is a code improvement.

@morgo morgo merged commit 75522f6 into main Jun 26, 2024
13 checks passed
@sahilm sahilm deleted the sahilm/upgrade-to-latest-golangci-lint branch June 26, 2024 22:44
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.

Upgrade golangci-lint to the latest version and enable new linters
2 participants