2017-04-29 16:33:18 +00:00
|
|
|
Before:
|
2017-01-20 17:30:23 +00:00
|
|
|
runtime ale_linters/python/mypy.vim
|
|
|
|
|
2017-09-11 21:25:15 +00:00
|
|
|
call ale#test#SetDirectory('/testplugin/test/handler')
|
|
|
|
|
2017-04-29 16:33:18 +00:00
|
|
|
After:
|
2017-09-11 21:25:15 +00:00
|
|
|
call ale#test#RestoreDirectory()
|
2017-04-29 16:33:18 +00:00
|
|
|
call ale#linter#Reset()
|
|
|
|
|
|
|
|
Execute(The mypy handler should parse lines correctly):
|
2017-09-11 21:25:15 +00:00
|
|
|
call ale#test#SetFilename('__init__.py')
|
2017-05-06 22:19:54 +00:00
|
|
|
|
2017-01-20 17:30:23 +00:00
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ {
|
2017-08-20 16:43:42 +00:00
|
|
|
\ 'lnum': 768,
|
|
|
|
\ 'col': 38,
|
2017-09-11 21:25:15 +00:00
|
|
|
\ 'filename': ale#path#Winify(g:dir . '/baz.py'),
|
2017-08-20 16:43:42 +00:00
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'text': 'Cannot determine type of ''SOME_SYMBOL''',
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 821,
|
|
|
|
\ 'col': 38,
|
2017-09-11 21:25:15 +00:00
|
|
|
\ 'filename': ale#path#Winify(g:dir . '/baz.py'),
|
2017-08-20 16:43:42 +00:00
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'text': 'Cannot determine type of ''SOME_SYMBOL''',
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 38,
|
|
|
|
\ 'col': 44,
|
2017-09-11 21:25:15 +00:00
|
|
|
\ 'filename': ale#path#Winify(g:dir . '/other.py'),
|
2017-08-20 16:43:42 +00:00
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'text': 'Cannot determine type of ''ANOTHER_SYMBOL''',
|
|
|
|
\ },
|
|
|
|
\ {
|
2017-05-06 22:19:54 +00:00
|
|
|
\ 'lnum': 15,
|
|
|
|
\ 'col': 3,
|
2017-09-11 21:25:15 +00:00
|
|
|
\ 'filename': ale#path#Winify(g:dir . '/__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-09-11 21:25:15 +00:00
|
|
|
\ 'filename': ale#path#Winify(g:dir . '/__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(''), [
|
2017-09-11 21:25:15 +00:00
|
|
|
\ 'baz.py: note: In class "SomeClass":',
|
|
|
|
\ 'baz.py:768:38: error: Cannot determine type of ''SOME_SYMBOL''',
|
|
|
|
\ 'baz.py: note: In class "AnotherClass":',
|
|
|
|
\ 'baz.py:821:38: error: Cannot determine type of ''SOME_SYMBOL''',
|
|
|
|
\ '__init__.py:92: note: In module imported here:',
|
|
|
|
\ 'other.py: note: In class "YetAnotherClass":',
|
|
|
|
\ 'other.py:38:44: error: Cannot determine type of ''ANOTHER_SYMBOL''',
|
|
|
|
\ '__init__.py: note: At top level:',
|
|
|
|
\ '__init__.py:15:3: error: Argument 1 to "somefunc" has incompatible type "int"; expected "str"',
|
2017-05-06 22:19:54 +00:00
|
|
|
\ 'another_module/bar.py:14: note: In module imported here,',
|
|
|
|
\ 'another_module/__init__.py:16: note: ... from here,',
|
2017-09-11 21:25:15 +00:00
|
|
|
\ '__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
|
|
|
\ ])
|