Skip to content

Conversation

@aknuds1
Copy link
Contributor

@aknuds1 aknuds1 commented Aug 25, 2025

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 gci formatter. I fix gci complaints in the offending *.go files.

@aknuds1 aknuds1 requested review from bwplotka, Copilot and ywwg August 25, 2025 08:17
Copy link
Contributor

Copilot AI left a 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 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 gci formatter requirements
  • Temporarily disables most new rules that would trigger existing violations, except for the gci formatter

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 <arve.knudsen@gmail.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
@aknuds1 aknuds1 force-pushed the arve/update-golangcilint-config branch from 3429ff1 to 4455083 Compare August 25, 2025 08:30
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Thanks!

@bwplotka bwplotka merged commit efa2e6b into main Aug 26, 2025
9 checks passed
@bwplotka bwplotka deleted the arve/update-golangcilint-config branch August 26, 2025 13:10
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.

3 participants