Skip to content

Conversation

@gchan
Copy link
Contributor

@gchan gchan commented Oct 23, 2025

Description

test-engine-client is currently using golangci-lint 1.64.8 which was
missing a few modern linters and formatters which are useful and
we can enable.

Notably staticcheck is a popular linter which wasn't enabled.

Context

TE-4860

test-engine-client is currently using golangci-lint 1.64.8 which was
missing a few modern linters and formatters which are useful and
we can enable.
@gchan gchan force-pushed the te-4860-update-golangci-lint-from-1648-to-250-to-use-modern-linters branch from c0b418b to e70a32a Compare October 23, 2025 22:03
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file was generated by the migration tool when I ran golangci-lint migrate locally. It has minor changes since then.

Comment on lines +6 to +10
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

std-error-handling ignores this class of linting errors

internal/api/client.go:180:24: Error return value of `resp.Body.Close` is not checked (errcheck)
                defer resp.Body.Close()
                                     ^
internal/runner/gotest_junit.go:58:21: Error return value of `xmlFile.Close` is not checked (errcheck)
        defer xmlFile.Close()
                           ^
internal/runner/rspec.go:202:10: Error return value of `f.Close` is not checked (errcheck)
                f.Close()
                       ^
internal/runner/rspec.go:203:12: Error return value of `os.Remove` is not checked (errcheck)
                os.Remove(f.Name())
                         ^

Comment on lines +16 to +19
paths:
- third_party$
- builtin$
- examples$
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Generated by the migrate tool

@gchan gchan marked this pull request as ready for review October 23, 2025 22:29
@gchan gchan requested a review from a team as a code owner October 23, 2025 22:29
@gchan gchan enabled auto-merge October 23, 2025 22:29
@gchan
Copy link
Contributor Author

gchan commented Oct 23, 2025

The following looks useful and are enabled in other Buildkite projects. We can stage these in later

gocritic https://github.com/go-critic/go-critic
gofumpt https://github.com/mvdan/gofumpt

I'm hesitant to bring them in just yet given there is some major code changes in flight.

@gchan gchan merged commit 24b8daa into main Oct 23, 2025
1 check passed
@gchan gchan deleted the te-4860-update-golangci-lint-from-1648-to-250-to-use-modern-linters branch October 23, 2025 22:58
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