diff --git a/dev/lint-r.R b/dev/lint-r.R index a4261d266bbc..96e20d410f09 100644 --- a/dev/lint-r.R +++ b/dev/lint-r.R @@ -24,13 +24,17 @@ if (! library(SparkR, lib.loc = LOCAL_LIB_LOC, logical.return = TRUE)) { stop("You should install SparkR in a local directory with `R/install-dev.sh`.") } -# Installs lintr from Github in a local directory. +# Installs lintr and dependencies from Github in a local directory. + +# Pinning Rcpp version to CRAN snapshot from 2017-10-15 +install.packages("Rcpp", repos = "https://cran.microsoft.com/snapshot/2017-10-15", lib = LOCAL_LIB_LOC) + # NOTE: The CRAN's version is too old to adapt to our rules. -if ("lintr" %in% row.names(installed.packages()) == FALSE) { - devtools::install_github("jimhester/lintr@5431140") -} +# NOTE: We won't use the lintr package that might have been installed on the test machine +devtools::with_libpaths(new = LOCAL_LIB_LOC, devtools::install_github("jimhester/lintr@5431140")) -library(lintr) +library(lintr, lib.loc = LOCAL_LIB_LOC) +library(xmlparsedata, lib.loc = LOCAL_LIB_LOC) library(methods) library(testthat) path.to.package <- file.path(SPARK_ROOT_DIR, "R", "pkg")