Sync .golangci.yml with prometheus/prometheus#817
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR synchronizes the .golangci.yml configuration file with the more comprehensive linting configuration from prometheus/prometheus, primarily to catch issues like superfluous type casting that were previously missed. The changes also fix import ordering violations detected by the new gci formatter rule.
- Significantly expands the golangci-lint configuration with additional linters and rules
- Fixes import ordering in Go files to comply with the new
gciformatter requirements - Temporarily disables most new rules that would trigger existing violations, except for the
gciformatter
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .golangci.yml | Major expansion of linting configuration with new rules, exclusions, and gci formatter settings |
| expfmt/text_create_test.go | Reorders imports to place third-party packages after local packages |
| expfmt/text_create.go | Adjusts import grouping and spacing to match gci formatter requirements |
| expfmt/openmetrics_create_test.go | Reorders imports to group third-party packages correctly |
| expfmt/openmetrics_create.go | Moves dto import to proper position before other third-party imports |
| expfmt/expfmt_test.go | Adjusts import spacing and grouping for gci compliance |
| expfmt/encode_test.go | Reorders imports to place dto import before other third-party packages |
| expfmt/encode.go | Reorganizes imports to group third-party packages before local packages |
| expfmt/bench_test.go | Reorders imports to place third-party packages after local packages |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: Arve Knudsen <[email protected]>
Signed-off-by: Arve Knudsen <[email protected]>
3429ff1 to
4455083
Compare
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.
Sync .golangci.yml with the much more extensive one in prometheus/prometheus. The motivation is that I noticed that superfluous type casting wasn't caught by the linter. I'm temporarily disabling all rules that are currently triggered by discrepancies in the code base, with the exception of the
gciformatter. I fixgcicomplaints in the offending *.go files.