summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/asciidoc/languagetool.vim2
-rw-r--r--ale_linters/bib/bibclean.vim7
-rw-r--r--ale_linters/java/javac.vim8
-rw-r--r--ale_linters/php/phpcs.vim2
-rw-r--r--ale_linters/python/jedils.vim34
-rw-r--r--ale_linters/python/pylint.vim38
-rw-r--r--ale_linters/typescript/tsserver.vim1
-rw-r--r--ale_linters/vim/vint.vim7
8 files changed, 80 insertions, 19 deletions
diff --git a/ale_linters/asciidoc/languagetool.vim b/ale_linters/asciidoc/languagetool.vim
index f16df6c0..8e8de7f3 100644
--- a/ale_linters/asciidoc/languagetool.vim
+++ b/ale_linters/asciidoc/languagetool.vim
@@ -2,4 +2,4 @@
" Description: languagetool for asciidoc files, copied from markdown.
-call ale#handlers#languagetool#DefineLinter('asciidoctor')
+call ale#handlers#languagetool#DefineLinter('asciidoc')
diff --git a/ale_linters/bib/bibclean.vim b/ale_linters/bib/bibclean.vim
index 9056a9c3..f1610e00 100644
--- a/ale_linters/bib/bibclean.vim
+++ b/ale_linters/bib/bibclean.vim
@@ -18,7 +18,12 @@ function! ale_linters#bib#bibclean#get_type(str) abort
endfunction
function! ale_linters#bib#bibclean#match_msg(line) abort
- return matchlist(a:line, '^\(.*\) "stdin", line \(.*\): \(.*\)$')
+ " Legacy message pattern works for bibclean <= v2.11.4. If empty, try
+ " the new message pattern for bibtex > v2.11.4
+ let l:matches_legacy = matchlist(a:line, '^\(.*\) "stdin", line \(\d\+\): \(.*\)$')
+
+ return ! empty(l:matches_legacy) ? l:matches_legacy
+ \ : matchlist(a:line, '^\(.*\) stdin:\(\d\+\):\(.*\)$')
endfunction
function! ale_linters#bib#bibclean#match_entry(line) abort
diff --git a/ale_linters/java/javac.vim b/ale_linters/java/javac.vim
index f866eb09..a5e57e6c 100644
--- a/ale_linters/java/javac.vim
+++ b/ale_linters/java/javac.vim
@@ -9,13 +9,7 @@ call ale#Set('java_javac_classpath', '')
call ale#Set('java_javac_sourcepath', '')
function! ale_linters#java#javac#RunWithImportPaths(buffer) abort
- let l:command = ''
- let l:pom_path = ale#path#FindNearestFile(a:buffer, 'pom.xml')
-
- if !empty(l:pom_path) && executable('mvn')
- let l:command = ale#path#CdString(fnamemodify(l:pom_path, ':h'))
- \ . 'mvn dependency:build-classpath'
- endif
+ let l:command = ale#maven#BuildClasspathCommand(a:buffer)
" Try to use Gradle if Maven isn't available.
if empty(l:command)
diff --git a/ale_linters/php/phpcs.vim b/ale_linters/php/phpcs.vim
index 11b81e84..c5a3faa9 100644
--- a/ale_linters/php/phpcs.vim
+++ b/ale_linters/php/phpcs.vim
@@ -23,7 +23,7 @@ function! ale_linters#php#phpcs#Handle(buffer, lines) abort
" Matches against lines like the following:
"
" /path/to/some-filename.php:18:3: error - Line indented incorrectly; expected 4 spaces, found 2 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
- let l:pattern = '^.*:\(\d\+\):\(\d\+\): \(.\+\) - \(.\+\) (\(.\+\))$'
+ let l:pattern = '^.*:\(\d\+\):\(\d\+\): \(.\+\) - \(.\+\) (\(.\+\)).*$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
diff --git a/ale_linters/python/jedils.vim b/ale_linters/python/jedils.vim
new file mode 100644
index 00000000..eae5fb07
--- /dev/null
+++ b/ale_linters/python/jedils.vim
@@ -0,0 +1,34 @@
+" Author: Dalius Dobravolskas <dalius.dobravolskas@gmail.com>
+" Description: https://github.com/pappasam/jedi-language-server
+
+call ale#Set('python_jedils_executable', 'jedi-language-server')
+call ale#Set('python_jedils_use_global', get(g:, 'ale_use_global_executables', 0))
+call ale#Set('python_jedils_auto_pipenv', 0)
+
+function! ale_linters#python#jedils#GetExecutable(buffer) abort
+ if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_jedils_auto_pipenv'))
+ \ && ale#python#PipenvPresent(a:buffer)
+ return 'pipenv'
+ endif
+
+ return ale#python#FindExecutable(a:buffer, 'python_jedils', ['jedi-language-server'])
+endfunction
+
+function! ale_linters#python#jedils#GetCommand(buffer) abort
+ let l:executable = ale_linters#python#jedils#GetExecutable(a:buffer)
+
+ let l:exec_args = l:executable =~? 'pipenv$'
+ \ ? ' run jedi-language-server'
+ \ : ''
+
+ return ale#Escape(l:executable) . l:exec_args
+endfunction
+
+call ale#linter#Define('python', {
+\ 'name': 'jedils',
+\ 'lsp': 'stdio',
+\ 'executable': function('ale_linters#python#jedils#GetExecutable'),
+\ 'command': function('ale_linters#python#jedils#GetCommand'),
+\ 'project_root': function('ale#python#FindProjectRoot'),
+\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
+\})
diff --git a/ale_linters/python/pylint.vim b/ale_linters/python/pylint.vim
index b16d5355..44eea246 100644
--- a/ale_linters/python/pylint.vim
+++ b/ale_linters/python/pylint.vim
@@ -17,7 +17,7 @@ function! ale_linters#python#pylint#GetExecutable(buffer) abort
return ale#python#FindExecutable(a:buffer, 'python_pylint', ['pylint'])
endfunction
-function! ale_linters#python#pylint#GetCommand(buffer) abort
+function! ale_linters#python#pylint#GetCommand(buffer, version) abort
let l:cd_string = ''
if ale#Var(a:buffer, 'python_pylint_change_directory')
@@ -38,17 +38,23 @@ function! ale_linters#python#pylint#GetCommand(buffer) abort
return l:cd_string
\ . ale#Escape(l:executable) . l:exec_args
- \ . ' ' . ale#Var(a:buffer, 'python_pylint_options')
+ \ . ale#Pad(ale#Var(a:buffer, 'python_pylint_options'))
\ . ' --output-format text --msg-template="{path}:{line}:{column}: {msg_id} ({symbol}) {msg}" --reports n'
+ \ . (ale#semver#GTE(a:version, [2, 4, 0]) ? ' --from-stdin' : '')
\ . ' %s'
endfunction
function! ale_linters#python#pylint#Handle(buffer, lines) abort
+ let l:output = ale#python#HandleTraceback(a:lines, 10)
+
+ if !empty(l:output)
+ return l:output
+ endif
+
" Matches patterns like the following:
"
" test.py:4:4: W0101 (unreachable) Unreachable code
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+): ([[:alnum:]]+) \(([^(]*)\) (.*)$'
- let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
"let l:failed = append(0, l:match)
@@ -71,13 +77,19 @@ function! ale_linters#python#pylint#Handle(buffer, lines) abort
let l:code_out = l:match[4]
endif
- call add(l:output, {
+ let l:item = {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 1,
\ 'text': l:match[5],
\ 'code': l:code_out,
- \ 'type': l:code[:0] is# 'E' ? 'E' : 'W',
- \})
+ \ 'type': 'W',
+ \}
+
+ if l:code[:0] is# 'E'
+ let l:item.type = 'E'
+ endif
+
+ call add(l:output, l:item)
endfor
return l:output
@@ -86,7 +98,17 @@ endfunction
call ale#linter#Define('python', {
\ 'name': 'pylint',
\ 'executable': function('ale_linters#python#pylint#GetExecutable'),
-\ 'command': function('ale_linters#python#pylint#GetCommand'),
+\ 'lint_file': {buffer -> ale#semver#RunWithVersionCheck(
+\ buffer,
+\ ale#Var(buffer, 'python_pylint_executable'),
+\ '%e --version',
+\ {buffer, version -> !ale#semver#GTE(version, [2, 4, 0])},
+\ )},
+\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
+\ buffer,
+\ ale#Var(buffer, 'python_pylint_executable'),
+\ '%e --version',
+\ function('ale_linters#python#pylint#GetCommand'),
+\ )},
\ 'callback': 'ale_linters#python#pylint#Handle',
-\ 'lint_file': 1,
\})
diff --git a/ale_linters/typescript/tsserver.vim b/ale_linters/typescript/tsserver.vim
index 840889f3..4726e40d 100644
--- a/ale_linters/typescript/tsserver.vim
+++ b/ale_linters/typescript/tsserver.vim
@@ -9,6 +9,7 @@ call ale#linter#Define('typescript', {
\ 'name': 'tsserver',
\ 'lsp': 'tsserver',
\ 'executable': {b -> ale#node#FindExecutable(b, 'typescript_tsserver', [
+\ '.yarn/sdks/typescript/bin/tsserver',
\ 'node_modules/.bin/tsserver',
\ ])},
\ 'command': '%e',
diff --git a/ale_linters/vim/vint.vim b/ale_linters/vim/vint.vim
index c7461bc8..f7054ffb 100644
--- a/ale_linters/vim/vint.vim
+++ b/ale_linters/vim/vint.vim
@@ -13,12 +13,17 @@ function! ale_linters#vim#vint#GetCommand(buffer, version) abort
let l:warning_flag = ale#Var(a:buffer, 'vim_vint_show_style_issues') ? '-s' : '-w'
+ " Use the --stdin-display-name argument if supported, temp file otherwise.
+ let l:stdin_or_temp = ale#semver#GTE(a:version, [0, 4, 0])
+ \ ? ' --stdin-display-name %s -'
+ \ : ' %t'
+
return '%e'
\ . ' ' . l:warning_flag
\ . (l:can_use_no_color_flag ? ' --no-color' : '')
\ . s:enable_neovim
\ . ' ' . s:format
- \ . ' %t'
+ \ . l:stdin_or_temp
endfunction
let s:word_regex_list = [