From a9ee9261d5904588e399b03ff255c652bfae6dc9 Mon Sep 17 00:00:00 2001 From: Luis Verde Arregoitia <luisd@ciencias.unam.mx> Date: Wed, 24 Jan 2024 15:10:23 -0300 Subject: [PATCH] bump version for release --- .Rbuildignore | 2 ++ .gitignore | 2 ++ DESCRIPTION | 8 +++++--- NEWS.md | 7 +++++++ R/annotate_fun_calls.R | 3 ++- R/annotate_repostitle.R | 3 ++- README.Rmd | 2 ++ README.md | 2 ++ man/annotate_fun_calls.Rd | 3 ++- man/annotater-package.Rd | 6 ++++++ tests/testthat/test-overall-annotation.R | 2 +- 11 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 1fe75df..4dfbb83 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,5 @@ ^codecov\.yml$ ^cran-comments\.md$ ^CRAN-SUBMISSION$ +^doc$ +^Meta$ diff --git a/.gitignore b/.gitignore index c833a2c..7a7155e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ .RData .Ruserdata inst/doc +/doc/ +/Meta/ diff --git a/DESCRIPTION b/DESCRIPTION index 6884641..e9b11be 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,19 +1,21 @@ Package: annotater Title: Annotate Package Load Calls Version: 0.2.2 -Authors@R: +Authors@R: c( person(given = "Luis D.", family = "Verde Arregoitia", role = c("aut", "cre"), email = "luis@liomys.mx", - comment = c(ORCID = "0000-0001-9520-6543")) + comment = c(ORCID = "0000-0001-9520-6543")), + person("Juan","Cruz Rodriguez",role="ctb"), + person("Hadley","Wickham",role="ctb")) Description: Provides non-invasive annotation of package load calls such as \code{library()}, \code{p_load()}, and \code{require()} so that we can have an idea of what the packages we are loading are meant for. License: MIT + file LICENSE Encoding: UTF-8 LazyData: true -RoxygenNote: 7.2.1 +RoxygenNote: 7.2.3 Imports: stringr, purrr, diff --git a/NEWS.md b/NEWS.md index 2710ee5..56c22e0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +# annotater 0.2.3 + +* Fix failing tests +* Better annotations for packages installed from R-universe +* Dataset annotation added +* Modern tidyselect syntax (thanks to PR by Hadley Wickham) + # annotater 0.2.2 * Bug fixes diff --git a/R/annotate_fun_calls.R b/R/annotate_fun_calls.R index de43263..aaf739a 100644 --- a/R/annotate_fun_calls.R +++ b/R/annotate_fun_calls.R @@ -5,7 +5,8 @@ #' @return text string with function call annotations. Will make note of #' packages not currently installed. Lines with existing comments or #' annotations are ignored by the regular expression that matches package -#' names. +#' names. Be aware that package-specific methods (e.g., print or summary +#' methods) will be annotated too. #' #' @examples #' test_string <- c("library(boot)\nrequire(lattice)\ncanonical.theme()") diff --git a/R/annotate_repostitle.R b/R/annotate_repostitle.R index 0a3c77a..fb002c9 100644 --- a/R/annotate_repostitle.R +++ b/R/annotate_repostitle.R @@ -42,10 +42,11 @@ annotate_repostitle <- function(string_og) { "CRAN" ~ "CRAN", .data$repo == "Bioconductor" ~ "Bioconductor", .data$repo == "none" ~ "not installed on this machine", + str_detect(.data$repo,"universe")~.data$repo,# for Runiverse pkgs TRUE ~ repo_details(.data$pkgname_clean) ), annotation = dplyr::case_when(stringr::str_detect( user_repo, - "/" + "/(?!.+r-universe.+)" ) ~ paste0("[", .data$repo, "::", user_repo, "]"), TRUE ~ user_repo)) pck_descs <- dplyr::mutate(pck_descs, version = pkg_version(gsub("[\'\"]", "", .data$package_name))) diff --git a/README.Rmd b/README.Rmd index 75f2c6f..ac1faf2 100644 --- a/README.Rmd +++ b/README.Rmd @@ -43,6 +43,8 @@ Thanks to [Juan Cruz Rodriguez](https://github.com/jcrodriguez1989), we can now <img src='https://raw.githubusercontent.com/luisdva/annotater/master/inst/media/jcruz.gif' align="center" width="400px" /> +As of version 0.2.3, loaded datasets can also be added as annotations. + ## `pacman` compatibility Users of the [`pacman`](https://cran.r-project.org/package=pacman) package can now use all `annotater` functions on `p_load` calls. This includes calls with multiple package names (e.g. `p_load(ggplot2,purrr)`), which will be split up across lines for readability. diff --git a/README.md b/README.md index e138315..45d2987 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,8 @@ script. <img src='https://raw.githubusercontent.com/luisdva/annotater/master/inst/media/jcruz.gif' align="center" width="400px" /> +As of version 0.2.3, loaded datasets can also be added as annotations. + ## `pacman` compatibility Users of the [`pacman`](https://cran.r-project.org/package=pacman) diff --git a/man/annotate_fun_calls.Rd b/man/annotate_fun_calls.Rd index 61313ce..7a44a92 100644 --- a/man/annotate_fun_calls.Rd +++ b/man/annotate_fun_calls.Rd @@ -13,7 +13,8 @@ annotate_fun_calls(string_og) text string with function call annotations. Will make note of packages not currently installed. Lines with existing comments or annotations are ignored by the regular expression that matches package - names. + names. Be aware that package-specific methods (e.g., print or summary + methods) will be annotated too. } \description{ Annotate function calls diff --git a/man/annotater-package.Rd b/man/annotater-package.Rd index 037f2c6..949fe88 100644 --- a/man/annotater-package.Rd +++ b/man/annotater-package.Rd @@ -22,5 +22,11 @@ Useful links: \author{ \strong{Maintainer}: Luis D. Verde Arregoitia \email{luis@liomys.mx} (\href{https://orcid.org/0000-0001-9520-6543}{ORCID}) +Other contributors: +\itemize{ + \item Juan Cruz Rodriguez [contributor] + \item Hadley Wickham [contributor] +} + } \keyword{internal} diff --git a/tests/testthat/test-overall-annotation.R b/tests/testthat/test-overall-annotation.R index 6b81128..1fd7d07 100644 --- a/tests/testthat/test-overall-annotation.R +++ b/tests/testthat/test-overall-annotation.R @@ -47,7 +47,7 @@ library(stringi)" ) expect_match( annotate_repo_source(test_string), - "p_load.*tidyr\\s*# CRAN v.*library.stringi.*CRAN v.*" + "p_load.*tidyr\\s*# .+ v.*library.stringi.* .+ v.*" ) })