summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Axthelm <AAxthelm@che.in.gov>2017-08-15 14:37:38 -0400
committerw0rp <devw0rp@gmail.com>2017-09-03 23:14:26 +0100
commitb60a7224ab8165280d61314016003181fb45fc4d (patch)
tree12bbbe52847afda24789d6701b7f83e399c8c3bc
parent29ffd5134f022ad598a6ab80b93f27e19625ebb2 (diff)
downloadale-b60a7224ab8165280d61314016003181fb45fc4d.zip
allow options to be set for `lintr`
-rw-r--r--ale_linters/r/lintr.vim7
1 files changed, 6 insertions, 1 deletions
diff --git a/ale_linters/r/lintr.vim b/ale_linters/r/lintr.vim
index 94bdd297..86b591c2 100644
--- a/ale_linters/r/lintr.vim
+++ b/ale_linters/r/lintr.vim
@@ -1,9 +1,14 @@
" Author: Michel Lang <michellang@gmail.com>, w0rp <devw0rp@gmail.com>
" Description: This file adds support for checking R code with lintr.
+let g:ale_r_lintr_options =
+\ get(g:, 'ale_r_lintr_options', 'lintr::with_defaults()')
+" A reasonable alternative default:
+" \ get(g:, 'ale_r_lintr_options', 'lintr::with_defaults(object_usage_linter = NULL)')
+
function! ale_linters#r#lintr#GetCommand(buffer) abort
return ale#path#BufferCdString(a:buffer)
- \ . 'Rscript -e ' . ale#Escape('lintr::lint(commandArgs(TRUE), linters = lintr::with_defaults(object_usage_linter = NULL))') . ' %t'
+ \ . 'Rscript -e ' . ale#Escape('lintr::lint(commandArgs(TRUE)[1], eval(parse(text = commandArgs(TRUE)[2])))') . ' %t' . ' ' . ale#Escape(ale#Var(a:buffer, 'r_lintr_options'))
endfunction
call ale#linter#Define('r', {