From 4db5f3923d8e30155c02fd903817e27cc0aa293f Mon Sep 17 00:00:00 2001 From: Jacob Bass Date: Wed, 26 Apr 2017 19:25:25 +1000 Subject: [PATCH] Create reasonml merlin linter copy @andreypopp 's ocaml merlin linter from this project into reason --- README.md | 1 + ale_linters/reason/merlin.vim | 17 +++++++++++++++++ doc/ale-reasonml.txt | 15 +++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 ale_linters/reason/merlin.vim create mode 100644 doc/ale-reasonml.txt diff --git a/README.md b/README.md index 3a793d75..77fdae88 100644 --- a/README.md +++ b/README.md @@ -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) | diff --git a/ale_linters/reason/merlin.vim b/ale_linters/reason/merlin.vim new file mode 100644 index 00000000..7bef7df8 --- /dev/null +++ b/ale_linters/reason/merlin.vim @@ -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', +\}) diff --git a/doc/ale-reasonml.txt b/doc/ale-reasonml.txt new file mode 100644 index 00000000..fddd7d75 --- /dev/null +++ b/doc/ale-reasonml.txt @@ -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: