1
0
mirror of https://github.com/amix/vimrc synced 2025-06-30 20:05:01 +08:00

Updated plugins

This commit is contained in:
Amir
2021-07-30 22:52:54 +02:00
parent a8f0b6f678
commit 65de68fa88
66 changed files with 1368 additions and 404 deletions

View File

@ -73,8 +73,8 @@ endfunction
function! ale_linters#ansible#ansible_lint#GetCommand(buffer, version) abort
let l:commands = {
\ '>=5.0.0': '%e --parseable-severity -x yaml',
\ '<5.0.0': '%e -p %t'
\ '>=5.0.0': '%e --nocolor --parseable-severity -x yaml -',
\ '<5.0.0': '%e --nocolor -p %t'
\}
let l:command = ale#semver#GTE(a:version, [5, 0]) ? l:commands['>=5.0.0'] : l:commands['<5.0.0']

View File

@ -1,6 +1,18 @@
" Author: Masashi Iizuka <liquidz.uo@gmail.com>
" Description: linter for clojure using clj-kondo https://github.com/borkdude/clj-kondo
call ale#Set('clojure_clj_kondo_options', '--cache')
function! ale_linters#clojure#clj_kondo#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'clojure_clj_kondo_options')
let l:command = 'clj-kondo'
\ . ale#Pad(l:options)
\ . ' --lint %t'
return l:command
endfunction
function! ale_linters#clojure#clj_kondo#HandleCljKondoFormat(buffer, lines) abort
" output format
" <filename>:<line>:<column>: <issue type>: <message>
@ -29,6 +41,6 @@ call ale#linter#Define('clojure', {
\ 'name': 'clj-kondo',
\ 'output_stream': 'stdout',
\ 'executable': 'clj-kondo',
\ 'command': 'clj-kondo --cache --lint %t',
\ 'command': function('ale_linters#clojure#clj_kondo#GetCommand'),
\ 'callback': 'ale_linters#clojure#clj_kondo#HandleCljKondoFormat',
\})

View File

@ -0,0 +1,28 @@
" Author: ghsang <gwonhyuksang@gmail.com>
" Description: Check Dart files with dart analyze
call ale#Set('dart_analyze_executable', 'dart')
function! ale_linters#dart#dart_analyze#Handle(buffer, lines) abort
let l:pattern = '\v^ ([a-z]+) - (.+):(\d+):(\d+) - (.+) - (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'type': l:match[1] is# 'error' ? 'E' : 'W',
\ 'text': l:match[6] . ': ' . l:match[5],
\ 'lnum': str2nr(l:match[3]),
\ 'col': str2nr(l:match[4]),
\})
endfor
return l:output
endfunction
call ale#linter#Define('dart', {
\ 'name': 'dart_analyze',
\ 'executable': {b -> ale#Var(b, 'dart_analyze_executable')},
\ 'command': '%e analyze %s',
\ 'callback': 'ale_linters#dart#dart_analyze#Handle',
\ 'lint_file': 1,
\})

View File

@ -7,7 +7,7 @@ call ale#Set('dockerfile_hadolint_docker_image', 'hadolint/hadolint')
function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
" Matches patterns line the following:
"
" /dev/stdin:19 DL3001 Pipe chain should start with a raw value.
" -:19 DL3001 warning: Pipe chain should start with a raw value.
" /dev/stdin:19:3 unexpected thing
let l:pattern = '\v^%(/dev/stdin|-):(\d+):?(\d+)? ((DL|SC)(\d+) )?((.+)?: )?(.+)$'
let l:output = []
@ -38,6 +38,8 @@ function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
let l:text = l:match[8]
let l:detail = l:match[8]
let l:domain = 'https://github.com/hadolint/hadolint/wiki/'
let l:code = ''
let l:link = ''
if l:match[4] is# 'SC'
let l:domain = 'https://github.com/koalaman/shellcheck/wiki/'
@ -46,9 +48,11 @@ function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
if l:match[5] isnot# ''
let l:code = l:match[4] . l:match[5]
let l:link = ' ( ' . l:domain . l:code . ' )'
let l:text = l:code . ': ' . l:detail
let l:detail = l:code . l:link . "\n\n" . l:detail
else
let l:type = 'E'
let l:detail = 'hadolint could not parse the file because of a syntax error.'
endif
call add(l:output, {

View File

@ -25,7 +25,7 @@ function! ale_linters#erlang#erlc#Handle(buffer, lines) abort
" error.erl:4: variable 'B' is unbound
" error.erl:3: Warning: function main/0 is unused
" error.erl:4: Warning: variable 'A' is unused
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+): (Warning: )?(.+)$'
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+:)? (Warning: )?(.+)$'
" parse_transforms are a special case. The error message does not indicate a location:
" error.erl: undefined parse transform 'some_parse_transform'
@ -65,8 +65,8 @@ function! ale_linters#erlang#erlc#Handle(buffer, lines) abort
endif
let l:line = l:match[2]
let l:warning_or_text = l:match[3]
let l:text = l:match[4]
let l:warning_or_text = l:match[4]
let l:text = l:match[5]
" If this file is a header .hrl, ignore the following expected messages:
" - 'no module definition'

View File

@ -6,6 +6,7 @@ let g:ale_php_phpstan_executable = get(g:, 'ale_php_phpstan_executable', 'phpsta
let g:ale_php_phpstan_level = get(g:, 'ale_php_phpstan_level', '')
let g:ale_php_phpstan_configuration = get(g:, 'ale_php_phpstan_configuration', '')
let g:ale_php_phpstan_autoload = get(g:, 'ale_php_phpstan_autoload', '')
call ale#Set('php_phpstan_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
let l:configuration = ale#Var(a:buffer, 'php_phpstan_configuration')
@ -32,8 +33,8 @@ function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
\ : ''
let l:error_format = ale#semver#GTE(a:version, [0, 10, 3])
\ ? ' --error-format raw'
\ : ' --errorFormat raw'
\ ? ' --error-format json'
\ : ' --errorFormat json'
return '%e analyze --no-progress'
\ . l:error_format
@ -44,17 +45,17 @@ function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
endfunction
function! ale_linters#php#phpstan#Handle(buffer, lines) abort
" Matches against lines like the following:
"
" filename.php:15:message
" C:\folder\filename.php:15:message
let l:pattern = '^\([a-zA-Z]:\)\?[^:]\+:\(\d\+\):\(.*\)$'
let l:res = ale#util#FuzzyJSONDecode(a:lines, {'files': []})
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
if type(l:res.files) is v:t_list
return l:output
endif
for l:err in l:res.files[expand('#' . a:buffer .':p')].messages
call add(l:output, {
\ 'lnum': l:match[2] + 0,
\ 'text': l:match[3],
\ 'lnum': l:err.line,
\ 'text': l:err.message,
\ 'type': 'E',
\})
endfor
@ -64,10 +65,16 @@ endfunction
call ale#linter#Define('php', {
\ 'name': 'phpstan',
\ 'executable': {b -> ale#Var(b, 'php_phpstan_executable')},
\ 'executable': {buffer -> ale#path#FindExecutable(buffer, 'php_phpstan', [
\ 'vendor/bin/phpstan',
\ 'phpstan'
\ ])},
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale#Var(buffer, 'php_phpstan_executable'),
\ ale#path#FindExecutable(buffer, 'php_phpstan', [
\ 'vendor/bin/phpstan',
\ 'phpstan'
\ ]),
\ '%e --version',
\ function('ale_linters#php#phpstan#GetCommand'),
\ )},

View File

@ -6,6 +6,7 @@ call ale#Set('python_bandit_options', '')
call ale#Set('python_bandit_use_config', 1)
call ale#Set('python_bandit_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_bandit_auto_pipenv', 0)
call ale#Set('python_bandit_auto_poetry', 0)
function! ale_linters#python#bandit#GetExecutable(buffer) abort
if (
@ -15,6 +16,13 @@ function! ale_linters#python#bandit#GetExecutable(buffer) abort
return 'pipenv'
endif
if (
\ ale#Var(a:buffer, 'python_auto_poetry')
\ || ale#Var(a:buffer, 'python_bandit_auto_poetry')
\) && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
return ale#python#FindExecutable(a:buffer, 'python_bandit', ['bandit'])
endfunction
@ -31,7 +39,7 @@ function! ale_linters#python#bandit#GetCommand(buffer) abort
endif
endif
let l:exec_args = l:executable =~? 'pipenv$'
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run bandit'
\ : ''

View File

@ -6,6 +6,7 @@ call ale#Set('python_flake8_options', '')
call ale#Set('python_flake8_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_flake8_change_directory', 'project')
call ale#Set('python_flake8_auto_pipenv', 0)
call ale#Set('python_flake8_auto_poetry', 0)
function! s:UsingModule(buffer) abort
return ale#Var(a:buffer, 'python_flake8_options') =~# ' *-m flake8'
@ -17,6 +18,11 @@ function! ale_linters#python#flake8#GetExecutable(buffer) abort
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_flake8_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
if !s:UsingModule(a:buffer)
return ale#python#FindExecutable(a:buffer, 'python_flake8', ['flake8'])
endif
@ -62,7 +68,7 @@ endfunction
function! ale_linters#python#flake8#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#flake8#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv$'
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run flake8'
\ : ''

View File

@ -7,6 +7,7 @@ call ale#Set('python_mypy_show_notes', 1)
call ale#Set('python_mypy_options', '')
call ale#Set('python_mypy_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_mypy_auto_pipenv', 0)
call ale#Set('python_mypy_auto_poetry', 0)
function! ale_linters#python#mypy#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_mypy_auto_pipenv'))
@ -14,6 +15,11 @@ function! ale_linters#python#mypy#GetExecutable(buffer) abort
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_mypy_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
return ale#python#FindExecutable(a:buffer, 'python_mypy', ['mypy'])
endfunction
@ -37,7 +43,7 @@ endfunction
function! ale_linters#python#mypy#GetCommand(buffer) abort
let l:executable = ale_linters#python#mypy#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv$'
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run mypy'
\ : ''

View File

@ -2,6 +2,7 @@
" Description: prospector linter python files
call ale#Set('python_prospector_auto_pipenv', 0)
call ale#Set('python_prospector_auto_poetry', 0)
let g:ale_python_prospector_executable =
\ get(g:, 'ale_python_prospector_executable', 'prospector')
@ -17,13 +18,18 @@ function! ale_linters#python#prospector#GetExecutable(buffer) abort
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_prospector_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
return ale#python#FindExecutable(a:buffer, 'python_prospector', ['prospector'])
endfunction
function! ale_linters#python#prospector#GetCommand(buffer) abort
let l:executable = ale_linters#python#prospector#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv$'
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run prospector'
\ : ''

View File

@ -5,6 +5,7 @@ call ale#Set('python_pycodestyle_executable', 'pycodestyle')
call ale#Set('python_pycodestyle_options', '')
call ale#Set('python_pycodestyle_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pycodestyle_auto_pipenv', 0)
call ale#Set('python_pycodestyle_auto_poetry', 0)
function! ale_linters#python#pycodestyle#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pycodestyle_auto_pipenv'))
@ -12,13 +13,18 @@ function! ale_linters#python#pycodestyle#GetExecutable(buffer) abort
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_pycodestyle_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
return ale#python#FindExecutable(a:buffer, 'python_pycodestyle', ['pycodestyle'])
endfunction
function! ale_linters#python#pycodestyle#GetCommand(buffer) abort
let l:executable = ale_linters#python#pycodestyle#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv$'
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run pycodestyle'
\ : ''

View File

@ -5,6 +5,7 @@ call ale#Set('python_pydocstyle_executable', 'pydocstyle')
call ale#Set('python_pydocstyle_options', '')
call ale#Set('python_pydocstyle_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pydocstyle_auto_pipenv', 0)
call ale#Set('python_pydocstyle_auto_poetry', 0)
function! ale_linters#python#pydocstyle#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pydocstyle_auto_pipenv'))
@ -12,12 +13,17 @@ function! ale_linters#python#pydocstyle#GetExecutable(buffer) abort
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_pydocstyle_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
return ale#python#FindExecutable(a:buffer, 'python_pydocstyle', ['pydocstyle'])
endfunction
function! ale_linters#python#pydocstyle#GetCommand(buffer) abort
let l:executable = ale_linters#python#pydocstyle#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv$'
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run pydocstyle'
\ : ''

View File

@ -4,6 +4,7 @@
call ale#Set('python_pyflakes_executable', 'pyflakes')
call ale#Set('python_pyflakes_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pyflakes_auto_pipenv', 0)
call ale#Set('python_pyflakes_auto_poetry', 0)
function! ale_linters#python#pyflakes#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyflakes_auto_pipenv'))
@ -11,13 +12,18 @@ function! ale_linters#python#pyflakes#GetExecutable(buffer) abort
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_pyflakes_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
return ale#python#FindExecutable(a:buffer, 'python_pyflakes', ['pyflakes'])
endfunction
function! ale_linters#python#pyflakes#GetCommand(buffer) abort
let l:executable = ale_linters#python#pyflakes#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv$'
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run pyflakes'
\ : ''

View File

@ -5,6 +5,7 @@ call ale#Set('python_pylama_executable', 'pylama')
call ale#Set('python_pylama_options', '')
call ale#Set('python_pylama_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pylama_auto_pipenv', 0)
call ale#Set('python_pylama_auto_poetry', 0)
call ale#Set('python_pylama_change_directory', 1)
function! ale_linters#python#pylama#GetExecutable(buffer) abort
@ -13,6 +14,11 @@ function! ale_linters#python#pylama#GetExecutable(buffer) abort
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_pylama_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
return ale#python#FindExecutable(a:buffer, 'python_pylama', ['pylama'])
endfunction
@ -31,7 +37,7 @@ endfunction
function! ale_linters#python#pylama#GetCommand(buffer) abort
let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv$'
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run pylama'
\ : ''

View File

@ -6,6 +6,7 @@ call ale#Set('python_pylint_options', '')
call ale#Set('python_pylint_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pylint_change_directory', 1)
call ale#Set('python_pylint_auto_pipenv', 0)
call ale#Set('python_pylint_auto_poetry', 0)
call ale#Set('python_pylint_use_msg_id', 0)
function! ale_linters#python#pylint#GetExecutable(buffer) abort
@ -14,6 +15,11 @@ function! ale_linters#python#pylint#GetExecutable(buffer) abort
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_pylint_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
return ale#python#FindExecutable(a:buffer, 'python_pylint', ['pylint'])
endfunction
@ -32,7 +38,7 @@ endfunction
function! ale_linters#python#pylint#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#pylint#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv$'
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run pylint'
\ : ''

View File

@ -1,37 +0,0 @@
" Author: aurieh <me@aurieh.me>
" Description: A language server for Python
call ale#Set('python_pyls_executable', 'pyls')
call ale#Set('python_pyls_options', '')
call ale#Set('python_pyls_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pyls_auto_pipenv', 0)
call ale#Set('python_pyls_config', {})
function! ale_linters#python#pyls#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyls_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
return ale#python#FindExecutable(a:buffer, 'python_pyls', ['pyls'])
endfunction
function! ale_linters#python#pyls#GetCommand(buffer) abort
let l:executable = ale_linters#python#pyls#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv$'
\ ? ' run pyls'
\ : ''
return ale#Escape(l:executable) . l:exec_args . ale#Pad(ale#Var(a:buffer, 'python_pyls_options'))
endfunction
call ale#linter#Define('python', {
\ 'name': 'pyls',
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#python#pyls#GetExecutable'),
\ 'command': function('ale_linters#python#pyls#GetCommand'),
\ 'project_root': function('ale#python#FindProjectRoot'),
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
\ 'lsp_config': {b -> ale#Var(b, 'python_pyls_config')},
\})

View File

@ -0,0 +1,43 @@
" Author: aurieh <me@aurieh.me>
" Description: A language server for Python
call ale#Set('python_pylsp_executable', 'pylsp')
call ale#Set('python_pylsp_options', '')
call ale#Set('python_pylsp_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pylsp_auto_pipenv', 0)
call ale#Set('python_pylsp_auto_poetry', 0)
call ale#Set('python_pylsp_config', {})
function! ale_linters#python#pylsp#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pylsp_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_pylsp_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
return ale#python#FindExecutable(a:buffer, 'python_pylsp', ['pylsp'])
endfunction
function! ale_linters#python#pylsp#GetCommand(buffer) abort
let l:executable = ale_linters#python#pylsp#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run pylsp'
\ : ''
return ale#Escape(l:executable) . l:exec_args . ale#Pad(ale#Var(a:buffer, 'python_pylsp_options'))
endfunction
call ale#linter#Define('python', {
\ 'name': 'pylsp',
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#python#pylsp#GetExecutable'),
\ 'command': function('ale_linters#python#pylsp#GetCommand'),
\ 'project_root': function('ale#python#FindProjectRoot'),
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
\ 'lsp_config': {b -> ale#Var(b, 'python_pylsp_config')},
\})

View File

@ -4,6 +4,7 @@
call ale#Set('python_pyre_executable', 'pyre')
call ale#Set('python_pyre_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pyre_auto_pipenv', 0)
call ale#Set('python_pyre_auto_poetry', 0)
function! ale_linters#python#pyre#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyre_auto_pipenv'))
@ -11,13 +12,18 @@ function! ale_linters#python#pyre#GetExecutable(buffer) abort
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_pyre_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
return ale#python#FindExecutable(a:buffer, 'python_pyre', ['pyre'])
endfunction
function! ale_linters#python#pyre#GetCommand(buffer) abort
let l:executable = ale_linters#python#pyre#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv$'
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run pyre persistent'
\ : ' persistent'

View File

@ -29,7 +29,7 @@ endfunction
function! ale_linters#python#vulture#GetCommand(buffer) abort
let l:executable = ale_linters#python#vulture#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv$'
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run vulture'
\ : ''
let l:lint_dest = ale#Var(a:buffer, 'python_vulture_change_directory')

View File

@ -0,0 +1,7 @@
call ale#linter#Define('racket', {
\ 'name': 'racket_langserver',
\ 'lsp': 'stdio',
\ 'executable': 'racket',
\ 'command': '%e -l racket-langserver',
\ 'project_root': function('ale#racket#FindProjectRoot'),
\})

View File

@ -1,4 +1,5 @@
" Author: Mohammed Chelouti - https://github.com/motato1
" Arnold Chand <creativenull@outlook.com>
" Description: Deno lsp linter for TypeScript files.
call ale#linter#Define('typescript', {
@ -7,19 +8,5 @@ call ale#linter#Define('typescript', {
\ 'executable': function('ale#handlers#deno#GetExecutable'),
\ 'command': '%e lsp',
\ 'project_root': function('ale#handlers#deno#GetProjectRoot'),
\ 'initialization_options': function('ale_linters#typescript#deno#GetInitializationOptions'),
\ 'initialization_options': function('ale#handlers#deno#GetInitializationOptions'),
\})
function! ale_linters#typescript#deno#GetInitializationOptions(buffer) abort
let l:options = {
\ 'enable': v:true,
\ 'lint': v:true,
\ 'unstable': v:false,
\ }
if ale#Var(a:buffer, 'deno_unstable')
let l:options.unstable = v:true
endif
return l:options
endfunction

View File

@ -0,0 +1,42 @@
" Author: Nathan Sharp <nwsharp+eda@live.com>
" Description: Yosys for Verilog files
call ale#Set('verilog_yosys_executable', 'yosys')
call ale#Set('verilog_yosys_options', '-Q -T -p ''read_verilog %s''')
function! ale_linters#verilog#yosys#GetCommand(buffer) abort
return '%e ' . ale#Var(a:buffer, 'verilog_yosys_options') . ' 2>&1'
endfunction
function! ale_linters#verilog#yosys#Handle(buffer, lines) abort
let l:output = []
let l:path = fnamemodify(bufname(a:buffer), ':p')
for l:match in ale#util#GetMatches(a:lines, '^\([^:]\+\):\(\d\+\): \(WARNING\|ERROR\): \(.\+\)$')
call add(l:output, {
\ 'lnum': str2nr(l:match[2]),
\ 'text': l:match[4],
\ 'type': l:match[3][0],
\ 'filename': l:match[1],
\})
endfor
for l:match in ale#util#GetMatches(a:lines, '^\(Warning\|ERROR\): \(.\+\)$')
call add(l:output, {
\ 'lnum': 1,
\ 'text': l:match[2],
\ 'type': l:match[1][0],
\})
endfor
return l:output
endfunction
call ale#linter#Define('verilog', {
\ 'name': 'yosys',
\ 'output_stream': 'stdout',
\ 'executable': {b -> ale#Var(b, 'verilog_yosys_executable')},
\ 'command': function('ale_linters#verilog#yosys#GetCommand'),
\ 'callback': 'ale_linters#verilog#yosys#Handle',
\ 'lint_file': 1,
\})

View File

@ -1002,7 +1002,7 @@ endfunction
function! ale#completion#HandleUserData(completed_item) abort
let l:user_data_json = get(a:completed_item, 'user_data', '')
let l:user_data = !empty(l:user_data_json)
\ ? json_decode(l:user_data_json)
\ ? ale#util#FuzzyJSONDecode(l:user_data_json, v:null)
\ : v:null
if type(l:user_data) isnot v:t_dict

View File

@ -17,6 +17,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['python'],
\ 'description': 'Fix import issues with autoimport.',
\ },
\ 'autoflake': {
\ 'function': 'ale#fixers#autoflake#Fix',
\ 'suggested_filetypes': ['python'],
\ 'description': 'Fix flake issues with autoflake.',
\ },
\ 'autopep8': {
\ 'function': 'ale#fixers#autopep8#Fix',
\ 'suggested_filetypes': ['python'],
@ -376,6 +381,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['dart'],
\ 'description': 'Fix Dart files with dartfmt.',
\ },
\ 'dart-format': {
\ 'function': 'ale#fixers#dart_format#Fix',
\ 'suggested_filetypes': ['dart'],
\ 'description': 'Fix Dart files with dart format.',
\ },
\ 'xmllint': {
\ 'function': 'ale#fixers#xmllint#Fix',
\ 'suggested_filetypes': ['xml'],
@ -441,6 +451,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['html', 'htmldjango'],
\ 'description': 'Fix HTML files with html-beautify.',
\ },
\ 'lua-format': {
\ 'function': 'ale#fixers#lua_format#Fix',
\ 'suggested_filetypes': ['lua'],
\ 'description': 'Fix Lua files with lua-format.',
\ },
\ 'luafmt': {
\ 'function': 'ale#fixers#luafmt#Fix',
\ 'suggested_filetypes': ['lua'],

View File

@ -0,0 +1,28 @@
" Author: circld <circld1@gmail.com>
" Description: Fixing files with autoflake.
call ale#Set('python_autoflake_executable', 'autoflake')
call ale#Set('python_autoflake_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_autoflake_options', '')
function! ale#fixers#autoflake#Fix(buffer) abort
let l:executable = ale#python#FindExecutable(
\ a:buffer,
\ 'python_autoflake',
\ ['autoflake'],
\)
if !executable(l:executable)
return 0
endif
let l:options = ale#Var(a:buffer, 'python_autoflake_options')
return {
\ 'command': ale#Escape(l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' --in-place '
\ . ' %t',
\ 'read_temporary_file': 1,
\}
endfunction

View File

@ -5,6 +5,7 @@ call ale#Set('python_black_executable', 'black')
call ale#Set('python_black_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_black_options', '')
call ale#Set('python_black_auto_pipenv', 0)
call ale#Set('python_black_auto_poetry', 0)
call ale#Set('python_black_change_directory', 1)
function! ale#fixers#black#GetExecutable(buffer) abort
@ -13,6 +14,11 @@ function! ale#fixers#black#GetExecutable(buffer) abort
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_black_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
return ale#python#FindExecutable(a:buffer, 'python_black', ['black'])
endfunction
@ -20,7 +26,7 @@ function! ale#fixers#black#Fix(buffer) abort
let l:executable = ale#fixers#black#GetExecutable(a:buffer)
let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? 'pipenv$'
if l:executable =~? 'pipenv\|poetry$'
call extend(l:cmd, ['run', 'black'])
endif

View File

@ -0,0 +1,18 @@
" Author: ghsang <gwonhyuksang@gmail.com>
" Description: Integration of dart format with ALE.
call ale#Set('dart_format_executable', 'dart')
call ale#Set('dart_format_options', '')
function! ale#fixers#dart_format#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'dart_format_executable')
let l:options = ale#Var(a:buffer, 'dart_format_options')
return {
\ 'command': ale#Escape(l:executable)
\ . ' format'
\ . (empty(l:options) ? '' : ' ' . l:options)
\ . ' %t',
\ 'read_temporary_file': 1,
\}
endfunction

View File

@ -29,6 +29,7 @@ function! ale#fixers#isort#Fix(buffer) abort
return {
\ 'cwd': '%s:h',
\ 'command': ale#Escape(l:executable) . l:exec_args
\ . ale#Pad('--filename %s')
\ . (!empty(l:options) ? ' ' . l:options : '') . ' -',
\}
endfunction

View File

@ -0,0 +1,16 @@
" Author: Mathias Jean Johansen <mathias@mjj.io>
" Description: Integration of LuaFormatter with ALE.
call ale#Set('lua_lua_format_executable', 'lua-format')
call ale#Set('lua_lua_format_options', '')
function! ale#fixers#lua_format#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'lua_lua_format_executable')
let l:options = ale#Var(a:buffer, 'lua_lua_format_options')
return {
\ 'command': ale#Escape(l:executable)
\ . ale#Pad(l:options)
\ . ' -i',
\}
endfunction

View File

@ -1,26 +1,35 @@
" Author: Jan-Grimo Sobez <jan-grimo.sobez@phys.chem.ethz.ch>
" Author: Kevin Clark <kevin.clark@gmail.com>
" Author: D. Ben Knoble <ben.knoble+github@gmail.com>
" Description: Floating preview window for showing whatever information in.
" Precondition: exists('*nvim_open_win')
" Precondition: exists('*nvim_open_win') || has('popupwin')
function! ale#floating_preview#Show(lines, ...) abort
if !exists('*nvim_open_win')
if !exists('*nvim_open_win') && !has('popupwin')
execute 'echom ''Floating windows not supported in this vim instance.'''
return
endif
let l:options = get(a:000, 0, {})
if has('nvim')
call s:NvimShow(a:lines, l:options)
else
call s:VimShow(a:lines, l:options)
endif
endfunction
function! s:NvimShow(lines, options) abort
" Remove the close autocmd so it doesn't happen mid update
augroup ale_floating_preview_window
autocmd!
augroup END
let l:options = get(a:000, 0, {})
" Only create a new window if we need it
if !exists('w:preview') || index(nvim_list_wins(), w:preview['id']) is# -1
call s:Create(l:options)
call s:NvimCreate(a:options)
else
call nvim_buf_set_option(w:preview['buffer'], 'modifiable', v:true)
endif
@ -30,7 +39,7 @@ function! ale#floating_preview#Show(lines, ...) abort
call nvim_set_current_win(w:preview['id'])
for l:command in get(l:options, 'commands', [])
for l:command in get(a:options, 'commands', [])
call execute(l:command)
endfor
@ -41,13 +50,13 @@ function! ale#floating_preview#Show(lines, ...) abort
autocmd!
if g:ale_close_preview_on_insert
autocmd CursorMoved,TabLeave,WinLeave,InsertEnter <buffer> ++once call s:Close()
autocmd CursorMoved,TabLeave,WinLeave,InsertEnter <buffer> ++once call s:NvimClose()
else
autocmd CursorMoved,TabLeave,WinLeave <buffer> ++once call s:Close()
autocmd CursorMoved,TabLeave,WinLeave <buffer> ++once call s:NvimClose()
endif
augroup END
let [l:lines, l:width, l:height] = s:PrepareWindowContent(a:lines)
let [l:lines, l:width, l:height] = s:NvimPrepareWindowContent(a:lines)
call nvim_win_set_width(w:preview['id'], l:width)
call nvim_win_set_height(w:preview['id'], l:height)
@ -56,7 +65,33 @@ function! ale#floating_preview#Show(lines, ...) abort
call nvim_buf_set_option(w:preview['buffer'], 'modifiable', v:false)
endfunction
function! s:PrepareWindowContent(lines) abort
function! s:VimShow(lines, options) abort
if g:ale_close_preview_on_insert
" Remove the close autocmd so it doesn't happen mid update
silent! autocmd! ale_floating_preview_window
endif
" Only create a new window if we need it
if !exists('w:preview') || index(popup_list(), w:preview['id']) is# -1
call s:VimCreate(a:options)
endif
" Execute commands in window context
for l:command in get(a:options, 'commands', [])
call win_execute(w:preview['id'], l:command)
endfor
call popup_settext(w:preview['id'], a:lines)
if g:ale_close_preview_on_insert
augroup ale_floating_preview_window
autocmd!
autocmd InsertEnter * ++once call s:VimClose()
augroup END
endif
endfunction
function! s:NvimPrepareWindowContent(lines) abort
let l:max_height = 10
let l:width = max(map(copy(a:lines), 'strdisplaywidth(v:val)'))
@ -94,7 +129,7 @@ function! s:PrepareWindowContent(lines) abort
return [l:lines, l:width, l:height]
endfunction
function! s:Create(options) abort
function! s:NvimCreate(options) abort
let l:buffer = nvim_create_buf(v:false, v:false)
let l:winid = nvim_open_win(l:buffer, v:false, {
\ 'relative': 'cursor',
@ -112,7 +147,32 @@ function! s:Create(options) abort
let w:preview = {'id': l:winid, 'buffer': l:buffer}
endfunction
function! s:Close() abort
function! s:VimCreate(options) abort
let l:popup_id = popup_create([], {
\ 'line': 'cursor+1',
\ 'col': 'cursor',
\ 'drag': v:true,
\ 'resize': v:true,
\ 'close': 'button',
\ 'padding': [0, 1, 0, 1],
\ 'border': [],
\ 'borderchars': empty(g:ale_floating_window_border) ? [' '] : [
\ g:ale_floating_window_border[1],
\ g:ale_floating_window_border[0],
\ g:ale_floating_window_border[1],
\ g:ale_floating_window_border[0],
\ g:ale_floating_window_border[2],
\ g:ale_floating_window_border[3],
\ g:ale_floating_window_border[4],
\ g:ale_floating_window_border[5],
\ ],
\ 'moved': 'any',
\ })
call setbufvar(winbufnr(l:popup_id), '&filetype', get(a:options, 'filetype', 'ale-preview'))
let w:preview = {'id': l:popup_id}
endfunction
function! s:NvimClose() abort
let l:mode = mode()
let l:restore_visual = l:mode is# 'v' || l:mode is# 'V' || l:mode is# "\<C-V>"
@ -132,3 +192,12 @@ function! s:Close() abort
normal! gv
endif
endfunction
function! s:VimClose() abort
if !exists('w:preview')
return
endif
call popup_close(w:preview['id'])
unlet w:preview
endfunction

View File

@ -1,8 +1,10 @@
" Author: Mohammed Chelouti - https://github.com/motato1
" Arnold Chand <creativenull@outlook.com>
" Description: Handler functions for Deno.
call ale#Set('deno_executable', 'deno')
call ale#Set('deno_unstable', 0)
call ale#Set('deno_importMap', 'import_map.json')
call ale#Set('deno_lsp_project_root', '')
function! ale#handlers#deno#GetExecutable(buffer) abort
@ -50,3 +52,23 @@ function! ale#handlers#deno#GetProjectRoot(buffer) abort
return ''
endfunction
" Initialization Options for deno, for javascript and typescript
function! ale#handlers#deno#GetInitializationOptions(buffer) abort
let l:options = {
\ 'enable': v:true,
\ 'lint': v:true,
\ 'unstable': v:false,
\ 'importMap': ale#path#FindNearestFile(a:buffer, 'import_map.json'),
\ }
if ale#Var(a:buffer, 'deno_unstable')
let l:options.unstable = v:true
endif
if ale#Var(a:buffer, 'deno_importMap') isnot# ''
let l:options.importMap = ale#path#FindNearestFile(a:buffer, ale#Var(a:buffer, 'deno_importMap'))
endif
return l:options
endfunction

View File

@ -2,6 +2,7 @@
" Description: Functions for integrating with Python linters.
call ale#Set('python_auto_pipenv', '0')
call ale#Set('python_auto_poetry', '0')
let s:sep = has('win32') ? '\' : '/'
" bin is used for Unix virtualenv directories, and Scripts is for Windows.
@ -34,6 +35,7 @@ function! ale#python#FindProjectRootIni(buffer) abort
\|| filereadable(l:path . '/Pipfile.lock')
\|| filereadable(l:path . '/poetry.lock')
\|| filereadable(l:path . '/pyproject.toml')
\|| filereadable(l:path . '/.tool-versions')
return l:path
endif
endfor
@ -157,3 +159,8 @@ endfunction
function! ale#python#PipenvPresent(buffer) abort
return findfile('Pipfile.lock', expand('#' . a:buffer . ':p:h') . ';') isnot# ''
endfunction
" Detects whether a poetry environment is present.
function! ale#python#PoetryPresent(buffer) abort
return findfile('poetry.lock', expand('#' . a:buffer . ':p:h') . ';') isnot# ''
endfunction

View File

@ -0,0 +1,12 @@
function! ale#racket#FindProjectRoot(buffer) abort
let l:cwd = expand('#' . a:buffer . ':p:h')
let l:highest_init = l:cwd
for l:path in ale#path#Upwards(l:cwd)
if filereadable(l:path.'/init.rkt')
let l:highest_init = l:path
endif
endfor
return l:highest_init
endfunction

View File

@ -85,7 +85,7 @@ execute 'sign define ALEStyleWarningSign text=' . s:EscapeSignText(g:ale_sign_st
\ . ' texthl=ALEStyleWarningSign linehl=ALEWarningLine'
execute 'sign define ALEInfoSign text=' . s:EscapeSignText(g:ale_sign_info)
\ . ' texthl=ALEInfoSign linehl=ALEInfoLine'
sign define ALEDummySign
sign define ALEDummySign text=\ texthl=SignColumn
if g:ale_sign_highlight_linenrs && has('nvim-0.3.2')
if !hlexists('ALEErrorSignLineNr')

View File

@ -9,6 +9,14 @@ A minimal and opinionated linter for code that sparks joy.
https://github.com/borkdude/clj-kondo
g:ale_clojure_clj_kondo_options *g:ale_clojure_clj_kondo_options*
*b:ale_clojure_clj_kondo_options*
Type: |String|
Default: `'--cache'`
This variable can be changed to modify options passed to clj-kondo.
===============================================================================
joker *ale-clojure-joker*

View File

@ -27,6 +27,67 @@ g:ale_dart_analysis_server_executable *g:ale_dart_analysis_server_executable*
This variable can be set to change the path of dart.
===============================================================================
dart-analyze *ale-dart-analyze*
Installation
-------------------------------------------------------------------------------
Installing Dart should probably ensure that `dart` is in your `$PATH`.
In case it is not, try to set the executable option to its absolute path. : >
" Set the executable path for dart to the absolute path to it.
let g:ale_dart_format_executable = '/usr/lib/dart/bin/dart'
>
Install Dart via whatever means. `dart analyze` will be included in the SDK.
Options
-------------------------------------------------------------------------------
g:ale_dart_analyze_executable *g:ale_dart_analyze_executable*
*b:ale_dart_analyze_executable*
Type: |String|
Default: `'dart'`
This variable can be set to specify an absolute path to the
format executable (or to specify an alternate executable).
===============================================================================
dart-format *ale-dart-format*
Installation
-------------------------------------------------------------------------------
Installing Dart should probably ensure that `dart` is in your `$PATH`.
In case it is not, try to set the executable option to its absolute path. : >
" Set the executable path for dart to the absolute path to it.
let g:ale_dart_format_executable = '/usr/lib/dart/bin/dart'
>
Options
-------------------------------------------------------------------------------
g:ale_dart_format_executable *g:ale_dart_format_executable*
*b:ale_dart_format_executable*
Type: |String|
Default: `'dart'`
This variable can be set to specify an absolute path to the
format executable (or to specify an alternate executable).
g:ale_dart_format_options *g:ale_dart_format_options*
*b:ale_dart_format_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to the dart format fixer.
===============================================================================
dartanalyzer *ale-dart-dartanalyzer*

View File

@ -193,13 +193,13 @@ The Java language server will look for the dependencies you specify in
===============================================================================
eclipselsp *ale-java-eclipselsp*
To enable Eclipse LSP linter you need to clone and build the eclipse.jdt.ls
To enable Eclipse JDT LSP linter you need to clone and build the eclipse.jdt.ls
language server from https://github.com/eclipse/eclipse.jdt.ls. Simply
clone the source code repo and then build the plugin:
./mvnw clean verify
Note: currently, the build can only run when launched with JDK 8. JDK 9 or more
Note: currently, the build can only run when launched with JDK 11. More
recent versions can be used to run the server though.
After build completes the files required to run the language server will be

View File

@ -1,6 +1,24 @@
===============================================================================
ALE Lua Integration *ale-lua-options*
===============================================================================
lua-format *ale-lua-lua-format*
g:ale_lua_lua_format_executable *g:ale_lua_lua_format_executable*
*b:ale_lua_lua_format_executable*
Type: |String|
Default: `'lua-format'`
This variable can be changed to change the path to lua-format.
g:ale_lua_lua_format_options *g:ale_lua_lua_format_options*
*b:ale_lua_lua_format_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to lua-format.
===============================================================================
luac *ale-lua-luac*

View File

@ -26,7 +26,7 @@ g:ale_purescript_ls_config g:ale_purescript_ls_config
\ 'purescript': {
\ 'addSpagoSources': v:true,
\ 'addNpmPath': v:true,
\ 'buildCommand': 'spago build -- --json-errors'
\ 'buildCommand': 'spago --quiet build --purs-args --json-errors'
\ }
\}
===============================================================================

View File

@ -10,6 +10,14 @@ g:ale_python_auto_pipenv *g:ale_python_auto_pipenv*
Detect whether the file is inside a pipenv, and set the executable to `pipenv`
if true. This is overridden by a manually-set executable.
g:ale_python_auto_poetry *g:ale_python_auto_poetry*
*b:ale_python_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
===============================================================================
ALE Python Project Root Behavior *ale-python-root*
@ -36,13 +44,41 @@ ALE will look for configuration files with the following filenames. >
.pylintrc
Pipfile
Pipfile.lock
poetry.lock
poetry.lock
pyproject.toml
.tool-versions
<
The first directory containing any of the files named above will be used.
===============================================================================
autoflake *ale-python-autoflake*
g:ale_python_autoflake_executable *g:ale_python_autoflake_executable*
*b:ale_python_autoflake_executable*
Type: |String|
Default: `'autoflake'`
See |ale-integrations-local-executables|
g:ale_python_autoflake_options *g:ale_python_autoflake_options*
*b:ale_python_autoflake_options*
Type: |String|
Default: `''`
This variable can be set to pass extra options to autoflake.
g:ale_python_autoflake_use_global *g:ale_python_autoflake_use_global*
*b:ale_python_autoflake_use_global*
Type: |Number|
Default: `get(g:, 'ale_use_global_executables', 0)`
See |ale-integrations-local-executables|
===============================================================================
autoimport *ale-python-autoimport*
@ -69,6 +105,7 @@ g:ale_python_autoimport_use_global *g:ale_python_autoimport_use_glob
See |ale-integrations-local-executables|
===============================================================================
autopep8 *ale-python-autopep8*
@ -107,6 +144,7 @@ g:ale_python_bandit_executable *g:ale_python_bandit_executable*
See |ale-integrations-local-executables|
Set this to `'pipenv'` to invoke `'pipenv` `run` `bandit'`.
Set this to `'poetry'` to invoke `'poetry` `run` `bandit'`.
g:ale_python_bandit_options *g:ale_python_bandit_options*
@ -146,6 +184,15 @@ g:ale_python_bandit_auto_pipenv *g:ale_python_bandit_auto_pipenv*
if true. This is overridden by a manually-set executable.
g:ale_python_bandit_auto_poetry *g:ale_python_bandit_auto_poetry*
*b:ale_python_bandit_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
===============================================================================
black *ale-python-black*
@ -181,6 +228,14 @@ g:ale_python_black_auto_pipenv *g:ale_python_black_auto_pipenv*
Detect whether the file is inside a pipenv, and set the executable to `pipenv`
if true. This is overridden by a manually-set executable.
g:ale_python_black_auto_poetry *g:ale_python_black_auto_poetry*
*b:ale_python_black_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
g:ale_python_black_change_directory *g:ale_python_black_change_directory*
*b:ale_python_black_change_directory*
Type: |Number|
@ -213,7 +268,8 @@ g:ale_python_flake8_executable *g:ale_python_flake8_executable*
Default: `'flake8'`
This variable can be changed to modify the executable used for flake8. Set
this to `'pipenv'` to invoke `'pipenv` `run` `flake8'`.
this to `'pipenv'` to invoke `'pipenv` `run` `flake8'`. Set this to
`'poetry'` to invoke `'poetry` `run` `flake8'`.
g:ale_python_flake8_options *g:ale_python_flake8_options*
@ -255,6 +311,15 @@ g:ale_python_flake8_auto_pipenv *g:ale_python_flake8_auto_pipenv*
if true. This is overridden by a manually-set executable.
g:ale_python_flake8_auto_poetry *g:ale_python_flake8_auto_poetry*
*b:ale_python_flake8_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
===============================================================================
isort *ale-python-isort*
@ -310,6 +375,15 @@ g:ale_python_mypy_auto_pipenv *g:ale_python_mypy_auto_pipenv*
if true. This is overridden by a manually-set executable.
g:ale_python_mypy_auto_poetry *g:ale_python_mypy_auto_poetry*
*b:ale_python_mypy_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
g:ale_python_mypy_executable *g:ale_python_mypy_executable*
*b:ale_python_mypy_executable*
Type: |String|
@ -318,6 +392,7 @@ g:ale_python_mypy_executable *g:ale_python_mypy_executable*
See |ale-integrations-local-executables|
Set this to `'pipenv'` to invoke `'pipenv` `run` `mypy'`.
Set this to `'poetry'` to invoke `'poetry` `run` `mypy'`.
g:ale_python_mypy_ignore_invalid_syntax
@ -368,6 +443,7 @@ g:ale_python_prospector_executable *g:ale_python_prospector_executable*
See |ale-integrations-local-executables|
Set this to `'pipenv'` to invoke `'pipenv` `run` `prospector'`.
Set this to `'poetry'` to invoke `'poetry` `run` `prospector'`.
g:ale_python_prospector_options *g:ale_python_prospector_options*
@ -408,6 +484,15 @@ g:ale_python_prospector_auto_pipenv *g:ale_python_prospector_auto_pipenv*
if true. This is overridden by a manually-set executable.
g:ale_python_prospector_auto_poetry *g:ale_python_prospector_auto_poetry*
*b:ale_python_prospector_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
===============================================================================
pycodestyle *ale-python-pycodestyle*
@ -420,6 +505,7 @@ g:ale_python_pycodestyle_executable *g:ale_python_pycodestyle_executable*
See |ale-integrations-local-executables|
Set this to `'pipenv'` to invoke `'pipenv` `run` `pycodestyle'`.
Set this to `'poetry'` to invoke `'poetry` `run` `pycodestyle'`.
g:ale_python_pycodestyle_options *g:ale_python_pycodestyle_options*
@ -448,6 +534,15 @@ g:ale_python_pycodestyle_auto_pipenv *g:ale_python_pycodestyle_auto_pipenv*
if true. This is overridden by a manually-set executable.
g:ale_python_pycodestyle_auto_poetry *g:ale_python_pycodestyle_auto_poetry*
*b:ale_python_pycodestyle_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
===============================================================================
pydocstyle *ale-python-pydocstyle*
@ -460,6 +555,7 @@ g:ale_python_pydocstyle_executable *g:ale_python_pydocstyle_executable*
See |ale-integrations-local-executables|
Set this to `'pipenv'` to invoke `'pipenv` `run` `pydocstyle'`.
Set this to `'poetry'` to invoke `'poetry` `run` `pydocstyle'`.
g:ale_python_pydocstyle_options *g:ale_python_pydocstyle_options*
@ -488,6 +584,15 @@ g:ale_python_pydocstyle_auto_pipenv *g:ale_python_pydocstyle_auto_pipenv*
if true. This is overridden by a manually-set executable.
g:ale_python_pydocstyle_auto_poetry *g:ale_python_pydocstyle_auto_poetry*
*b:ale_python_pydocstyle_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
===============================================================================
pyflakes *ale-python-pyflakes*
@ -500,6 +605,7 @@ g:ale_python_pyflakes_executable *g:ale_python_pyflakes_executable*
See |ale-integrations-local-executables|
Set this to `'pipenv'` to invoke `'pipenv` `run` `pyflakes'`.
Set this to `'poetry'` to invoke `'poetry` `run` `pyflakes'`.
g:ale_python_pyflakes_auto_pipenv *g:ale_python_pyflakes_auto_pipenv*
@ -511,6 +617,15 @@ g:ale_python_pyflakes_auto_pipenv *g:ale_python_pyflakes_auto_pipenv*
if true. This is overridden by a manually-set executable.
g:ale_python_pyflakes_auto_poetry *g:ale_python_pyflakes_auto_poetry*
*b:ale_python_pyflakes_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
===============================================================================
pylama *ale-python-pylama*
@ -532,7 +647,8 @@ g:ale_python_pylama_executable *g:ale_python_pylama_executable*
Default: `'pylama'`
This variable can be changed to modify the executable used for pylama. Set
this to `'pipenv'` to invoke `'pipenv` `run` `pylama'`.
this to `'pipenv'` to invoke `'pipenv` `run` `pylama'`. Set this to
`'poetry'` to invoke `'poetry` `run` `pylama'`.
g:ale_python_pylama_options *g:ale_python_pylama_options*
@ -565,6 +681,15 @@ g:ale_python_pylama_auto_pipenv *g:ale_python_pylama_auto_pipenv*
if true. This is overridden by a manually-set executable.
g:ale_python_pylama_auto_poetry *g:ale_python_pylama_auto_poetry*
*b:ale_python_pylama_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
===============================================================================
pylint *ale-python-pylint*
@ -589,6 +714,7 @@ g:ale_python_pylint_executable *g:ale_python_pylint_executable*
See |ale-integrations-local-executables|
Set this to `'pipenv'` to invoke `'pipenv` `run` `pylint'`.
Set this to `'poetry'` to invoke `'poetry` `run` `pylint'`.
g:ale_python_pylint_options *g:ale_python_pylint_options*
@ -628,6 +754,15 @@ g:ale_python_pylint_auto_pipenv *g:ale_python_pylint_auto_pipenv*
if true. This is overridden by a manually-set executable.
g:ale_python_pylint_auto_poetry *g:ale_python_pylint_auto_poetry*
*b:ale_python_pylint_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
g:ale_python_pylint_use_msg_id *g:ale_python_pylint_use_msg_id*
*b:ale_python_pylint_use_msg_id*
Type: |Number|
@ -638,31 +773,32 @@ g:ale_python_pylint_use_msg_id *g:ale_python_pylint_use_msg_id*
===============================================================================
pyls *ale-python-pyls*
pylsp *ale-python-pylsp*
`pyls` will be run from a detected project root, per |ale-python-root|.
`pylsp` will be run from a detected project root, per |ale-python-root|.
g:ale_python_pyls_executable *g:ale_python_pyls_executable*
*b:ale_python_pyls_executable*
g:ale_python_pylsp_executable *g:ale_python_pylsp_executable*
*b:ale_python_pylsp_executable*
Type: |String|
Default: `'pyls'`
Default: `'pylsp'`
See |ale-integrations-local-executables|
Set this to `'pipenv'` to invoke `'pipenv` `run` `pyls'`.
Set this to `'pipenv'` to invoke `'pipenv` `run` `pylsp'`.
Set this to `'poetry'` to invoke `'poetry` `run` `pyls'`.
g:ale_python_pyls_use_global *g:ale_python_pyls_use_global*
*b:ale_python_pyls_use_global*
g:ale_python_pylsp_use_global *g:ale_python_pylsp_use_global*
*b:ale_python_pylsp_use_global*
Type: |Number|
Default: `get(g:, 'ale_use_global_executables', 0)`
See |ale-integrations-local-executables|
g:ale_python_pyls_auto_pipenv *g:ale_python_pyls_auto_pipenv*
*b:ale_python_pyls_auto_pipenv*
g:ale_python_pylsp_auto_pipenv *g:ale_python_pylsp_auto_pipenv*
*b:ale_python_pylsp_auto_pipenv*
Type: |Number|
Default: `0`
@ -670,15 +806,24 @@ g:ale_python_pyls_auto_pipenv *g:ale_python_pyls_auto_pipenv*
if true. This is overridden by a manually-set executable.
g:ale_python_pyls_config *g:ale_python_pyls_config*
*b:ale_python_pyls_config*
g:ale_python_pylsp_auto_poetry *g:ale_python_pylsp_auto_poetry*
*b:ale_python_pylsp_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
g:ale_python_pylsp_config *g:ale_python_pylsp_config*
*b:ale_python_pylsp_config*
Type: |Dictionary|
Default: `{}`
Dictionary with configuration settings for pyls. For example, to disable
Dictionary with configuration settings for pylsp. For example, to disable
the pycodestyle linter: >
{
\ 'pyls': {
\ 'pylsp': {
\ 'plugins': {
\ 'pycodestyle': {
\ 'enabled': v:false
@ -688,24 +833,24 @@ g:ale_python_pyls_config *g:ale_python_pyls_config*
\ }
<
g:ale_python_pyls_options *g:ale_python_pyls_options*
*b:ale_python_pyls_options*
g:ale_python_pylsp_options *g:ale_python_pylsp_options*
*b:ale_python_pylsp_options*
Type: |String|
Default: `''`
This variable can be changed to add command-line arguments to the pyls
invocation. Note that this is not the same thing as ale_python_pyls_config,
which allows configuration of how pyls functions; this is intended to
provide flexibility in how the pyls command is invoked.
This variable can be changed to add command-line arguments to the pylsp
invocation. Note that this is not the same thing as ale_python_pylsp_config,
which allows configuration of how pylsp functions; this is intended to
provide flexibility in how the pylsp command is invoked.
For example, if you had installed `pyls` but your `pyls` executable was not
on your `PATH` for some reason, an alternative way to run the pyls server
For example, if you had installed `pylsp` but your `pylsp` executable was not
on your `PATH` for some reason, an alternative way to run the pylsp server
would be:
let g:ale_python_pyls_executable = 'python3'
let g:ale_python_pyls_options = '-m pyls'
let g:ale_python_pylsp_executable = 'python3'
let g:ale_python_pylsp_options = '-m pylsp'
An example stragety for installing `pyls`:
`python3 -m pip install --user pyls`
An example stragety for installing `pylsp`:
`python3 -m pip install --user pylsp`
===============================================================================
pyre *ale-python-pyre*
@ -721,6 +866,7 @@ g:ale_python_pyre_executable *g:ale_python_pyre_executable*
See |ale-integrations-local-executables|
Set this to `'pipenv'` to invoke `'pipenv` `run` `pyre'`.
Set this to `'poetry'` to invoke `'poetry` `run` `pyre'`.
g:ale_python_pyre_use_global *g:ale_python_pyre_use_global*
@ -740,6 +886,15 @@ g:ale_python_pyre_auto_pipenv *g:ale_python_pyre_auto_pipenv*
if true. This is overridden by a manually-set executable.
g:ale_python_pyre_auto_poetry *g:ale_python_pyre_auto_poetry*
*b:ale_python_pyre_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
===============================================================================
pyright *ale-python-pyright*

View File

@ -124,6 +124,8 @@ Notes:
* `dafny`!!
* Dart
* `analysis_server`
* `dart-analyze`!!
* `dart-format`!!
* `dartanalyzer`!!
* `dartfmt`!!
* `language_server`
@ -285,6 +287,7 @@ Notes:
* LLVM
* `llc`
* Lua
* `lua-format`
* `luac`
* `luacheck`
* `luafmt`
@ -398,6 +401,7 @@ Notes:
* `purescript-language-server`
* `purty`
* Python
* `autoflake`!!
* `autoimport`
* `autopep8`
* `bandit`
@ -411,7 +415,7 @@ Notes:
* `pyflakes`
* `pylama`!!
* `pylint`!!
* `pyls`
* `pylsp`
* `pyre`
* `pyright`
* `reorder-python-imports`
@ -425,6 +429,7 @@ Notes:
* `lintr`
* `styler`
* Racket
* `racket-langserver`
* `raco`
* Re:VIEW
* `redpen`
@ -549,6 +554,7 @@ Notes:
* `verilator`
* `vlog`
* `xvlog`
* `yosys`
* VHDL
* `ghdl`
* `vcom`

View File

@ -34,6 +34,12 @@ g:ale_deno_unstable *g:ale_deno_unstable*
Enable or disable unstable Deno features and APIs.
g:ale_deno_importMap *g:ale_deno_importMap*
*b:ale_deno_importMap*
Type: |String|
Default: `'import_map.json'`
Specify the import map filename to load url maps in a deno project.
===============================================================================
eslint *ale-typescript-eslint*

View File

@ -3,7 +3,7 @@ ALE Verilog/SystemVerilog Integration *ale-verilog-options*
===============================================================================
ALE can use five different linters for Verilog HDL:
ALE can use six different linters for Verilog HDL:
HDL Checker
Using `hdl_checker --lsp`
@ -20,6 +20,9 @@ ALE can use five different linters for Verilog HDL:
Vivado
Using `xvlog`
Yosys
Using `ysoys -Q -T -p 'read_verilog'`
By default, both 'verilog' and 'systemverilog' filetypes are checked.
You can limit 'systemverilog' files to be checked using only 'verilator' by
@ -114,5 +117,26 @@ g:ale_verilog_xvlog_options *g:ale_verilog_xvlog_options*
This variable can be changed to modify the flags/options passed to 'xvlog'.
===============================================================================
yosys *ale-verilog-yosys*
g:ale_verilog_yosys_executable *g:ale_verilog_yosys_executable*
*b:ale_verilog_yosys_executable*
Type: |String|
Default: `'yosys'`
This variable can be changed to the path to the 'yosys' executable.
g:ale_verilog_yosys_options *g:ale_verilog_yosys_options*
*b:ale_verilog_yosys_options*
Type: |String|
Default: `'-Q -T -p ''read_verilog %s'''`
This variable can be changed to modify the flags/options passed to 'yosys'.
By default, Yosys is an interative program. To obtain linting functionality,
the `'read_verilog'` command is used.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -651,9 +651,9 @@ problem will be displayed in a balloon instead of hover information.
Hover information can be displayed in the preview window instead by setting
|g:ale_hover_to_preview| to `1`.
When using Neovim, if |g:ale_hover_to_floating_preview| or |g:ale_floating_preview|
is set to 1, the hover information will show in a floating window. And
|g:ale_floating_window_border| for the border setting.
When using Neovim or Vim with |popupwin|, if |g:ale_hover_to_floating_preview|
or |g:ale_floating_preview| is set to 1, the hover information will show in a
floating window. And |g:ale_floating_window_border| for the border setting.
For Vim 8.1+ terminals, mouse hovering is disabled by default. Enabling
|balloonexpr| commands in terminals can cause scrolling issues in terminals,
@ -968,8 +968,8 @@ g:ale_detail_to_floating_preview *g:ale_detail_to_floating_preview*
Type: |Number|
Default: `0`
When this option is set to `1`, Neovim will use a floating window for
ALEDetail output.
When this option is set to `1`, Neovim or Vim with |popupwin| will use a
floating window for ALEDetail output.
g:ale_disable_lsp *g:ale_disable_lsp*
@ -1200,7 +1200,8 @@ g:ale_floating_preview *g:ale_floating_preview*
Type: |Number|
Default: `0`
When set to `1`, Neovim will use a floating window for ale's preview window.
When set to `1`, Neovim or Vim with |popupwin| will use a floating window
for ale's preview window.
This is equivalent to setting |g:ale_hover_to_floating_preview| and
|g:ale_detail_to_floating_preview| to `1`.
@ -1281,7 +1282,8 @@ g:ale_hover_to_floating_preview *g:ale_hover_to_floating_preview*
Type: |Number|
Default: `0`
If set to `1`, Neovim will use floating windows for hover messages.
If set to `1`, Neovim or Vim with |popupwin| will use floating windows for
hover messages.
g:ale_keep_list_window_open *g:ale_keep_list_window_open*
@ -2698,6 +2700,8 @@ documented in additional help files.
dafny.................................|ale-dafny-dafny|
dart....................................|ale-dart-options|
analysis_server.......................|ale-dart-analysis_server|
dart-analyze..........................|ale-dart-analyze|
dart-format...........................|ale-dart-format|
dartanalyzer..........................|ale-dart-dartanalyzer|
dartfmt...............................|ale-dart-dartfmt|
desktop.................................|ale-desktop-options|
@ -2840,6 +2844,7 @@ documented in additional help files.
llvm....................................|ale-llvm-options|
llc...................................|ale-llvm-llc|
lua.....................................|ale-lua-options|
lua-format............................|ale-lua-lua-format|
luac..................................|ale-lua-luac|
luacheck..............................|ale-lua-luacheck|
luafmt................................|ale-lua-luafmt|
@ -2932,6 +2937,7 @@ documented in additional help files.
pyrex (cython)..........................|ale-pyrex-options|
cython................................|ale-pyrex-cython|
python..................................|ale-python-options|
autoflake.............................|ale-python-autoflake|
autoimport............................|ale-python-autoimport|
autopep8..............................|ale-python-autopep8|
bandit................................|ale-python-bandit|
@ -2945,7 +2951,7 @@ documented in additional help files.
pyflakes..............................|ale-python-pyflakes|
pylama................................|ale-python-pylama|
pylint................................|ale-python-pylint|
pyls..................................|ale-python-pyls|
pylsp.................................|ale-python-pylsp|
pyre..................................|ale-python-pyre|
pyright...............................|ale-python-pyright|
reorder-python-imports................|ale-python-reorder_python_imports|
@ -3066,6 +3072,7 @@ documented in additional help files.
verilator.............................|ale-verilog-verilator|
vlog..................................|ale-verilog-vlog|
xvlog.................................|ale-verilog-xvlog|
yosys.................................|ale-verilog-yosys|
vhdl....................................|ale-vhdl-options|
ghdl..................................|ale-vhdl-ghdl|
hdl-checker...........................|ale-vhdl-hdl-checker|
@ -3104,7 +3111,7 @@ ALEComplete *ALEComplete*
Manually trigger LSP autocomplete and show the menu. Works only when called
from insert mode. >
inoremap <silent> <C-Space> <C-\><C-O>:AleComplete<CR>
inoremap <silent> <C-Space> <C-\><C-O>:ALEComplete<CR>
<
A plug mapping `<Plug>(ale_complete)` is defined for this command. >

View File

@ -172,9 +172,15 @@ let g:ale_completion_enabled = get(g:, 'ale_completion_enabled', 0)
" Enable automatic detection of pipenv for Python linters.
let g:ale_python_auto_pipenv = get(g:, 'ale_python_auto_pipenv', 0)
" Enable automatic detection of poetry for Python linters.
let g:ale_python_auto_poetry = get(g:, 'ale_python_auto_poetry', 0)
" This variable can be overridden to set the GO111MODULE environment variable.
let g:ale_go_go111module = get(g:, 'ale_go_go111module', '')
" Default executable for deno, needed set before plugin start
let g:ale_deno_executable = get(g:, 'ale_deno_executable', 'deno')
" If 1, enable a popup menu for commands.
let g:ale_popup_menu_enabled = get(g:, 'ale_popup_menu_enabled', has('gui_running'))

View File

@ -133,6 +133,8 @@ formatting.
* [dafny](https://rise4fun.com/Dafny) :floppy_disk:
* Dart
* [analysis_server](https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server)
* [dart-analyze](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) :floppy_disk:
* [dart-format](https://github.com/dart-lang/sdk/tree/master/utils/dartfmt)
* [dartanalyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) :floppy_disk:
* [dartfmt](https://github.com/dart-lang/sdk/tree/master/utils/dartfmt)
* [language_server](https://github.com/natebosch/dart_language_server)
@ -294,6 +296,7 @@ formatting.
* LLVM
* [llc](https://llvm.org/docs/CommandGuide/llc.html)
* Lua
* [lua-format](https://github.com/Koihik/LuaFormatter)
* [luac](https://www.lua.org/manual/5.1/luac.html)
* [luacheck](https://github.com/mpeterv/luacheck)
* [luafmt](https://github.com/trixnz/lua-fmt)
@ -407,6 +410,7 @@ formatting.
* [purescript-language-server](https://github.com/nwolverson/purescript-language-server)
* [purty](https://gitlab.com/joneshf/purty)
* Python
* [autoflake](https://github.com/myint/autoflake)
* [autoimport](https://lyz-code.github.io/autoimport/)
* [autopep8](https://github.com/hhatto/autopep8)
* [bandit](https://github.com/PyCQA/bandit) :warning:
@ -420,7 +424,7 @@ formatting.
* [pyflakes](https://github.com/PyCQA/pyflakes)
* [pylama](https://github.com/klen/pylama) :floppy_disk:
* [pylint](https://www.pylint.org/) :floppy_disk:
* [pyls](https://github.com/palantir/python-language-server) :warning:
* [pylsp](https://github.com/python-lsp/python-lsp-server) :warning:
* [pyre](https://github.com/facebook/pyre-check) :warning:
* [pyright](https://github.com/microsoft/pyright)
* [reorder-python-imports](https://github.com/asottile/reorder_python_imports)
@ -434,6 +438,7 @@ formatting.
* [lintr](https://github.com/jimhester/lintr)
* [styler](https://github.com/r-lib/styler)
* Racket
* [racket-langserver](https://github.com/jeapostrophe/racket-langserver/tree/master)
* [raco](https://docs.racket-lang.org/raco/)
* Re:VIEW
* [redpen](http://redpen.cc/)
@ -558,6 +563,7 @@ formatting.
* [verilator](http://www.veripool.org/projects/verilator/wiki/Intro)
* [vlog](https://www.mentor.com/products/fv/questa/)
* [xvlog](https://www.xilinx.com/products/design-tools/vivado.html)
* [yosys](http://www.clifford.at/yosys/)
* VHDL
* [ghdl](https://github.com/ghdl/ghdl)
* [vcom](https://www.mentor.com/products/fv/questa/)