diff options
author | Yu ISHIKAWA <yuu.ishikawa@gmail.com> | 2015-08-27 19:38:53 -0700 |
---|---|---|
committer | Shivaram Venkataraman <shivaram@cs.berkeley.edu> | 2015-08-27 19:38:53 -0700 |
commit | 1f90c5e2198bcf49e115d97ec300c17c1be4dcb4 (patch) | |
tree | b94d86d67bddbb4a4a27057a82b43547cf019314 /dev/lint-r.R | |
parent | 54cda0deb6bebf1470f16ba5bcc6c4fb842bdac1 (diff) | |
download | spark-1f90c5e2198bcf49e115d97ec300c17c1be4dcb4.tar.gz spark-1f90c5e2198bcf49e115d97ec300c17c1be4dcb4.tar.bz2 spark-1f90c5e2198bcf49e115d97ec300c17c1be4dcb4.zip |
[SPARK-8505] [SPARKR] Add settings to kick `lint-r` from `./dev/run-test.py`
JoshRosen we'd like to check the SparkR source code with the `dev/lint-r` script on the Jenkins. I tried to incorporate the script into `dev/run-test.py`. Could you review it when you have time?
shivaram I modified `dev/lint-r` and `dev/lint-r.R` to install lintr package into a local directory(`R/lib/`) and to exit with a lint status. Could you review it?
- [[SPARK-8505] Add settings to kick `lint-r` from `./dev/run-test.py` - ASF JIRA](https://issues.apache.org/jira/browse/SPARK-8505)
Author: Yu ISHIKAWA <yuu.ishikawa@gmail.com>
Closes #7883 from yu-iskw/SPARK-8505.
Diffstat (limited to 'dev/lint-r.R')
-rw-r--r-- | dev/lint-r.R | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/dev/lint-r.R b/dev/lint-r.R index 48bd624609..999eef571b 100644 --- a/dev/lint-r.R +++ b/dev/lint-r.R @@ -17,8 +17,14 @@ argv <- commandArgs(TRUE) SPARK_ROOT_DIR <- as.character(argv[1]) +LOCAL_LIB_LOC <- file.path(SPARK_ROOT_DIR, "R", "lib") -# Installs lintr from Github. +# Checks if SparkR is installed in a local directory. +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. # 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") @@ -27,9 +33,5 @@ if ("lintr" %in% row.names(installed.packages()) == FALSE) { library(lintr) library(methods) library(testthat) -if (! library(SparkR, lib.loc = file.path(SPARK_ROOT_DIR, "R", "lib"), logical.return = TRUE)) { - stop("You should install SparkR in a local directory with `R/install-dev.sh`.") -} - path.to.package <- file.path(SPARK_ROOT_DIR, "R", "pkg") lint_package(path.to.package, cache = FALSE) |