Closed GeoBosh closed 1 year ago
The rcmdcheck package already uses switch in DESCIRPTION
to avoid cleaning up inst/doc
(https://github.com/r-lib/rcmdcheck/blob/a38200c997f58478c8d3e2c4d2dd5e6244dabcba/R/options.R#L87). . If we had the same in pkgbuild
, would that work for you?
That would be great. I assume that it would be honoured by devtools::check()
as well.
FYI I mentioned the prospect of this in the vignettes chapter of R Packages like so:
You can prevent the cleaning of
inst/doc/
withpkgbuild::build(clean_doc =)
. You can putConfig/build/clean-inst-doc: FALSE
in DESCRIPTION to prevent rcmdcheck from cleaning inst/doc/ and something similar may be implemented for pkgbuild (https://github.com/r-lib/pkgbuild/issues/128).
The general stance in devtools and the book is to not keep anything in inst/doc/
and, instead, to let the official build machinery have full control. But we acknowledge that there can be good reasons to do otherwise, so I try to explain how to prevent the devtools-verse from constantly clobbering inst/doc/
.
Doesn't an option to prevent wiping off inst/doc
(rather then the other way out) look like a very strong expression of stance, while remaining friendly?
Not a big deal here but similar stance on pdf's by pkgdown (which ignores them) and the GHA check workflows are really painful (the latter don't include LaTeX examples and the incorporation in a workflow of the separately provided examples is tricky and changes as the GHA evolve).
I don't think it is very important to wipe out inst/doc
on the CI, where it should not exist for HTML vignettes, and if it does then we probably should not wipe it out in the first place.
OTOH, it is easy to package up outdated files on your local computer when you are submitting a package, so cleaning inst/doc
makes sense there. Also, I am not sure if we can change the default at this point.
In any case, when we implement support for Config/build/clean-inst-doc: FALSE
it will be a simple one time operation that you need to add to your package, and then pkgbuild will not clean up inst/doc
.
We'll think about whether the default could be different on the CI.
I know that this was raised in #58 but there the discussion was about specific user cases.
devtools::check()
also usespkgbuild
to build a package and thus deletesinst/doc
, as well.The fact is that
inst/doc
is not designated for automatically generated files only. In that sense, deleting it is analogous to the former roxygen2 approach to overwrite, for example, NAMESPACE (which it does not do any more).WRE, section 1.4, explicitly provides for the possibility to have other files and subdirectories in
inst/doc
:A compromise would be to delete files in
inst/doc
except forinst/doc/index.html
and not touch subdirectories ofinst/doc
.