Fixed lintr::lint_package command
This commit is contained in:
parent
dda132c1a2
commit
5dc884b24d
@ -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
|
function! ale_linters#r#lintr#GetCommand(buffer) abort
|
||||||
if ale#Var(a:buffer, 'r_lintr_lint_package')
|
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
|
else
|
||||||
let l:lint_cmd = 'lint'
|
let l:lint_cmd = 'lint(cache = FALSE, commandArgs(TRUE), '
|
||||||
|
\ . ale#Var(a:buffer, 'r_lintr_options') . ')'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:cmd_string = 'suppressPackageStartupMessages(library(lintr));'
|
let l:cmd_string = 'suppressPackageStartupMessages(library(lintr));'
|
||||||
\ . l:lint_cmd . '(cache = FALSE, commandArgs(TRUE),'
|
\ . l:lint_cmd
|
||||||
\ . ale#Var(a:buffer, 'r_lintr_options') . ')'
|
|
||||||
|
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return ale#path#BufferCdString(a:buffer)
|
||||||
\ . 'Rscript -e '
|
\ . 'Rscript -e '
|
||||||
|
@ -18,7 +18,7 @@ Execute(The default lintr command should be correct):
|
|||||||
\ 'cd ' . ale#Escape(getcwd()) . ' && '
|
\ 'cd ' . ale#Escape(getcwd()) . ' && '
|
||||||
\ . 'Rscript -e '
|
\ . 'Rscript -e '
|
||||||
\ . ale#Escape('suppressPackageStartupMessages(library(lintr));'
|
\ . ale#Escape('suppressPackageStartupMessages(library(lintr));'
|
||||||
\ . 'lint(cache = FALSE, commandArgs(TRUE),'
|
\ . 'lint(cache = FALSE, commandArgs(TRUE), '
|
||||||
\ . 'with_defaults())')
|
\ . 'with_defaults())')
|
||||||
\ . ' %t',
|
\ . ' %t',
|
||||||
\ ale_linters#r#lintr#GetCommand(bufnr(''))
|
\ ale_linters#r#lintr#GetCommand(bufnr(''))
|
||||||
@ -30,7 +30,7 @@ Execute(The lintr options should be configurable):
|
|||||||
\ 'cd ' . ale#Escape(getcwd()) . ' && '
|
\ 'cd ' . ale#Escape(getcwd()) . ' && '
|
||||||
\ . 'Rscript -e '
|
\ . 'Rscript -e '
|
||||||
\ . ale#Escape('suppressPackageStartupMessages(library(lintr));'
|
\ . ale#Escape('suppressPackageStartupMessages(library(lintr));'
|
||||||
\ . 'lint(cache = FALSE, commandArgs(TRUE),'
|
\ . 'lint(cache = FALSE, commandArgs(TRUE), '
|
||||||
\ . 'with_defaults(object_usage_linter = NULL))')
|
\ . 'with_defaults(object_usage_linter = NULL))')
|
||||||
\ . ' %t',
|
\ . ' %t',
|
||||||
\ ale_linters#r#lintr#GetCommand(bufnr(''))
|
\ 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()) . ' && '
|
\ 'cd ' . ale#Escape(getcwd()) . ' && '
|
||||||
\ . 'Rscript -e '
|
\ . 'Rscript -e '
|
||||||
\ . ale#Escape('suppressPackageStartupMessages(library(lintr));'
|
\ . ale#Escape('suppressPackageStartupMessages(library(lintr));'
|
||||||
\ . 'lint_package(cache = FALSE, commandArgs(TRUE),'
|
\ . 'lint_package(cache = FALSE, '
|
||||||
\ . 'with_defaults())')
|
\ . 'linters = with_defaults())')
|
||||||
\ . ' %t',
|
\ . ' %t',
|
||||||
\ ale_linters#r#lintr#GetCommand(bufnr(''))
|
\ ale_linters#r#lintr#GetCommand(bufnr(''))
|
||||||
|
Loading…
Reference in New Issue
Block a user