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

fix-pkg-staticcheck and remove the repeat code #8035

Merged
merged 1 commit into from
Dec 14, 2019
Merged

fix-pkg-staticcheck and remove the repeat code #8035

merged 1 commit into from
Dec 14, 2019

Conversation

tanjunchen
Copy link
Member

1:remove some repeat code
2:fix some staticcheck

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 2, 2019
@tanjunchen
Copy link
Member Author

/cc @justinsb

@johngmyers
Copy link
Member

I don't quite see the value of removing the unreferenced convenience functions. I think it would make sense to either consolidate the convenience functions to just the ones in fi or just leave them alone.

@tanjunchen
Copy link
Member Author

@johngmyers Thanks your view.
1:Maybe you can refer to the issue kubernetes/kubernetes#81657
2:And we need to delete unused code because of golang rules(recommend to do this)

@tanjunchen
Copy link
Member Author

@rifelpet The Same Question

@tanjunchen
Copy link
Member Author

/cc @mikesplain

@justinsb
Copy link
Member

I'd say if there is a linter that is reliable that we can use, I am in favor of more static analysis to help us in code review. We've started using hack/verify-staticcheck.sh (albeit with a lot of excluded packages right now)

While in general I agree with @johngmyers that if we have two functions i32 and i64, and we stop using i64, then we shouldn't necessarily rush to delete i64. But I do think that having static checkers helping us avoid mistakes is possibly more important. I think @johngmyers raises an excellent point though, in that we could also put these into a helper package. (Unfortunately fi has become a bit big, so we started pkg/values)

So I'm in favor of this PR, in that if we can get hack/verify-staticcheck.sh checking all our code, it should save us a lot of time in code review. I personally think some of the rules are not what I would have chosen, but having a set of rules will save us a lot of time. (It's the same as the gofmt argument: not perfect, but at least we don't have to debate tabs vs spaces)

/approve
/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb, tanjunchen

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 14, 2019
@johngmyers
Copy link
Member

/retest

@k8s-ci-robot k8s-ci-robot merged commit c54394c into kubernetes:master Dec 14, 2019
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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants