Fix issue #623 (related to Collate field, and loadall with S4 classes) #648
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.
This proposed change should resolve issue #623.
The additional code proposed for load_all calls
roxygen2::update_collate
to make sure the Collate field in the DESCRIPTION file is up to date with any@includes
in the package's R directory, before attempting to read and evaluate any of the package's code.as.package
is then used to refresh thepkg
structure (specificallypkg$collate
) used in load_all to ensure that later steps are aware of and use the up to date Collate information..IMPORTANT This pull request should NOT be applied until the roxygen issue r-lib/roxygen2#302 has been resolved. (At the time of writing, ie with that roxygen issue unresolved)
roxygen::update_collate
creates a blank Collate field in (to be precise totally removes the Collate field from) the DESCRIPTION file when there are no@includes
found in the .r files. Several of the testthats for devtools have exactly that scenario - viz a manually entered Collate field (rather than one generated by roxygen2 via@includes
) - and the change to their DESCRIPTION files (iftest()
were run on devtools itself) would permanently damage the test.I have submitted two pull requests for roxygen2, namely pull request r-lib/roxygen2#303 (to resolve the roxygen issue), and r-lib/roxygen2#304 (to add a testthat the roxygen issue is indeed resolved satisfactorily). Please review those changes before considering this request.
I will submit a separate pull request containing a testthat issue #623 is actually resolved.
Geoff