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

Disable deprecated linters - structcheck, deadcode, varcheck, ifshort #7115

Closed
killianmuldoon opened this issue Aug 24, 2022 · 9 comments
Closed
Assignees
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@killianmuldoon
Copy link
Contributor

The following linters are deprecated in golangci-lint but we're still using them in our config:

  • structcheck - Finds unused struct fields
  • deadcode - Finds unused code
  • varcheck - Finds unused global variables and constants
  • ifshort - Go linter that checks if your code uses short syntax for if-statements whenever possible.

We should remove these linters at some point as they're no longer mantained, but is there a strong reason to keep any of them around?

I think ifshort is low-impact and is currently buggy (gives different results on my machine for some reason). The others - deadcode, varcheck, and struct check can all be replaced by unused

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Aug 24, 2022
@killianmuldoon
Copy link
Contributor Author

/kind cleanup

@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Aug 24, 2022
@killianmuldoon
Copy link
Contributor Author

/assign

@killianmuldoon
Copy link
Contributor Author

I've removed the linters in #7114 to see if it's desirable / if there's any objections.

@chrischdi
Copy link
Member

I'd 👍 for making use of unused. These linters sound helpful for imho.

A buggy / non-deterministic ifshort makes no sense for me.

@sbueringer
Copy link
Member

+1 to drop them

@fabriziopandini
Copy link
Member

+1 to drop them given that we are already running the unused linter

@fabriziopandini
Copy link
Member

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 26, 2022
@killianmuldoon
Copy link
Contributor Author

dropped in #7114

/close

@k8s-ci-robot
Copy link
Contributor

@killianmuldoon: Closing this issue.

In response to this:

dropped in #7114

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

5 participants