Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renv::install() sometimes doesn't like glue::glue() double curly brace escapes #1891

Open
pbbgss opened this issue May 2, 2024 · 0 comments

Comments

@pbbgss
Copy link

pbbgss commented May 2, 2024

Hello there!

Since version 1.0.0 (I think) renv appears to have a problem with the use of {{}} in glue::glue() expressions where there is a variable to be evaluated inside the escaped braces. (A use case for these is when dynamically building {cli} formatted messages).

Reprex (using {renv} 1.0.7)

writeLines("Imports:\n\tglue\n\tcli", con = "DESCRIPTION")

# This will cause issues
writeLines("foo <- 'world'\nbar <- glue::glue('Hello {{{foo}}}')", con = "foo.R")

# This will cause issues - this is the "real" use case with a cli class
writeLines("foo <- 'world'\nbar <- glue::glue('Hello {{.strong {foo}}}')", con = "bar.R")

# This will not cause issues
writeLines("foo <- 'world'\nbar <- glue::glue('Hello {foo}')", con = "baz.R")

# This will not cause issues
writeLines("foo <- 'world'\nbar <- glue::glue('Hello {{world}}')", con = "ham.R")

renv::install()
WARNING: One or more problems were discovered while enumerating dependencies.

# /home/pbbgss/projects/foo/bar.R --------------------------------------------
Error: <text>:1:4: unexpected '}'
1: foo}
       ^

# /home/pbbgss/projects/foo/foo.R --------------------------------------------
Error: <text>:1:4: unexpected '}'
1: foo}
       ^

Please see `?renv::dependencies` for more information.

The warning isn't triggered on {renv} 0.15.4 but I haven't tested everything in between

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant