Set metadata in packrat lockfile#429
Conversation
| #' # Setting back old state | ||
| #' # set_lockfile_metadata(r_version = old_rver) | ||
| #' } | ||
| set_lockfile_metadata <- function(repos = NULL, r_version = NULL, project = NULL) { |
There was a problem hiding this comment.
Most of the Packrat APIs take the project as the first argument -- can we follow that convention here?
There was a problem hiding this comment.
I followed the convention of set_opts and get_opts that I find close in functionality. project is last in get_opts and second in set_opts. From usage :
get_opts(options = NULL, simplify = TRUE, project = NULL)
set_opts(..., project = NULL, persist = TRUE)bad idea ?
Still want me to change ?
There was a problem hiding this comment.
Good point! I think you're right; let's leave it as is then.
| stop(paste(lockFilePath, " is missing. Run packrat::init('", | ||
| project, "') to generate it.", sep = "")) | ||
| } | ||
| lf <- as.data.frame(readDcf(lf_filepath), stringsAsFactors = F) |
There was a problem hiding this comment.
Can we use FALSE instead of the abbreviated F here?
There was a problem hiding this comment.
Absolutely right ! Good practice still not automatic for me. Done!
|
Thanks! |
|
Oh thanks for merging! thanks again for you review ! |
|
I added a NEWS bullet and bumped the version here: I'd welcome a PR adding tests as well if you have the time to put something together as well. Thanks for taking the time to put this together! |
|
Thanks, should have looked in the other commit.. |
Hey,
This is related #425. @kevinushey I followed you advice and made one function to change different metadata. Just two for the moment
reposandr_version. I think the others are not useful to modify.Can you take a look and tell me if the direction I took is ok ?
I tried to write some tests but I don't manage to make them work. It seems like other test are not working either.
I tried something like that
but
initdoes not work as expected.help appreciated for those tests. thanks.
This change is