aboutsummaryrefslogtreecommitdiff
path: root/dev/lint-r.R
diff options
context:
space:
mode:
authorYu ISHIKAWA <yuu.ishikawa@gmail.com>2015-07-21 22:50:27 -0700
committerShivaram Venkataraman <shivaram@cs.berkeley.edu>2015-07-21 22:50:27 -0700
commit63f4bcc73f5a09c1790cc3c333f08b18609de6a4 (patch)
treefdb2dfbbd34cd4b7cfd469fe1eb1bf03b7c5bec8 /dev/lint-r.R
parenta4c83cb1e4b066cd60264b6572fd3e51d160d26a (diff)
downloadspark-63f4bcc73f5a09c1790cc3c333f08b18609de6a4.tar.gz
spark-63f4bcc73f5a09c1790cc3c333f08b18609de6a4.tar.bz2
spark-63f4bcc73f5a09c1790cc3c333f08b18609de6a4.zip
[SPARK-9121] [SPARKR] Get rid of the warnings about `no visible global function definition` in SparkR
[[SPARK-9121] Get rid of the warnings about `no visible global function definition` in SparkR - ASF JIRA](https://issues.apache.org/jira/browse/SPARK-9121) ## The Result of `dev/lint-r` [The result of lint-r for SPARK-9121 at the revision:1ddd0f2f1688560f88470e312b72af04364e2d49 when I have sent a PR](https://gist.github.com/yu-iskw/6f55953425901725edf6) Author: Yu ISHIKAWA <yuu.ishikawa@gmail.com> Closes #7567 from yu-iskw/SPARK-9121 and squashes the following commits: c8cfd63 [Yu ISHIKAWA] Fix the typo b1f19ed [Yu ISHIKAWA] Add a validate statement for local SparkR 1a03987 [Yu ISHIKAWA] Load the `testthat` package in `dev/lint-r.R`, instead of using the full path of function. 3a5e0ab [Yu ISHIKAWA] [SPARK-9121][SparkR] Get rid of the warnings about `no visible global function definition` in SparkR
Diffstat (limited to 'dev/lint-r.R')
-rw-r--r--dev/lint-r.R12
1 files changed, 9 insertions, 3 deletions
diff --git a/dev/lint-r.R b/dev/lint-r.R
index dcb1a18429..48bd624609 100644
--- a/dev/lint-r.R
+++ b/dev/lint-r.R
@@ -15,15 +15,21 @@
# limitations under the License.
#
+argv <- commandArgs(TRUE)
+SPARK_ROOT_DIR <- as.character(argv[1])
+
# Installs lintr from Github.
# 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")
}
-library(lintr)
-argv <- commandArgs(TRUE)
-SPARK_ROOT_DIR <- as.character(argv[1])
+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)