From 23742ae7f9e3946649e3328b4dcfd478f06a5af8 Mon Sep 17 00:00:00 2001 From: jangorecki Date: Fri, 9 Dec 2016 09:46:54 -0800 Subject: [PATCH] handle optional data.table in check validation --- scripts/validate_r_cmd_check_output.R | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/validate_r_cmd_check_output.R b/scripts/validate_r_cmd_check_output.R index 8979c78bda0d..2aacb3f47d58 100755 --- a/scripts/validate_r_cmd_check_output.R +++ b/scripts/validate_r_cmd_check_output.R @@ -9,7 +9,8 @@ whitelist = list( "Package has FOSS license, installs .class/.jar but has no 'java' directory", "Insufficient package version", # when we check older version of package than current available on CRAN "Days since last update"), # when we submit to CRAN recently - "package dependencies" = "No repository set, so cyclic dependency check skipped", + "package dependencies" = c("No repository set, so cyclic dependency check skipped", + "Package suggested but not available for checking"), "installed package size" = c("installed size is .*Mb", # h2o.jar is installed "sub-directories of 1Mb or more", "java .*Mb"), @@ -30,9 +31,13 @@ check_note <- function(details, whitelist, verbose=TRUE) { if (!length(check_whitelist)) return(check_lines) # check if whitelisted - wl <- sapply(check_whitelist, grepl, check_lines) - if (is.matrix(wl)) - wl <- apply(wl, 1, any) + wl <- sapply( + check_lines, + function(line) any(sapply( + check_whitelist, + function (pattern) grepl(pattern, line) + )) + ) check_lines[!wl] } new_note <- sapply(names(lines), filter_check, lines, whitelist, simplify=FALSE)