All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 Save g:ale_python_mypy_ignore_invalid_syntax
3 Save g:ale_python_mypy_show_notes
5 unlet! g:ale_python_mypy_show_notes
6 unlet! g:ale_python_mypy_ignore_invalid_syntax
8 runtime ale_linters/python/mypy.vim
10 call ale#test#SetDirectory('/testplugin/test/handler')
15 call ale#test#RestoreDirectory()
16 call ale#linter#Reset()
18 Execute(The mypy handler should parse lines correctly):
19 call ale#test#SetFilename('__init__.py')
21 let g:ale_python_mypy_show_notes = 0
28 \ 'filename': ale#path#Simplify(g:dir . '/baz.py'),
30 \ 'text': 'Cannot determine type of ''SOME_SYMBOL''',
35 \ 'filename': ale#path#Simplify(g:dir . '/baz.py'),
37 \ 'text': 'Cannot determine type of ''SOME_SYMBOL''',
42 \ 'filename': ale#path#Simplify(g:dir . '/other.py'),
44 \ 'text': 'Cannot determine type of ''ANOTHER_SYMBOL''',
49 \ 'filename': ale#path#Simplify(g:dir . '/__init__.py'),
51 \ 'text': 'Argument 1 to "somefunc" has incompatible type "int"; expected "str"'
56 \ 'filename': ale#path#Simplify(g:dir . '/__init__.py'),
58 \ 'text': 'Some warning',
61 \ ale_linters#python#mypy#Handle(bufnr(''), [
62 \ 'baz.py: note: In class "SomeClass":',
63 \ 'baz.py:768:38: error: Cannot determine type of ''SOME_SYMBOL''',
64 \ 'baz.py: note: In class "AnotherClass":',
65 \ 'baz.py:821:38: error: Cannot determine type of ''SOME_SYMBOL''',
66 \ '__init__.py:92: note: In module imported here:',
67 \ 'other.py: note: In class "YetAnotherClass":',
68 \ 'other.py:38:44: error: Cannot determine type of ''ANOTHER_SYMBOL''',
69 \ '__init__.py: note: At top level:',
70 \ '__init__.py:15:3: error: Argument 1 to "somefunc" has incompatible type "int"; expected "str"',
71 \ 'another_module/bar.py:14: note: In module imported here,',
72 \ 'another_module/__init__.py:16: note: ... from here,',
73 \ '__init__.py:72:1: warning: Some warning',
76 Execute(The mypy handler should show notes if enabled):
77 call ale#test#SetFilename('__init__.py')
84 \ 'filename': ale#path#Simplify(g:dir . '/__init__.py'),
89 \ ale_linters#python#mypy#Handle(bufnr(''), [
90 \ '__init__.py:72:1: note: A note',
93 let g:ale_python_mypy_show_notes = 0
97 \ ale_linters#python#mypy#Handle(bufnr(''), [
98 \ '__init__.py:72:1: note: A note',
101 Execute(The mypy handler should handle Windows names with spaces):
102 " This test works on Unix, where this is seen as a single filename
103 silent file C:\\something\\with\ spaces.py
110 \ 'filename': ale#path#Simplify('C:\something\with spaces.py'),
112 \ 'text': 'No library stub file for module ''django.db''',
115 \ ale_linters#python#mypy#Handle(bufnr(''), [
116 \ 'C:\something\with spaces.py:4: error: No library stub file for module ''django.db''',
119 Execute(The mypy syntax errors shouldn't be ignored by default):
125 \ 'filename': ale#path#Simplify(g:dir . '/foo.py'),
127 \ 'text': 'invalid syntax',
130 \ ale_linters#python#mypy#Handle(bufnr(''), [
131 \ 'foo.py:4: error: invalid syntax',
134 Execute(The mypy syntax errors should be ignored when the option is on):
135 let g:ale_python_mypy_ignore_invalid_syntax = 1
139 \ ale_linters#python#mypy#Handle(bufnr(''), [
140 \ 'foo.py:4: error: invalid syntax',