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
hack/verify-test-code.sh: replace with proper linter #115234
Comments
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
/sig testing |
@pohly Can I help in finishing the opened task? |
@yashsingh74: you can look into updating @PauloGoncalvesLima was interested in doing something with go-ruleguard. |
I'm going to start working on it today. |
https://github.com/nunnatsa/ginkgolinter is promising. It can enforce the usage of BeTrue and then we can forbid that function to ensure that booleans are checked with plain |
@pohly, Sorry for the delay college was getting me these past weeks. I did some search and had a doubt about how this golint would be implemented. Would the changes be enforced by the Git Actions? or pre-commit? where this change would need to be implemented? |
The linter needs to be part of the golangci-lint invocation(s) in hack/verify-golangci-lint.sh. The go-ruleguard page has information on how to use it from golangci-lint. The unsolved problem is writing such rules. Note that ginkgolinter probably covers quite a few of the things that I planned to do with go-ruleguard. Let's put this issue on hold, I'll come back to it soonish with an update. |
/reopen |
@pohly: Reopened this issue. In response to this:
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. |
@pohly, Ok, if there is an issue that I can help with, please let me know. 🚀 |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
Still waiting for golangci/golangci-lint#3612 and golangci/golangci-lint#3617. /remove-lifecycle stale |
This can be done through a combination of different linters:
|
Way to go! @pohly is there something that I can already start working on? |
@Transmitt0r: it's still in flux and probably to early to work on. Regarding |
/assign |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
What would you like to be added?
A proper linter like something built on https://github.com/quasilyte/go-ruleguard may become a more reliable and capable linter for test guidelines.
framework.ExpectError
Expect.Equal(someBoolean, ...)
anti-patternAn enhanced forbidigo could detect:
wait.Poll
and friends instead ofgomega.Eventually
import-boss should be used to
Why is this needed?
The script uses grep to enforce certain code patterns. This is prone to false negatives. For example, it missed this until the code was changed to be all in one line
test/e2e_node/resource_collector.go:
The current
test/e2e/framework/.import-restrictions
is probably out-dated.The text was updated successfully, but these errors were encountered: