diff options
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', { |