summaryrefslogtreecommitdiff
path: root/ale_linters/r
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-07-03 22:34:22 +0100
committerw0rp <devw0rp@gmail.com>2017-07-03 22:34:30 +0100
commita1cf7f67a10b03e40596b2c48a2cbe11d9ce38a4 (patch)
tree521ea7076155bcf1c59e2acc01f4d2c666453ae0 /ale_linters/r
parent638eb1f000446eb4063d31d23b13bcc47b20842e (diff)
downloadale-a1cf7f67a10b03e40596b2c48a2cbe11d9ce38a4.zip
Fix #182 - Add support for lintr
Diffstat (limited to 'ale_linters/r')
-rw-r--r--ale_linters/r/lintr.vim15
1 files changed, 15 insertions, 0 deletions
diff --git a/ale_linters/r/lintr.vim b/ale_linters/r/lintr.vim
new file mode 100644
index 00000000..9375b8a5
--- /dev/null
+++ b/ale_linters/r/lintr.vim
@@ -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',
+\})