From b60a7224ab8165280d61314016003181fb45fc4d Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Tue, 15 Aug 2017 14:37:38 -0400 Subject: [PATCH] allow options to be set for `lintr` --- ale_linters/r/lintr.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 , w0rp " 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', {