Merge pull request #1326 from michaelquinn32/patch-1

Call lintr library before linting
This commit is contained in:
w0rp 2018-02-04 11:38:05 +00:00 committed by GitHub
commit 31e0f48d62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 11 deletions

View file

@ -17,18 +17,20 @@ Execute(The default lintr command should be correct):
AssertEqual
\ 'cd ' . ale#Escape(getcwd()) . ' && '
\ . 'Rscript -e '
\ . ale#Escape('lintr::lint(commandArgs(TRUE)[1], eval(parse(text = commandArgs(TRUE)[2])))')
\ . ' %t '
\ . ale#Escape('lintr::with_defaults()'),
\ . ale#Escape('suppressPackageStartupMessages(library(lintr));'
\ . 'lint(cache = FALSE, commandArgs(TRUE),'
\ . 'with_defaults())')
\ . ' %t',
\ ale_linters#r#lintr#GetCommand(bufnr(''))
Execute(The lintr options should be configurable):
let b:ale_r_lintr_options = 'lintr::with_defaults(object_usage_linter = NULL)'
let b:ale_r_lintr_options = 'with_defaults(object_usage_linter = NULL)'
AssertEqual
\ 'cd ' . ale#Escape(getcwd()) . ' && '
\ . 'Rscript -e '
\ . ale#Escape('lintr::lint(commandArgs(TRUE)[1], eval(parse(text = commandArgs(TRUE)[2])))')
\ . ' %t '
\ . ale#Escape('lintr::with_defaults(object_usage_linter = NULL)'),
\ . ale#Escape('suppressPackageStartupMessages(library(lintr));'
\ . 'lint(cache = FALSE, commandArgs(TRUE),'
\ . 'with_defaults(object_usage_linter = NULL))')
\ . ' %t',
\ ale_linters#r#lintr#GetCommand(bufnr(''))