summaryrefslogtreecommitdiff
path: root/test/command_callback/test_lintr_command_callback.vader
blob: 8a0e6c1c7283997c8d0aeb7114614ab243a02d21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Before:
  call ale#assert#SetUpLinterTest('r', 'lintr')

After:
  call ale#assert#TearDownLinterTest()

Execute(The default lintr command should be correct):
  AssertLinter 'Rscript',
  \   'cd ' . ale#Escape(getcwd()) . ' && '
  \   . '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',
  \   'cd ' . ale#Escape(getcwd()) . ' && '
  \   . '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',
  \   'cd ' . ale#Escape(getcwd()) . ' && '
  \   . 'Rscript --vanilla -e '
  \   . ale#Escape('suppressPackageStartupMessages(library(lintr));'
  \   .            'lint_package(cache = FALSE, '
  \   .            'linters = with_defaults())')
  \   . ' %t'