Create reasonml merlin linter

copy @andreypopp 's ocaml merlin linter from this project into reason
This commit is contained in:
Jacob Bass 2017-04-26 19:25:25 +10:00
parent 65fc4aeb1e
commit 4db5f3923d
3 changed files with 33 additions and 0 deletions

View File

@ -95,6 +95,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 | [flake8](http://flake8.pycqa.org/en/latest/), [mypy](http://mypy-lang.org/), [pylint](https://www.pylint.org/) |
| 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`) |
| Ruby | [reek](https://github.com/troessner/reek), [rubocop](https://github.com/bbatsov/rubocop), [ruby](https://www.ruby-lang.org) |

View File

@ -0,0 +1,17 @@
" Author: Andrey Popp -- @andreypopp
" Description: Report errors in ReasonML code with Merlin
if !exists('g:merlin')
finish
endif
function! ale_linters#reason#merlin#Handle(buffer, lines) abort
return merlin#ErrorLocList()
endfunction
call ale#linter#Define('reason', {
\ 'name': 'merlin',
\ 'executable': 'ocamlmerlin',
\ 'command': 'true',
\ 'callback': 'ale_linters#reason#merlin#Handle',
\})

15
doc/ale-reasonml.txt Normal file
View File

@ -0,0 +1,15 @@
===============================================================================
ALE ReasonML Integration *ale-reasonml-options*
-------------------------------------------------------------------------------
merlin *ale-reasonml-merlin*
To use merlin linter for ReasonML source code you need to make sure Merlin for
Vim is correctly configured. See the corresponding Merlin wiki page for
detailed instructions
(https://github.com/the-lambda-church/merlin/wiki/vim-from-scratch).
-------------------------------------------------------------------------------
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: