From b356d564483d68ffbd7cc11436d3484148cf39fb Mon Sep 17 00:00:00 2001 From: Jake Zimmerman Date: Mon, 21 Aug 2017 13:34:42 -0700 Subject: [PATCH] Add erubis linter This linter works largely the same as the existing `erubylint` linter, except it works with `erubis` instead of `erb` as the driving command. --- README.md | 2 +- ale_linters/eruby/erubis.vim | 11 +++++++++++ doc/ale-eruby.txt | 17 +++++++++++++++++ doc/ale.txt | 1 + 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 ale_linters/eruby/erubis.vim create mode 100644 doc/ale-eruby.txt diff --git a/README.md b/README.md index 7c05feb..16f0f31 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ name. That seems to be the fairest way to arrange this table. | Dockerfile | [hadolint](https://github.com/lukasmartinelli/hadolint) | | Elixir | [credo](https://github.com/rrrene/credo), [dogma](https://github.com/lpil/dogma) | | Elm | [elm-make](https://github.com/elm-lang/elm-make) | -| Erb | [erb](https://github.com/jeremyevans/erubi) | +| Erb | [erb](https://github.com/jeremyevans/erubi), [erubis](https://github.com/kwatch/erubis) | | Erlang | [erlc](http://erlang.org/doc/man/erlc.html), [SyntaxErl](https://github.com/ten0s/syntaxerl) | | Fortran | [gcc](https://gcc.gnu.org/) | | FusionScript | [fusion-lint](https://github.com/RyanSquared/fusionscript) | diff --git a/ale_linters/eruby/erubis.vim b/ale_linters/eruby/erubis.vim new file mode 100644 index 0000000..be9332d --- /dev/null +++ b/ale_linters/eruby/erubis.vim @@ -0,0 +1,11 @@ +" Author: Jake Zimmerman +" Description: eruby checker using `erubis`, instead of `erb` + +call ale#linter#Define('eruby', { +\ 'name': 'erubis', +\ 'executable': 'erubis', +\ 'output_stream': 'stderr', +\ 'command': 'erubis -x %t | ruby -c', +\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors', +\}) + diff --git a/doc/ale-eruby.txt b/doc/ale-eruby.txt new file mode 100644 index 0000000..b9cd3cb --- /dev/null +++ b/doc/ale-eruby.txt @@ -0,0 +1,17 @@ +=============================================================================== +ALE Eruby Integration *ale-eruby-options* + +There are two linters for `eruby` files: + +- `erubylint` +- `erubis` + +If you don't know which one your project uses, it's probably `erb`. +To selectively enable one or the other, see |g:ale_linters|. + +(Note that ALE already disables linters if the executable for that linter is +not found; thus, there's probably no need to disable one of these if you're +using the other one.) + +=============================================================================== + vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: diff --git a/doc/ale.txt b/doc/ale.txt index 1de7803..8131ede 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -36,6 +36,7 @@ CONTENTS *ale-contents* erlang................................|ale-erlang-options| erlc................................|ale-erlang-erlc| syntaxerl...........................|ale-erlang-syntaxerl| + eruby.................................|ale-eruby-options| fortran...............................|ale-fortran-options| gcc.................................|ale-fortran-gcc| fusionscript..........................|ale-fuse-options|