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

View File

@ -103,6 +103,7 @@ name. That seems to be the fairest way to arrange this table.
| Pug | [pug-lint](https://github.com/pugjs/pug-lint) |
| Puppet | [puppet](https://puppet.com), [puppet-lint](https://puppet-lint.com) |
| Python | [autopep8](https://github.com/hhatto/autopep8), [flake8](http://flake8.pycqa.org/en/latest/), [isort](https://github.com/timothycrosley/isort), [mypy](http://mypy-lang.org/), [pylint](https://www.pylint.org/), [yapf](https://github.com/google/yapf) |
| R | [lintr](https://github.com/jimhester/lintr) |
| ReasonML | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-integration-reason-merlin` for configuration instructions
| reStructuredText | [proselint](http://proselint.com/)|
| RPM spec | [rpmlint](https://github.com/rpm-software-management/rpmlint) (disabled by default; see `:help ale-integration-spec`) |

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',
\})

View File

@ -194,6 +194,7 @@ The following languages and tools are supported.
* Pug: 'pug-lint'
* Puppet: 'puppet', 'puppet-lint'
* Python: 'autopep8', 'flake8', 'isort', 'mypy', 'pylint', 'yapf'
* R: 'lintr'
* ReasonML: 'merlin'
* reStructuredText: 'proselint'
* RPM spec: 'spec'