Fix #182 - Add support for lintr

This commit is contained in:
w0rp
2017-07-03 22:34:22 +01:00
parent 638eb1f000
commit a1cf7f67a1
3 changed files with 17 additions and 0 deletions

15
ale_linters/r/lintr.vim Normal file
View File

@@ -0,0 +1,15 @@
" Author: Michel Lang <michellang@gmail.com>, w0rp <devw0rp@gmail.com>
" Description: This file adds support for checking R code with lintr.
function! ale_linters#r#lintr#GetCommand(buffer) abort
return ale#path#BufferCdString(a:buffer)
\ . 'Rscript -e ' . ale#Escape('lintr::lint(commandArgs(TRUE))') . ' %t'
endfunction
call ale#linter#Define('r', {
\ 'name': 'lintr',
\ 'executable': 'Rscript',
\ 'command_callback': 'ale_linters#r#lintr#GetCommand',
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
\ 'output_stream': 'both',
\})