allcontributors
allcontributors copied to clipboard
Add rate limit checking
This PR adds a small function to check the rate limit on the GitHub API. When this hits 0, it will display a warning.
This will help people get feedback on when they are exceeding the rate limit, which can be helpful to scope down the task to be more manageable.
Pre-discussed in #36. Happy to take feedback as you know your standards for this package best. I tried to stick to how you've previously implemented warnings for sake of package consistency.
@chartgerink That looks great! Could you please fix the tests? They include mock results of all external calls, so now fail because new API calls have been introduced. You should be able to update them with these steps:
- Delete the
tests/testthat/getcontribsdirectory (notgit rm, justrm!) - Run
library (httptest2) testthat::test_local () git add tests/testthat/getcontribs
Then you can stage all of those files, commit, and push. Thanks!
Thanks @mpadge - updated according to your steps 👍
EDIT: It seems like the tests still fail on remote, even though they pass locally. The error indicates a timeout?
Sorry for dropping this @chartgerink. This still fails tests, but I'll merge and fix everything straight away, before moving straight on to #35.