klmr / box

Write reusable, composable and modular R code
https://klmr.me/box/
MIT License
833 stars 47 forks source link

Reexports don't work with trailing comma #263

Closed kamilzyla closed 2 years ago

kamilzyla commented 2 years ago

Error description

Say we have main.R with the following content:

#' @export
box::use(
  ./module,
)

Trying to box::use(./main) results in the following error:

Error in box::use(./main) : 
  alias without name provided in use declaration
(inside “parse_pkg_name(expr)”)

Removing the trailing comma after ./module makes the code work as expected. As trailing commas normally work inside box::use(), I'd expect them to work when #' @export is applied as well.

R version

platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          4                           
minor          1.1                         
year           2021                        
month          08                          
day            10                          
svn rev        80725                       
language       R                           
version.string R version 4.1.1 (2021-08-10)
nickname       Kick Things

‘box’ version

1.1.0

klmr commented 2 years ago

Thanks for reporting! A fix has been committed and will be part of the next release. To use the fixed version before it arrives on CRAN (which potentially won’t be for a while!), please install the dev version via

install.packages('box', repos = 'https://klmr.r-universe.dev')

Please note that it may take up to an hour before the fix will land in the dev build.