diff options
author | Alex Axthelm <AAxthelm@che.in.gov> | 2017-08-15 14:37:38 -0400 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-09-03 23:14:26 +0100 |
commit | b60a7224ab8165280d61314016003181fb45fc4d (patch) | |
tree | 12bbbe52847afda24789d6701b7f83e399c8c3bc /ale_linters | |
parent | 29ffd5134f022ad598a6ab80b93f27e19625ebb2 (diff) | |
download | ale-b60a7224ab8165280d61314016003181fb45fc4d.zip |
allow options to be set for `lintr`
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/r/lintr.vim | 7 |
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', { |