diff options
author | Fenner Macrae <13209544+fennerm@users.noreply.github.com> | 2018-02-04 10:57:52 -0800 |
---|---|---|
committer | Fenner Macrae <13209544+fennerm@users.noreply.github.com> | 2018-02-04 10:57:52 -0800 |
commit | dda132c1a2818390cafd674e5db0e3b6ce802965 (patch) | |
tree | 3066f06a1543fb99c23f59fb72ec7b5be098b5d7 /ale_linters/r | |
parent | 33b3331b0499e502f01730af60fb0e9b5a30951f (diff) | |
download | ale-dda132c1a2818390cafd674e5db0e3b6ce802965.zip |
Add lint_package support to lintr
Diffstat (limited to 'ale_linters/r')
-rw-r--r-- | ale_linters/r/lintr.vim | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ale_linters/r/lintr.vim b/ale_linters/r/lintr.vim index e1639051..006bf47c 100644 --- a/ale_linters/r/lintr.vim +++ b/ale_linters/r/lintr.vim @@ -1,13 +1,23 @@ -" Author: Michel Lang <michellang@gmail.com>, w0rp <devw0rp@gmail.com> +" Author: Michel Lang <michellang@gmail.com>, w0rp <devw0rp@gmail.com>, +" Fenner Macrae <fmacrae.dev@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', 'with_defaults()') " A reasonable alternative default: " get(g:, 'ale_r_lintr_options', 'with_defaults(object_usage_linter = NULL)') + +let g:ale_r_lintr_lint_package = get(g:, 'ale_r_lintr_lint_package', 0) + function! ale_linters#r#lintr#GetCommand(buffer) abort + if ale#Var(a:buffer, 'r_lintr_lint_package') + let l:lint_cmd = 'lint_package' + else + let l:lint_cmd = 'lint' + endif + let l:cmd_string = 'suppressPackageStartupMessages(library(lintr));' - \ . 'lint(cache = FALSE, commandArgs(TRUE),' + \ . l:lint_cmd . '(cache = FALSE, commandArgs(TRUE),' \ . ale#Var(a:buffer, 'r_lintr_options') . ')' return ale#path#BufferCdString(a:buffer) |