-
Notifications
You must be signed in to change notification settings - Fork 2.2k
chore: Enable unparam linter and cover unused *Response results
#3955
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
base: master
Are you sure you want to change the base?
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
signed |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3955 +/- ##
==========================================
+ Coverage 92.45% 92.51% +0.05%
==========================================
Files 203 203
Lines 14980 14980
==========================================
+ Hits 13850 13858 +8
+ Misses 927 923 -4
+ Partials 203 199 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gmlewis
left a comment
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.
Thank you, @ManavSharma142!
This is very interesting and is actually highlighting a number of problems:
testBadOptionsdoesn't need to be within any table-driven teststestBadOptionsonly needs to be called once per endpoint, with newlines for argsmethodNameshould always be shared betweentestBadOptionsandtestNewRequestAndDoFailure- Some tests that actually take string arguments appear to be missing a
testBadOptionscall
Could you please investigate these issues in this repo, @ManavSharma142?
I believe a separate issue/pr is warranted, since this requires extensive refactoring across all test functions. |
unparam linter and cover unused *Response results
gmlewis
left a comment
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.
Thank you, @ManavSharma142!
LGTM.
Awaiting second LGTM+Approval from any other contribitor to this repo before merging.
| - commentFormatting | ||
| - deprecatedComment | ||
| - paramTypeCombine | ||
| unparam: |
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.
For consistency can we place it after staticcheck (Alphabetical order)
Fixes : #3953
I enabled the unparam linter for exported results and exercised previously unused *Response return values in tests.
For the 9 affected methods, I added testNewRequestAndDoFailure blocks to ensure the *Response path is covered.
I also updated the CI config to enable:
unparam:
check-exported: true
and modified apps_test.go accordingly.