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

Match depends correctly #1463

Closed
wants to merge 2 commits into from

Conversation

Projects
None yet
2 participants
@thomasp85
Copy link
Member

thomasp85 commented Feb 20, 2017

This change ensures that only exact matches in imports will get ignored. Currently adding e.g. plyr to a package that already imports dplyr will silently fail. This will happen for all packages that are substrings of packages already ignored.

The proposed change adds regex "fences" around the name of the package to import to circumvent this...

Match depends correctly
This change ensures that only exact matches in imports will get ignored. Currently adding e.g. `plyr` to a package that already imports `dplyr` will silently fail. This will happen for all packages that are substrings of packages already ignored.

The proposed change adds regex "fences" around the name of the package to import to circumvent this...
@jimhester

This comment has been minimized.

Copy link
Member

jimhester commented Feb 20, 2017

The proper way to do this is to use word boundary anchors around the package name.

re <- "\\btest\\b"
grepl(re, "test")
#> [1] TRUE
grepl(re, "ttest")
#> [1] FALSE
grepl(re, "testt")
#> [1] FALSE
grepl(re, " test")
#> [1] TRUE
grepl(re, " test ")
#> [1] TRUE
grepl(re, " test, ")
#> [1] TRUE
@thomasp85

This comment has been minimized.

Copy link
Member Author

thomasp85 commented Feb 20, 2017

Oh, didn't know that one... Much cleaner

@jimhester jimhester added this to the 1.13.0 milestone May 3, 2017

@jimhester

This comment has been minimized.

Copy link
Member

jimhester commented May 17, 2017

Thanks! Merged in f7d4c02

@jimhester jimhester closed this May 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.