2017-04-29 16:33:18 +00:00
|
|
|
Before:
|
2017-01-20 17:30:23 +00:00
|
|
|
runtime ale_linters/python/mypy.vim
|
|
|
|
|
2017-04-29 16:33:18 +00:00
|
|
|
After:
|
|
|
|
call ale#linter#Reset()
|
2017-05-06 22:19:54 +00:00
|
|
|
silent file something_else.py
|
2017-04-29 16:33:18 +00:00
|
|
|
|
|
|
|
Execute(The mypy handler should parse lines correctly):
|
2017-05-06 22:19:54 +00:00
|
|
|
silent file foo/bar/__init__.py
|
|
|
|
|
2017-01-20 17:30:23 +00:00
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ {
|
2017-08-20 16:43:42 +00:00
|
|
|
\ 'lnum': 768,
|
|
|
|
\ 'col': 38,
|
|
|
|
\ 'filename': 'foo/bar/foo/bar/baz.py',
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'text': 'Cannot determine type of ''SOME_SYMBOL''',
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 821,
|
|
|
|
\ 'col': 38,
|
|
|
|
\ 'filename': 'foo/bar/foo/bar/baz.py',
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'text': 'Cannot determine type of ''SOME_SYMBOL''',
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 38,
|
|
|
|
\ 'col': 44,
|
|
|
|
\ 'filename': 'foo/bar/foo/bar/other.py',
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'text': 'Cannot determine type of ''ANOTHER_SYMBOL''',
|
|
|
|
\ },
|
|
|
|
\ {
|
2017-05-06 22:19:54 +00:00
|
|
|
\ 'lnum': 15,
|
|
|
|
\ 'col': 3,
|
2017-08-20 16:43:42 +00:00
|
|
|
\ 'filename': 'foo/bar/foo/bar/__init__.py',
|
2017-01-20 17:30:23 +00:00
|
|
|
\ 'type': 'E',
|
2017-08-20 16:43:42 +00:00
|
|
|
\ 'text': 'Argument 1 to "somefunc" has incompatible type "int"; expected "str"'
|
2017-01-20 17:30:23 +00:00
|
|
|
\ },
|
2017-02-04 19:47:37 +00:00
|
|
|
\ {
|
2017-05-06 22:19:54 +00:00
|
|
|
\ 'lnum': 72,
|
|
|
|
\ 'col': 1,
|
2017-08-20 16:43:42 +00:00
|
|
|
\ 'filename': 'foo/bar/foo/bar/__init__.py',
|
2017-05-06 22:19:54 +00:00
|
|
|
\ 'type': 'W',
|
2017-08-20 16:43:42 +00:00
|
|
|
\ 'text': 'Some warning',
|
2017-02-04 19:47:37 +00:00
|
|
|
\ },
|
2017-01-20 17:30:23 +00:00
|
|
|
\ ],
|
2017-05-06 22:19:54 +00:00
|
|
|
\ ale_linters#python#mypy#Handle(bufnr(''), [
|
|
|
|
\ 'foo/bar/baz.py: note: In class "SomeClass":',
|
|
|
|
\ 'foo/bar/baz.py:768:38: error: Cannot determine type of ''SOME_SYMBOL''',
|
|
|
|
\ 'foo/bar/baz.py: note: In class "AnotherClass":',
|
|
|
|
\ 'foo/bar/baz.py:821:38: error: Cannot determine type of ''SOME_SYMBOL''',
|
|
|
|
\ 'foo/bar/__init__.py:92: note: In module imported here:',
|
|
|
|
\ 'foo/bar/other.py: note: In class "YetAnotherClass":',
|
|
|
|
\ 'foo/bar/other.py:38:44: error: Cannot determine type of ''ANOTHER_SYMBOL''',
|
|
|
|
\ 'foo/bar/__init__.py: note: At top level:',
|
|
|
|
\ 'foo/bar/__init__.py:15:3: error: Argument 1 to "somefunc" has incompatible type "int"; expected "str"',
|
|
|
|
\ 'another_module/bar.py:14: note: In module imported here,',
|
|
|
|
\ 'another_module/__init__.py:16: note: ... from here,',
|
|
|
|
\ 'foo/bar/__init__.py:72:1: warning: Some warning',
|
2017-01-20 17:30:23 +00:00
|
|
|
\ ])
|
|
|
|
|
2017-04-29 16:33:18 +00:00
|
|
|
Execute(The mypy handler should handle Windows names with spaces):
|
2017-05-06 22:19:54 +00:00
|
|
|
" This test works on Unix, where this is seen as a single filename
|
|
|
|
silent file C:\\something\\with\ spaces.py
|
|
|
|
|
2017-04-29 16:33:18 +00:00
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 4,
|
|
|
|
\ 'col': 0,
|
2017-08-20 16:43:42 +00:00
|
|
|
\ 'filename': 'C:\something\with spaces.py',
|
2017-04-29 16:33:18 +00:00
|
|
|
\ 'type': 'E',
|
2017-08-20 16:43:42 +00:00
|
|
|
\ 'text': 'No library stub file for module ''django.db''',
|
2017-04-29 16:33:18 +00:00
|
|
|
\ },
|
|
|
|
\ ],
|
2017-05-06 22:19:54 +00:00
|
|
|
\ ale_linters#python#mypy#Handle(bufnr(''), [
|
|
|
|
\ 'C:\something\with spaces.py:4: error: No library stub file for module ''django.db''',
|
2017-04-29 16:33:18 +00:00
|
|
|
\ ])
|