summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Bass <jacob@jacobbass.net>2017-04-26 19:25:25 +1000
committerJacob Bass <jacob@jacobbass.net>2017-04-26 19:29:09 +1000
commit4db5f3923d8e30155c02fd903817e27cc0aa293f (patch)
tree25c059eabeffb0858115bea2101012ff5c84511f
parent65fc4aeb1e12d75b2174bdcd887aacf2c7c98952 (diff)
downloadale-4db5f3923d8e30155c02fd903817e27cc0aa293f.zip
Create reasonml merlin linter
copy @andreypopp 's ocaml merlin linter from this project into reason
-rw-r--r--README.md1
-rw-r--r--ale_linters/reason/merlin.vim17
-rw-r--r--doc/ale-reasonml.txt15
3 files changed, 33 insertions, 0 deletions
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: