kubernetes: fix staticcheck failures
Many of our packages are failing staticcheck, we should fix all of them. See previously https://github.com/kubernetes/kubernetes/issues/36858 https://github.com/kubernetes/kubernetes/issues/90208 https://github.com/kubernetes/kubernetes/issues/81657
/help
To fix these, take a look at hack/.staticcheck_failures for a list of currently failing packages.
You can check a package by removing it from the list and running make verify WHAT=staticcheck.
Once the package is no longer failing, please file a PR including the fixes and removing it from the list.
Before filing your PR, you should run hack/update-gofmt.sh and hack/update-bazel.sh to auto format your code and update the build.
I recommend keeping PRs scoped down in size for review, fix a package or set of closely related packages, or a certain class of failures, to make it easier for your reviewers to handle.
We don’t need to fix all failures in one PR, but please avoid 100s of single character PRs, as it does cost time & resources to get each PR reviewed, tested, merged etc. 🙃
I can help review some of these, but many of them will require other reviewers that own the relevant code.
EDIT: I also don’t recommend /assign ing to this one, many people are going to need to work on it and we want more people to join in.
You can link to this issue in your PR and comment here that you’re working on certain packages to help avoid duplication.
EDIT2: Please do NOT put Fixes #... in your Pull Request, despite the template. That will close this PR. Instead put something like Part of #92402
I think each of these own code that is currently failing: /sig testing /sig storage /sig api-machinery /sig architecture /sig cli /sig instrumentation /sig autoscaling /sig cloud-provider
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 45 (32 by maintainers)
Commits related to this issue
- fix staticcheck failures: apiserver/pkg/{storage,util} fix static check failures for these folders: - vendor/k8s.io/apiserver/pkg/storage - vendor/k8s.io/apiserver/pkg/storage/cacher - vendor/k8s.io/... — committed to obeyda/kubernetes by obeyda 4 years ago
- Part of #92402 - fixes staticcheck failure of pkg/controller/replicaset — committed to A9u/kubernetes by deleted user 4 years ago
- Fix staticcheck in test/integration/{examples,framework} Part of #92402, fixes staticcheck failures SA1006, SA1019 and SA2002 in test/integration/examples and test/integration/framework. — committed to tiloso/kubernetes by tiloso 4 years ago
- Part of #92402; fixes staticcheck failures for wsstream — committed to m-Bilal/kubernetes by m-Bilal 3 years ago
We’re close to resolving this issue - all remaining packages in hack/.staticcheck_failures are covered by PRs. 🙂
Edits 11/01/2021: Added PR ref for
vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope10/05/2021: Removed packages that have been fixed by 103023 and removed references to closed 102899 07/01/2021: Added additional issues which have been brought up by 103256 06/25/2021: Added PR ref forvendor/k8s.io/apiserver/pkg/util/wsstreamand removedvendor/k8s.io/apiserver/pkg/storagesince100771was mergedSorry, didn’t notice this before.
@m-Bilal Yes! go ahead as @tiloso mentioned, there is still
vendor/k8s.io/apiserver/pkg/util/wsstreamneeded to be fixedHello, I tried to narrow down the list of packages without active PRs as of now, hope this is useful for anyone who wants to contribute:
Hey @jpmartins201, currently, there’s no pending pull request for
vendor/k8s.io/apiserver/pkg/server/routes. Feel free to tackle it.Hey @sanya301 and @mourya007! At the moment, all remaining failures are covered by PRs.
[lots of PRs going on, unassigning it so people searching for available issues will find this / it’s not accurate to assign one person 😅 ]
should I do that in
staging/thanks 😃 yeah, I think people tend to not work on issues that are already assigned, but I don’t think anyone one person is going to get PRs in for all of this, there’s lots of room for many to work on this 😃