ale/test/command_callback/test_lintr_command_callback.vader

37 lines
1.2 KiB
Plaintext
Raw Normal View History

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