Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Migrates
.golangci.yml(root,pp/,pp-pkg/) from golangci-lint v1 to v2 config format, porting existing comments/rationale from the old configs into the new ones (pp/.golangci.yml.bakremoved once ported). Fixes the lint findings that the v2 config and its updated linter set surface across the codebase —staticcheck,govet,gosec(includingG115), andperfsprint— plus related test fixes, spanningpp/,pp-pkg/,cmd/,discovery/,model/,promql/,rules/,scrape/,storage/,tsdb/,web/, and other largely-unmodified upstream packages touched only for these lint fixes.Why do we need it, and what problem does it solve?
The project's golangci-lint config was still on the v1 format; upgrading to v2 (and its stricter/updated linters) surfaced a number of real issues — nil-safety and error-handling gaps (
staticcheck), suspiciousPrintf-style formatting/vet issues (govet), integer overflow/conversion risks (gosecG115), and inefficient string/number formatting (perfsprint). This PR brings the config current and clears the resulting backlog so CI lint gates pass on v2 going forward.Additionally, starting with go1.27 golangci-lint v1 works very poorly (frequent crashes/incorrect analysis), so migrating to v2 is effectively required to keep linting usable with the toolchain version this repo is now on.