Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade golangci-lint to v1.52.2 #5067

Merged
merged 7 commits into from
May 24, 2023
Merged

Conversation

charleskorn
Copy link
Contributor

@charleskorn charleskorn commented May 24, 2023

What this PR does

This PR upgrades golangci-lint to v1.52.2 and fixes all new linting warnings, primarily from the upgraded version of revive.

Some warnings are false positives (see mgechev/revive#386) and have been ignored. The new if-return rule from revive enabled by default seemed unnecessary and has been disabled.

ℹ️ This PR will require a maintainer with permission to push the build image to Docker Hub to build and push the build image to Docker Hub and then update the image tag in the Makefile before merging (see these instructions).

Which issue(s) this PR fixes or relates to

(none)

Checklist

  • [n/a] Tests updated
  • [n/a] Documentation added
  • [n/a] CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@charleskorn charleskorn marked this pull request as ready for review May 24, 2023 04:21
@charleskorn charleskorn requested review from a team as code owners May 24, 2023 04:21
@aknuds1 aknuds1 added the chore label May 24, 2023
@aknuds1
Copy link
Contributor

aknuds1 commented May 24, 2023

I'm pushing a new build image, and will update the PR as you request :)

Signed-off-by: Arve Knudsen <[email protected]>
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

LGTM - I <3 linters

Though, in the future I might recommend splitting up into smaller PRs, so the reviewing is easier and there's less risk of hitting merge conflicts.

Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

LGTM. @aknuds1 can you merge the PR once you've done publishing the new build image? I have another big refactoring PR lining up and I don't want to deal with such conflicts. Thanks!

@aknuds1
Copy link
Contributor

aknuds1 commented May 24, 2023

@pracucci I will fix the conflicts and merge (build image is already updated).

@aknuds1 aknuds1 enabled auto-merge (squash) May 24, 2023 10:03
@pracucci
Copy link
Collaborator

@aknuds1 About this linter error:

func NewFetcherMetrics(reg prometheus.Registerer, syncedExtraLabels, modifiedExtraLabels [][]string) *FetcherMetrics {

You can just make the linter happy. I will take care of removing that dead code in a follow up PR.

@aknuds1 aknuds1 merged commit bc241d9 into main May 24, 2023
@aknuds1 aknuds1 deleted the charleskorn/golangci-lint-upgrade branch May 24, 2023 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants