chore: Enable `unparam` linter and cover unused `*Response` results by ManavSharma142 · Pull Request #3955 · google/go-github
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.
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.
Codecov Report
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.51%. Comparing base (f32f05e) to head (172ef8f).
⚠️ Report is 4 commits behind head on master.
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.
📢 Have feedback on the report? Share it here.
🚀 New features to boost your workflow:
- ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
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?
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
testBadOptionscallCould 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.
gmlewis
changed the title
chore: Enable unparam linter and cover unused *Response results
chore: Enable unparam linter and cover unused *Response results
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters