Skip to content

Conversation

aknuds1
Copy link
Contributor

@aknuds1 aknuds1 commented Aug 27, 2025

Enable previously disabled revive rules, to harmonize with Prometheus:

  • dot-imports
  • early-return
  • exported
  • increment-decrement
  • indent-error-flow
  • receiver-naming
  • unexported-return
  • unused-receiver
  • var-declaration
  • var-naming

Also fixing caught issues.

@aknuds1 aknuds1 requested review from Copilot, bwplotka and ywwg August 27, 2025 05:34
Copy link
Contributor

@Copilot 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 enables previously disabled revive linting rules to harmonize with Prometheus standards and fixes the caught linting issues. The changes focus on standardizing receiver naming conventions and improving code quality.

Key changes:

  • Enable 10 revive linting rules including receiver-naming, var-naming, and increment-decrement
  • Fix receiver parameter names to follow Go conventions (use consistent short names)
  • Apply early-return pattern and increment/decrement optimizations

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.golangci.yml Enables previously disabled revive linting rules
server/static_file_server_test.go Removes unused receiver parameter
model/value_type.go Standardizes receiver name from 'e' to 'et'
model/value_histogram.go Changes receiver name from 'b' to 's' for consistency
model/value.go Changes receiver name from 'mat' to 'm' for brevity
model/time.go Removes unused receiver parameter
model/metric.go Removes unused receiver parameter
model/labelset.go Standardizes receiver names from 'l' to 'ls'
expfmt/text_parse.go Applies early-return pattern for better flow control
expfmt/expfmt.go Fixes receiver naming and adds lint suppressions
config/http_config.go Uses increment operator and removes unused receivers
config/config.go Removes redundant bool type declaration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@aknuds1 aknuds1 merged commit 3d3db39 into main Aug 27, 2025
9 checks passed
@aknuds1 aknuds1 deleted the arve/revive-rules branch August 27, 2025 13:21
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