mirror of
https://github.com/dense-analysis/ale
synced 2025-03-08 06:07:52 +00:00
Working directories are now set seperately from the commands so they can later be swapped out when running linters over projects is supported, and also better support filename mapping for running linters on other machines in future.
35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
Before:
|
|
call ale#assert#SetUpLinterTest('r', 'lintr')
|
|
|
|
After:
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
Execute(The default lintr command should be correct):
|
|
AssertLinterCwd '%s:h'
|
|
AssertLinter 'Rscript',
|
|
\ 'Rscript --vanilla -e '
|
|
\ . ale#Escape('suppressPackageStartupMessages(library(lintr));'
|
|
\ . 'lint(cache = FALSE, commandArgs(TRUE), '
|
|
\ . 'with_defaults())')
|
|
\ . ' %t'
|
|
|
|
Execute(The lintr options should be configurable):
|
|
let b:ale_r_lintr_options = 'with_defaults(object_usage_linter = NULL)'
|
|
|
|
AssertLinter 'Rscript',
|
|
\ 'Rscript --vanilla -e '
|
|
\ . ale#Escape('suppressPackageStartupMessages(library(lintr));'
|
|
\ . 'lint(cache = FALSE, commandArgs(TRUE), '
|
|
\ . 'with_defaults(object_usage_linter = NULL))')
|
|
\ . ' %t'
|
|
|
|
Execute(If the lint_package flag is set, lintr::lint_package should be called):
|
|
let b:ale_r_lintr_lint_package = 1
|
|
|
|
AssertLinter 'Rscript',
|
|
\ 'Rscript --vanilla -e '
|
|
\ . ale#Escape('suppressPackageStartupMessages(library(lintr));'
|
|
\ . 'lint_package(cache = FALSE, '
|
|
\ . 'linters = with_defaults())')
|
|
\ . ' %t'
|