Skip to content

golangci-lint: add stylecheck linter #128

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

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

olivierlemasle
Copy link
Member

Adding stylecheck linter, as it would have prevented duplicated import (#127).

This was prompted by this comment.

stylecheck adds the ST* checks from https://staticcheck.io/docs/checks (the SA* and S* checks were already enforced).

The duplicated imports fixed in #217 would have raised an error:

pkg/registry/custom_metrics/reststorage.go:28:2: ST1019: package "k8s.io/apiserver/pkg/endpoints/request" is being imported more than once (stylecheck)
	"k8s.io/apiserver/pkg/endpoints/request"
	^
pkg/registry/custom_metrics/reststorage.go:29:2: ST1019(related information): other import of "k8s.io/apiserver/pkg/endpoints/request" (stylecheck)
	genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
	^
pkg/registry/external_metrics/reststorage.go:26:2: ST1019: package "k8s.io/apiserver/pkg/endpoints/request" is being imported more than once (stylecheck)
	"k8s.io/apiserver/pkg/endpoints/request"
	^
pkg/registry/external_metrics/reststorage.go:27:2: ST1019(related information): other import of "k8s.io/apiserver/pkg/endpoints/request" (stylecheck)
	genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
	^

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 8, 2022
@k8s-ci-robot
Copy link
Contributor

@olivierlemasle: This issue is currently awaiting triage.

If custom-metrics-apiserver contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 8, 2022
@dgrisonnet
Copy link
Member

Awesome! Thanks!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 8, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dgrisonnet, olivierlemasle

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 8, 2022
@k8s-ci-robot k8s-ci-robot merged commit 8187cbc into kubernetes-sigs:master Dec 8, 2022
@olivierlemasle olivierlemasle deleted the stylecheck branch December 8, 2022 19:04
@dgrisonnet dgrisonnet mentioned this pull request May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants