Skip to content

hack/tools enable additional linter gocritic in golangci-lint #113256

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
Oct 23, 2022

Conversation

oscr
Copy link
Contributor

@oscr oscr commented Oct 21, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

Enables linter gocritic with two checks enabled for a subset of the project.

My goal is to remove the exclusions in follow up prs, but I'm trying to keep the prs small to make them easier to merge.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 21, 2022
@k8s-ci-robot
Copy link
Contributor

@oscr: This issue is currently awaiting triage.

If a SIG or subproject determines 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 needs-priority Indicates a PR lacks a `priority/foo` label and requires one. sig/cli Categorizes an issue or PR as relevant to SIG CLI. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 21, 2022
@oscr
Copy link
Contributor Author

oscr commented Oct 21, 2022

/sig testing

@k8s-ci-robot k8s-ci-robot added the sig/testing Categorizes an issue or PR as relevant to SIG Testing. label Oct 21, 2022
Enables linter gocritic with two checks enabled for a subset of the project
@oscr oscr force-pushed the enable-gocritic-check branch from 00d6944 to 21fa8d1 Compare October 21, 2022 15:59
@aojea
Copy link
Member

aojea commented Oct 21, 2022

/lgtm
/assign @thockin
/cc @pohly

@k8s-ci-robot k8s-ci-robot requested a review from pohly October 21, 2022 16:23
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 21, 2022
@aojea
Copy link
Member

aojea commented Oct 21, 2022

which linter enables the missing check on errors?

@aojea
Copy link
Member

aojea commented Oct 21, 2022

we'd like to prioritize that if possible

@oscr
Copy link
Contributor Author

oscr commented Oct 21, 2022

/test pull-kubernetes-e2e-kind

@oscr
Copy link
Contributor Author

oscr commented Oct 21, 2022

which linter enables the missing check on errors?

@aojea Do you mean errcheck? Also relevant is nilerr. I would gladly start working on errcheck and then nilerr.

EDIT: Maybe you mean this revive check https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error ?

@pohly
Copy link
Contributor

pohly commented Oct 21, 2022

Before you prepare PRs against test/e2e* that add error checks (or any other wide-ranging changes), let's merge #112923 first.

@oscr
Copy link
Contributor Author

oscr commented Oct 21, 2022

@pohly I fully understand given the size of that pr. This pr explicitly excludes test/* and I will make sure any future lint pr also excludes it until #112923 is merged.

Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

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

Thanks!

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: oscr, thockin

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 Oct 23, 2022
@oscr
Copy link
Contributor Author

oscr commented Oct 23, 2022

/retest

Failure not related to this pr: There are no nodes that your pod can schedule to - check your requests, tolerations, and node selectors ((combined from similar events): 0/66 nodes are available: 10 Insufficient memory, 58 Insufficient cpu, 8 node(s) had taint {node.kubernetes.io/not-ready: }, that the pod didn't tolerate.)

@k8s-ci-robot k8s-ci-robot merged commit 641197d into kubernetes:master Oct 23, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.26 milestone Oct 23, 2022
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants