Repository navigation
Rd file names R CMD build will not throw away - #36
Merged
Merged
Conversation
write_rd() sanitized two shapes -- a leading dot, and %op% -- and left
everything else to chance. `$.foo`, `[[.foo` and `$<-.foo` are
ordinary S3 methods, and the files named after them are not legal
file names on every platform R runs on.
R CMD build does not fail on those. It prints
* excluding invalid files
Subdirectory 'man' contains invalid file names: ...
and carries on, and the R CMD check that follows reads a tarball those
files are no longer in, so it has nothing to report. glinty shipped
four undocumented S3 methods that way with four green CI jobs over it.
The report came from a human running R CMD build by hand.
rd_filename() applies roxygen2's substitution table, so a package
moving between the two tools does not churn its man directory, and the
two cases tinyrox already handled come out spelled exactly as they
were: %||% is still grapes-or-or-grapes, .onLoad still dot-onLoad. The
\name{} inside the file keeps the real topic, so help resolves under
it either way.
document() also refuses now if a name it just wrote would still be
dropped. A silent failure in both directions deserves something that
says no.
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.
Reported against glinty:
Why this is worse than a NOTE
R CMD builddoes not fail on those names. It prints* excluding invalid filesand drops them from the tarball. TheR CMD checkthat follows then reads a tarball those files are no longer in, so it has nothing to report.glinty shipped four undocumented S3 methods that way, with four green CI jobs over it. Confirmed both directions:
The fix
write_rd()sanitized exactly two shapes — a leading dot, and%op%— and left every other name to chance.$.foo,[[.fooand$<-.fooare ordinary S3 methods.rd_filename()applies roxygen2's substitution table. Two reasons for using theirs rather than inventing one:mandirectory;%||%is stillgrapes-or-or-grapes,.onLoadstilldot-onLoad— so this renames nothing that was already working.The
\name{}inside the file keeps the real topic, so help resolves under it either way; only the file on disk is renamed.document()now refuses outright if a name it just wrote would still be dropped. A failure that is silent in both directions deserves something that says no.Tests
135 assertions in
test_rd_filenames.R: the four reported names, the two that must not change, ordinary names left alone, the rest of the operator table, and a sweep over 27 awkward topics asserting each result is portable, has no leading dot or dangling separator, and that no two topics collide. Plus an end-to-end write throughwrite_rd()checking the name it actually lands under.Suite: 374 assertions, 0 failures.