From 252097bee0966cd1136be66d87b9a8b723a9758e Mon Sep 17 00:00:00 2001 From: Stefan Siegel Date: Thu, 7 Jun 2018 15:06:09 +0200 Subject: [PATCH 1/2] Use --vanilla switch for Rscript This prevents possibly bad interference with the user's R environment, e.g. by an auto-activating packrat. --- ale_linters/r/lintr.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ale_linters/r/lintr.vim b/ale_linters/r/lintr.vim index 51e5c56..8f74c9b 100644 --- a/ale_linters/r/lintr.vim +++ b/ale_linters/r/lintr.vim @@ -22,7 +22,7 @@ function! ale_linters#r#lintr#GetCommand(buffer) abort \ . l:lint_cmd return ale#path#BufferCdString(a:buffer) - \ . 'Rscript -e ' + \ . 'Rscript --vanilla -e ' \ . ale#Escape(l:cmd_string) . ' %t' endfunction From 42192c1593e106922b483e94a738697aa29fa1ce Mon Sep 17 00:00:00 2001 From: Stefan Siegel Date: Thu, 7 Jun 2018 15:56:14 +0200 Subject: [PATCH 2/2] Adapt test to also use Rscript --vanilla --- test/command_callback/test_lintr_command_callback.vader | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/command_callback/test_lintr_command_callback.vader b/test/command_callback/test_lintr_command_callback.vader index e655328..2f7dfb1 100644 --- a/test/command_callback/test_lintr_command_callback.vader +++ b/test/command_callback/test_lintr_command_callback.vader @@ -16,7 +16,7 @@ After: Execute(The default lintr command should be correct): AssertEqual \ 'cd ' . ale#Escape(getcwd()) . ' && ' - \ . 'Rscript -e ' + \ . 'Rscript --vanilla -e ' \ . ale#Escape('suppressPackageStartupMessages(library(lintr));' \ . 'lint(cache = FALSE, commandArgs(TRUE), ' \ . 'with_defaults())') @@ -28,7 +28,7 @@ Execute(The lintr options should be configurable): AssertEqual \ 'cd ' . ale#Escape(getcwd()) . ' && ' - \ . 'Rscript -e ' + \ . 'Rscript --vanilla -e ' \ . ale#Escape('suppressPackageStartupMessages(library(lintr));' \ . 'lint(cache = FALSE, commandArgs(TRUE), ' \ . 'with_defaults(object_usage_linter = NULL))') @@ -40,7 +40,7 @@ Execute(If the lint_package flag is set, lintr::lint_package should be called): AssertEqual \ 'cd ' . ale#Escape(getcwd()) . ' && ' - \ . 'Rscript -e ' + \ . 'Rscript --vanilla -e ' \ . ale#Escape('suppressPackageStartupMessages(library(lintr));' \ . 'lint_package(cache = FALSE, ' \ . 'linters = with_defaults())')