Repository navigation
Look for NEWS files only where news() reads them - #276
Merged
Merged
Conversation
checkNEWS() searched the whole package with the pattern 'NEWS[\\.Rd|\\.md]*$'. The bracket is a character class, not alternation, and nothing anchors the start of the name, so files such as vignettes/NEWS.Rmd or tests/fixtures/oldNEWS matched. These raised a spurious 'More than one NEWS file' NOTE. The file it then parsed was the first in locale sort order, which need not be the one news() reads. Check only inst/NEWS.Rd, NEWS.md, inst/NEWS.md, NEWS and inst/NEWS, in the order news() looks for their installed copies (NEWS.Rd, NEWS.md, NEWS), and parse the first one found. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I found nothing worth raising. The change fixes the old pattern and anchoring problems. The new tests cover the I read the diff and the surrounding code but did not run the tests. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #276 +/- ##
==========================================
- Coverage 70.21% 70.18% -0.03%
==========================================
Files 15 15
Lines 2793 2791 -2
==========================================
- Hits 1961 1959 -2
Misses 832 832 ☔ 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.
Found in the review of #275.
checkNEWS()searched the whole package withlist.files(pattern = "NEWS[\\.Rd|\\.md]*$", recursive = TRUE)and parsedhead()of the result. That has three problems:[\.Rd|\.md]*is a character class, not alternation. Any run of\ . R d | mafterNEWSmatches, soNEWS.Rmdcounts as a NEWS file.oldNEWSormyNEWSmatch too.head()pickedinst/NEWS, whichnews()reads last.So a vignette or test fixture whose name ends in
NEWSraised a spurious "More than one NEWS file found" NOTE. BiocCheck could also warn about a stray file while the real NEWS file was fine, or the reverse.Changes
inst/NEWS.Rd,NEWS.md,inst/NEWS.md,NEWSandinst/NEWS. That is the order in whichnews()looks for their installed copies (NEWS.Rd,NEWS.md,NEWS). Parse the first one found.utils::file_test.Tests
A package with a valid
NEWSplusvignettes/NEWS.Rmd,tests/fixtures/oldNEWSandinst/NEWS.txtraises no conditions. Adding an unparseableinst/NEWS.Rdgives one NOTE listing onlyinst/NEWS.RdandNEWS, and one WARNING naminginst/NEWS.Rd. Against the oldcheckNEWS(), 5 of these assertions fail.Checks
inst/tinytest/test_BiocCheck.Rpasses 175 of 175 on R-devel (2026-12-02 r91021) with Bioc 3.25, run twice in one R session.🤖 Generated with Claude Code