Skip to content

Commit

Permalink
handle optional data.table in check validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jangorecki committed Dec 9, 2016
1 parent 72fcccd commit 23742ae
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/validate_r_cmd_check_output.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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)
Expand Down

0 comments on commit 23742ae

Please sign in to comment.