2017-11-15 17:21:17 +00:00
|
|
|
Before:
|
2017-03-18 16:33:26 +00:00
|
|
|
runtime ale_linters/nim/nimcheck.vim
|
2017-11-15 17:21:17 +00:00
|
|
|
|
|
|
|
After:
|
|
|
|
call ale#linter#Reset()
|
|
|
|
|
|
|
|
Execute(Parsing nim errors should work):
|
2017-05-06 22:06:51 +00:00
|
|
|
silent file foobar.nim
|
2017-03-18 16:33:26 +00:00
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 8,
|
|
|
|
\ 'col': 8,
|
2017-11-19 00:38:00 +00:00
|
|
|
\ 'text': 'use {.base.} for base methods; baseless methods are deprecated',
|
|
|
|
\ 'code': 'UseBase',
|
2017-03-18 16:33:26 +00:00
|
|
|
\ 'type': 'W',
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 12,
|
|
|
|
\ 'col': 2,
|
2017-11-19 00:38:00 +00:00
|
|
|
\ 'text': 'identifier expected, but found ''a.barfoo''',
|
2017-03-18 16:33:26 +00:00
|
|
|
\ 'type': 'E',
|
2019-11-06 17:44:56 +00:00
|
|
|
\ 'end_col': 9,
|
2017-03-18 16:33:26 +00:00
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 2,
|
|
|
|
\ 'col': 5,
|
2017-11-19 00:38:00 +00:00
|
|
|
\ 'text': '''NotUsed'' is declared but not used',
|
|
|
|
\ 'code': 'XDeclaredButNotUsed',
|
2017-03-18 16:33:26 +00:00
|
|
|
\ 'type': 'W',
|
2019-11-06 17:44:56 +00:00
|
|
|
\ 'end_col': 11,
|
2017-03-18 16:33:26 +00:00
|
|
|
\ },
|
2017-03-22 09:11:32 +00:00
|
|
|
\ {
|
|
|
|
\ 'lnum': 12,
|
|
|
|
\ 'col': 2,
|
2017-11-19 00:38:00 +00:00
|
|
|
\ 'text': 'with : character',
|
2017-03-22 09:11:32 +00:00
|
|
|
\ 'type': 'E',
|
|
|
|
\ },
|
2019-11-06 17:44:56 +00:00
|
|
|
\ {
|
|
|
|
\ 'lnum': 1,
|
|
|
|
\ 'col': 8,
|
|
|
|
\ 'text': 'imported and not used: ''strutils''',
|
|
|
|
\ 'code': 'UnusedImport',
|
|
|
|
\ 'type': 'W',
|
|
|
|
\ 'end_col': 15,
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 12,
|
|
|
|
\ 'col': 9,
|
|
|
|
\ 'text': 'undeclared identifier: ''total''',
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'end_col': 13,
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 14,
|
|
|
|
\ 'col': 1,
|
|
|
|
\ 'text': '''sum'' cannot be assigned to',
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'end_col': 3,
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 15,
|
|
|
|
\ 'col': 1,
|
|
|
|
\ 'text': 'redefinition of ''getName''; previous declaration here: /nested/folder/foobar.nim(14, 6)',
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'end_col': 7,
|
|
|
|
\ },
|
2017-03-18 16:33:26 +00:00
|
|
|
\ ],
|
2017-05-06 22:06:51 +00:00
|
|
|
\ ale_linters#nim#nimcheck#Handle(bufnr(''), [
|
2017-03-18 16:33:26 +00:00
|
|
|
\ 'Line with wrong( format)',
|
|
|
|
\ 'foobar.nim(8, 8) Warning: use {.base.} for base methods; baseless methods are deprecated [UseBase]',
|
|
|
|
\ 'foobar.nim(12, 2) Error: identifier expected, but found ''a.barfoo''',
|
|
|
|
\ '/nested/folder/foobar.nim(2, 5) Hint: ''NotUsed'' is declared but not used [XDeclaredButNotUsed]',
|
2017-03-22 09:11:32 +00:00
|
|
|
\ 'foobar.nim(12, 2) Error: with : character',
|
2019-11-06 17:44:56 +00:00
|
|
|
\ 'foobar.nim(1, 8) Warning: imported and not used: ''strutils'' [UnusedImport]',
|
|
|
|
\ 'foobar.nim(12, 9) Error: undeclared identifier: ''total''',
|
|
|
|
\ 'foobar.nim(14, 1) Error: ''sum'' cannot be assigned to',
|
|
|
|
\ 'foobar.nim(15, 1) Error: redefinition of ''getName''; previous declaration here: /nested/folder/foobar.nim(14, 6)',
|
2017-03-18 16:33:26 +00:00
|
|
|
\ ])
|