简体   繁体   中英

Configure Travis CI run exactly the same checks as check --as-cran?

Is there a way to get Travis CI to perform exactly the same checks as

R CMD check --as-cran

?

Currently my check passes --as-cran locally with 0 errors and 0 warnings. But I see lots of warnings via Travis CI which don't occur during CRAN checks.

Here is a sample or the warnings Travis CI generates (that CRAN checks don't):

Package hyperref Warning: Option `hyperindex' has already been used,
(hyperref)                setting the option has no effect on input line 377.

Package rerunfilecheck Warning: File `Rd2.out' has changed.
(rerunfilecheck)                Rerun to get outlines right
(rerunfilecheck)                or use package `bookmark'.
LaTeX Font Warning: Font shape `T1/zi4/m/it' undefined
(Font)              using `T1/zi4/m/n' instead on input line 43.

One way around this is to configure Travis CI to stop treating warnings as errors, but I prefer it fail on warnings, but only on warnings CRAN would also elicit.

Those are pure LaTeX warnings which actually have little to do with CRAN's NOTE, WARNING or ERROR counts.

This LaTeX warnings can come from different LaTeX installations, versions of LaTeX packages, different (or missing) fonts and on and on.

Sadly, CRAN does not "publish" their exact test setup as a Docker image so we cannot "exactly" reproduce. So some care is needed in interpreting the result which... in the above case you can likely ignore.

There are other ways to suppress them. One is to not re-run the LaTeX build and include a pdf premade. It is a little drastic (but I do it in a few packages) and hey, you asked to get rid of the warnings:)

Edit: By the way, another way to fine-tune your Travis CI setup is to run it in a Docker container you provide or specify (and can hence adjust). I do that in a few repos with particularly (often: library) needs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM