#rstats package dev question: can I make R CMD check exit with a status code 1 when there are warnings but no errors? Alternatively, how does CRAN distinguish warning and error status on package check pages?
1
3
1
Replying to @thosjleeper
If I recall correctly, the `rcmdcheck` utility package by @GaborCsardi gives you a summary object you can act upon. I have been using for ages via the `rcc.r` shell / command-line wrapper in my `littler` package (but do not act on the summary there).

Nov 24, 2021 · 10:45 PM UTC

2
2
As to 'how does CRAN ...': It's all in the open in base R. If you look ati `R CMD check`, it dispatches to `tools::check_packages()`. These are all great resources for study (and while I don't remember if I saw it write out intermediate results I recommend these for study).
1
2
Right, I've looked at that code. I think, though, the package check results page post-processes that in order to produce the OK, NOTE, WARNING, ERROR summary table. And I'm not sure that code is open sourced.
1
Don't think 'R CMD check' can do that (good feature req tho), but {rcmdcheck} can: $ Rscript -e 'rcmdcheck::rcmdcheck(error_on="warning")' … 0 errors ✔ | 1 warning ✖ | 0 notes ✔ Error: R CMD check found WARNINGs $ echo $? 1