mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-23 12:31:30 +08:00
Improve mypy handling a little bit more
This commit is contained in:
15
test/test_find_nearest_directory.vader
Normal file
15
test/test_find_nearest_directory.vader
Normal file
@@ -0,0 +1,15 @@
|
||||
Execute(Open a file some directory down):
|
||||
silent! cd /testplugin/test
|
||||
:e! top/middle/bottom/dummy.txt
|
||||
|
||||
Then(We should be able to find the right directory):
|
||||
AssertEqual
|
||||
\ expand('%:p:h:h:h:h') . '/top/ale-special-directory-name-dont-use-this-please/',
|
||||
\ ale#util#FindNearestDirectory(bufnr('%'), 'ale-special-directory-name-dont-use-this-please')
|
||||
|
||||
Execute(Do nothing):
|
||||
|
||||
Then(We shouldn't find anything for files which don't match):
|
||||
AssertEqual
|
||||
\ '',
|
||||
\ ale#util#FindNearestDirectory(bufnr('%'), 'ale-this-should-never-match-anything')
|
||||
22
test/test_mypy_handler.vader
Normal file
22
test/test_mypy_handler.vader
Normal file
@@ -0,0 +1,22 @@
|
||||
Execute(The mypy handler should parse lines correctly):
|
||||
runtime ale_linters/python/mypy.vim
|
||||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'bufnr': 347,
|
||||
\ 'lnum': 4,
|
||||
\ 'vcol': 0,
|
||||
\ 'col': 0,
|
||||
\ 'text': "No library stub file for module 'django.db'",
|
||||
\ 'type': 'E',
|
||||
\ 'nr': -1,
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#python#mypy#Handle(347, [
|
||||
\ "file.py:4: error: No library stub file for module 'django.db'",
|
||||
\ 'file.py:4: note: (Stub files are from https://github.com/python/typeshed)',
|
||||
\ ])
|
||||
|
||||
After:
|
||||
call ale#linter#Reset()
|
||||
@@ -2,7 +2,7 @@ Execute(Open a file some directory down):
|
||||
silent! cd /testplugin/test
|
||||
:e! top/middle/bottom/dummy.txt
|
||||
|
||||
Then(We should be able to to find the local version of a file):
|
||||
Then(We should be able to find the local version of a file):
|
||||
AssertEqual
|
||||
\ expand('%:p:h:h:h:h') . '/top/example.ini',
|
||||
\ ale#util#ResolveLocalPath(bufnr('%'), 'example.ini', '/global/config.ini')
|
||||
|
||||
Reference in New Issue
Block a user