From 44e4953f94379e95b8dc2d6753d1616e4bdbb88b Mon Sep 17 00:00:00 2001 From: Jared Knowles Date: Sat, 8 Aug 2026 18:25:00 -0400 Subject: [PATCH] fix: keep doc/ and Meta/ out of the build Removing ^vignettes$ was right; removing ^doc$ and ^Meta$ with it was not. Those are devtools::build_vignettes() artefacts, not sources -- R CMD build regenerates inst/doc/ from vignettes/ by itself, and shipping the local copies earned a 'non-standard file/directory found at top level' NOTE. R CMD check --as-cran is now 0 errors, 0 warnings, 0 notes. --- .Rbuildignore | 2 ++ tests/testthat/test-config.R | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/.Rbuildignore b/.Rbuildignore index 28bb40d..ba6315b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -3,6 +3,8 @@ ^\.Rproj\.user$ ^_pkgdown\.yml$ ^docs$ +^Meta$ +^doc$ ^pkgdown$ ^\.github$ ^LICENSE\.md$ diff --git a/tests/testthat/test-config.R b/tests/testthat/test-config.R index cdeae60..cdf3580 100644 --- a/tests/testthat/test-config.R +++ b/tests/testthat/test-config.R @@ -130,6 +130,11 @@ test_that("vignettes are not excluded from the build", { # The fixture is what lets R CMD check run offline with no credentials on # r-universe and GitHub Actions. It must never be excluded. expect_false(any(grepl("fixture_corpus", ignore, fixed = TRUE))) + # doc/ and Meta/ ARE build artefacts of devtools::build_vignettes() and must + # stay excluded -- R CMD build regenerates inst/doc/ from vignettes/ on its + # own, and leaving them in earns a "non-standard file at top level" NOTE. + expect_true(any(grepl("^\\^doc\\$$", ignore))) + expect_true(any(grepl("^\\^Meta\\$$", ignore))) }) test_that("_pkgdown.yml indexes every exported topic", {