mirror of https://github.com/dense-analysis/ale
Update formatting and tests.
This commit is contained in:
parent
bb095df25e
commit
b13f290390
|
@ -9,6 +9,7 @@ function! ale_linters#r#lintr#GetCommand(buffer) abort
|
||||||
let l:cmd_string = 'suppressPackageStartupMessages(library(lintr));'
|
let l:cmd_string = 'suppressPackageStartupMessages(library(lintr));'
|
||||||
\ . 'lint(cache = FALSE, commandArgs(TRUE),'
|
\ . 'lint(cache = FALSE, commandArgs(TRUE),'
|
||||||
\ . ale#Var(a:buffer, 'r_lintr_options') . ')'
|
\ . ale#Var(a:buffer, 'r_lintr_options') . ')'
|
||||||
|
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return ale#path#BufferCdString(a:buffer)
|
||||||
\ . 'Rscript -e '
|
\ . 'Rscript -e '
|
||||||
\ . ale#Escape(l:cmd_string) . ' %t'
|
\ . ale#Escape(l:cmd_string) . ' %t'
|
||||||
|
@ -21,4 +22,3 @@ call ale#linter#Define('r', {
|
||||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\})
|
\})
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,20 @@ Execute(The default lintr command should be correct):
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ 'cd ' . ale#Escape(getcwd()) . ' && '
|
\ 'cd ' . ale#Escape(getcwd()) . ' && '
|
||||||
\ . 'Rscript -e '
|
\ . 'Rscript -e '
|
||||||
\ . ale#Escape('lintr::lint(commandArgs(TRUE)[1], eval(parse(text = commandArgs(TRUE)[2])))')
|
\ . ale#Escape('suppressPackageStartupMessages(library(lintr));'
|
||||||
\ . ' %t '
|
\ . 'lint(cache = FALSE, commandArgs(TRUE),'
|
||||||
\ . ale#Escape('lintr::with_defaults()'),
|
\ . 'with_defaults())')
|
||||||
|
\ . ' %t',
|
||||||
\ ale_linters#r#lintr#GetCommand(bufnr(''))
|
\ ale_linters#r#lintr#GetCommand(bufnr(''))
|
||||||
|
|
||||||
Execute(The lintr options should be configurable):
|
Execute(The lintr options should be configurable):
|
||||||
let b:ale_r_lintr_options = 'lintr::with_defaults(object_usage_linter = NULL)'
|
let b:ale_r_lintr_options = 'with_defaults(object_usage_linter = NULL)'
|
||||||
|
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ 'cd ' . ale#Escape(getcwd()) . ' && '
|
\ 'cd ' . ale#Escape(getcwd()) . ' && '
|
||||||
\ . 'Rscript -e '
|
\ . 'Rscript -e '
|
||||||
\ . ale#Escape('lintr::lint(commandArgs(TRUE)[1], eval(parse(text = commandArgs(TRUE)[2])))')
|
\ . ale#Escape('suppressPackageStartupMessages(library(lintr));'
|
||||||
\ . ' %t '
|
\ . 'lint(cache = FALSE, commandArgs(TRUE),'
|
||||||
\ . ale#Escape('lintr::with_defaults(object_usage_linter = NULL)'),
|
\ . 'with_defaults(object_usage_linter = NULL))')
|
||||||
|
\ . ' %t',
|
||||||
\ ale_linters#r#lintr#GetCommand(bufnr(''))
|
\ ale_linters#r#lintr#GetCommand(bufnr(''))
|
||||||
|
|
Loading…
Reference in New Issue