-
Notifications
You must be signed in to change notification settings - Fork 25
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
[Issue 188] Add golangci-lint to subo #189
Conversation
So this one fails because of deadcode issues in the following three places:
Can y'all provide more context on what they are (supposed to be) used for? 🙂 |
Okay, so after a bit more digging handlerDataThere is no mention of anywhere else in the codebase. It is also not exported, so nothing that imports subo could potentially use it anyways. I recommend removing it. resourceFlagThis is not exported from the I recommend removing it. updateFlagThis is being used in two other places within subo itself: here and here, but both places are commented out. They were removed in this commit: 198ad21 This is not being used in any of the other projects either. Recommend removing and maybe adding a @todo comment? |
I removed the unused pieces of code and created issues to track them:
The linter Commit d664574 moves them out from being function arguments so the constants themselves can be used as args in whatever functionality needs them within the An alternative solution to the unparam, if we want to keep them as function arguments, is to write a test to the |
@javorszky that totally works for me. We do need the params s.t. it could be used for other types of docs (requiring us to swap out the template/action). subo/.github/workflows/sanity.yml Lines 29 to 37 in 9249bb7
I can totally take care of the integration test for I'm all for it and I can take care of it, want me to create a separate ticket for that? |
@denopink Ideally we should be unit testing every piece of code as well. I'm a fan of table driven tests, and the stretchify/assert package (this one: https://github.com/stretchr/testify), and mockery (https://github.com/vektra/mockery) if we need to create controllable mocks of interfaces. Let me know if I can help with any of it. I tried creating a test function for the |
Also, thank you for the link to the integration tests 🙂 |
@javorszky I agree with just removing the params for now so it doesn't block this pr (it'll be just as easy to add them later). |
I haven't done table driven tests outside of basic tutorials, so I would love to help with that. |
All right, I'll put some documentation / examples together and share it here later today :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
Closes #188