Fix #2704 - Show mypy notes; can be disabled

This commit is contained in:
w0rp
2020-01-02 14:19:21 +00:00
parent 0cb432cb82
commit 8c4c8dfd97
3 changed files with 59 additions and 12 deletions

View File

@@ -1,6 +1,8 @@
Before:
Save g:ale_python_mypy_ignore_invalid_syntax
Save g:ale_python_mypy_show_notes
unlet! g:ale_python_mypy_show_notes
unlet! g:ale_python_mypy_ignore_invalid_syntax
runtime ale_linters/python/mypy.vim
@@ -69,6 +71,31 @@ Execute(The mypy handler should parse lines correctly):
\ '__init__.py:72:1: warning: Some warning',
\ ])
Execute(The mypy handler should show notes if enabled):
call ale#test#SetFilename('__init__.py')
AssertEqual
\ [
\ {
\ 'lnum': 72,
\ 'col': 1,
\ 'filename': ale#path#Simplify(g:dir . '/__init__.py'),
\ 'type': 'I',
\ 'text': 'A note',
\ },
\ ],
\ ale_linters#python#mypy#Handle(bufnr(''), [
\ '__init__.py:72:1: note: A note',
\ ])
let g:ale_python_mypy_show_notes = 0
AssertEqual
\ [],
\ ale_linters#python#mypy#Handle(bufnr(''), [
\ '__init__.py:72:1: note: A note',
\ ])
Execute(The mypy handler should handle Windows names with spaces):
" This test works on Unix, where this is seen as a single filename
silent file C:\\something\\with\ spaces.py