linter/cypher: add cypher-lint

This commit is contained in:
Francisco Lopes
2019-02-03 03:04:23 -02:00
parent 4d426bf287
commit 626572a539
5 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
Before:
call ale#assert#SetUpLinterTest('cypher', 'cypher_lint')
After:
call ale#assert#TearDownLinterTest()
Execute(The default command and executable should be correct):
AssertLinter 'cypher-lint', 'cypher-lint %s'

View File

@@ -0,0 +1,21 @@
Before:
runtime ale_linters/cypher/cypher_lint.vim
After:
call ale#linter#Reset()
Execute(The cypher-lint handler should handle errors for the current file correctly):
AssertEqual
\ [
\ {
\ 'lnum': 1,
\ 'col': 75,
\ 'type': 'E',
\ 'text': "Invalid input ',': expected an identifier, shortestPath, allShortestPaths or '('",
\ },
\ ],
\ ale_linters#cypher#cypher_lint#Handle(bufnr(''), [
\ "shakespeare.cql:1:75: Invalid input ',': expected an identifier, shortestPath, allShortestPaths or '('",
\ "CREATE (shakespeare:Author {firstname:'William', lastname:'Shakespeare'}),,",
\ " ^",
\ ])