2017-09-03 22:29:12 +00:00
|
|
|
Before:
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#SetUpLinterTest('r', 'lintr')
|
2017-09-03 22:29:12 +00:00
|
|
|
|
|
|
|
After:
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#TearDownLinterTest()
|
2017-09-03 22:29:12 +00:00
|
|
|
|
|
|
|
Execute(The default lintr command should be correct):
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'Rscript',
|
2018-10-23 14:20:27 +00:00
|
|
|
\ ale#path#CdString(getcwd())
|
2018-06-07 13:56:14 +00:00
|
|
|
\ . 'Rscript --vanilla -e '
|
2018-02-01 02:06:35 +00:00
|
|
|
\ . ale#Escape('suppressPackageStartupMessages(library(lintr));'
|
2018-07-15 17:24:53 +00:00
|
|
|
\ . 'lint(cache = FALSE, commandArgs(TRUE), '
|
|
|
|
\ . 'with_defaults())')
|
|
|
|
\ . ' %t'
|
2017-09-03 22:29:12 +00:00
|
|
|
|
|
|
|
Execute(The lintr options should be configurable):
|
2018-02-01 02:06:35 +00:00
|
|
|
let b:ale_r_lintr_options = 'with_defaults(object_usage_linter = NULL)'
|
2017-09-03 22:29:12 +00:00
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'Rscript',
|
2018-10-23 14:20:27 +00:00
|
|
|
\ ale#path#CdString(getcwd())
|
2018-06-07 13:56:14 +00:00
|
|
|
\ . 'Rscript --vanilla -e '
|
2018-02-01 02:06:35 +00:00
|
|
|
\ . ale#Escape('suppressPackageStartupMessages(library(lintr));'
|
2018-07-15 17:24:53 +00:00
|
|
|
\ . 'lint(cache = FALSE, commandArgs(TRUE), '
|
|
|
|
\ . 'with_defaults(object_usage_linter = NULL))')
|
|
|
|
\ . ' %t'
|
2018-02-04 18:57:52 +00:00
|
|
|
|
|
|
|
Execute(If the lint_package flag is set, lintr::lint_package should be called):
|
|
|
|
let b:ale_r_lintr_lint_package = 1
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'Rscript',
|
2018-10-23 14:20:27 +00:00
|
|
|
\ ale#path#CdString(getcwd())
|
2018-06-07 13:56:14 +00:00
|
|
|
\ . 'Rscript --vanilla -e '
|
2018-02-04 18:57:52 +00:00
|
|
|
\ . ale#Escape('suppressPackageStartupMessages(library(lintr));'
|
2018-07-15 17:24:53 +00:00
|
|
|
\ . 'lint_package(cache = FALSE, '
|
|
|
|
\ . 'linters = with_defaults())')
|
|
|
|
\ . ' %t'
|