openpharma / roxytypes

typed parameter definitions for `roxygen2`
https://openpharma.github.io/roxytypes/
Other
5 stars 1 forks source link

Prefer glue_data() when data might be list-ish, not an actual environment #15

Closed jennybc closed 1 month ago

jennybc commented 1 month ago

This PR is inspired by doing revdep checks for glue. In the next release of glue, which is very soon, glue::glue() will error when .envir is not an actual environment. .envir has always been documented to be an environment and I've been working to make this actually true.

I last did revdep checks for this in December 2023 and I opened issue or PRs everywhere that I could. So roxytypes's usage of this pattern must have arisen more recently (?).

glue_data() does officially accept something "list-ish" as .x. So you should switch to glue_data(.x = list_ish_thing, ...) as opposed to glue(.envir = list_ish_thing, ...).

Relevant links in glue:

https://github.com/tidyverse/glue/issues/308 https://github.com/tidyverse/glue/commit/e2b74ff17704261b5a7da25b4ebd2dec94740764 https://github.com/tidyverse/glue/issues/341

Here's what I'm currently seeing for roxytypes in glue's revdep checks: https://github.com/tidyverse/glue/blob/main/revdep/problems.md#roxytypes

dgkf commented 1 month ago

Thanks @jennybc! Will update and push out a new release with the change asap.

jennybc commented 1 month ago

glue 1.8.0 has been accepted on CRAN now.