You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a vexing little bug that should be easy to fix. Upon activating an renv project (version 1.0.3), renv does its normal routine of dependency discovery to crosscheck against the lockfile. If, say, you have multiple nested subdirectories that each contain hundreds of files, renv throws a warning message:
# At 'R/snapshot.R#957'## report to userlines<- c(
"",
"NOTE: Dependency discovery took %s during snapshot.",
"Consider using .renvignore to ignore files, or switching to explicit snapshots.",
"See `?renv::dependencies` for more information.",
if (length(count)) c(
"",
sprintf("- %s: %s", format(names(count)), nplural("file", count))
),
""
)
If there are multiple directories that are in count, then this should be a multi-length vector. This is all fine and dandy, but there is a lurking issue: nplural. nplural in turn calls plural with its source being:
This now will throw an error when length(n) > 1. As it exists now, renv crashes on activation, which means any related processes (e.g. {languageserver}) will also crash when trying to operate on the project files.
I would amend this utility to:
plural<-function(word, n) {
stopifnot(length(word) == length(n))
if (length(word) >1) {
# Assuming compat-purrr or equivalent is around; I didn't checkreturn(map2_chr(word, n, plural))
}
if (n==1) wordelse paste(word, "s", sep="")
}
Would be happy to create a PR for this!
The text was updated successfully, but these errors were encountered:
Hello,
I found a vexing little bug that should be easy to fix. Upon activating an renv project (version 1.0.3), renv does its normal routine of dependency discovery to crosscheck against the lockfile. If, say, you have multiple nested subdirectories that each contain hundreds of files, renv throws a warning message:
If there are multiple directories that are in
count
, then this should be a multi-length vector. This is all fine and dandy, but there is a lurking issue:nplural
.nplural
in turn callsplural
with its source being:This now will throw an error when
length(n) > 1
. As it exists now, renv crashes on activation, which means any related processes (e.g. {languageserver}) will also crash when trying to operate on the project files.I would amend this utility to:
Would be happy to create a PR for this!
The text was updated successfully, but these errors were encountered: