I cannot figure out how to turn off specific linters using lintr. The documentation offers an example (for vim/syntastic, which is what I'm using), which is not very clear:
let g:syntastic_r_lintr_linters = "with_defaults(line_length_linter(120))"
Apparently all this does is change a default. Do I need to list all the linters I want to use here? Is there a way to exclude just a couple?
I assume there's something like
let g:syntastic_r_lintr_linters_nonportable_path_linter = 0
but I can't find the right syntax.
Apparently g:syntastic_r_lintr_linters
is supposed to be a list of linters. But it's not clear what syntax is supposed to work.
If we forget about the vim syntax and head right to the R package lintr
(which vim/syntastic calls) and the linters
argument of lint
then this works:
lint(file.R, linters=assignment_linter)
This doesn't (no error, but doesn't catch mistakes in code):
lint(file.R, linters=list(assignment_linter, single_quotes_linter))
Nor does this (errors out):
lint(file.R, linters=list('assignment_linter', 'single_quotes_linter'))
But this does:
lint('file.R',linters=list('assignment_linter'=assignment_linter,'single_quotes_linter'=single_quotes_linter))
So maybe it's supposed to be a named list?