-
Notifications
You must be signed in to change notification settings - Fork 15
Add pkgchk_uses_dontrun() as a watch check
#246
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
Conversation
pkgchk_uses_dontrun() as a watch check
|
Thanks @ateucher. Print method will be improved by #247. It's currently off by default unless checks are listed there, but that will make for easier and more sensible default print behaviour. This is also a great test case for #248, because this check should definitely ✖️ if all examples are |
|
Ah, that's a good idea to have an ✖️ if all are |
However, wouldn't it be nice if all those were covered by |
Been attempting exactly that here, and with that demonstrating that sometimes |
|
@ateucher What's the status here? Tests and checks fail only because you need to run locally and then
|
|
Sorry for the delay @mpadge. I'll get back to this in the next few days! |
* Use tryCatch when parsing Rd files * Use .Rd_get_section to pull out examples * Different summary if all vs some examples use dontrun
* Determine if all, some, or none of the examples are wrapped in `dont_run` * print/summary messages based on all/some/none * Tweak function names for clarity
|
@mpadge I finally found some time to finish this off. Now it fails with an ✖️ if all examples are wrapped in It looks like the failures here on ubuntu are because the |
|
Thanks @ateucher, great to see this moving again. Can you please do this: testthat::test_file('tests/testthat/test-extra-checks.R')
testthat::snapshot_review('extra-checks/')and accept and merge the changes? Thanks |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #246 +/- ##
==========================================
+ Coverage 92.44% 92.54% +0.10%
==========================================
Files 46 47 +1
Lines 3479 3567 +88
==========================================
+ Hits 3216 3301 +85
- Misses 263 266 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
That's awesome, thanks so much @ateucher for the great work. And with due apologies for ongoing requests, but this one is knida important: Can you please add yourself to https://github.com/ropensci-review-tools/pkgcheck/blob/main/DESCRIPTION as "aut"? Then we're good to go; thanks so much! I really like the conditional use of |
|
Thanks @mpadge! |
This closes #238 when merged.
I thought it made sense for this to be a "watch" check, since there are valid reasons to use
\dontrun{}in examples.I didn't add tests as I couldn't see an obvious pattern of how to do it by looking at existing test. I did run this on several of my local packages.
One thing I'm not sure about is the print method - I don't see it getting printed, only the summary, and wasn't sure how to trigger that (i.e., see the list of functions that use
dontrun{}.Please see my comment on line 37-38 - I was able to extract the
dontrun{}sections from the Rd files, but the code is much harder to read. Usinggrepl()on the character representation is clearer and I can't think of a situation where that search would return a false positive or a false negative.Running it on
pkgcheckgives:Created on 2025-06-21 with reprex v2.1.1