X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/0ee596c5c5e11fc79598407eaf22f83d279f7e9e..5a4872f466ebd76ddd532bdf2798554421c53df4:/.vim/bundle/ale/test/linter/test_lintr.vader diff --git a/.vim/bundle/ale/test/linter/test_lintr.vader b/.vim/bundle/ale/test/linter/test_lintr.vader new file mode 100644 index 00000000..8f6fb88f --- /dev/null +++ b/.vim/bundle/ale/test/linter/test_lintr.vader @@ -0,0 +1,34 @@ +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 --no-save --no-restore --no-site-file --no-init-file -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 --no-save --no-restore --no-site-file --no-init-file -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 --no-save --no-restore --no-site-file --no-init-file -e ' + \ . ale#Escape('suppressPackageStartupMessages(library(lintr));' + \ . 'lint_package(cache = FALSE, ' + \ . 'linters = with_defaults())') + \ . ' %t'