[Rd] eliminate a partial argument match warning in R CMD check

Jennifer Bryan jenny@|@bry@n @end|ng |rom gm@||@com
Tue Jul 2 04:26:42 CEST 2019


Hello,

I'm seeing a nuisance warning when I run `R CMD check --as-cran
whatever_x.y.z.tar.gz`.

I generally work with these options set:

options(
  warnPartialMatchArgs = TRUE,
  warnPartialMatchAttr = TRUE,
  warnPartialMatchDollar = TRUE
)

And I see this:

* checking use of SHLIB_OPENMP_*FLAGS in Makefiles ...Warning in dir("src",
patt = "[.]c$") :
  partial argument match of 'patt' to 'pattern'
Warning in dir("src", patt = "[.](cc|cpp)$") :
  partial argument match of 'patt' to 'pattern'
Warning in dir("src", patt = "[.]f$") :
  partial argument match of 'patt' to 'pattern'
Warning in dir("src", patt = "[.]f9[05]$") :
  partial argument match of 'patt' to 'pattern'

It's not a big deal but it would be nice to silence it. Patch below.

Thanks,
Jenny

diff --git a/src/library/tools/R/check.R b/src/library/tools/R/check.R

index 21d192af485..199029bda73 100644
--- a/src/library/tools/R/check.R
+++ b/src/library/tools/R/check.R
@@ -2933,10 +2933,10 @@ add_dummies <- function(dir, Log)
             any <- msg <- character()
             for (m in makefiles) {
                 lines <- readLines(m, warn = FALSE)
-                have_c <- length(dir('src', patt = "[.]c$", recursive
= TRUE)) > 0L
-                have_cxx <- length(dir('src', patt = "[.](cc|cpp)$",
recursive = TRUE)) > 0L
-                have_f <- length(dir('src', patt = "[.]f$", recursive
= TRUE)) > 0L
-                have_f9x <- length(dir('src', patt = "[.]f9[05]$",
recursive = TRUE)) > 0L
+                have_c <- length(dir('src', pattern = "[.]c$",
recursive = TRUE)) > 0L
+                have_cxx <- length(dir('src', pattern =
"[.](cc|cpp)$", recursive = TRUE)) > 0L
+                have_f <- length(dir('src', pattern = "[.]f$",
recursive = TRUE)) > 0L
+                have_f9x <- length(dir('src', pattern = "[.]f9[05]$",
recursive = TRUE)) > 0L
                 for (f in c("C", "CXX", "F", "FC", "CPP"))  {
                     this <- paste0(f, "FLAGS")
                     this2 <- paste0("PKG_", this)

	[[alternative HTML version deleted]]



More information about the R-devel mailing list