mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-28 14:56:52 +08:00
Fix #2704 - Show mypy notes; can be disabled
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user