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

FR: Support library("tidyverse") notation #4

Closed
stephlocke opened this issue Jul 11, 2018 · 6 comments
Closed

FR: Support library("tidyverse") notation #4

stephlocke opened this issue Jul 11, 2018 · 6 comments

Comments

@stephlocke
Copy link
Contributor

Speech marks are not supported in the CRAN or git version (as of Issue generation point). Taking the example from parse_packages:

> cat('library("ggplot2")\n # library(curl)\n require(leaflet)\n CB::date_print()\n',file='temp.R')
> parse_packages('temp.R')
[1] "\"ggplot2\"" "leaflet"     "CB"         
> unlink('temp.R')

This should result in

> cat('library("ggplot2")\n # library(curl)\n require(leaflet)\n CB::date_print()\n',file='temp.R')
> parse_packages('temp.R')
[1] "ggplot2" "leaflet"     "CB"         
> unlink('temp.R')
@stephlocke
Copy link
Contributor Author

stephlocke commented Jul 11, 2018

If I have time to write tests etc this is how I'd change the library call (and obv the require would also need to be changed)

(?<=library\("*)[0-9|a-z|A-Z|.]+

Example: https://regexr.com/3s9ua

@cole-brokamp
Copy link
Owner

Thanks for bringing this up. I hope to have some time during the next week to implement this fix. Pull request always welcome if you want to take a stab before I get to it.

@stephlocke
Copy link
Contributor Author

omg Cole - no tests present 😱

I'm gonna start your test harness as I have some time right now. Any objections to testthat?

@cole-brokamp
Copy link
Owner

cole-brokamp commented Jul 12, 2018 via email

@stephlocke
Copy link
Contributor Author

This is now working in #5, just waiting for travis to complete

cole-brokamp added a commit that referenced this issue Sep 11, 2018
Adding a test harness and implementing #4
@cole-brokamp
Copy link
Owner

thank you for showing me the testing ways @stephlocke 😎 merged!

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

2 participants