diff options
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/c/clang.vim | 4 | ||||
-rw-r--r-- | ale_linters/c/gcc.vim | 4 | ||||
-rw-r--r-- | ale_linters/cpp/clang.vim | 4 | ||||
-rw-r--r-- | ale_linters/cpp/gcc.vim | 4 | ||||
-rw-r--r-- | ale_linters/perl/perl.vim | 11 | ||||
-rw-r--r-- | ale_linters/python/flake8.vim | 2 | ||||
-rw-r--r-- | ale_linters/python/mypy.vim | 17 | ||||
-rw-r--r-- | ale_linters/python/pylint.vim | 4 |
8 files changed, 23 insertions, 27 deletions
diff --git a/ale_linters/c/clang.vim b/ale_linters/c/clang.vim index ecfa5050..2cecc514 100644 --- a/ale_linters/c/clang.vim +++ b/ale_linters/c/clang.vim @@ -10,13 +10,13 @@ if !exists('g:ale_c_clang_options') endif function! ale_linters#c#clang#GetCommand(buffer) abort - let l:paths = ale#handlers#c#FindLocalHeaderPaths(a:buffer) + let l:paths = ale#c#FindLocalHeaderPaths(a:buffer) " -iquote with the directory the file is in makes #include work for " headers in the same directory. return 'clang -S -x c -fsyntax-only ' \ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' ' - \ . ale#handlers#c#IncludeOptions(l:paths) + \ . ale#c#IncludeOptions(l:paths) \ . ale#Var(a:buffer, 'c_clang_options') . ' -' endfunction diff --git a/ale_linters/c/gcc.vim b/ale_linters/c/gcc.vim index bcf8017e..c988b30f 100644 --- a/ale_linters/c/gcc.vim +++ b/ale_linters/c/gcc.vim @@ -10,13 +10,13 @@ if !exists('g:ale_c_gcc_options') endif function! ale_linters#c#gcc#GetCommand(buffer) abort - let l:paths = ale#handlers#c#FindLocalHeaderPaths(a:buffer) + let l:paths = ale#c#FindLocalHeaderPaths(a:buffer) " -iquote with the directory the file is in makes #include work for " headers in the same directory. return 'gcc -S -x c -fsyntax-only ' \ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' ' - \ . ale#handlers#c#IncludeOptions(l:paths) + \ . ale#c#IncludeOptions(l:paths) \ . ale#Var(a:buffer, 'c_gcc_options') . ' -' endfunction diff --git a/ale_linters/cpp/clang.vim b/ale_linters/cpp/clang.vim index 953c8a71..f70101d3 100644 --- a/ale_linters/cpp/clang.vim +++ b/ale_linters/cpp/clang.vim @@ -7,13 +7,13 @@ if !exists('g:ale_cpp_clang_options') endif function! ale_linters#cpp#clang#GetCommand(buffer) abort - let l:paths = ale#handlers#c#FindLocalHeaderPaths(a:buffer) + let l:paths = ale#c#FindLocalHeaderPaths(a:buffer) " -iquote with the directory the file is in makes #include work for " headers in the same directory. return 'clang++ -S -x c++ -fsyntax-only ' \ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' ' - \ . ale#handlers#c#IncludeOptions(l:paths) + \ . ale#c#IncludeOptions(l:paths) \ . ale#Var(a:buffer, 'cpp_clang_options') . ' -' endfunction diff --git a/ale_linters/cpp/gcc.vim b/ale_linters/cpp/gcc.vim index 36e958e7..69b69e4f 100644 --- a/ale_linters/cpp/gcc.vim +++ b/ale_linters/cpp/gcc.vim @@ -17,13 +17,13 @@ if !exists('g:ale_cpp_gcc_options') endif function! ale_linters#cpp#gcc#GetCommand(buffer) abort - let l:paths = ale#handlers#c#FindLocalHeaderPaths(a:buffer) + let l:paths = ale#c#FindLocalHeaderPaths(a:buffer) " -iquote with the directory the file is in makes #include work for " headers in the same directory. return 'gcc -S -x c++ -fsyntax-only ' \ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' ' - \ . ale#handlers#c#IncludeOptions(l:paths) + \ . ale#c#IncludeOptions(l:paths) \ . ale#Var(a:buffer, 'cpp_gcc_options') . ' -' endfunction diff --git a/ale_linters/perl/perl.vim b/ale_linters/perl/perl.vim index f4b35ab9..087d03eb 100644 --- a/ale_linters/perl/perl.vim +++ b/ale_linters/perl/perl.vim @@ -17,6 +17,11 @@ function! ale_linters#perl#perl#GetCommand(buffer) abort \ . ' %t' endfunction +let s:begin_failed_skip_pattern = '\v' . join([ +\ '^Compilation failed in require', +\ '^Can''t locate', +\], '|') + function! ale_linters#perl#perl#Handle(buffer, lines) abort let l:pattern = '\(.\+\) at \(.\+\) line \(\d\+\)' let l:output = [] @@ -28,7 +33,11 @@ function! ale_linters#perl#perl#Handle(buffer, lines) abort let l:type = 'E' if ale#path#IsBufferPath(a:buffer, l:match[2]) - \&& l:text !=# 'BEGIN failed--compilation aborted' + \ && ( + \ l:text !=# 'BEGIN failed--compilation aborted' + \ || empty(l:output) + \ || match(l:output[-1].text, s:begin_failed_skip_pattern) < 0 + \ ) call add(l:output, { \ 'lnum': l:line, \ 'text': l:text, diff --git a/ale_linters/python/flake8.vim b/ale_linters/python/flake8.vim index df091053..fb02e1ee 100644 --- a/ale_linters/python/flake8.vim +++ b/ale_linters/python/flake8.vim @@ -136,7 +136,7 @@ function! ale_linters#python#flake8#Handle(buffer, lines) abort \ 'type': 'W', \} - if l:code[:0] ==# 'F' + if l:code[:0] ==# 'F' || l:code ==# 'E999' let l:item.type = 'E' elseif l:code[:0] ==# 'E' let l:item.type = 'E' diff --git a/ale_linters/python/mypy.vim b/ale_linters/python/mypy.vim index 3c8b181f..e39ee349 100644 --- a/ale_linters/python/mypy.vim +++ b/ale_linters/python/mypy.vim @@ -7,19 +7,7 @@ let g:ale_python_mypy_options = get(g:, 'ale_python_mypy_options', '') let g:ale_python_mypy_use_global = get(g:, 'ale_python_mypy_use_global', 0) function! ale_linters#python#mypy#GetExecutable(buffer) abort - if !ale#Var(a:buffer, 'python_mypy_use_global') - let l:virtualenv = ale#python#FindVirtualenv(a:buffer) - - if !empty(l:virtualenv) - let l:ve_mypy = l:virtualenv . '/bin/mypy' - - if executable(l:ve_mypy) - return l:ve_mypy - endif - endif - endif - - return ale#Var(a:buffer, 'python_mypy_executable') + return ale#python#FindExecutable(a:buffer, 'python_mypy', ['/bin/mypy']) endfunction function! ale_linters#python#mypy#GetCommand(buffer) abort @@ -33,7 +21,7 @@ function! ale_linters#python#mypy#GetCommand(buffer) abort \ . ale#Escape(l:executable) \ . ' --show-column-numbers ' \ . ale#Var(a:buffer, 'python_mypy_options') - \ . ' %s' + \ . ' --shadow-file %s %t %s' endfunction function! ale_linters#python#mypy#Handle(buffer, lines) abort @@ -69,5 +57,4 @@ call ale#linter#Define('python', { \ 'executable_callback': 'ale_linters#python#mypy#GetExecutable', \ 'command_callback': 'ale_linters#python#mypy#GetCommand', \ 'callback': 'ale_linters#python#mypy#Handle', -\ 'lint_file': 1, \}) diff --git a/ale_linters/python/pylint.vim b/ale_linters/python/pylint.vim index 57c3870a..dcb26c78 100644 --- a/ale_linters/python/pylint.vim +++ b/ale_linters/python/pylint.vim @@ -36,7 +36,7 @@ function! ale_linters#python#pylint#Handle(buffer, lines) abort " Matches patterns like the following: " " test.py:4:4: W0101 (unreachable) Unreachable code - let l:pattern = '\v^[^:]+:(\d+):(\d+): ([[:alnum:]]+) \((.*)\) (.*)$' + let l:pattern = '\v^[^:]+:(\d+):(\d+): ([[:alnum:]]+) \(([^(]*)\) (.*)$' let l:output = [] for l:match in ale#util#GetMatches(a:lines, l:pattern) @@ -57,7 +57,7 @@ function! ale_linters#python#pylint#Handle(buffer, lines) abort call add(l:output, { \ 'lnum': l:match[1] + 0, \ 'col': l:match[2] + 1, - \ 'text': l:code . ': ' . l:match[5], + \ 'text': l:code . ': ' . l:match[5] . ' (' . l:match[4] . ')', \ 'type': l:code[:0] ==# 'E' ? 'E' : 'W', \}) endfor |