Merge pull request #1333 from fennerm/master

Fix the lintr::lint_package command
This commit is contained in:
w0rp 2018-02-06 09:46:22 +00:00 committed by GitHub
commit a3329ef3fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View File

@ -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 '

View File

@ -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(''))