Add support for more package loading functions
Opened this issue · 5 comments
Have you considered to make the parsing code (https://github.com/cole-brokamp/automagic/blob/master/R/parse_packages.R#L52 ff.) modular so that more ways to load packages could be easily managed / added?
I just read https://yihui.name/en/2018/09/xfun-pkg-attach/ and using xfun::pkg_attach(c('ggplot2', 'dplyr', 'shiny'))
or pacman::p_load()
would not be handled by automagic (correct me if I'm wrong).
If the unit test PR #5 gets merged, I would be happy to have a go at this issue, if you'd welcome the change.
@cole-brokamp merged my PR so you're now good to go
yes, PR merged. You are correct that xfun or pacman would not be handled correctly. I would most definitely welcome the change!
I've added your examples to the (currently failing) tests, @nuest
As the sample files are only loaded for text parsing purposes I think xfun and pacman should be ok without being added into the Suggests
field on the DESCRIPTION but it may potentially cause some problems for CRAN checks
Thank - and sorry for the delay. I'll put this on my list!