diff options
author | w0rp <w0rp@users.noreply.github.com> | 2019-02-06 22:04:47 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-06 22:04:47 +0000 |
commit | c0c634c5eccfee6b5fd3ba7e6d506c345abc3e21 (patch) | |
tree | c7be5564415dd003e610328a8e5914c857462b1b /ale_linters | |
parent | 81c73da3b98455c4ad11f32208dac3dcfa6e0da7 (diff) | |
parent | 626572a53962d47545fcc67e2045d3eb984cbef1 (diff) | |
download | ale-c0c634c5eccfee6b5fd3ba7e6d506c345abc3e21.zip |
Merge pull request #2270 from oblitum/add-cypher-lint
linter/cypher: add cypher-lint
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/cypher/cypher_lint.vim | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ale_linters/cypher/cypher_lint.vim b/ale_linters/cypher/cypher_lint.vim new file mode 100644 index 00000000..c72abf45 --- /dev/null +++ b/ale_linters/cypher/cypher_lint.vim @@ -0,0 +1,26 @@ +" Author: Francisco Lopes <francisco@oblita.com> +" Description: Linting for Neo4j's Cypher + +function! ale_linters#cypher#cypher_lint#Handle(buffer, lines) abort + let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+): (.*)$' + let l:output = [] + + for l:match in ale#util#GetMatches(a:lines, l:pattern) + call add(l:output, { + \ 'lnum': l:match[2] + 0, + \ 'col': l:match[3] + 0, + \ 'text': l:match[4], + \ 'type': 'E', + \}) + endfor + + return l:output +endfunction + +call ale#linter#Define('cypher', { +\ 'name': 'cypher_lint', +\ 'executable': 'cypher-lint', +\ 'command': 'cypher-lint %s', +\ 'output_stream': 'stderr', +\ 'callback': 'ale_linters#cypher#cypher_lint#Handle', +\}) |