From 5dc884b24dff08e48287134f903b8ff5e93b33cb Mon Sep 17 00:00:00 2001 From: Fenner Macrae <13209544+fennerm@users.noreply.github.com> Date: Mon, 5 Feb 2018 09:54:15 -0800 Subject: [PATCH 1/2] Fixed lintr::lint_package command --- ale_linters/r/lintr.vim | 9 +++++---- test/command_callback/test_lintr_command_callback.vader | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ale_linters/r/lintr.vim b/ale_linters/r/lintr.vim index 006bf47..ac1d856 100644 --- a/ale_linters/r/lintr.vim +++ b/ale_linters/r/lintr.vim @@ -11,14 +11,15 @@ let g:ale_r_lintr_lint_package = get(g:, 'ale_r_lintr_lint_package', 0) function! ale_linters#r#lintr#GetCommand(buffer) abort if ale#Var(a:buffer, 'r_lintr_lint_package') - let l:lint_cmd = 'lint_package' + let l:lint_cmd = 'lint_package(cache = FALSE, linters = ' + \ . ale#Var(a:buffer, 'r_lintr_options') . ')' else - let l:lint_cmd = 'lint' + let l:lint_cmd = 'lint(cache = FALSE, commandArgs(TRUE), ' + \ . ale#Var(a:buffer, 'r_lintr_options') . ')' endif let l:cmd_string = 'suppressPackageStartupMessages(library(lintr));' - \ . l:lint_cmd . '(cache = FALSE, commandArgs(TRUE),' - \ . ale#Var(a:buffer, 'r_lintr_options') . ')' + \ . l:lint_cmd return ale#path#BufferCdString(a:buffer) \ . 'Rscript -e ' diff --git a/test/command_callback/test_lintr_command_callback.vader b/test/command_callback/test_lintr_command_callback.vader index 33259e0..e655328 100644 --- a/test/command_callback/test_lintr_command_callback.vader +++ b/test/command_callback/test_lintr_command_callback.vader @@ -18,7 +18,7 @@ Execute(The default lintr command should be correct): \ 'cd ' . ale#Escape(getcwd()) . ' && ' \ . 'Rscript -e ' \ . ale#Escape('suppressPackageStartupMessages(library(lintr));' - \ . 'lint(cache = FALSE, commandArgs(TRUE),' + \ . 'lint(cache = FALSE, commandArgs(TRUE), ' \ . 'with_defaults())') \ . ' %t', \ ale_linters#r#lintr#GetCommand(bufnr('')) @@ -30,7 +30,7 @@ Execute(The lintr options should be configurable): \ 'cd ' . ale#Escape(getcwd()) . ' && ' \ . 'Rscript -e ' \ . ale#Escape('suppressPackageStartupMessages(library(lintr));' - \ . 'lint(cache = FALSE, commandArgs(TRUE),' + \ . 'lint(cache = FALSE, commandArgs(TRUE), ' \ . 'with_defaults(object_usage_linter = NULL))') \ . ' %t', \ ale_linters#r#lintr#GetCommand(bufnr('')) @@ -42,7 +42,7 @@ Execute(If the lint_package flag is set, lintr::lint_package should be called): \ 'cd ' . ale#Escape(getcwd()) . ' && ' \ . 'Rscript -e ' \ . ale#Escape('suppressPackageStartupMessages(library(lintr));' - \ . 'lint_package(cache = FALSE, commandArgs(TRUE),' - \ . 'with_defaults())') + \ . 'lint_package(cache = FALSE, ' + \ . 'linters = with_defaults())') \ . ' %t', \ ale_linters#r#lintr#GetCommand(bufnr('')) From c2ab8853849d1fc64d448d6e65920c988ca9c0fa Mon Sep 17 00:00:00 2001 From: Fenner Macrae <13209544+fennerm@users.noreply.github.com> Date: Mon, 5 Feb 2018 11:33:23 -0800 Subject: [PATCH 2/2] Removed trailing whitespaces --- ale_linters/r/lintr.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ale_linters/r/lintr.vim b/ale_linters/r/lintr.vim index ac1d856..51e5c56 100644 --- a/ale_linters/r/lintr.vim +++ b/ale_linters/r/lintr.vim @@ -11,7 +11,7 @@ let g:ale_r_lintr_lint_package = get(g:, 'ale_r_lintr_lint_package', 0) function! ale_linters#r#lintr#GetCommand(buffer) abort if ale#Var(a:buffer, 'r_lintr_lint_package') - let l:lint_cmd = 'lint_package(cache = FALSE, linters = ' + let l:lint_cmd = 'lint_package(cache = FALSE, linters = ' \ . ale#Var(a:buffer, 'r_lintr_options') . ')' else let l:lint_cmd = 'lint(cache = FALSE, commandArgs(TRUE), ' @@ -19,7 +19,7 @@ function! ale_linters#r#lintr#GetCommand(buffer) abort endif let l:cmd_string = 'suppressPackageStartupMessages(library(lintr));' - \ . l:lint_cmd + \ . l:lint_cmd return ale#path#BufferCdString(a:buffer) \ . 'Rscript -e '