inbo / checklist

An R package for checking R packages and R code
https://inbo.github.io/checklist
GNU General Public License v3.0
16 stars 2 forks source link

Note because pandoc is not installed #55

Closed ElsLommelen closed 3 years ago

ElsLommelen commented 3 years ago

When following this manual to install the checks on an existing package (inbodb), I got the following note when running x <- checklist::check_package():

N  checking top-level files ...
   Files 'README.md' or 'NEWS.md' cannot be checked without 'pandoc' being installed.

When doing the regular checks in RStudio (with or without adding the option --as-cran), I don't get this note, so I suppose this remark is coming from checklist? On the other hand I noticed on the tutorials website that pandoc is automatically installed with RStudio, so I should have it installed?

I don't understand why this note is there and it would be good to somewhere in the documentation find some advise on how to deal with it (preferably with a reference to the documentation in the note itself).

hansvancalster commented 3 years ago

I've encountered this issue too. See https://github.com/inbo/checklist/issues/40.

ElsLommelen commented 3 years ago

What is actually checked in these files? If it is relevant, I think it's a pity that these tests are also ignored in the Linux tests because we put them in .Rbuildignore just because of the note. I'd rather ignore the note, unfortunately here again we have to choose once for both Windows and Linux. If relevant, I'd rather suggest a PR to ignore this specific test on Windows machines (if possible). If it's just a check if the file is present, ignoring is indeed the right thing to do.

ThierryO commented 3 years ago

I think that R CMD checks if it can renders those files to html. If you add them to .Rbuildignore, they will not be ables on CRAN. So not an issue for packages not on CRAN.

ElsLommelen commented 3 years ago

Thanks, that solves the problem for me. I find, however, a bit counter-intuitive to add it to .Rbuildignore while I want these files to be added to my pkgdown website. Anyway, I think it would be useful to add the above information in the documentation before closing this issue, otherways you may have to answer this same question several times. ;-)

ThierryO commented 3 years ago

Adding them to .Rbuildignore excludes them from the package. So they will not be available after installation of a binary version. However, they are still available in the source code and rendered to the pkgdown website.

ThierryO commented 3 years ago

I assume the message occurs when running check_cran()? As that is the function that calls rcmdcheck().

ElsLommelen commented 3 years ago

Yes, indeed, it occurs when running check_cran(). But it doesn't occur when running rcmdcheck::rcmdcheck().

ThierryO commented 3 years ago

Interesting. checklist uses rcmdcheck(args = c("--timings", "--as-cran", "--no-manual"), error_on = "never", quiet = FALSE). Could you give that a try? Don't forget to (temporary) remove the md files from .Rbuildignore ;-)

ElsLommelen commented 3 years ago

Unfortunately, the error occurs in this case. I could try to remove the args alternately to check the culprit, but I suppose you want to keep them all? (And I suppose "--as-cran" is likely to be the culprit. ;-) )

ThierryO commented 3 years ago

The culprit is rcmdcheck() which is not able to detect the installed pandoc. --as-cran implies to run all checks as required by CRAN. We do need all those checks.

ElsLommelen commented 3 years ago

The code below doesn't give the note, maybe check_cran() can be replaced with this code in check_package()? (If needed, surrounded by a check if the OS is Windows, and until it is solved in rcmdcheck.)

withr::with_path(dirname(rmarkdown::pandoc_exec()), check_cran())