Repository navigation
Check duplicate chunk labels only in knitr-tangled vignettes - #272
Merged
Merged
Conversation
checkDupChunkLabels() ran knitr::purl() on every vignette, including Sweave .Rnw files that BiocCheck otherwise tangles with Stangle(). knitr cannot parse some Sweave chunk options (e.g., `<<<eval=F>>=`), and the re-signalled error halted BiocCheck with "! in callr subprocess". Sweave allows duplicate labels, so the check only applies to vignettes tangled with knitr. Factor the knitr-vs-Sweave decision out of purl_or_tangle() into .isKnitrTangled() and use it in both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #272 +/- ##
==========================================
+ Coverage 70.18% 70.19% +0.01%
==========================================
Files 15 15
Lines 2767 2768 +1
==========================================
+ Hits 1942 1943 +1
Misses 825 825 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BiocCheck halts at "Checking vignette directory" on Sweave vignettes whose chunk options knitr can't parse, as seen in the r-universe Bioc builds for CNORfuzzy, flowBeads, isobar, mirIntegrator, riboSeqR, and xmapbridge:
Cause
checkDupChunkLabels()runsknitr::purl()on every vignette, but BiocCheck tangles.Rnwfiles without a knitr or quartoVignetteEnginewithStangle()everywhere else. These vignettes declare no engine and use chunk headers Sweave accepts but knitr rejects (<<<eval=F>>=,<<defaultParameters echo=TRUE>>=). Errors other than "Duplicate chunk label" are re-signalled withwarning(e), which an enclosingtryCatch(error = )still treats as an error, so BiocCheck stops.Change
purl_or_tangle()into.isKnitrTangled().checkDupChunkLabels()checks only vignettes for which.isKnitrTangled()isTRUE: Rmd and qmd vignettes, and Rnw vignettes that declare a knitr or quartoVignetteEngine. Rnw vignettes tangled with Sweave are skipped. Sweave allows duplicate labels:R CMD buildandR CMD checkpass with them, though twofig=TRUEchunks sharing a label write the same figure file, so the later plot replaces the earlier one.Checks
inst/tinytest/test_checkVignettes.R: a Sweave vignette with<<<eval=F>>=and duplicate labels gives no condition, and a.Rnwthat declaresknitr::knitrwith duplicate labels is still flagged.checkVignetteDir()on the nine vignettes of the six packages above: before the change all six packages halt with! in callr subprocess; after it all six complete.Stangle()tangles every one of them.test_BiocCheck.Rpasses 146 of 146 andtest_checkVignettes.Rpasses 28 of 28.R CMD checkis left to CI.This PR was drafted with the help of Claude Code (Claude Opus 5.5).
🤖 Generated with Claude Code