1
0
Fork 0
mirror of synced 2024-11-24 01:35:35 -05:00

Updated plugins

This commit is contained in:
Amir 2024-10-06 10:25:50 +02:00
parent ee7e062909
commit 46294d589d
202 changed files with 306918 additions and 203617 deletions

View file

@ -0,0 +1,11 @@
" Author: Hyuksang Kwon <gwonhyuksang@gmail.com>
" Description: eslint for astro files
call ale#linter#Define('astro', {
\ 'name': 'eslint',
\ 'output_stream': 'both',
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
\ 'cwd': function('ale#handlers#eslint#GetCwd'),
\ 'command': function('ale#handlers#eslint#GetCommand'),
\ 'callback': 'ale#handlers#eslint#HandleJSON',
\})

View file

@ -15,7 +15,7 @@ function! ale_linters#cmake#cmake_lint#Command(buffer) abort
let l:executable = ale_linters#cmake#cmake_lint#Executable(a:buffer) let l:executable = ale_linters#cmake#cmake_lint#Executable(a:buffer)
let l:options = ale#Var(a:buffer, 'cmake_cmake_lint_options') let l:options = ale#Var(a:buffer, 'cmake_cmake_lint_options')
return ale#Escape(l:executable) . ' ' . l:options . ' %t' return ale#Escape(l:executable) . ' ' . l:options . ' %s'
endfunction endfunction
function! ale_linters#cmake#cmake_lint#Handle(buffer, lines) abort function! ale_linters#cmake#cmake_lint#Handle(buffer, lines) abort

View file

@ -11,6 +11,7 @@ endfunction
call ale#linter#Define('css', { call ale#linter#Define('css', {
\ 'name': 'stylelint', \ 'name': 'stylelint',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#path#FindExecutable(b, 'css_stylelint', [ \ 'executable': {b -> ale#path#FindExecutable(b, 'css_stylelint', [
\ 'node_modules/.bin/stylelint', \ 'node_modules/.bin/stylelint',
\ ])}, \ ])},

View file

@ -1,6 +1,7 @@
" Author: Nelson Yeung <nelsyeung@gmail.com> " Author: Nelson Yeung <nelsyeung@gmail.com>
" Description: Check Dart files with dart analysis server LSP " Description: Check Dart files with dart analysis server LSP
call ale#Set('dart_analysis_server_enable_language_server', 1)
call ale#Set('dart_analysis_server_executable', 'dart') call ale#Set('dart_analysis_server_executable', 'dart')
function! ale_linters#dart#analysis_server#GetProjectRoot(buffer) abort function! ale_linters#dart#analysis_server#GetProjectRoot(buffer) abort
@ -12,12 +13,19 @@ function! ale_linters#dart#analysis_server#GetProjectRoot(buffer) abort
endfunction endfunction
function! ale_linters#dart#analysis_server#GetCommand(buffer) abort function! ale_linters#dart#analysis_server#GetCommand(buffer) abort
let l:language_server = ale#Var(a:buffer, 'dart_analysis_server_enable_language_server')
let l:executable = ale#Var(a:buffer, 'dart_analysis_server_executable') let l:executable = ale#Var(a:buffer, 'dart_analysis_server_executable')
let l:dart = resolve(exepath(l:executable)) let l:dart = resolve(exepath(l:executable))
let l:output = '%e '
return '%e '
\ . fnamemodify(l:dart, ':h') . '/snapshots/analysis_server.dart.snapshot' \ . fnamemodify(l:dart, ':h') . '/snapshots/analysis_server.dart.snapshot'
\ . ' --lsp' \ . ' --lsp'
" Enable new language-server command
if l:language_server == 1
let l:output = '%e language-server --protocol=lsp'
endif
return l:output
endfunction endfunction
call ale#linter#Define('dart', { call ale#linter#Define('dart', {

View file

@ -16,7 +16,7 @@ function! ale_linters#elm#ls#GetProjectRoot(buffer) abort
return !empty(l:elm_json) ? fnamemodify(l:elm_json, ':p:h') : '' return !empty(l:elm_json) ? fnamemodify(l:elm_json, ':p:h') : ''
endfunction endfunction
function! ale_linters#elm#ls#GetOptions(buffer) abort function! ale_linters#elm#ls#GetInitializationOptions(buffer) abort
return { return {
\ 'elmPath': ale#Var(a:buffer, 'elm_ls_elm_path'), \ 'elmPath': ale#Var(a:buffer, 'elm_ls_elm_path'),
\ 'elmFormatPath': ale#Var(a:buffer, 'elm_ls_elm_format_path'), \ 'elmFormatPath': ale#Var(a:buffer, 'elm_ls_elm_format_path'),
@ -37,5 +37,5 @@ call ale#linter#Define('elm', {
\ 'command': '%e --stdio', \ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#elm#ls#GetProjectRoot'), \ 'project_root': function('ale_linters#elm#ls#GetProjectRoot'),
\ 'language': 'elm', \ 'language': 'elm',
\ 'initialization_options': function('elm_ls#GetOptions') \ 'initialization_options': function('ale_linters#elm#ls#GetInitializationOptions')
\}) \})

View file

@ -26,9 +26,27 @@ function! s:AbbreviateMessage(text) abort
endfunction endfunction
function! s:GetCommand(buffer) abort function! s:GetCommand(buffer) abort
let l:file = ale#Escape(expand('#' . a:buffer . ':.')) let l:cwd = s:GetCwd(a:buffer)
return '%e rock --output-format=parsable ' . l:file let l:file = !empty(l:cwd)
\ ? expand('#' . a:buffer . ':p')[len(l:cwd) + 1:]
\ : expand('#' . a:buffer . ':.')
return '%e rock --output-format=parsable ' . ale#Escape(l:file)
endfunction
function! s:GetCwd(buffer) abort
let l:markers = ['elvis.config', 'rebar.lock', 'erlang.mk']
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
for l:marker in l:markers
if filereadable(l:path . '/' . l:marker)
return l:path
endif
endfor
endfor
return ''
endfunction endfunction
call ale#linter#Define('erlang', { call ale#linter#Define('erlang', {
@ -36,5 +54,6 @@ call ale#linter#Define('erlang', {
\ 'callback': 'ale_linters#erlang#elvis#Handle', \ 'callback': 'ale_linters#erlang#elvis#Handle',
\ 'executable': {b -> ale#Var(b, 'erlang_elvis_executable')}, \ 'executable': {b -> ale#Var(b, 'erlang_elvis_executable')},
\ 'command': function('s:GetCommand'), \ 'command': function('s:GetCommand'),
\ 'cwd': function('s:GetCwd'),
\ 'lint_file': 1, \ 'lint_file': 1,
\}) \})

View file

@ -21,7 +21,14 @@ function! s:GetCommand(buffer) abort
endfunction endfunction
function! s:FindProjectRoot(buffer) abort function! s:FindProjectRoot(buffer) abort
let l:markers = ['_build/', 'erlang_ls.config', 'rebar.lock'] let l:markers = [
\ '_checkouts/',
\ '_build/',
\ 'deps/',
\ 'erlang_ls.config',
\ 'rebar.lock',
\ 'erlang.mk',
\]
" This is a way to find Erlang/OTP root (the one that is managed " This is a way to find Erlang/OTP root (the one that is managed
" by kerl or asdf). Useful if :ALEGoToDefinition takes us there. " by kerl or asdf). Useful if :ALEGoToDefinition takes us there.

View file

@ -3,29 +3,13 @@
call ale#Set('erlang_syntaxerl_executable', 'syntaxerl') call ale#Set('erlang_syntaxerl_executable', 'syntaxerl')
function! ale_linters#erlang#syntaxerl#RunHelpCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'erlang_syntaxerl_executable')
return ale#command#Run(
\ a:buffer,
\ ale#Escape(l:executable) . ' -h',
\ function('ale_linters#erlang#syntaxerl#GetCommand'),
\)
endfunction
function! ale_linters#erlang#syntaxerl#GetCommand(buffer, output, meta) abort
let l:use_b_option = match(a:output, '\C\V-b, --base\>') > -1
return '%e' . (l:use_b_option ? ' -b %s %t' : ' %t')
endfunction
function! ale_linters#erlang#syntaxerl#Handle(buffer, lines) abort function! ale_linters#erlang#syntaxerl#Handle(buffer, lines) abort
let l:pattern = '\v\C:(\d+):( warning:)? (.+)' let l:pattern = '\v\C:(\d+):( warning:)? (.+)'
let l:loclist = [] let l:loclist = []
for l:match in ale#util#GetMatches(a:lines, l:pattern) for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:loclist, { call add(l:loclist, {
\ 'lnum': l:match[1] + 0, \ 'lnum': str2nr(l:match[1]),
\ 'text': l:match[3], \ 'text': l:match[3],
\ 'type': empty(l:match[2]) ? 'E' : 'W', \ 'type': empty(l:match[2]) ? 'E' : 'W',
\}) \})
@ -34,9 +18,27 @@ function! ale_linters#erlang#syntaxerl#Handle(buffer, lines) abort
return l:loclist return l:loclist
endfunction endfunction
function! s:GetExecutable(buffer) abort
return ale#Var(a:buffer, 'erlang_syntaxerl_executable')
endfunction
function! s:GetCommand(buffer) abort
let l:Callback = function('s:GetCommandFromHelpOutput')
return ale#command#Run(a:buffer, '%e -h', l:Callback, {
\ 'executable': s:GetExecutable(a:buffer),
\})
endfunction
function! s:GetCommandFromHelpOutput(buffer, output, metadata) abort
let l:has_b_option = match(a:output, '\V\C-b, --base\>') > -1
return l:has_b_option ? '%e -b %s %t' : '%e %t'
endfunction
call ale#linter#Define('erlang', { call ale#linter#Define('erlang', {
\ 'name': 'syntaxerl', \ 'name': 'syntaxerl',
\ 'executable': {b -> ale#Var(b, 'erlang_syntaxerl_executable')},
\ 'command': {b -> ale_linters#erlang#syntaxerl#RunHelpCommand(b)},
\ 'callback': 'ale_linters#erlang#syntaxerl#Handle', \ 'callback': 'ale_linters#erlang#syntaxerl#Handle',
\ 'executable': function('s:GetExecutable'),
\ 'command': function('s:GetCommand'),
\}) \})

View file

@ -0,0 +1,6 @@
" Author: Sam Saffron <sam.saffron@gmail.com>
" Description: Ember-template-lint for checking GJS (Glimmer JS) files
scriptencoding utf-8
call ale#handlers#embertemplatelint#DefineLinter('glimmer')

View file

@ -3,7 +3,7 @@
call ale#Set('go_golangci_lint_options', '') call ale#Set('go_golangci_lint_options', '')
call ale#Set('go_golangci_lint_executable', 'golangci-lint') call ale#Set('go_golangci_lint_executable', 'golangci-lint')
call ale#Set('go_golangci_lint_package', 0) call ale#Set('go_golangci_lint_package', 1)
function! ale_linters#go#golangci_lint#GetCommand(buffer) abort function! ale_linters#go#golangci_lint#GetCommand(buffer) abort
let l:filename = expand('#' . a:buffer . ':t') let l:filename = expand('#' . a:buffer . ':t')

View file

@ -1,62 +1,6 @@
" Author: Adrian Zalewski <aazalewski@hotmail.com> " Author: Adrian Zalewski <aazalewski@hotmail.com>
" Description: Ember-template-lint for checking Handlebars files " Description: Ember-template-lint for checking Handlebars files
call ale#Set('handlebars_embertemplatelint_executable', 'ember-template-lint') scriptencoding utf-8
call ale#Set('handlebars_embertemplatelint_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#handlebars#embertemplatelint#GetExecutable(buffer) abort call ale#handlers#embertemplatelint#DefineLinter('handlebars')
return ale#path#FindExecutable(a:buffer, 'handlebars_embertemplatelint', [
\ 'node_modules/.bin/ember-template-lint',
\])
endfunction
function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer, version) abort
if ale#semver#GTE(a:version, [4, 0, 0])
" --json was removed in favor of --format=json in ember-template-lint@4.0.0
return '%e --format=json --filename %s'
endif
return '%e --json --filename %s'
endfunction
function! ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck(buffer) abort
return ale#semver#RunWithVersionCheck(
\ a:buffer,
\ ale_linters#handlebars#embertemplatelint#GetExecutable(a:buffer),
\ '%e --version',
\ function('ale_linters#handlebars#embertemplatelint#GetCommand'),
\)
endfunction
function! ale_linters#handlebars#embertemplatelint#Handle(buffer, lines) abort
let l:output = []
let l:json = ale#util#FuzzyJSONDecode(a:lines, {})
for l:error in get(values(l:json), 0, [])
if has_key(l:error, 'fatal')
call add(l:output, {
\ 'lnum': get(l:error, 'line', 1),
\ 'col': get(l:error, 'column', 1),
\ 'text': l:error.message,
\ 'type': l:error.severity == 1 ? 'W' : 'E',
\})
else
call add(l:output, {
\ 'lnum': l:error.line,
\ 'col': l:error.column,
\ 'text': l:error.rule . ': ' . l:error.message,
\ 'type': l:error.severity == 1 ? 'W' : 'E',
\})
endif
endfor
return l:output
endfunction
call ale#linter#Define('handlebars', {
\ 'name': 'embertemplatelint',
\ 'aliases': ['ember-template-lint'],
\ 'executable': function('ale_linters#handlebars#embertemplatelint#GetExecutable'),
\ 'command': function('ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck'),
\ 'callback': 'ale_linters#handlebars#embertemplatelint#Handle',
\})

View file

@ -21,6 +21,7 @@ endfunction
call ale#linter#Define('html', { call ale#linter#Define('html', {
\ 'name': 'stylelint', \ 'name': 'stylelint',
\ 'output_stream': 'both',
\ 'executable': function('ale_linters#html#stylelint#GetExecutable'), \ 'executable': function('ale_linters#html#stylelint#GetExecutable'),
\ 'command': function('ale_linters#html#stylelint#GetCommand'), \ 'command': function('ale_linters#html#stylelint#GetCommand'),
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat', \ 'callback': 'ale#handlers#css#HandleStyleLintFormat',

View file

@ -0,0 +1,69 @@
" Description: Hurl linter using hurlfmt --check.
" https://hurl.dev/
call ale#Set('hurl_hurlfmt_executable', 'hurlfmt')
function! ale_linters#hurl#hurlfmt#GetCommand(buffer) abort
return '%e'
\ . ' --check --no-color '
endfunction
function! ale_linters#hurl#hurlfmt#HandleOutput(buffer, lines) abort
" Matches patterns:
"
" error: Parsing space
" --> test.hurl:11:48
" |
" 8 | header "Content-Type"= "application/json; charset=utf-8"
" | ^ expecting a space
" |
"
" error: Parsing URL
" --> test.hurl:11:48
" |
" 11 | PUT https://jsonplaceholder.typicode.com/posts/{post_id}}
" | ^ illegal character <{>
" |
"
" Note: hurlfmt seems to report always the first error only so we assume
" there is only one error to make parsing easier.
let l:output = []
if empty(a:lines)
return l:output
endif
let l:pattern = '\v(error|warning): (.+) --\> (.+):(\d+):(\d+) .+ \^ (.+) |'
let l:lines = join(a:lines, ' ')
for l:match in ale#util#GetMatches(l:lines, l:pattern)
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'lnum': match[4] + 0,
\ 'col': match[5] + 0,
\ 'end_col': match[5] + 0,
\ 'text': match[2] . ' : ' . match[6],
\ 'type': (match[1] is# 'error') ? 'E' : 'W'
\})
endfor
return l:output
endfunction
function! ale_linters#hurl#hurlfmt#GetType(severity) abort
if a:severity is? 'convention'
\|| a:severity is? 'warning'
\|| a:severity is? 'refactor'
return 'W'
endif
return 'E'
endfunction
call ale#linter#Define('hurl', {
\ 'name': 'hurlfmt',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'hurl_hurlfmt_executable')},
\ 'command': function('ale_linters#hurl#hurlfmt#GetCommand'),
\ 'callback': 'ale_linters#hurl#hurlfmt#HandleOutput',
\})

View file

@ -0,0 +1,11 @@
" Author: Filip Gospodinov <f@gospodinov.ch>
" Description: biome for JavaScript files
call ale#linter#Define('javascript', {
\ 'name': 'biome',
\ 'lsp': 'stdio',
\ 'language': function('ale#handlers#biome#GetLanguage'),
\ 'executable': function('ale#handlers#biome#GetExecutable'),
\ 'command': '%e lsp-proxy',
\ 'project_root': function('ale#handlers#biome#GetProjectRoot'),
\})

View file

@ -0,0 +1,10 @@
" Description: biome for json files
call ale#linter#Define('json', {
\ 'name': 'biome',
\ 'lsp': 'stdio',
\ 'language': function('ale#handlers#biome#GetLanguage'),
\ 'executable': function('ale#handlers#biome#GetExecutable'),
\ 'command': '%e lsp-proxy',
\ 'project_root': function('ale#handlers#biome#GetProjectRoot'),
\})

View file

@ -0,0 +1,10 @@
" Description: biome for jsonc files
call ale#linter#Define('jsonc', {
\ 'name': 'biome',
\ 'lsp': 'stdio',
\ 'language': function('ale#handlers#biome#GetLanguage'),
\ 'executable': function('ale#handlers#biome#GetExecutable'),
\ 'command': '%e lsp-proxy',
\ 'project_root': function('ale#handlers#biome#GetProjectRoot'),
\})

View file

@ -12,6 +12,7 @@ endfunction
call ale#linter#Define('less', { call ale#linter#Define('less', {
\ 'name': 'stylelint', \ 'name': 'stylelint',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#path#FindExecutable(b, 'less_stylelint', [ \ 'executable': {b -> ale#path#FindExecutable(b, 'less_stylelint', [
\ 'node_modules/.bin/stylelint', \ 'node_modules/.bin/stylelint',
\ ])}, \ ])},

View file

@ -0,0 +1,19 @@
" Author: Benjamin Block <https://github.com/benjamindblock>
" Description: A language server for Odin.
function! ale_linters#odin#ols#GetProjectRoot(buffer) abort
return fnamemodify('', ':h')
endfunction
call ale#Set('odin_ols_executable', 'ols')
call ale#Set('odin_ols_config', {})
call ale#linter#Define('odin', {
\ 'name': 'ols',
\ 'lsp': 'stdio',
\ 'language': 'odin',
\ 'lsp_config': {b -> ale#Var(b, 'odin_ols_config')},
\ 'executable': {b -> ale#Var(b, 'odin_ols_executable')},
\ 'command': '%e',
\ 'project_root': function('ale_linters#odin#ols#GetProjectRoot'),
\})

View file

@ -57,12 +57,14 @@ function! ale_linters#php#phpstan#Handle(buffer, lines) abort
return l:output return l:output
endif endif
for l:err in l:res.files[expand('#' . a:buffer .':p')].messages for l:key in keys(l:res.files)
call add(l:output, { for l:err in l:res.files[l:key].messages
\ 'lnum': l:err.line, call add(l:output, {
\ 'text': l:err.message, \ 'lnum': l:err.line,
\ 'type': 'E', \ 'text': l:err.message,
\}) \ 'type': 'E',
\})
endfor
endfor endfor
return l:output return l:output

View file

@ -7,6 +7,7 @@ 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_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_bandit_auto_pipenv', 0) call ale#Set('python_bandit_auto_pipenv', 0)
call ale#Set('python_bandit_auto_poetry', 0) call ale#Set('python_bandit_auto_poetry', 0)
call ale#Set('python_bandit_auto_uv', 0)
function! ale_linters#python#bandit#GetExecutable(buffer) abort function! ale_linters#python#bandit#GetExecutable(buffer) abort
if ( if (
@ -23,6 +24,11 @@ function! ale_linters#python#bandit#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_bandit_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_bandit', ['bandit']) return ale#python#FindExecutable(a:buffer, 'python_bandit', ['bandit'])
endfunction endfunction
@ -39,7 +45,7 @@ function! ale_linters#python#bandit#GetCommand(buffer) abort
endif endif
endif endif
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run bandit' \ ? ' run bandit'
\ : '' \ : ''

View file

@ -7,6 +7,7 @@ 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_change_directory', 'project')
call ale#Set('python_flake8_auto_pipenv', 0) call ale#Set('python_flake8_auto_pipenv', 0)
call ale#Set('python_flake8_auto_poetry', 0) call ale#Set('python_flake8_auto_poetry', 0)
call ale#Set('python_flake8_auto_uv', 0)
function! s:UsingModule(buffer) abort function! s:UsingModule(buffer) abort
return ale#Var(a:buffer, 'python_flake8_options') =~# ' *-m flake8' return ale#Var(a:buffer, 'python_flake8_options') =~# ' *-m flake8'
@ -23,6 +24,11 @@ function! ale_linters#python#flake8#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_flake8_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
if !s:UsingModule(a:buffer) if !s:UsingModule(a:buffer)
return ale#python#FindExecutable(a:buffer, 'python_flake8', ['flake8']) return ale#python#FindExecutable(a:buffer, 'python_flake8', ['flake8'])
endif endif
@ -68,7 +74,7 @@ endfunction
function! ale_linters#python#flake8#GetCommand(buffer, version) abort function! ale_linters#python#flake8#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#flake8#GetExecutable(a:buffer) let l:executable = ale_linters#python#flake8#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run flake8' \ ? ' run flake8'
\ : '' \ : ''

View file

@ -7,6 +7,7 @@ call ale#Set('python_flakehell_use_global', get(g:, 'ale_use_global_executables'
call ale#Set('python_flakehell_change_directory', 'project') call ale#Set('python_flakehell_change_directory', 'project')
call ale#Set('python_flakehell_auto_pipenv', 0) call ale#Set('python_flakehell_auto_pipenv', 0)
call ale#Set('python_flakehell_auto_poetry', 0) call ale#Set('python_flakehell_auto_poetry', 0)
call ale#Set('python_flakehell_auto_uv', 0)
function! s:UsingModule(buffer) abort function! s:UsingModule(buffer) abort
return ale#Var(a:buffer, 'python_flakehell_executable') is? 'python' return ale#Var(a:buffer, 'python_flakehell_executable') is? 'python'
@ -23,6 +24,11 @@ function! ale_linters#python#flakehell#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_flakehell_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
if !s:UsingModule(a:buffer) if !s:UsingModule(a:buffer)
return ale#python#FindExecutable(a:buffer, 'python_flakehell', ['flakehell']) return ale#python#FindExecutable(a:buffer, 'python_flakehell', ['flakehell'])
endif endif
@ -68,7 +74,7 @@ endfunction
function! ale_linters#python#flakehell#GetCommand(buffer, version) abort function! ale_linters#python#flakehell#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#flakehell#GetExecutable(a:buffer) let l:executable = ale_linters#python#flakehell#GetExecutable(a:buffer)
if (l:executable =~? 'pipenv\|poetry$') if (l:executable =~? 'pipenv\|poetry\|uv$')
let l:exec_args = ' run flakehell' let l:exec_args = ' run flakehell'
elseif (l:executable is? 'python') elseif (l:executable is? 'python')
let l:exec_args = ' -m flakehell' let l:exec_args = ' -m flakehell'

View file

@ -4,6 +4,8 @@
call ale#Set('python_jedils_executable', '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_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_jedils_auto_pipenv', 0) call ale#Set('python_jedils_auto_pipenv', 0)
call ale#Set('python_jedils_auto_poetry', 0)
call ale#Set('python_jedils_auto_uv', 0)
function! ale_linters#python#jedils#GetExecutable(buffer) abort function! ale_linters#python#jedils#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_jedils_auto_pipenv')) if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_jedils_auto_pipenv'))
@ -11,12 +13,22 @@ function! ale_linters#python#jedils#GetExecutable(buffer) abort
return 'pipenv' return 'pipenv'
endif endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_jedils_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_jedils_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_jedils', ['jedi-language-server']) return ale#python#FindExecutable(a:buffer, 'python_jedils', ['jedi-language-server'])
endfunction endfunction
function! ale_linters#python#jedils#GetCommand(buffer) abort function! ale_linters#python#jedils#GetCommand(buffer) abort
let l:executable = ale_linters#python#jedils#GetExecutable(a:buffer) let l:executable = ale_linters#python#jedils#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run jedi-language-server' \ ? ' run jedi-language-server'
\ : '' \ : ''
let l:env_string = '' let l:env_string = ''

View file

@ -8,6 +8,7 @@ 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_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_mypy_auto_pipenv', 0) call ale#Set('python_mypy_auto_pipenv', 0)
call ale#Set('python_mypy_auto_poetry', 0) call ale#Set('python_mypy_auto_poetry', 0)
call ale#Set('python_mypy_auto_uv', 0)
function! ale_linters#python#mypy#GetExecutable(buffer) abort function! ale_linters#python#mypy#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_mypy_auto_pipenv')) if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_mypy_auto_pipenv'))
@ -20,6 +21,11 @@ function! ale_linters#python#mypy#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_mypy_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_mypy', ['mypy']) return ale#python#FindExecutable(a:buffer, 'python_mypy', ['mypy'])
endfunction endfunction
@ -43,7 +49,7 @@ endfunction
function! ale_linters#python#mypy#GetCommand(buffer) abort function! ale_linters#python#mypy#GetCommand(buffer) abort
let l:executable = ale_linters#python#mypy#GetExecutable(a:buffer) let l:executable = ale_linters#python#mypy#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run mypy' \ ? ' run mypy'
\ : '' \ : ''

View file

@ -3,6 +3,7 @@
call ale#Set('python_prospector_auto_pipenv', 0) call ale#Set('python_prospector_auto_pipenv', 0)
call ale#Set('python_prospector_auto_poetry', 0) call ale#Set('python_prospector_auto_poetry', 0)
call ale#Set('python_prospector_auto_uv', 0)
let g:ale_python_prospector_executable = let g:ale_python_prospector_executable =
\ get(g:, 'ale_python_prospector_executable', 'prospector') \ get(g:, 'ale_python_prospector_executable', 'prospector')
@ -23,13 +24,18 @@ function! ale_linters#python#prospector#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_prospector_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_prospector', ['prospector']) return ale#python#FindExecutable(a:buffer, 'python_prospector', ['prospector'])
endfunction endfunction
function! ale_linters#python#prospector#GetCommand(buffer) abort function! ale_linters#python#prospector#GetCommand(buffer) abort
let l:executable = ale_linters#python#prospector#GetExecutable(a:buffer) let l:executable = ale_linters#python#prospector#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run prospector' \ ? ' run prospector'
\ : '' \ : ''

View file

@ -7,6 +7,7 @@ call ale#Set('python_pycln_use_global', get(g:, 'ale_use_global_executables', 0)
call ale#Set('python_pycln_change_directory', 1) call ale#Set('python_pycln_change_directory', 1)
call ale#Set('python_pycln_auto_pipenv', 0) call ale#Set('python_pycln_auto_pipenv', 0)
call ale#Set('python_pycln_auto_poetry', 0) call ale#Set('python_pycln_auto_poetry', 0)
call ale#Set('python_pycln_auto_uv', 0)
call ale#Set('python_pycln_config_file', '') call ale#Set('python_pycln_config_file', '')
function! ale_linters#python#pycln#GetExecutable(buffer) abort function! ale_linters#python#pycln#GetExecutable(buffer) abort
@ -20,6 +21,11 @@ function! ale_linters#python#pycln#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_pycln_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_pycln', ['pycln']) return ale#python#FindExecutable(a:buffer, 'python_pycln', ['pycln'])
endfunction endfunction
@ -36,7 +42,7 @@ endfunction
function! ale_linters#python#pycln#GetCommand(buffer, version) abort function! ale_linters#python#pycln#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#pycln#GetExecutable(a:buffer) let l:executable = ale_linters#python#pycln#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run pycln' \ ? ' run pycln'
\ : '' \ : ''

View file

@ -6,6 +6,7 @@ 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_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pycodestyle_auto_pipenv', 0) call ale#Set('python_pycodestyle_auto_pipenv', 0)
call ale#Set('python_pycodestyle_auto_poetry', 0) call ale#Set('python_pycodestyle_auto_poetry', 0)
call ale#Set('python_pycodestyle_auto_uv', 0)
function! ale_linters#python#pycodestyle#GetExecutable(buffer) abort function! ale_linters#python#pycodestyle#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pycodestyle_auto_pipenv')) if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pycodestyle_auto_pipenv'))
@ -18,13 +19,18 @@ function! ale_linters#python#pycodestyle#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_pycodestyle_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_pycodestyle', ['pycodestyle']) return ale#python#FindExecutable(a:buffer, 'python_pycodestyle', ['pycodestyle'])
endfunction endfunction
function! ale_linters#python#pycodestyle#GetCommand(buffer) abort function! ale_linters#python#pycodestyle#GetCommand(buffer) abort
let l:executable = ale_linters#python#pycodestyle#GetExecutable(a:buffer) let l:executable = ale_linters#python#pycodestyle#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run pycodestyle' \ ? ' run pycodestyle'
\ : '' \ : ''

View file

@ -6,6 +6,7 @@ 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_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pydocstyle_auto_pipenv', 0) call ale#Set('python_pydocstyle_auto_pipenv', 0)
call ale#Set('python_pydocstyle_auto_poetry', 0) call ale#Set('python_pydocstyle_auto_poetry', 0)
call ale#Set('python_pydocstyle_auto_uv', 0)
function! ale_linters#python#pydocstyle#GetExecutable(buffer) abort function! ale_linters#python#pydocstyle#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pydocstyle_auto_pipenv')) if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pydocstyle_auto_pipenv'))
@ -18,12 +19,17 @@ function! ale_linters#python#pydocstyle#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_pydocstyle_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_pydocstyle', ['pydocstyle']) return ale#python#FindExecutable(a:buffer, 'python_pydocstyle', ['pydocstyle'])
endfunction endfunction
function! ale_linters#python#pydocstyle#GetCommand(buffer) abort function! ale_linters#python#pydocstyle#GetCommand(buffer) abort
let l:executable = ale_linters#python#pydocstyle#GetExecutable(a:buffer) let l:executable = ale_linters#python#pydocstyle#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run pydocstyle' \ ? ' run pydocstyle'
\ : '' \ : ''

View file

@ -5,6 +5,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_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pyflakes_auto_pipenv', 0) call ale#Set('python_pyflakes_auto_pipenv', 0)
call ale#Set('python_pyflakes_auto_poetry', 0) call ale#Set('python_pyflakes_auto_poetry', 0)
call ale#Set('python_pyflakes_auto_uv', 0)
function! ale_linters#python#pyflakes#GetExecutable(buffer) abort function! ale_linters#python#pyflakes#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyflakes_auto_pipenv')) if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyflakes_auto_pipenv'))
@ -17,13 +18,18 @@ function! ale_linters#python#pyflakes#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_pyflakes_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_pyflakes', ['pyflakes']) return ale#python#FindExecutable(a:buffer, 'python_pyflakes', ['pyflakes'])
endfunction endfunction
function! ale_linters#python#pyflakes#GetCommand(buffer) abort function! ale_linters#python#pyflakes#GetCommand(buffer) abort
let l:executable = ale_linters#python#pyflakes#GetExecutable(a:buffer) let l:executable = ale_linters#python#pyflakes#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run pyflakes' \ ? ' run pyflakes'
\ : '' \ : ''

View file

@ -6,6 +6,7 @@ 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_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pylama_auto_pipenv', 0) call ale#Set('python_pylama_auto_pipenv', 0)
call ale#Set('python_pylama_auto_poetry', 0) call ale#Set('python_pylama_auto_poetry', 0)
call ale#Set('python_pylama_auto_uv', 0)
call ale#Set('python_pylama_change_directory', 1) call ale#Set('python_pylama_change_directory', 1)
function! ale_linters#python#pylama#GetExecutable(buffer) abort function! ale_linters#python#pylama#GetExecutable(buffer) abort
@ -19,12 +20,17 @@ function! ale_linters#python#pylama#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_pylama_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_pylama', ['pylama']) return ale#python#FindExecutable(a:buffer, 'python_pylama', ['pylama'])
endfunction endfunction
function! ale_linters#python#pylama#RunWithVersionCheck(buffer) abort function! ale_linters#python#pylama#RunWithVersionCheck(buffer) abort
let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer) let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run pylama' \ ? ' run pylama'
\ : '' \ : ''
@ -53,7 +59,7 @@ endfunction
function! ale_linters#python#pylama#GetCommand(buffer, version) abort function! ale_linters#python#pylama#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer) let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run pylama' \ ? ' run pylama'
\ : '' \ : ''

View file

@ -7,6 +7,7 @@ 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_change_directory', 1)
call ale#Set('python_pylint_auto_pipenv', 0) call ale#Set('python_pylint_auto_pipenv', 0)
call ale#Set('python_pylint_auto_poetry', 0) call ale#Set('python_pylint_auto_poetry', 0)
call ale#Set('python_pylint_auto_uv', 0)
call ale#Set('python_pylint_use_msg_id', 0) call ale#Set('python_pylint_use_msg_id', 0)
function! ale_linters#python#pylint#GetExecutable(buffer) abort function! ale_linters#python#pylint#GetExecutable(buffer) abort
@ -20,6 +21,11 @@ function! ale_linters#python#pylint#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_pylint_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_pylint', ['pylint']) return ale#python#FindExecutable(a:buffer, 'python_pylint', ['pylint'])
endfunction endfunction
@ -38,7 +44,7 @@ endfunction
function! ale_linters#python#pylint#GetCommand(buffer, version) abort function! ale_linters#python#pylint#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#pylint#GetExecutable(a:buffer) let l:executable = ale_linters#python#pylint#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run pylint' \ ? ' run pylint'
\ : '' \ : ''

View file

@ -6,6 +6,7 @@ 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_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pylsp_auto_pipenv', 0) call ale#Set('python_pylsp_auto_pipenv', 0)
call ale#Set('python_pylsp_auto_poetry', 0) call ale#Set('python_pylsp_auto_poetry', 0)
call ale#Set('python_pylsp_auto_uv', 0)
call ale#Set('python_pylsp_config', {}) call ale#Set('python_pylsp_config', {})
function! ale_linters#python#pylsp#GetExecutable(buffer) abort function! ale_linters#python#pylsp#GetExecutable(buffer) abort
@ -19,6 +20,11 @@ function! ale_linters#python#pylsp#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_pylsp_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_pylsp', ['pylsp']) return ale#python#FindExecutable(a:buffer, 'python_pylsp', ['pylsp'])
endfunction endfunction
@ -37,7 +43,7 @@ endfunction
function! ale_linters#python#pylsp#GetCommand(buffer) abort function! ale_linters#python#pylsp#GetCommand(buffer) abort
let l:executable = ale_linters#python#pylsp#GetExecutable(a:buffer) let l:executable = ale_linters#python#pylsp#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run pylsp' \ ? ' run pylsp'
\ : '' \ : ''
let l:env_string = '' let l:env_string = ''

View file

@ -5,6 +5,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_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pyre_auto_pipenv', 0) call ale#Set('python_pyre_auto_pipenv', 0)
call ale#Set('python_pyre_auto_poetry', 0) call ale#Set('python_pyre_auto_poetry', 0)
call ale#Set('python_pyre_auto_uv', 0)
function! ale_linters#python#pyre#GetExecutable(buffer) abort function! ale_linters#python#pyre#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyre_auto_pipenv')) if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyre_auto_pipenv'))
@ -17,12 +18,17 @@ function! ale_linters#python#pyre#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_pyre_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_pyre', ['pyre']) return ale#python#FindExecutable(a:buffer, 'python_pyre', ['pyre'])
endfunction endfunction
function! ale_linters#python#pyre#GetCommand(buffer) abort function! ale_linters#python#pyre#GetCommand(buffer) abort
let l:executable = ale_linters#python#pyre#GetExecutable(a:buffer) let l:executable = ale_linters#python#pyre#GetExecutable(a:buffer)
let l:exec_args = (l:executable =~? 'pipenv\|poetry$' ? ' run pyre' : '') . ' persistent' let l:exec_args = (l:executable =~? 'pipenv\|poetry\|uv$' ? ' run pyre' : '') . ' persistent'
return ale#Escape(l:executable) . l:exec_args return ale#Escape(l:executable) . l:exec_args
endfunction endfunction

View file

@ -3,6 +3,7 @@ call ale#Set('python_pyright_executable', 'pyright-langserver')
call ale#Set('python_pyright_config', {}) call ale#Set('python_pyright_config', {})
call ale#Set('python_pyright_auto_pipenv', 0) call ale#Set('python_pyright_auto_pipenv', 0)
call ale#Set('python_pyright_auto_poetry', 0) call ale#Set('python_pyright_auto_poetry', 0)
call ale#Set('python_pyright_auto_uv', 0)
" Force the cwd of the server to be the same as the project root to " Force the cwd of the server to be the same as the project root to
" fix issues with treating local files matching first or third party library " fix issues with treating local files matching first or third party library
@ -59,12 +60,17 @@ function! ale_linters#python#pyright#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_pyright_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_pyright', ['pyright-langserver']) return ale#python#FindExecutable(a:buffer, 'python_pyright', ['pyright-langserver'])
endfunction endfunction
function! ale_linters#python#pyright#GetCommand(buffer) abort function! ale_linters#python#pyright#GetCommand(buffer) abort
let l:executable = ale_linters#python#pyright#GetExecutable(a:buffer) let l:executable = ale_linters#python#pyright#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run pyright-langserver' \ ? ' run pyright-langserver'
\ : '' \ : ''
let l:env_string = '' let l:env_string = ''

View file

@ -7,6 +7,7 @@ call ale#Set('python_refurb_use_global', get(g:, 'ale_use_global_executables', 0
call ale#Set('python_refurb_change_directory', 1) call ale#Set('python_refurb_change_directory', 1)
call ale#Set('python_refurb_auto_pipenv', 0) call ale#Set('python_refurb_auto_pipenv', 0)
call ale#Set('python_refurb_auto_poetry', 0) call ale#Set('python_refurb_auto_poetry', 0)
call ale#Set('python_refurb_auto_uv', 0)
function! ale_linters#python#refurb#GetExecutable(buffer) abort function! ale_linters#python#refurb#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_refurb_auto_pipenv')) if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_refurb_auto_pipenv'))
@ -19,6 +20,11 @@ function! ale_linters#python#refurb#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_refurb_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_refurb', ['refurb']) return ale#python#FindExecutable(a:buffer, 'python_refurb', ['refurb'])
endfunction endfunction
@ -35,7 +41,7 @@ endfunction
function! ale_linters#python#refurb#GetCommand(buffer) abort function! ale_linters#python#refurb#GetCommand(buffer) abort
let l:executable = ale_linters#python#refurb#GetExecutable(a:buffer) let l:executable = ale_linters#python#refurb#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run refurb' \ ? ' run refurb'
\ : '' \ : ''

View file

@ -7,6 +7,7 @@ call ale#Set('python_ruff_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_ruff_change_directory', 1) call ale#Set('python_ruff_change_directory', 1)
call ale#Set('python_ruff_auto_pipenv', 0) call ale#Set('python_ruff_auto_pipenv', 0)
call ale#Set('python_ruff_auto_poetry', 0) call ale#Set('python_ruff_auto_poetry', 0)
call ale#Set('python_ruff_auto_uv', 0)
call ale#fix#registry#Add('ruff', call ale#fix#registry#Add('ruff',
\ 'ale#fixers#ruff#Fix', \ 'ale#fixers#ruff#Fix',
@ -25,6 +26,11 @@ function! ale_linters#python#ruff#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_ruff_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_ruff', ['ruff']) return ale#python#FindExecutable(a:buffer, 'python_ruff', ['ruff'])
endfunction endfunction
@ -41,13 +47,18 @@ endfunction
function! ale_linters#python#ruff#GetCommand(buffer, version) abort function! ale_linters#python#ruff#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#ruff#GetExecutable(a:buffer) let l:executable = ale_linters#python#ruff#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run ruff' \ ? ' run ruff'
\ : '' \ : ''
" NOTE: ruff version `0.0.69` supports liniting input from stdin " NOTE: ruff 0.3.0 deprecates `ruff <path>` in favor of `ruff check <path>`
let l:exec_args = l:exec_args
\ . (ale#semver#GTE(a:version, [0, 3, 0]) ? ' check' : '')
" NOTE: ruff version `0.0.69` supports linting input from stdin
" NOTE: ruff version `0.1.0` deprecates `--format text` " NOTE: ruff version `0.1.0` deprecates `--format text`
return ale#Escape(l:executable) . l:exec_args . ' -q' return ale#Escape(l:executable) . l:exec_args . ' -q'
\ . ' --no-fix'
\ . ale#Pad(ale#Var(a:buffer, 'python_ruff_options')) \ . ale#Pad(ale#Var(a:buffer, 'python_ruff_options'))
\ . (ale#semver#GTE(a:version, [0, 1, 0]) ? ' --output-format json-lines' : ' --format json-lines') \ . (ale#semver#GTE(a:version, [0, 1, 0]) ? ' --output-format json-lines' : ' --format json-lines')
\ . (ale#semver#GTE(a:version, [0, 0, 69]) ? ' --stdin-filename %s -' : ' %s') \ . (ale#semver#GTE(a:version, [0, 0, 69]) ? ' --stdin-filename %s -' : ' %s')
@ -56,17 +67,25 @@ endfunction
function! ale_linters#python#ruff#Handle(buffer, lines) abort function! ale_linters#python#ruff#Handle(buffer, lines) abort
let l:output = [] let l:output = []
" Read all lines of ruff output and parse use all the valid JSONL lines.
for l:line in a:lines for l:line in a:lines
let l:item = json_decode(l:line) try
call add(l:output, { let l:item = json_decode(l:line)
\ 'lnum': l:item.location.row, catch
\ 'col': l:item.location.column, let l:item = v:null
\ 'end_lnum': l:item.end_location.row, endtry
\ 'end_col': l:item.end_location.column - 1,
\ 'code': l:item.code, if !empty(l:item)
\ 'text': l:item.message, call add(l:output, {
\ 'type': l:item.code =~? '\vE\d+' ? 'E' : 'W', \ 'lnum': l:item.location.row,
\}) \ 'col': l:item.location.column,
\ 'end_lnum': l:item.end_location.row,
\ 'end_col': l:item.end_location.column - 1,
\ 'code': l:item.code,
\ 'text': l:item.message,
\ 'type': l:item.code =~? '\vE\d+' ? 'E' : 'W',
\})
endif
endfor endfor
return l:output return l:output

View file

@ -5,6 +5,7 @@ call ale#Set('python_unimport_options', '')
call ale#Set('python_unimport_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('python_unimport_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_unimport_auto_pipenv', 0) call ale#Set('python_unimport_auto_pipenv', 0)
call ale#Set('python_unimport_auto_poetry', 0) call ale#Set('python_unimport_auto_poetry', 0)
call ale#Set('python_unimport_auto_uv', 0)
function! ale_linters#python#unimport#GetExecutable(buffer) abort function! ale_linters#python#unimport#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_unimport_auto_pipenv')) if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_unimport_auto_pipenv'))
@ -17,12 +18,17 @@ function! ale_linters#python#unimport#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_unimport_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_unimport', ['unimport']) return ale#python#FindExecutable(a:buffer, 'python_unimport', ['unimport'])
endfunction endfunction
function! ale_linters#python#unimport#GetCommand(buffer) abort function! ale_linters#python#unimport#GetCommand(buffer) abort
let l:executable = ale_linters#python#unimport#GetExecutable(a:buffer) let l:executable = ale_linters#python#unimport#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run unimport' \ ? ' run unimport'
\ : '' \ : ''

View file

@ -5,6 +5,9 @@ call ale#Set('python_vulture_executable', 'vulture')
call ale#Set('python_vulture_options', '') call ale#Set('python_vulture_options', '')
call ale#Set('python_vulture_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('python_vulture_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_vulture_change_directory', 1) call ale#Set('python_vulture_change_directory', 1)
call ale#Set('python_vulture_auto_pipenv', 0)
call ale#Set('python_vulture_auto_poetry', 0)
call ale#Set('python_vulture_auto_uv', 0)
" The directory to change to before running vulture " The directory to change to before running vulture
function! s:GetDir(buffer) abort function! s:GetDir(buffer) abort
@ -16,6 +19,21 @@ function! s:GetDir(buffer) abort
endfunction endfunction
function! ale_linters#python#vulture#GetExecutable(buffer) abort function! ale_linters#python#vulture#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_vulture_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_vulture_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_vulture_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_vulture', ['vulture']) return ale#python#FindExecutable(a:buffer, 'python_vulture', ['vulture'])
endfunction endfunction
@ -29,7 +47,7 @@ endfunction
function! ale_linters#python#vulture#GetCommand(buffer) abort function! ale_linters#python#vulture#GetCommand(buffer) abort
let l:executable = ale_linters#python#vulture#GetExecutable(a:buffer) let l:executable = ale_linters#python#vulture#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run vulture' \ ? ' run vulture'
\ : '' \ : ''
let l:lint_dest = ale#Var(a:buffer, 'python_vulture_change_directory') let l:lint_dest = ale#Var(a:buffer, 'python_vulture_change_directory')

View file

@ -0,0 +1,172 @@
call ale#Set('ruby_steep_executable', 'steep')
call ale#Set('ruby_steep_options', '')
" Find the nearest dir containing a Steepfile
function! ale_linters#ruby#steep#FindRoot(buffer) abort
for l:name in ['Steepfile']
let l:dir = fnamemodify(
\ ale#path#FindNearestFile(a:buffer, l:name),
\ ':h'
\)
if l:dir isnot# '.' && isdirectory(l:dir)
return l:dir
endif
endfor
return ''
endfunction
" Rename path relative to root
function! ale_linters#ruby#steep#RelativeToRoot(buffer, path) abort
let l:separator = has('win32') ? '\' : '/'
let l:steep_root = ale_linters#ruby#steep#FindRoot(a:buffer)
" path isn't under root
if l:steep_root is# ''
return ''
endif
let l:steep_root_prefix = l:steep_root . l:separator
" win32 path separators get interpreted by substitute, escape them
if has('win32')
let l:steep_root_pat = substitute(l:steep_root_prefix, '\\', '\\\\', 'g')
else
let l:steep_root_pat = l:steep_root_prefix
endif
return substitute(a:path, l:steep_root_pat, '', '')
endfunction
function! ale_linters#ruby#steep#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'ruby_steep_executable')
" steep check needs to apply some config from the file path so:
" - steep check can't use stdin (no path)
" - steep check can't use %t (path outside of project)
" => we can only use %s
" somehow :ALEInfo shows that ALE still appends '< %t' to the command
" => luckily steep check ignores stdin
" somehow steep has a problem with absolute path to file but a path
" relative to Steepfile directory works:
" see https://github.com/soutaro/steep/pull/975
" => change to Steepfile directory and remove leading path
let l:buffer_filename = fnamemodify(bufname(a:buffer), ':p')
let l:buffer_filename = fnameescape(l:buffer_filename)
let l:relative = ale_linters#ruby#steep#RelativeToRoot(a:buffer, l:buffer_filename)
" if file is not under steep root, steep can't type check
if l:relative is# ''
" don't execute
return ''
endif
return ale#ruby#EscapeExecutable(l:executable, 'steep')
\ . ' check '
\ . ale#Var(a:buffer, 'ruby_steep_options')
\ . ' ' . fnameescape(l:relative)
endfunction
function! ale_linters#ruby#steep#GetType(severity) abort
if a:severity is? 'information'
\|| a:severity is? 'hint'
return 'I'
endif
if a:severity is? 'warning'
return 'W'
endif
return 'E'
endfunction
" Handle output from steep
function! ale_linters#ruby#steep#HandleOutput(buffer, lines) abort
let l:output = []
let l:in = 0
let l:item = {}
for l:line in a:lines
" Look for first line of a message block
" If not in-message (l:in == 0) that's expected
" If in-message (l:in > 0) that's less expected but let's recover
let l:match = matchlist(l:line, '^\([^:]*\):\([0-9]*\):\([0-9]*\): \[\([^]]*\)\] \(.*\)')
if len(l:match) > 0
" Something is lingering: recover by pushing what is there
if len(l:item) > 0
call add(l:output, l:item)
let l:item = {}
endif
let l:filename = l:match[1]
" Steep's reported column is offset by 1 (zero-indexed?)
let l:item = {
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 1,
\ 'type': ale_linters#ruby#steep#GetType(l:match[4]),
\ 'text': l:match[5],
\}
" Done with this line, mark being in-message and go on with next line
let l:in = 1
continue
endif
" We're past the first line of a message block
if l:in > 0
" Look for code in subsequent lines of the message block
if l:line =~# '^│ Diagnostic ID:'
let l:match = matchlist(l:line, '^│ Diagnostic ID: \(.*\)')
if len(l:match) > 0
let l:item.code = l:match[1]
endif
" Done with the line
continue
endif
" Look for last line of the message block
if l:line =~# '^└'
" Done with the line, mark looking for underline and go on with the next line
let l:in = 2
continue
endif
" Look for underline right after last line
if l:in == 2
let l:match = matchlist(l:line, '\([~][~]*\)')
if len(l:match) > 0
let l:item.end_col = l:item['col'] + len(l:match[1]) - 1
endif
call add(l:output, l:item)
" Done with the line, mark looking for first line and go on with the next line
let l:in = 0
let l:item = {}
continue
endif
endif
endfor
return l:output
endfunction
call ale#linter#Define('ruby', {
\ 'name': 'steep',
\ 'executable': {b -> ale#Var(b, 'ruby_steep_executable')},
\ 'language': 'ruby',
\ 'command': function('ale_linters#ruby#steep#GetCommand'),
\ 'project_root': function('ale_linters#ruby#steep#FindRoot'),
\ 'callback': 'ale_linters#ruby#steep#HandleOutput',
\})

View file

@ -5,6 +5,7 @@ call ale#Set('sass_stylelint_use_global', get(g:, 'ale_use_global_executables',
call ale#linter#Define('sass', { call ale#linter#Define('sass', {
\ 'name': 'stylelint', \ 'name': 'stylelint',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#path#FindExecutable(b, 'sass_stylelint', [ \ 'executable': {b -> ale#path#FindExecutable(b, 'sass_stylelint', [
\ 'node_modules/.bin/stylelint', \ 'node_modules/.bin/stylelint',
\ ])}, \ ])},

View file

@ -11,6 +11,7 @@ endfunction
call ale#linter#Define('scss', { call ale#linter#Define('scss', {
\ 'name': 'stylelint', \ 'name': 'stylelint',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#path#FindExecutable(b, 'scss_stylelint', [ \ 'executable': {b -> ale#path#FindExecutable(b, 'scss_stylelint', [
\ 'node_modules/.bin/stylelint', \ 'node_modules/.bin/stylelint',
\ ])}, \ ])},

View file

@ -11,7 +11,7 @@ function! ale_linters#sql#sqlfluff#Executable(buffer) abort
return ale#Var(a:buffer, 'sql_sqlfluff_executable') return ale#Var(a:buffer, 'sql_sqlfluff_executable')
endfunction endfunction
function! ale_linters#sql#sqlfluff#Command(buffer) abort function! ale_linters#sql#sqlfluff#Command(buffer, version) abort
let l:executable = ale_linters#sql#sqlfluff#Executable(a:buffer) let l:executable = ale_linters#sql#sqlfluff#Executable(a:buffer)
let l:options = ale#Var(a:buffer, 'sql_sqlfluff_options') let l:options = ale#Var(a:buffer, 'sql_sqlfluff_options')
@ -35,7 +35,7 @@ function! ale_linters#sql#sqlfluff#Command(buffer) abort
return l:cmd return l:cmd
endfunction endfunction
function! ale_linters#sql#sqlfluff#Handle(buffer, lines) abort function! ale_linters#sql#sqlfluff#Handle(buffer, version, lines) abort
let l:output = [] let l:output = []
let l:json_lines = ale#util#FuzzyJSONDecode(a:lines, []) let l:json_lines = ale#util#FuzzyJSONDecode(a:lines, [])
@ -50,16 +50,31 @@ function! ale_linters#sql#sqlfluff#Handle(buffer, lines) abort
return l:output return l:output
endif endif
for l:violation in get(l:json, 'violations', []) if ale#semver#GTE(a:version, [3, 0, 0])
call add(l:output, { for l:violation in get(l:json, 'violations', [])
\ 'filename': l:json.filepath, call add(l:output, {
\ 'lnum': l:violation.line_no, \ 'filename': l:json.filepath,
\ 'col': l:violation.line_pos, \ 'lnum': l:violation.start_line_no,
\ 'text': l:violation.description, \ 'end_lnum': l:violation.end_line_no,
\ 'code': l:violation.code, \ 'col': l:violation.start_line_pos,
\ 'type': 'W', \ 'end_col': l:violation.end_line_pos,
\}) \ 'text': l:violation.description,
endfor \ 'code': l:violation.code,
\ 'type': 'W',
\})
endfor
else
for l:violation in get(l:json, 'violations', [])
call add(l:output, {
\ 'filename': l:json.filepath,
\ 'lnum': l:violation.line_no,
\ 'col': l:violation.line_pos,
\ 'text': l:violation.description,
\ 'code': l:violation.code,
\ 'type': 'W',
\})
endfor
endif
return l:output return l:output
endfunction endfunction
@ -67,6 +82,19 @@ endfunction
call ale#linter#Define('sql', { call ale#linter#Define('sql', {
\ 'name': 'sqlfluff', \ 'name': 'sqlfluff',
\ 'executable': function('ale_linters#sql#sqlfluff#Executable'), \ 'executable': function('ale_linters#sql#sqlfluff#Executable'),
\ 'command': function('ale_linters#sql#sqlfluff#Command'), \ 'command': {buffer -> ale#semver#RunWithVersionCheck(
\ 'callback': 'ale_linters#sql#sqlfluff#Handle', \ buffer,
\ ale_linters#sql#sqlfluff#Executable(buffer),
\ '%e --version',
\ function('ale_linters#sql#sqlfluff#Command'),
\ )},
\ 'callback': {buffer, lines -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale_linters#sql#sqlfluff#Executable(buffer),
\ '%e --version',
\ {buffer, version -> ale_linters#sql#sqlfluff#Handle(
\ buffer,
\ l:version,
\ lines)},
\ )},
\}) \})

View file

@ -12,6 +12,7 @@ endfunction
call ale#linter#Define('stylus', { call ale#linter#Define('stylus', {
\ 'name': 'stylelint', \ 'name': 'stylelint',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#path#FindExecutable(b, 'stylus_stylelint', [ \ 'executable': {b -> ale#path#FindExecutable(b, 'stylus_stylelint', [
\ 'node_modules/.bin/stylelint', \ 'node_modules/.bin/stylelint',
\ ])}, \ ])},

View file

@ -13,6 +13,7 @@ endfunction
call ale#linter#Define('sugarss', { call ale#linter#Define('sugarss', {
\ 'name': 'stylelint', \ 'name': 'stylelint',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#path#FindExecutable(b, 'sugarss_stylelint', [ \ 'executable': {b -> ale#path#FindExecutable(b, 'sugarss_stylelint', [
\ 'node_modules/.bin/stylelint', \ 'node_modules/.bin/stylelint',
\ ])}, \ ])},

View file

@ -1,29 +1,34 @@
" Author: Andrew Balmos - <andrew@balmos.org> " Author: Andrew Balmos - <andrew@balmos.org>
" Description: chktex for LaTeX files " Description: chktex for LaTeX files
let g:ale_tex_chktex_executable = call ale#Set('tex_chktex_executable', 'chktex')
\ get(g:, 'ale_tex_chktex_executable', 'chktex') call ale#Set('tex_chktex_options', '-I')
let g:ale_tex_chktex_options = function! ale_linters#tex#chktex#GetExecutable(buffer) abort
\ get(g:, 'ale_tex_chktex_options', '-I') return ale#Var(a:buffer, 'tex_chktex_executable')
endfunction
function! ale_linters#tex#chktex#GetCommand(buffer) abort function! ale_linters#tex#chktex#GetCommand(buffer, version) abort
" Check for optional .chktexrc let l:options = ''
let l:chktex_config = ale#path#FindNearestFile(
\ a:buffer,
\ '.chktexrc')
let l:command = ale#Var(a:buffer, 'tex_chktex_executable')
" Avoid bug when used without -p (last warning has gibberish for a filename) " Avoid bug when used without -p (last warning has gibberish for a filename)
let l:command .= ' -v0 -p stdin -q' let l:options .= ' -v0 -p stdin -q'
if !empty(l:chktex_config) " Avoid bug of reporting wrong column when using tabs (issue #723)
let l:command .= ' -l ' . ale#Escape(l:chktex_config) if ale#semver#GTE(a:version, [1, 7, 7])
let l:options .= ' -S TabSize=1'
endif endif
let l:command .= ' ' . ale#Var(a:buffer, 'tex_chktex_options') " Check for optional .chktexrc
let l:chktex_config = ale#path#FindNearestFile(a:buffer, '.chktexrc')
return l:command if !empty(l:chktex_config)
let l:options .= ' -l ' . ale#Escape(l:chktex_config)
endif
let l:options .= ' ' . ale#Var(a:buffer, 'tex_chktex_options')
return '%e' . l:options
endfunction endfunction
function! ale_linters#tex#chktex#Handle(buffer, lines) abort function! ale_linters#tex#chktex#Handle(buffer, lines) abort
@ -48,7 +53,12 @@ endfunction
call ale#linter#Define('tex', { call ale#linter#Define('tex', {
\ 'name': 'chktex', \ 'name': 'chktex',
\ 'executable': 'chktex', \ 'executable': function('ale_linters#tex#chktex#GetExecutable'),
\ 'command': function('ale_linters#tex#chktex#GetCommand'), \ 'command': {buffer -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale_linters#tex#chktex#GetExecutable(buffer),
\ '%e --version',
\ function('ale_linters#tex#chktex#GetCommand'),
\ )},
\ 'callback': 'ale_linters#tex#chktex#Handle' \ 'callback': 'ale_linters#tex#chktex#Handle'
\}) \})

View file

@ -0,0 +1,11 @@
" Author: Filip Gospodinov <f@gospodinov.ch>
" Description: biome for TypeScript files
call ale#linter#Define('typescript', {
\ 'name': 'biome',
\ 'lsp': 'stdio',
\ 'language': function('ale#handlers#biome#GetLanguage'),
\ 'executable': function('ale#handlers#biome#GetExecutable'),
\ 'command': '%e lsp-proxy',
\ 'project_root': function('ale#handlers#biome#GetProjectRoot'),
\})

View file

@ -0,0 +1,53 @@
" Author: Alvin Rolling <alvinrolling@gmail.com>
" Description: slang for verilog files
" Set this option to change Slang lint options
if !exists('g:ale_verilog_slang_options')
let g:ale_verilog_slang_options = ''
endif
" --lint-only
function! ale_linters#verilog#slang#GetCommand(buffer) abort
return 'slang -Weverything '
\ . '-I%s:h '
\ . ale#Var(a:buffer, 'verilog_slang_options') .' '
\ . '%t'
endfunction
function! s:RemoveUnicodeQuotes(text) abort
let l:text = a:text
let l:text = substitute(l:text, '[`´]', '''', 'g')
let l:text = substitute(l:text, '[“”]', '"', 'g')
return l:text
endfunction
function! ale_linters#verilog#slang#Handle(buffer, lines) abort
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+)?:?(\d+)?:? ([^:]+): (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:item = {
\ 'lnum': str2nr(l:match[2]),
\ 'type': (l:match[4] is# 'error') ? 'E' : 'W',
\ 'text': s:RemoveUnicodeQuotes(l:match[5]),
\}
if !empty(l:match[3])
let l:item.col = str2nr(l:match[3])
endif
call add(l:output, l:item)
endfor
return l:output
endfunction
call ale#linter#Define('verilog', {
\ 'name': 'slang',
\ 'output_stream': 'stderr',
\ 'executable': 'slang',
\ 'command': function('ale_linters#verilog#slang#GetCommand'),
\ 'callback': 'ale_linters#verilog#slang#Handle',
\ 'read_buffer': 0,
\})

View file

@ -5,6 +5,11 @@ call ale#Set('yaml_actionlint_executable', 'actionlint')
call ale#Set('yaml_actionlint_options', '') call ale#Set('yaml_actionlint_options', '')
function! ale_linters#yaml#actionlint#GetCommand(buffer) abort function! ale_linters#yaml#actionlint#GetCommand(buffer) abort
" Only execute actionlint on YAML files in /.github/ paths.
if expand('#' . a:buffer . ':p') !~# '\v[/\\]\.github[/\\]'
return ''
endif
let l:options = ale#Var(a:buffer, 'yaml_actionlint_options') let l:options = ale#Var(a:buffer, 'yaml_actionlint_options')
if l:options !~# '-no-color' if l:options !~# '-no-color'
@ -15,21 +20,33 @@ function! ale_linters#yaml#actionlint#GetCommand(buffer) abort
let l:options .= ale#Pad('-oneline') let l:options .= ale#Pad('-oneline')
endif endif
return '%e' . ale#Pad(l:options) return '%e' . ale#Pad(l:options) . ' - '
endfunction endfunction
function! ale_linters#yaml#actionlint#Handle(buffer, lines) abort function! ale_linters#yaml#actionlint#Handle(buffer, lines) abort
" Matches patterns line the following: " Matches patterns line the following:
".github/workflows/main.yml:19:0: could not parse as YAML: yaml: line 19: mapping values are not allowed in this context [yaml-syntax] ".github/workflows/main.yml:19:0: could not parse as YAML: yaml: line 19: mapping values are not allowed in this context [yaml-syntax]
let l:pattern = '\v^.*:(\d+):(\d+): (.+) \[(.+)\]$' let l:pattern = '\v^.{-}:(\d+):(\d+): (.+) \[(.+)\]$'
let l:output = [] let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern) for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:code = l:match[4]
let l:text = l:match[3]
" Handle sub-linter errors like the following:
"validate.yml:19:9: shellcheck reported issue in this script: SC2086:info:1:15: Double quote to prevent globbing and word splitting [shellcheck]
if l:code is# 'shellcheck'
let l:shellcheck_match = matchlist(l:text, '\v^.+: (SC\d{4}):.+:\d+:\d+: (.+)$')
let l:text = l:shellcheck_match[2]
let l:code = 'shellcheck ' . l:shellcheck_match[1]
endif
let l:item = { let l:item = {
\ 'lnum': l:match[1] + 0, \ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0, \ 'col': l:match[2] + 0,
\ 'text': l:match[3], \ 'text': l:text,
\ 'code': l:match[4], \ 'code': l:code,
\ 'type': 'E', \ 'type': 'E',
\} \}

View file

@ -35,22 +35,94 @@ function! ale#definition#UpdateTagStack() abort
endif endif
endfunction endfunction
function! ale#definition#FormatTSServerResponse(response_item, options) abort
if get(a:options, 'open_in') is# 'quickfix'
return {
\ 'filename': a:response_item.file,
\ 'lnum': a:response_item.start.line,
\ 'col': a:response_item.start.offset,
\}
else
return {
\ 'filename': a:response_item.file,
\ 'line': a:response_item.start.line,
\ 'column': a:response_item.start.offset,
\}
endif
endfunction
function! ale#definition#HandleTSServerResponse(conn_id, response) abort function! ale#definition#HandleTSServerResponse(conn_id, response) abort
if has_key(a:response, 'request_seq') if has_key(a:response, 'request_seq')
\&& has_key(s:go_to_definition_map, a:response.request_seq) \&& has_key(s:go_to_definition_map, a:response.request_seq)
let l:options = remove(s:go_to_definition_map, a:response.request_seq) let l:options = remove(s:go_to_definition_map, a:response.request_seq)
if get(a:response, 'success', v:false) is v:true && !empty(a:response.body) if get(a:response, 'success', v:false) is v:true && !empty(a:response.body)
let l:filename = a:response.body[0].file let l:item_list = []
let l:line = a:response.body[0].start.line
let l:column = a:response.body[0].start.offset
call ale#definition#UpdateTagStack() for l:response_item in a:response.body
call ale#util#Open(l:filename, l:line, l:column, l:options) call add(
\ l:item_list,
\ ale#definition#FormatTSServerResponse(l:response_item, l:options)
\)
endfor
if empty(l:item_list)
call ale#util#Execute('echom ''No definitions found''')
elseif len(l:item_list) == 1
let l:filename = l:item_list[0].filename
if get(l:options, 'open_in') is# 'quickfix'
let l:line = l:item_list[0].lnum
let l:column = l:item_list[0].col
else
let l:line = l:item_list[0].line
let l:column = l:item_list[0].column
endif
call ale#definition#UpdateTagStack()
call ale#util#Open(l:filename, l:line, l:column, l:options)
else
if get(l:options, 'open_in') is# 'quickfix'
call setqflist([], 'r')
call setqflist(l:item_list, 'a')
call ale#util#Execute('cc 1')
else
call ale#definition#UpdateTagStack()
call ale#preview#ShowSelection(l:item_list, l:options)
endif
endif
endif endif
endif endif
endfunction endfunction
function! ale#definition#FormatLSPResponse(response_item, options) abort
if has_key(a:response_item, 'targetUri')
" LocationLink items use targetUri
let l:uri = a:response_item.targetUri
let l:line = a:response_item.targetRange.start.line + 1
let l:column = a:response_item.targetRange.start.character + 1
else
" LocationLink items use uri
let l:uri = a:response_item.uri
let l:line = a:response_item.range.start.line + 1
let l:column = a:response_item.range.start.character + 1
endif
if get(a:options, 'open_in') is# 'quickfix'
return {
\ 'filename': ale#util#ToResource(l:uri),
\ 'lnum': l:line,
\ 'col': l:column,
\}
else
return {
\ 'filename': ale#util#ToResource(l:uri),
\ 'line': l:line,
\ 'column': l:column,
\}
endif
endfunction
function! ale#definition#HandleLSPResponse(conn_id, response) abort function! ale#definition#HandleLSPResponse(conn_id, response) abort
if has_key(a:response, 'id') if has_key(a:response, 'id')
\&& has_key(s:go_to_definition_map, a:response.id) \&& has_key(s:go_to_definition_map, a:response.id)
@ -65,21 +137,29 @@ function! ale#definition#HandleLSPResponse(conn_id, response) abort
let l:result = [] let l:result = []
endif endif
for l:item in l:result let l:item_list = []
if has_key(l:item, 'targetUri')
" LocationLink items use targetUri
let l:uri = l:item.targetUri
let l:line = l:item.targetRange.start.line + 1
let l:column = l:item.targetRange.start.character + 1
else
" LocationLink items use uri
let l:uri = l:item.uri
let l:line = l:item.range.start.line + 1
let l:column = l:item.range.start.character + 1
endif
for l:response_item in l:result
call add(l:item_list,
\ ale#definition#FormatLSPResponse(l:response_item, l:options)
\)
endfor
if empty(l:item_list)
call ale#util#Execute('echom ''No definitions found''')
elseif len(l:item_list) == 1
call ale#definition#UpdateTagStack() call ale#definition#UpdateTagStack()
let l:uri = ale#util#ToURI(l:item_list[0].filename)
if get(l:options, 'open_in') is# 'quickfix'
let l:line = l:item_list[0].lnum
let l:column = l:item_list[0].col
else
let l:line = l:item_list[0].line
let l:column = l:item_list[0].column
endif
let l:uri_handler = ale#uri#GetURIHandler(l:uri) let l:uri_handler = ale#uri#GetURIHandler(l:uri)
if l:uri_handler is# v:null if l:uri_handler is# v:null
@ -88,9 +168,16 @@ function! ale#definition#HandleLSPResponse(conn_id, response) abort
else else
call l:uri_handler.OpenURILink(l:uri, l:line, l:column, l:options, a:conn_id) call l:uri_handler.OpenURILink(l:uri, l:line, l:column, l:options, a:conn_id)
endif endif
else
break if get(l:options, 'open_in') is# 'quickfix'
endfor call setqflist([], 'r')
call setqflist(l:item_list, 'a')
call ale#util#Execute('cc 1')
else
call ale#definition#UpdateTagStack()
call ale#preview#ShowSelection(l:item_list, l:options)
endif
endif
endif endif
endfunction endfunction

View file

@ -37,6 +37,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['bib'], \ 'suggested_filetypes': ['bib'],
\ 'description': 'Format bib files using bibclean.', \ 'description': 'Format bib files using bibclean.',
\ }, \ },
\ 'biome': {
\ 'function': 'ale#fixers#biome#Fix',
\ 'suggested_filetypes': ['javascript', 'typescript', 'json', 'jsonc'],
\ 'description': 'Fix JavaScript and TypeScript using biome.',
\ },
\ 'black': { \ 'black': {
\ 'function': 'ale#fixers#black#Fix', \ 'function': 'ale#fixers#black#Fix',
\ 'suggested_filetypes': ['python'], \ 'suggested_filetypes': ['python'],
@ -98,6 +103,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['javascript', 'css', 'html'], \ 'suggested_filetypes': ['javascript', 'css', 'html'],
\ 'description': 'Apply fecs format to a file.', \ 'description': 'Apply fecs format to a file.',
\ }, \ },
\ 'hurlfmt': {
\ 'function': 'ale#fixers#hurlfmt#Fix',
\ 'suggested_filetypes': ['hurl'],
\ 'description': 'Fix hurl files with hurlfmt.',
\ },
\ 'tidy': { \ 'tidy': {
\ 'function': 'ale#fixers#tidy#Fix', \ 'function': 'ale#fixers#tidy#Fix',
\ 'suggested_filetypes': ['html'], \ 'suggested_filetypes': ['html'],
@ -127,7 +137,7 @@ let s:default_registry = {
\ }, \ },
\ 'eslint': { \ 'eslint': {
\ 'function': 'ale#fixers#eslint#Fix', \ 'function': 'ale#fixers#eslint#Fix',
\ 'suggested_filetypes': ['javascript', 'typescript'], \ 'suggested_filetypes': ['javascript', 'typescript', 'astro'],
\ 'description': 'Apply eslint --fix to a file.', \ 'description': 'Apply eslint --fix to a file.',
\ }, \ },
\ 'mix_format': { \ 'mix_format': {
@ -142,7 +152,7 @@ let s:default_registry = {
\ }, \ },
\ 'prettier': { \ 'prettier': {
\ 'function': 'ale#fixers#prettier#Fix', \ 'function': 'ale#fixers#prettier#Fix',
\ 'suggested_filetypes': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'json5', 'graphql', 'markdown', 'vue', 'svelte', 'html', 'yaml', 'openapi', 'ruby'], \ 'suggested_filetypes': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'json5', 'graphql', 'markdown', 'vue', 'svelte', 'html', 'yaml', 'openapi', 'ruby', 'astro'],
\ 'description': 'Apply prettier to a file.', \ 'description': 'Apply prettier to a file.',
\ }, \ },
\ 'prettier_eslint': { \ 'prettier_eslint': {
@ -291,6 +301,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['solidity'], \ 'suggested_filetypes': ['solidity'],
\ 'description': 'Fix Solidity files with forge fmt.', \ 'description': 'Fix Solidity files with forge fmt.',
\ }, \ },
\ 'gleam_format': {
\ 'function': 'ale#fixers#gleam_format#Fix',
\ 'suggested_filetypes': ['gleam'],
\ 'description': 'Fix Gleam files with gleam format.',
\ },
\ 'gofmt': { \ 'gofmt': {
\ 'function': 'ale#fixers#gofmt#Fix', \ 'function': 'ale#fixers#gofmt#Fix',
\ 'suggested_filetypes': ['go'], \ 'suggested_filetypes': ['go'],
@ -546,6 +561,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['html', 'htmldjango'], \ 'suggested_filetypes': ['html', 'htmldjango'],
\ 'description': 'Fix HTML files with html-beautify from js-beautify.', \ 'description': 'Fix HTML files with html-beautify from js-beautify.',
\ }, \ },
\ 'htmlbeautifier': {
\ 'function': 'ale#fixers#htmlbeautifier#Fix',
\ 'suggested_filetypes': ['eruby'],
\ 'description': 'Fix ERB files with htmlbeautifier gem.',
\ },
\ 'lua-format': { \ 'lua-format': {
\ 'function': 'ale#fixers#lua_format#Fix', \ 'function': 'ale#fixers#lua_format#Fix',
\ 'suggested_filetypes': ['lua'], \ 'suggested_filetypes': ['lua'],
@ -641,6 +661,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['nickel'], \ 'suggested_filetypes': ['nickel'],
\ 'description': 'Fix nickel files with nickel format', \ 'description': 'Fix nickel files with nickel format',
\ }, \ },
\ 'rubyfmt': {
\ 'function': 'ale#fixers#rubyfmt#Fix',
\ 'suggested_filetypes': ['ruby'],
\ 'description': 'A formatter for Ruby source code',
\ },
\} \}
" Reset the function registry to the default entries. " Reset the function registry to the default entries.

View file

@ -4,22 +4,40 @@
call ale#Set('python_autoflake_executable', '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_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_autoflake_options', '') call ale#Set('python_autoflake_options', '')
call ale#Set('python_autoflake_auto_pipenv', 0)
call ale#Set('python_autoflake_auto_poetry', 0)
call ale#Set('python_autoflake_auto_uv', 0)
function! ale#fixers#autoflake#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_autoflake_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_autoflake_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_autoflake_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_autoflake', ['autoflake'])
endfunction
function! ale#fixers#autoflake#Fix(buffer) abort function! ale#fixers#autoflake#Fix(buffer) abort
let l:executable = ale#python#FindExecutable( let l:executable = ale#fixers#autoflake#GetExecutable(a:buffer)
\ a:buffer,
\ 'python_autoflake',
\ ['autoflake'],
\)
if !executable(l:executable) let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
return 0 \ ? ' run autoflake'
endif \ : ''
let l:options = ale#Var(a:buffer, 'python_autoflake_options') let l:options = ale#Var(a:buffer, 'python_autoflake_options')
return { return {
\ 'command': ale#Escape(l:executable) \ 'command': ale#Escape(l:executable) . l:exec_args
\ . (!empty(l:options) ? ' ' . l:options : '') \ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' --in-place ' \ . ' --in-place '
\ . ' %t', \ . ' %t',

View file

@ -4,23 +4,41 @@
call ale#Set('python_autoimport_executable', 'autoimport') call ale#Set('python_autoimport_executable', 'autoimport')
call ale#Set('python_autoimport_options', '') call ale#Set('python_autoimport_options', '')
call ale#Set('python_autoimport_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('python_autoimport_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_autoimport_auto_pipenv', 0)
call ale#Set('python_autoimport_auto_poetry', 0)
call ale#Set('python_autoimport_auto_uv', 0)
function! ale#fixers#autoimport#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_autoimport_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_autoimport_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_autoimport_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_autoimport', ['autoimport'])
endfunction
function! ale#fixers#autoimport#Fix(buffer) abort function! ale#fixers#autoimport#Fix(buffer) abort
let l:executable = ale#fixers#autoimport#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run autoimport'
\ : ''
let l:options = ale#Var(a:buffer, 'python_autoimport_options') let l:options = ale#Var(a:buffer, 'python_autoimport_options')
let l:executable = ale#python#FindExecutable(
\ a:buffer,
\ 'python_autoimport',
\ ['autoimport'],
\)
if !executable(l:executable)
return 0
endif
return { return {
\ 'cwd': '%s:h', \ 'cwd': '%s:h',
\ 'command': ale#Escape(l:executable) \ 'command': ale#Escape(l:executable) . l:exec_args
\ . (!empty(l:options) ? ' ' . l:options : '') \ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' -', \ . ' -',
\} \}

View file

@ -4,22 +4,40 @@
call ale#Set('python_autopep8_executable', 'autopep8') call ale#Set('python_autopep8_executable', 'autopep8')
call ale#Set('python_autopep8_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('python_autopep8_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_autopep8_options', '') call ale#Set('python_autopep8_options', '')
call ale#Set('python_autopep8_auto_pipenv', 0)
call ale#Set('python_autopep8_auto_poetry', 0)
call ale#Set('python_autopep8_auto_uv', 0)
function! ale#fixers#autopep8#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_autopep8_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_autopep8_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_autopep8_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_autopep8', ['autopep8'])
endfunction
function! ale#fixers#autopep8#Fix(buffer) abort function! ale#fixers#autopep8#Fix(buffer) abort
let l:executable = ale#python#FindExecutable( let l:executable = ale#fixers#autopep8#GetExecutable(a:buffer)
\ a:buffer,
\ 'python_autopep8',
\ ['autopep8'],
\)
if !executable(l:executable) let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
return 0 \ ? ' run autopep8'
endif \ : ''
let l:options = ale#Var(a:buffer, 'python_autopep8_options') let l:options = ale#Var(a:buffer, 'python_autopep8_options')
return { return {
\ 'command': ale#Escape(l:executable) \ 'command': ale#Escape(l:executable) . l:exec_args
\ . (!empty(l:options) ? ' ' . l:options : '') \ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' -', \ . ' -',
\} \}

View file

@ -1,17 +1,12 @@
" Author: Akiomi Kamakura <akiomik@gmail.com>
" Description: Fixing files with biome (ex.rome).
function! ale#fixers#biome#Fix(buffer) abort function! ale#fixers#biome#Fix(buffer) abort
let l:executable = ale#handlers#biome#GetExecutable(a:buffer) let l:executable = ale#handlers#biome#GetExecutable(a:buffer)
let l:options = ale#Var(a:buffer, 'javascript_biome_options') let l:options = ale#Var(a:buffer, 'biome_options')
let l:node = ale#Var(a:buffer, 'javascript_biome_node_executable') let l:apply = ale#Var(a:buffer, 'biome_fixer_apply_unsafe') ? '--apply-unsafe' : '--apply'
return { return {
\ 'command': (has('win32') ? (ale#Escape(l:node) . ' ') : '')
\ . ale#Escape(l:executable)
\ . ' check --apply'
\ . ale#Pad(l:options)
\ . ' %t',
\ 'read_temporary_file': 1, \ 'read_temporary_file': 1,
\ 'command': ale#Escape(l:executable) . ' check ' . l:apply
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' %t'
\} \}
endfunction endfunction

View file

@ -6,6 +6,7 @@ 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_options', '')
call ale#Set('python_black_auto_pipenv', 0) call ale#Set('python_black_auto_pipenv', 0)
call ale#Set('python_black_auto_poetry', 0) call ale#Set('python_black_auto_poetry', 0)
call ale#Set('python_black_auto_uv', 0)
call ale#Set('python_black_change_directory', 1) call ale#Set('python_black_change_directory', 1)
function! ale#fixers#black#GetExecutable(buffer) abort function! ale#fixers#black#GetExecutable(buffer) abort
@ -19,6 +20,11 @@ function! ale#fixers#black#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_black_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_black', ['black']) return ale#python#FindExecutable(a:buffer, 'python_black', ['black'])
endfunction endfunction
@ -26,7 +32,7 @@ function! ale#fixers#black#Fix(buffer) abort
let l:executable = ale#fixers#black#GetExecutable(a:buffer) let l:executable = ale#fixers#black#GetExecutable(a:buffer)
let l:cmd = [ale#Escape(l:executable)] let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? 'pipenv\|poetry$' if l:executable =~? 'pipenv\|poetry\|uv$'
call extend(l:cmd, ['run', 'black']) call extend(l:cmd, ['run', 'black'])
endif endif

View file

@ -0,0 +1,13 @@
" Author: Arash Mousavi <arash-m>
" Description: Support for HTML Beautifier https://github.com/threedaymonk/htmlbeautifier
call ale#Set('eruby_htmlbeautifier_executable', 'htmlbeautifier')
function! ale#fixers#htmlbeautifier#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'eruby_htmlbeautifier_executable')
return {
\ 'command': ale#Escape(l:executable) . ' %t',
\ 'read_temporary_file': 1,
\}
endfunction

View file

@ -0,0 +1,15 @@
call ale#Set('hurl_hurlfmt_executable', 'hurlfmt')
function! ale#fixers#hurlfmt#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'hurl_hurlfmt_executable')
return ale#Escape(l:executable)
\ . ' --out hurl'
endfunction
function! ale#fixers#hurlfmt#Fix(buffer) abort
return {
\ 'command': ale#fixers#hurlfmt#GetCommand(a:buffer)
\}
endfunction

View file

@ -6,6 +6,7 @@ call ale#Set('python_isort_use_global', get(g:, 'ale_use_global_executables', 0)
call ale#Set('python_isort_options', '') call ale#Set('python_isort_options', '')
call ale#Set('python_isort_auto_pipenv', 0) call ale#Set('python_isort_auto_pipenv', 0)
call ale#Set('python_isort_auto_poetry', 0) call ale#Set('python_isort_auto_poetry', 0)
call ale#Set('python_isort_auto_uv', 0)
function! ale#fixers#isort#GetExecutable(buffer) abort function! ale#fixers#isort#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_isort_auto_pipenv')) if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_isort_auto_pipenv'))
@ -18,6 +19,11 @@ function! ale#fixers#isort#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_isort_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_isort', ['isort']) return ale#python#FindExecutable(a:buffer, 'python_isort', ['isort'])
endfunction endfunction
@ -25,7 +31,7 @@ function! ale#fixers#isort#GetCmd(buffer) abort
let l:executable = ale#fixers#isort#GetExecutable(a:buffer) let l:executable = ale#fixers#isort#GetExecutable(a:buffer)
let l:cmd = [ale#Escape(l:executable)] let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? 'pipenv\|poetry$' if l:executable =~? 'pipenv\|poetry\|uv$'
call extend(l:cmd, ['run', 'isort']) call extend(l:cmd, ['run', 'isort'])
endif endif
@ -36,7 +42,7 @@ function! ale#fixers#isort#FixForVersion(buffer, version) abort
let l:executable = ale#fixers#isort#GetExecutable(a:buffer) let l:executable = ale#fixers#isort#GetExecutable(a:buffer)
let l:cmd = [ale#Escape(l:executable)] let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? 'pipenv\|poetry$' if l:executable =~? 'pipenv\|poetry\|uv$'
call extend(l:cmd, ['run', 'isort']) call extend(l:cmd, ['run', 'isort'])
endif endif

View file

@ -4,6 +4,7 @@
call ale#Set('php_cs_fixer_executable', 'php-cs-fixer') call ale#Set('php_cs_fixer_executable', 'php-cs-fixer')
call ale#Set('php_cs_fixer_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('php_cs_fixer_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('php_cs_fixer_options', '') call ale#Set('php_cs_fixer_options', '')
call ale#Set('php_cs_fixer_fix_options', '')
function! ale#fixers#php_cs_fixer#GetExecutable(buffer) abort function! ale#fixers#php_cs_fixer#GetExecutable(buffer) abort
return ale#path#FindExecutable(a:buffer, 'php_cs_fixer', [ return ale#path#FindExecutable(a:buffer, 'php_cs_fixer', [
@ -18,7 +19,8 @@ function! ale#fixers#php_cs_fixer#Fix(buffer) abort
return { return {
\ 'command': ale#Escape(l:executable) \ 'command': ale#Escape(l:executable)
\ . ' ' . ale#Var(a:buffer, 'php_cs_fixer_options') \ . ' ' . ale#Var(a:buffer, 'php_cs_fixer_options')
\ . ' fix %t', \ . ' fix ' . ale#Var(a:buffer, 'php_cs_fixer_fix_options')
\ . ' %t',
\ 'read_temporary_file': 1, \ 'read_temporary_file': 1,
\} \}
endfunction endfunction

View file

@ -79,6 +79,7 @@ function! ale#fixers#prettier#ApplyFixForVersion(buffer, version) abort
\ 'openapi': 'yaml', \ 'openapi': 'yaml',
\ 'html': 'html', \ 'html': 'html',
\ 'ruby': 'ruby', \ 'ruby': 'ruby',
\ 'astro': 'astro',
\} \}
for l:filetype in l:filetypes for l:filetype in l:filetypes

View file

@ -7,6 +7,7 @@ call ale#Set('python_pycln_use_global', get(g:, 'ale_use_global_executables', 0)
call ale#Set('python_pycln_change_directory', 1) call ale#Set('python_pycln_change_directory', 1)
call ale#Set('python_pycln_auto_pipenv', 0) call ale#Set('python_pycln_auto_pipenv', 0)
call ale#Set('python_pycln_auto_poetry', 0) call ale#Set('python_pycln_auto_poetry', 0)
call ale#Set('python_pycln_auto_uv', 0)
call ale#Set('python_pycln_config_file', '') call ale#Set('python_pycln_config_file', '')
function! ale#fixers#pycln#GetCwd(buffer) abort function! ale#fixers#pycln#GetCwd(buffer) abort
@ -31,12 +32,17 @@ function! ale#fixers#pycln#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_pycln_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_pycln', ['pycln']) return ale#python#FindExecutable(a:buffer, 'python_pycln', ['pycln'])
endfunction endfunction
function! ale#fixers#pycln#GetCommand(buffer) abort function! ale#fixers#pycln#GetCommand(buffer) abort
let l:executable = ale#fixers#pycln#GetExecutable(a:buffer) let l:executable = ale#fixers#pycln#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run pycln' \ ? ' run pycln'
\ : '' \ : ''
@ -47,7 +53,7 @@ function! ale#fixers#pycln#FixForVersion(buffer, version) abort
let l:executable = ale#fixers#pycln#GetExecutable(a:buffer) let l:executable = ale#fixers#pycln#GetExecutable(a:buffer)
let l:cmd = [ale#Escape(l:executable)] let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? 'pipenv\|poetry$' if l:executable =~? 'pipenv\|poetry\|uv$'
call extend(l:cmd, ['run', 'pycln']) call extend(l:cmd, ['run', 'pycln'])
endif endif

View file

@ -7,6 +7,7 @@ call ale#Set('python_pyflyby_use_global', get(g:, 'ale_use_global_executables',
call ale#Set('python_pyflyby_options', '') call ale#Set('python_pyflyby_options', '')
call ale#Set('python_pyflyby_auto_pipenv', 0) call ale#Set('python_pyflyby_auto_pipenv', 0)
call ale#Set('python_pyflyby_auto_poetry', 0) call ale#Set('python_pyflyby_auto_poetry', 0)
call ale#Set('python_pyflyby_auto_uv', 0)
function! ale#fixers#pyflyby#GetExecutable(buffer) abort function! ale#fixers#pyflyby#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyflyby_auto_pipenv')) if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyflyby_auto_pipenv'))
@ -19,6 +20,11 @@ function! ale#fixers#pyflyby#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_pyflyby_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_pyflyby', ['tidy-imports']) return ale#python#FindExecutable(a:buffer, 'python_pyflyby', ['tidy-imports'])
endfunction endfunction
@ -27,7 +33,7 @@ function! ale#fixers#pyflyby#Fix(buffer) abort
let l:executable = ale#fixers#pyflyby#GetExecutable(a:buffer) let l:executable = ale#fixers#pyflyby#GetExecutable(a:buffer)
let l:cmd = [ale#Escape(l:executable)] let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? 'pipenv\|poetry$' if l:executable =~? 'pipenv\|poetry\|uv$'
call extend(l:cmd, ['run', 'tidy-imports']) call extend(l:cmd, ['run', 'tidy-imports'])
endif endif

View file

@ -4,22 +4,40 @@
call ale#Set('python_reorder_python_imports_executable', 'reorder-python-imports') call ale#Set('python_reorder_python_imports_executable', 'reorder-python-imports')
call ale#Set('python_reorder_python_imports_options', '') call ale#Set('python_reorder_python_imports_options', '')
call ale#Set('python_reorder_python_imports_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('python_reorder_python_imports_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_reorder_python_imports_auto_pipenv', 0)
call ale#Set('python_reorder_python_imports_auto_poetry', 0)
call ale#Set('python_reorder_python_imports_auto_uv', 0)
function! ale#fixers#reorder_python_imports#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_reorder_python_imports_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_reorder_python_imports_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_reorder_python_imports_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_reorder_python_imports', ['reorder-python-imports'])
endfunction
function! ale#fixers#reorder_python_imports#Fix(buffer) abort function! ale#fixers#reorder_python_imports#Fix(buffer) abort
let l:executable = ale#python#FindExecutable( let l:executable = ale#fixers#reorder_python_imports#GetExecutable(a:buffer)
\ a:buffer,
\ 'python_reorder_python_imports',
\ ['reorder-python-imports'],
\)
if !executable(l:executable) let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
return 0 \ ? ' run reorder-python-imports'
endif \ : ''
let l:options = ale#Var(a:buffer, 'python_reorder_python_imports_options') let l:options = ale#Var(a:buffer, 'python_reorder_python_imports_options')
return { return {
\ 'command': ale#Escape(l:executable) \ 'command': ale#Escape(l:executable) . l:exec_args
\ . (!empty(l:options) ? ' ' . l:options : '') . ' -', \ . (!empty(l:options) ? ' ' . l:options : '') . ' -',
\} \}
endfunction endfunction

View file

@ -7,6 +7,7 @@ call ale#Set('python_ruff_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_ruff_change_directory', 1) call ale#Set('python_ruff_change_directory', 1)
call ale#Set('python_ruff_auto_pipenv', 0) call ale#Set('python_ruff_auto_pipenv', 0)
call ale#Set('python_ruff_auto_poetry', 0) call ale#Set('python_ruff_auto_poetry', 0)
call ale#Set('python_ruff_auto_uv', 0)
function! ale#fixers#ruff#GetCwd(buffer) abort function! ale#fixers#ruff#GetCwd(buffer) abort
if ale#Var(a:buffer, 'python_ruff_change_directory') if ale#Var(a:buffer, 'python_ruff_change_directory')
@ -30,12 +31,17 @@ function! ale#fixers#ruff#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_ruff_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_ruff', ['ruff']) return ale#python#FindExecutable(a:buffer, 'python_ruff', ['ruff'])
endfunction endfunction
function! ale#fixers#ruff#GetCommand(buffer) abort function! ale#fixers#ruff#GetCommand(buffer) abort
let l:executable = ale#fixers#ruff#GetExecutable(a:buffer) let l:executable = ale#fixers#ruff#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run ruff' \ ? ' run ruff'
\ : '' \ : ''
@ -46,10 +52,15 @@ function! ale#fixers#ruff#FixForVersion(buffer, version) abort
let l:executable = ale#fixers#ruff#GetExecutable(a:buffer) let l:executable = ale#fixers#ruff#GetExecutable(a:buffer)
let l:cmd = [ale#Escape(l:executable)] let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? 'pipenv\|poetry$' if l:executable =~? 'pipenv\|poetry\|uv$'
call extend(l:cmd, ['run', 'ruff']) call extend(l:cmd, ['run', 'ruff'])
endif endif
" NOTE: ruff 0.5.0 removes `ruff <path>` in favor of `ruff check <path>`
if ale#semver#GTE(a:version, [0, 5, 0])
call extend(l:cmd, ['check'])
endif
let l:options = ale#Var(a:buffer, 'python_ruff_options') let l:options = ale#Var(a:buffer, 'python_ruff_options')
if !empty(l:options) if !empty(l:options)

View file

@ -7,6 +7,7 @@ call ale#Set('python_ruff_format_use_global', get(g:, 'ale_use_global_executable
call ale#Set('python_ruff_format_change_directory', 1) call ale#Set('python_ruff_format_change_directory', 1)
call ale#Set('python_ruff_format_auto_pipenv', 0) call ale#Set('python_ruff_format_auto_pipenv', 0)
call ale#Set('python_ruff_format_auto_poetry', 0) call ale#Set('python_ruff_format_auto_poetry', 0)
call ale#Set('python_ruff_format_auto_uv', 0)
function! ale#fixers#ruff_format#GetCwd(buffer) abort function! ale#fixers#ruff_format#GetCwd(buffer) abort
if ale#Var(a:buffer, 'python_ruff_format_change_directory') if ale#Var(a:buffer, 'python_ruff_format_change_directory')
@ -30,12 +31,17 @@ function! ale#fixers#ruff_format#GetExecutable(buffer) abort
return 'poetry' return 'poetry'
endif endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_ruff_format_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_ruff_format', ['ruff']) return ale#python#FindExecutable(a:buffer, 'python_ruff_format', ['ruff'])
endfunction endfunction
function! ale#fixers#ruff_format#GetCommand(buffer) abort function! ale#fixers#ruff_format#GetCommand(buffer) abort
let l:executable = ale#fixers#ruff_format#GetExecutable(a:buffer) let l:executable = ale#fixers#ruff_format#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run ruff' \ ? ' run ruff'
\ : '' \ : ''
@ -46,7 +52,7 @@ function! ale#fixers#ruff_format#Fix(buffer) abort
let l:executable = ale#fixers#ruff_format#GetExecutable(a:buffer) let l:executable = ale#fixers#ruff_format#GetExecutable(a:buffer)
let l:cmd = [ale#Escape(l:executable)] let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? 'pipenv\|poetry$' if l:executable =~? 'pipenv\|poetry\|uv$'
call extend(l:cmd, ['run', 'ruff']) call extend(l:cmd, ['run', 'ruff'])
endif endif

View file

@ -3,17 +3,35 @@
call ale#Set('python_yapf_executable', 'yapf') call ale#Set('python_yapf_executable', 'yapf')
call ale#Set('python_yapf_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('python_yapf_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_yapf_auto_pipenv', 0)
call ale#Set('python_yapf_auto_poetry', 0)
call ale#Set('python_yapf_auto_uv', 0)
function! ale#fixers#yapf#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_yapf_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_yapf_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_yapf_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_yapf', ['yapf'])
endfunction
function! ale#fixers#yapf#Fix(buffer) abort function! ale#fixers#yapf#Fix(buffer) abort
let l:executable = ale#python#FindExecutable( let l:executable = ale#fixers#yapf#GetExecutable(a:buffer)
\ a:buffer,
\ 'python_yapf',
\ ['yapf'],
\)
if !executable(l:executable) let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
return 0 \ ? ' run yapf'
endif \ : ''
let l:config = ale#path#FindNearestFile(a:buffer, '.style.yapf') let l:config = ale#path#FindNearestFile(a:buffer, '.style.yapf')
let l:config_options = !empty(l:config) let l:config_options = !empty(l:config)
@ -21,6 +39,6 @@ function! ale#fixers#yapf#Fix(buffer) abort
\ : '' \ : ''
return { return {
\ 'command': ale#Escape(l:executable) . l:config_options, \ 'command': ale#Escape(l:executable) . l:exec_args . l:config_options,
\} \}
endfunction endfunction

View file

@ -1,14 +1,58 @@
" Author: Akiomi Kamakura <akiomik@gmail.com> " Author: Filip Gospodinov <f@gospodinov.ch>
" Description: Functions for working with biome, for fixing files. " Description: Functions for working with biome, for checking or fixing files.
call ale#Set('javascript_biome_node_executable', 'node.exe') call ale#Set('biome_executable', 'biome')
call ale#Set('javascript_biome_executable', 'biome') call ale#Set('biome_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('javascript_biome_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('biome_options', '')
call ale#Set('javascript_biome_options', '') call ale#Set('biome_fixer_apply_unsafe', 0)
call ale#Set('biome_lsp_project_root', '')
function! ale#handlers#biome#GetExecutable(buffer) abort function! ale#handlers#biome#GetExecutable(buffer) abort
return ale#path#FindExecutable(a:buffer, 'javascript_biome', [ return ale#path#FindExecutable(a:buffer, 'biome', [
\ 'node_modules/@biomejs/cli-linux-x64/biome',
\ 'node_modules/@biomejs/cli-linux-arm64/biome',
\ 'node_modules/@biomejs/cli-win32-x64/biome.exe',
\ 'node_modules/@biomejs/cli-win32-arm64/biome.exe',
\ 'node_modules/@biomejs/cli-darwin-x64/biome',
\ 'node_modules/@biomejs/cli-darwin-arm64/biome',
\ 'node_modules/.bin/biome', \ 'node_modules/.bin/biome',
\ 'node_modules/@biomejs/biome/bin/biome',
\]) \])
endfunction endfunction
function! ale#handlers#biome#GetLanguage(buffer) abort
return getbufvar(a:buffer, '&filetype')
endfunction
function! ale#handlers#biome#GetProjectRoot(buffer) abort
let l:project_root = ale#Var(a:buffer, 'biome_lsp_project_root')
if !empty(l:project_root)
return l:project_root
endif
let l:possible_project_roots = [
\ 'biome.json',
\ 'biome.jsonc',
\ 'package.json',
\ '.git',
\ bufname(a:buffer),
\]
for l:possible_root in l:possible_project_roots
let l:project_root = ale#path#FindNearestFile(a:buffer, l:possible_root)
if empty(l:project_root)
let l:project_root = ale#path#FindNearestDirectory(a:buffer, l:possible_root)
endif
if !empty(l:project_root)
" dir:p expands to /full/path/to/dir/ whereas
" file:p expands to /full/path/to/file (no trailing slash)
" Appending '/' ensures that :h:h removes the path's last segment
" regardless of whether it is a directory or not.
return fnamemodify(l:project_root . '/', ':p:h:h')
endif
endfor
return ''
endfunction

View file

@ -11,12 +11,31 @@ function! ale#handlers#cspell#GetExecutable(buffer) abort
\) \)
endfunction endfunction
function! ale#handlers#cspell#GetLanguageId(buffer) abort
let l:filetype = getbufvar(a:buffer, '&filetype')
if l:filetype is# 'tex'
" Vim's tex corresponds to latex language-id in cspell
return 'latex'
elseif l:filetype is# 'plaintex'
" Vim's plaintex corresponds to tex language-id in cspell
return 'tex'
else
" Fallback to filetype for everything else.
return l:filetype
endif
endfunction
function! ale#handlers#cspell#GetCommand(buffer) abort function! ale#handlers#cspell#GetCommand(buffer) abort
let l:executable = ale#handlers#cspell#GetExecutable(a:buffer) let l:executable = ale#handlers#cspell#GetExecutable(a:buffer)
let l:options = ale#Var(a:buffer, 'cspell_options') let l:options = ale#Var(a:buffer, 'cspell_options')
let l:language_id = ale#handlers#cspell#GetLanguageId(a:buffer)
let l:language_id_option = empty(l:language_id) ? '' : '--language-id="' . l:language_id . '"'
return ale#node#Executable(a:buffer, l:executable) return ale#node#Executable(a:buffer, l:executable)
\ . ' lint --no-color --no-progress --no-summary' \ . ' lint --no-color --no-progress --no-summary'
\ . ale#Pad(l:language_id_option)
\ . ale#Pad(l:options) \ . ale#Pad(l:options)
\ . ' -- stdin' \ . ' -- stdin'
endfunction endfunction

View file

@ -0,0 +1,66 @@
" Author: Adrian Zalewski <aazalewski@hotmail.com>
" Description: Ember-template-lint for checking Handlebars files
function! ale#handlers#embertemplatelint#GetExecutable(buffer) abort
return ale#path#FindExecutable(a:buffer, 'handlebars_embertemplatelint', [
\ 'node_modules/.bin/ember-template-lint',
\])
endfunction
function! ale#handlers#embertemplatelint#GetCommand(buffer, version) abort
if ale#semver#GTE(a:version, [4, 0, 0])
" --json was removed in favor of --format=json in ember-template-lint@4.0.0
return '%e --format=json --filename %s'
endif
return '%e --json --filename %s'
endfunction
function! ale#handlers#embertemplatelint#GetCommandWithVersionCheck(buffer) abort
return ale#semver#RunWithVersionCheck(
\ a:buffer,
\ ale#handlers#embertemplatelint#GetExecutable(a:buffer),
\ '%e --version',
\ function('ale#handlers#embertemplatelint#GetCommand'),
\)
endfunction
function! ale#handlers#embertemplatelint#Handle(buffer, lines) abort
let l:output = []
let l:json = ale#util#FuzzyJSONDecode(a:lines, {})
for l:error in get(values(l:json), 0, [])
if has_key(l:error, 'fatal')
call add(l:output, {
\ 'lnum': get(l:error, 'line', 1),
\ 'col': get(l:error, 'column', 1),
\ 'text': l:error.message,
\ 'type': l:error.severity == 1 ? 'W' : 'E',
\})
else
call add(l:output, {
\ 'lnum': l:error.line,
\ 'col': l:error.column,
\ 'text': l:error.rule . ': ' . l:error.message,
\ 'type': l:error.severity == 1 ? 'W' : 'E',
\})
endif
endfor
return l:output
endfunction
function! ale#handlers#embertemplatelint#DefineLinter(filetype) abort
call ale#Set('handlebars_embertemplatelint_executable', 'ember-template-lint')
call ale#Set('handlebars_embertemplatelint_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#linter#Define(a:filetype, {
\ 'name': 'embertemplatelint',
\ 'aliases': ['ember-template-lint'],
\ 'executable': function('ale#handlers#embertemplatelint#GetExecutable'),
\ 'command': function('ale#handlers#embertemplatelint#GetCommandWithVersionCheck'),
\ 'callback': 'ale#handlers#embertemplatelint#Handle',
\})
endfunction

View file

@ -18,7 +18,11 @@ call ale#Set('javascript_eslint_suppress_missing_config', 0)
function! ale#handlers#eslint#FindConfig(buffer) abort function! ale#handlers#eslint#FindConfig(buffer) abort
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h')) for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
for l:basename in [ for l:basename in [
\ 'eslint.config.js',
\ 'eslint.config.mjs',
\ 'eslint.config.cjs',
\ '.eslintrc.js', \ '.eslintrc.js',
\ '.eslintrc.cjs',
\ '.eslintrc.yaml', \ '.eslintrc.yaml',
\ '.eslintrc.yml', \ '.eslintrc.yml',
\ '.eslintrc.json', \ '.eslintrc.json',
@ -41,31 +45,7 @@ endfunction
" Given a buffer, return an appropriate working directory for ESLint. " Given a buffer, return an appropriate working directory for ESLint.
function! ale#handlers#eslint#GetCwd(buffer) abort function! ale#handlers#eslint#GetCwd(buffer) abort
" ESLint 6 loads plugins/configs/parsers from the project root return ale#path#Dirname(ale#handlers#eslint#FindConfig(a:buffer))
" By default, the project root is simply the CWD of the running process.
" https://github.com/eslint/rfcs/blob/master/designs/2018-simplified-package-loading/README.md
" https://github.com/dense-analysis/ale/issues/2787
"
" If eslint is installed in a directory which contains the buffer, assume
" it is the ESLint project root. Otherwise, use nearest node_modules.
" Note: If node_modules not present yet, can't load local deps anyway.
let l:executable = ale#path#FindNearestExecutable(a:buffer, s:executables)
if !empty(l:executable)
let l:modules_index = strridx(l:executable, 'node_modules')
let l:modules_root = l:modules_index > -1 ? l:executable[0:l:modules_index - 2] : ''
let l:sdks_index = strridx(l:executable, ale#path#Simplify('.yarn/sdks'))
let l:sdks_root = l:sdks_index > -1 ? l:executable[0:l:sdks_index - 2] : ''
else
let l:modules_dir = ale#path#FindNearestDirectory(a:buffer, 'node_modules')
let l:modules_root = !empty(l:modules_dir) ? fnamemodify(l:modules_dir, ':h:h') : ''
let l:sdks_dir = ale#path#FindNearestDirectory(a:buffer, ale#path#Simplify('.yarn/sdks'))
let l:sdks_root = !empty(l:sdks_dir) ? fnamemodify(l:sdks_dir, ':h:h:h') : ''
endif
return strlen(l:modules_root) > strlen(l:sdks_root) ? l:modules_root : l:sdks_root
endfunction endfunction
function! ale#handlers#eslint#GetCommand(buffer) abort function! ale#handlers#eslint#GetCommand(buffer) abort

View file

@ -49,6 +49,7 @@ function! ale#handlers#shellcheck#GetCommand(buffer, version) abort
let l:exclude_option = ale#Var(a:buffer, 'sh_shellcheck_exclusions') let l:exclude_option = ale#Var(a:buffer, 'sh_shellcheck_exclusions')
let l:dialect = ale#Var(a:buffer, 'sh_shellcheck_dialect') let l:dialect = ale#Var(a:buffer, 'sh_shellcheck_dialect')
let l:external_option = ale#semver#GTE(a:version, [0, 4, 0]) ? ' -x' : '' let l:external_option = ale#semver#GTE(a:version, [0, 4, 0]) ? ' -x' : ''
let l:format = ale#semver#GTE(a:version, [0, 7, 0]) ? 'json1' : 'gcc'
if l:dialect is# 'auto' if l:dialect is# 'auto'
let l:dialect = ale#handlers#shellcheck#GetDialectArgument(a:buffer) let l:dialect = ale#handlers#shellcheck#GetDialectArgument(a:buffer)
@ -59,10 +60,69 @@ function! ale#handlers#shellcheck#GetCommand(buffer, version) abort
\ . (!empty(l:options) ? ' ' . l:options : '') \ . (!empty(l:options) ? ' ' . l:options : '')
\ . (!empty(l:exclude_option) ? ' -e ' . l:exclude_option : '') \ . (!empty(l:exclude_option) ? ' -e ' . l:exclude_option : '')
\ . l:external_option \ . l:external_option
\ . ' -f gcc -' \ . ' -f ' . l:format . ' -'
endfunction endfunction
function! ale#handlers#shellcheck#Handle(buffer, lines) abort function! s:HandleShellcheckJSON(buffer, lines) abort
try
let l:errors = json_decode(a:lines[0])
catch
return []
endtry
if !has_key(l:errors, 'comments')
return []
endif
let l:output = []
for l:error in l:errors['comments']
if l:error['level'] is# 'error'
let l:type = 'E'
elseif l:error['level'] is# 'info'
let l:type = 'I'
elseif l:error['level'] is# 'style'
let l:type = 'I'
else
let l:type = 'W'
endif
let l:item = {
\ 'lnum': l:error['line'],
\ 'type': l:type,
\ 'text': l:error['message'],
\ 'code': 'SC' . l:error['code'],
\ 'detail': l:error['message'] . "\n\nFor more information:\n https://www.shellcheck.net/wiki/SC" . l:error['code'],
\}
if has_key(l:error, 'column')
let l:item.col = l:error['column']
endif
if has_key(l:error, 'endColumn')
let l:item.end_col = l:error['endColumn'] - 1
endif
if has_key(l:error, 'endLine')
let l:item.end_lnum = l:error['endLine']
endif
" If the filename is something like <stdin>, <nofile> or -, then
" this is an error for the file we checked.
if has_key(l:error, 'file')
if l:error['file'] isnot# '-' && l:error['file'][0] isnot# '<'
let l:item['filename'] = l:error['file']
endif
endif
call add(l:output, l:item)
endfor
return l:output
endfunction
function! s:HandleShellcheckGCC(buffer, lines) abort
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+)?:? ([^:]+): (.+) \[([^\]]+)\]$' let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+)?:? ([^:]+): (.+) \[([^\]]+)\]$'
let l:output = [] let l:output = []
@ -80,6 +140,7 @@ function! ale#handlers#shellcheck#Handle(buffer, lines) abort
\ 'type': l:type, \ 'type': l:type,
\ 'text': l:match[5], \ 'text': l:match[5],
\ 'code': l:match[6], \ 'code': l:match[6],
\ 'detail': l:match[5] . "\n\nFor more information:\n https://www.shellcheck.net/wiki/" . l:match[6],
\} \}
if !empty(l:match[3]) if !empty(l:match[3])
@ -98,6 +159,12 @@ function! ale#handlers#shellcheck#Handle(buffer, lines) abort
return l:output return l:output
endfunction endfunction
function! ale#handlers#shellcheck#Handle(buffer, version, lines) abort
return ale#semver#GTE(a:version, [0, 7, 0])
\ ? s:HandleShellcheckJSON(a:buffer, a:lines)
\ : s:HandleShellcheckGCC(a:buffer, a:lines)
endfunction
function! ale#handlers#shellcheck#DefineLinter(filetype) abort function! ale#handlers#shellcheck#DefineLinter(filetype) abort
" This global variable can be set with a string of comma-separated error " This global variable can be set with a string of comma-separated error
" codes to exclude from shellcheck. For example: " codes to exclude from shellcheck. For example:
@ -118,6 +185,14 @@ function! ale#handlers#shellcheck#DefineLinter(filetype) abort
\ '%e --version', \ '%e --version',
\ function('ale#handlers#shellcheck#GetCommand'), \ function('ale#handlers#shellcheck#GetCommand'),
\ )}, \ )},
\ 'callback': 'ale#handlers#shellcheck#Handle', \ 'callback': {buffer, lines -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale#Var(buffer, 'sh_shellcheck_executable'),
\ '%e --version',
\ {buffer, version -> ale#handlers#shellcheck#Handle(
\ buffer,
\ l:version,
\ lines)},
\ )},
\}) \})
endfunction endfunction

View file

@ -117,10 +117,10 @@ function! ale#hover#ParseLSPResult(contents) abort
for l:line in split(l:item, "\n") for l:line in split(l:item, "\n")
if l:fence_language is v:null if l:fence_language is v:null
" Look for the start of a code fence. (```python, etc.) " Look for the start of a code fence. (```python, etc.)
let l:match = matchlist(l:line, '^``` *\([^ ]\+\) *$') let l:match = matchlist(l:line, '^``` *\([^ ]\+\)\? *$')
if !empty(l:match) if !empty(l:match)
let l:fence_language = l:match[1] let l:fence_language = len(l:match) > 1 ? l:match[1] : 'text'
if !empty(l:marked_list) if !empty(l:marked_list)
call add(l:fence_lines, '') call add(l:fence_lines, '')

View file

@ -40,6 +40,7 @@ let s:default_ale_linter_aliases = {
" NOTE: Update the g:ale_linters documentation when modifying this. " NOTE: Update the g:ale_linters documentation when modifying this.
let s:default_ale_linters = { let s:default_ale_linters = {
\ 'apkbuild': ['apkbuild_lint', 'secfixes_check'], \ 'apkbuild': ['apkbuild_lint', 'secfixes_check'],
\ 'astro': ['eslint'],
\ 'csh': ['shell'], \ 'csh': ['shell'],
\ 'elixir': ['credo', 'dialyxir', 'dogma'], \ 'elixir': ['credo', 'dialyxir', 'dogma'],
\ 'go': ['gofmt', 'golangci-lint', 'gopls', 'govet'], \ 'go': ['gofmt', 'golangci-lint', 'gopls', 'govet'],
@ -47,9 +48,9 @@ let s:default_ale_linters = {
\ 'hack': ['hack'], \ 'hack': ['hack'],
\ 'help': [], \ 'help': [],
\ 'inko': ['inko'], \ 'inko': ['inko'],
\ 'json': ['jsonlint', 'spectral', 'vscodejson'], \ 'json': ['biome', 'jsonlint', 'spectral', 'vscodejson'],
\ 'json5': [], \ 'json5': [],
\ 'jsonc': [], \ 'jsonc': ['biome'],
\ 'perl': ['perlcritic'], \ 'perl': ['perlcritic'],
\ 'perl6': [], \ 'perl6': [],
\ 'python': ['flake8', 'mypy', 'pylint', 'pyright', 'ruff'], \ 'python': ['flake8', 'mypy', 'pylint', 'pyright', 'ruff'],
@ -60,7 +61,7 @@ let s:default_ale_linters = {
\ 'vue': ['eslint', 'vls'], \ 'vue': ['eslint', 'vls'],
\ 'zsh': ['shell'], \ 'zsh': ['shell'],
\ 'v': ['v'], \ 'v': ['v'],
\ 'yaml': ['spectral', 'yaml-language-server', 'yamllint'], \ 'yaml': ['actionlint', 'spectral', 'yaml-language-server', 'yamllint'],
\} \}
" Testing/debugging helper to unload all linters. " Testing/debugging helper to unload all linters.

View file

@ -3,6 +3,7 @@
call ale#Set('python_auto_pipenv', '0') call ale#Set('python_auto_pipenv', '0')
call ale#Set('python_auto_poetry', '0') call ale#Set('python_auto_poetry', '0')
call ale#Set('python_auto_uv', '0')
let s:sep = has('win32') ? '\' : '/' let s:sep = has('win32') ? '\' : '/'
" bin is used for Unix virtualenv directories, and Scripts is for Windows. " bin is used for Unix virtualenv directories, and Scripts is for Windows.
@ -43,6 +44,7 @@ function! ale#python#FindProjectRootIni(buffer) abort
\|| filereadable(l:path . '/poetry.lock') \|| filereadable(l:path . '/poetry.lock')
\|| filereadable(l:path . '/pyproject.toml') \|| filereadable(l:path . '/pyproject.toml')
\|| filereadable(l:path . '/.tool-versions') \|| filereadable(l:path . '/.tool-versions')
\|| filereadable(l:path . '/uv.lock')
return l:path return l:path
endif endif
endfor endfor
@ -192,3 +194,8 @@ endfunction
function! ale#python#PoetryPresent(buffer) abort function! ale#python#PoetryPresent(buffer) abort
return findfile('poetry.lock', expand('#' . a:buffer . ':p:h') . ';') isnot# '' return findfile('poetry.lock', expand('#' . a:buffer . ':p:h') . ';') isnot# ''
endfunction endfunction
" Detects whether a poetry environment is present.
function! ale#python#UvPresent(buffer) abort
return findfile('uv.lock', expand('#' . a:buffer . ':p:h') . ';') isnot# ''
endfunction

View file

@ -161,7 +161,7 @@ endfunction
function! s:GroupCmd() abort function! s:GroupCmd() abort
if s:supports_sign_groups if s:supports_sign_groups
return ' group=ale ' return ' group=ale_signs '
else else
return ' ' return ' '
endif endif
@ -180,13 +180,13 @@ endfunction
function! ale#sign#ParsePattern() abort function! ale#sign#ParsePattern() abort
if s:supports_sign_groups if s:supports_sign_groups
" Matches output like : " Matches output like :
" line=4 id=1 group=ale name=ALEErrorSign " line=4 id=1 group=ale_signs name=ALEErrorSign
" строка=1 id=1000001 группа=ale имя=ALEErrorSign " строка=1 id=1000001 группа=ale_signs имя=ALEErrorSign
" 行=1 識別子=1000001 グループ=ale 名前=ALEWarningSign " 行=1 識別子=1000001 グループ=ale_signs 名前=ALEWarningSign
" línea=12 id=1000001 grupo=ale nombre=ALEWarningSign " línea=12 id=1000001 grupo=ale_signs nombre=ALEWarningSign
" riga=1 id=1000001 gruppo=ale nome=ALEWarningSign " riga=1 id=1000001 gruppo=ale_signs nome=ALEWarningSign
" Zeile=235 id=1000001 Gruppe=ale Name=ALEErrorSign " Zeile=235 id=1000001 Gruppe=ale_signs Name=ALEErrorSign
let l:pattern = '\v^.*\=(\d+).*\=(\d+).*\=ale>.*\=(ALE[a-zA-Z]+Sign)' let l:pattern = '\v^.*\=(\d+).*\=(\d+).*\=ale_signs>.*\=(ALE[a-zA-Z]+Sign)'
else else
" Matches output like : " Matches output like :
" line=4 id=1 name=ALEErrorSign " line=4 id=1 name=ALEErrorSign
@ -203,7 +203,7 @@ endfunction
" Given a buffer number, return a List of placed signs [line, id, group] " Given a buffer number, return a List of placed signs [line, id, group]
function! ale#sign#ParseSignsWithGetPlaced(buffer) abort function! ale#sign#ParseSignsWithGetPlaced(buffer) abort
let l:signs = sign_getplaced(a:buffer, { 'group': s:supports_sign_groups ? 'ale' : '' })[0].signs let l:signs = sign_getplaced(a:buffer, { 'group': s:supports_sign_groups ? 'ale_signs' : '' })[0].signs
let l:result = [] let l:result = []
let l:is_dummy_sign_set = 0 let l:is_dummy_sign_set = 0
@ -489,7 +489,7 @@ endfunction
" Remove all signs. " Remove all signs.
function! ale#sign#Clear() abort function! ale#sign#Clear() abort
if s:supports_sign_groups if s:supports_sign_groups
sign unplace group=ale * sign unplace group=ale_signs *
else else
sign unplace * sign unplace *
endif endif

View file

@ -0,0 +1,16 @@
===============================================================================
ALE Astro Integration *ale-astro-options*
===============================================================================
eslint *ale-astro-eslint*
See |ale-javascript-eslint| for information about the available options.
===============================================================================
prettier *ale-astro-prettier*
See |ale-javascript-prettier| for information about the available options.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View file

@ -27,6 +27,19 @@ g:ale_dart_analysis_server_executable *g:ale_dart_analysis_server_executable*
This variable can be set to change the path of dart. This variable can be set to change the path of dart.
g:ale_dart_analysis_server_enable_language_server
*g:ale_dart_analysis_server_enable_language_server*
*b:ale_dart_analysis_server_enable_language_server*
Type: |Number|
Default: `1`
When set to `1`, ALE will use the new `dart language-server` command,
available from Dart version 2.16.0, to launch the language server. When set
to `0`, ALE will instead use the deprecated
`./snapshots/analysis_server.dart.snapshot --lsp` command used by older
versions of Dart.
=============================================================================== ===============================================================================
dart-analyze *ale-dart-analyze* dart-analyze *ale-dart-analyze*

View file

@ -7,6 +7,7 @@ There are four linters for `eruby` files:
- `erblint` - `erblint`
- `erubis` - `erubis`
- `erubi` - `erubi`
- `htmlbeautifier`
- `ruumba` - `ruumba`
`erb` is in the Ruby standard library and is mostly universal. `erubis` is the `erb` is in the Ruby standard library and is mostly universal. `erubis` is the
@ -47,6 +48,18 @@ g:ale_eruby_erblint_options *g:ale_ruby_erblint_options*
This variable can be change to modify flags given to erblint. This variable can be change to modify flags given to erblint.
===============================================================================
htmlbeautifier *ale-eruby-htmlbeautifier*
g:ale_eruby_htmlbeautifier_executable *g:ale_eruby_htmlbeautifier_executable*
*b:ale_eruby_htmlbeautifier_executable*
Type: |String|
Default: `'htmlbeautifier'`
Override the invoked htmlbeautifier binary. This is useful for running
htmlbeautifier from binstubs or a bundle.
=============================================================================== ===============================================================================
ruumba *ale-eruby-ruumba* ruumba *ale-eruby-ruumba*

View file

@ -0,0 +1,17 @@
===============================================================================
ALE Hurl Integration *ale-hurl-options*
===============================================================================
hurlfmt *ale-hurl-hurlfmt*
g:ale_hurl_hurlfmt_executable *g:ale_hurl_hurlfmt_executable*
*b:ale_hurl_hurlfmt_executable*
Type: |String|
Default: `'hurlfmt'`
Override the invoked hurlfmt binary.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View file

@ -25,6 +25,12 @@ To this: >
< <
===============================================================================
biome *ale-javascript-biome*
Check the docs over at |ale-typescript-biome|.
=============================================================================== ===============================================================================
clang-format *ale-javascript-clangformat* clang-format *ale-javascript-clangformat*

View file

@ -2,6 +2,12 @@
ALE JSON Integration *ale-json-options* ALE JSON Integration *ale-json-options*
===============================================================================
biome *ale-json-biome*
Check the docs over at |ale-typescript-biome|.
=============================================================================== ===============================================================================
clang-format *ale-json-clangformat* clang-format *ale-json-clangformat*

View file

@ -2,6 +2,12 @@
ALE JSONC Integration *ale-jsonc-options* ALE JSONC Integration *ale-jsonc-options*
===============================================================================
biome *ale-jsonc-biome*
Check the docs over at |ale-typescript-biome|.
=============================================================================== ===============================================================================
eslint *ale-jsonc-eslint* eslint *ale-jsonc-eslint*

View file

@ -0,0 +1,29 @@
===============================================================================
ALE Odin Integration *ale-odin-options*
*ale-integration-odin*
===============================================================================
Integration Information
Currently, the only supported linter for Odin is ols.
===============================================================================
ols *ale-odin-ols*
g:ale_odin_ols_executable *g:ale_odin_ols_executable*
*b:ale_odin_ols_executable*
Type: |String|
Default: `'ols'`
This variable can be modified to change the executable path for `ols`.
g:ale_odin_ols_config *g:ale_odin_ols_config*
*b:ale_odin_ols_config*
Type: |Dictionary|
Default: `{}`
Dictionary with configuration settings for ols.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View file

@ -20,6 +20,15 @@ g:ale_python_auto_poetry *g:ale_python_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_auto_uv *g:ale_python_auto_uv*
*b:ale_python_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
g:ale_python_auto_virtualenv *g:ale_python_auto_virtualenv* g:ale_python_auto_virtualenv *g:ale_python_auto_virtualenv*
*b:ale_python_auto_virtualenv* *b:ale_python_auto_virtualenv*
Type: |Number| Type: |Number|
@ -96,6 +105,33 @@ g:ale_python_autoflake_use_global *g:ale_python_autoflake_use_global*
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
g:ale_python_autoflake_auto_pipenv *g:ale_python_autoflake_auto_pipenv*
*b:ale_python_autoflake_auto_pipenv*
Type: |Number|
Default: `0`
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_autoflake_auto_poetry *g:ale_python_autoflake_auto_poetry*
*b:ale_python_autoflake_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_autoflake_auto_uv *g:ale_python_autoflake_auto_uv*
*b:ale_python_autoflake_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
autoimport *ale-python-autoimport* autoimport *ale-python-autoimport*
@ -123,6 +159,33 @@ g:ale_python_autoimport_use_global *g:ale_python_autoimport_use_global*
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
g:ale_python_autoimport_auto_pipenv *g:ale_python_autoimport_auto_pipenv*
*b:ale_python_autoimport_auto_pipenv*
Type: |Number|
Default: `0`
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_autoimport_auto_poetry *g:ale_python_autoimport_auto_poetry*
*b:ale_python_autoimport_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_autoimport_auto_uv *g:ale_python_autoimport_auto_uv*
*b:ale_python_autoimport_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
autopep8 *ale-python-autopep8* autopep8 *ale-python-autopep8*
@ -150,6 +213,33 @@ g:ale_python_autopep8_use_global *g:ale_python_autopep8_use_global*
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
g:ale_python_autopep8_auto_pipenv *g:ale_python_autopep8_auto_pipenv*
*b:ale_python_autopep8_auto_pipenv*
Type: |Number|
Default: `0`
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_autopep8_auto_poetry *g:ale_python_autopep8_auto_poetry*
*b:ale_python_autopep8_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_autopep8_auto_uv *g:ale_python_autopep8_auto_uv*
*b:ale_python_autopep8_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
bandit *ale-python-bandit* bandit *ale-python-bandit*
@ -210,6 +300,15 @@ g:ale_python_bandit_auto_poetry *g:ale_python_bandit_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_bandit_auto_uv *g:ale_python_bandit_auto_uv*
*b:ale_python_bandit_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
black *ale-python-black* black *ale-python-black*
@ -255,6 +354,15 @@ g:ale_python_black_auto_poetry *g:ale_python_black_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_black_auto_uv *g:ale_python_black_auto_uv*
*b:ale_python_black_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
g:ale_python_black_change_directory *g:ale_python_black_change_directory* g:ale_python_black_change_directory *g:ale_python_black_change_directory*
*b:ale_python_black_change_directory* *b:ale_python_black_change_directory*
Type: |Number| Type: |Number|
@ -345,6 +453,15 @@ g:ale_python_flake8_auto_poetry *g:ale_python_flake8_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_flake8_auto_uv *g:ale_python_flake8_auto_uv*
*b:ale_python_flake8_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
flakehell *ale-python-flakehell* flakehell *ale-python-flakehell*
@ -410,6 +527,15 @@ g:ale_python_flakehell_auto_poetry *g:ale_python_flakehell_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_flakehell_auto_uv *g:ale_python_flakehell_auto_uv*
*b:ale_python_flakehell_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
isort *ale-python-isort* isort *ale-python-isort*
@ -455,6 +581,15 @@ g:ale_python_isort_auto_poetry *g:ale_python_isort_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_isort_auto_uv *g:ale_python_isort_auto_uv*
*b:ale_python_isort_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
mypy *ale-python-mypy* mypy *ale-python-mypy*
@ -483,6 +618,15 @@ g:ale_python_mypy_auto_poetry *g:ale_python_mypy_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_mypy_auto_uv *g:ale_python_mypy_auto_uv*
*b:ale_python_mypy_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
g:ale_python_mypy_executable *g:ale_python_mypy_executable* g:ale_python_mypy_executable *g:ale_python_mypy_executable*
*b:ale_python_mypy_executable* *b:ale_python_mypy_executable*
Type: |String| Type: |String|
@ -591,6 +735,15 @@ g:ale_python_prospector_auto_poetry *g:ale_python_prospector_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_prospector_auto_uv *g:ale_python_prospector_auto_uv*
*b:ale_python_prospector_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
pycln *ale-python-pycln* pycln *ale-python-pycln*
@ -663,6 +816,15 @@ g:ale_python_pycln_auto_poetry *g:ale_python_pycln_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_pycln_auto_uv *g:ale_python_pycln_auto_uv*
*b:ale_python_pycln_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
pycodestyle *ale-python-pycodestyle* pycodestyle *ale-python-pycodestyle*
@ -712,6 +874,15 @@ g:ale_python_pycodestyle_auto_poetry *g:ale_python_pycodestyle_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_pycodestyle_auto_uv *g:ale_python_pycodestyle_auto_uv*
*b:ale_python_pycodestyle_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
pydocstyle *ale-python-pydocstyle* pydocstyle *ale-python-pydocstyle*
@ -761,6 +932,15 @@ g:ale_python_pydocstyle_auto_poetry *g:ale_python_pydocstyle_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_pydocstyle_auto_uv *g:ale_python_pydocstyle_auto_uv*
*b:ale_python_pydocstyle_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
pyflakes *ale-python-pyflakes* pyflakes *ale-python-pyflakes*
@ -793,6 +973,15 @@ g:ale_python_pyflakes_auto_poetry *g:ale_python_pyflakes_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_pyflakes_auto_uv *g:ale_python_pyflakes_auto_uv*
*b:ale_python_pyflakes_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
pyflyby *ale-python-pyflyby* pyflyby *ale-python-pyflyby*
@ -839,6 +1028,15 @@ g:ale_python_pyflyby_auto_poetry *g:ale_python_pyflyby_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_pyflyby_auto_uv *g:ale_python_pyflyby_auto_uv*
*b:ale_python_pyflyby_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
pylama *ale-python-pylama* pylama *ale-python-pylama*
@ -902,6 +1100,14 @@ g:ale_python_pylama_auto_poetry *g:ale_python_pylama_auto_poetry*
Detect whether the file is inside a poetry, and set the executable to `poetry` Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_pylama_auto_uv *g:ale_python_pylama_auto_uv*
*b:ale_python_pylama_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
pylint *ale-python-pylint* pylint *ale-python-pylint*
@ -976,6 +1182,15 @@ g:ale_python_pylint_auto_poetry *g:ale_python_pylint_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_pylint_auto_uv *g:ale_python_pylint_auto_uv*
*b:ale_python_pylint_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
g:ale_python_pylint_use_msg_id *g:ale_python_pylint_use_msg_id* g:ale_python_pylint_use_msg_id *g:ale_python_pylint_use_msg_id*
*b:ale_python_pylint_use_msg_id* *b:ale_python_pylint_use_msg_id*
Type: |Number| Type: |Number|
@ -1028,6 +1243,15 @@ g:ale_python_pylsp_auto_poetry *g:ale_python_pylsp_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_pylsp_auto_uv *g:ale_python_pylsp_auto_uv*
*b:ale_python_pylsp_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
g:ale_python_pylsp_config *g:ale_python_pylsp_config* g:ale_python_pylsp_config *g:ale_python_pylsp_config*
*b:ale_python_pylsp_config* *b:ale_python_pylsp_config*
Type: |Dictionary| Type: |Dictionary|
@ -1109,6 +1333,15 @@ g:ale_python_pyre_auto_poetry *g:ale_python_pyre_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_pyre_auto_uv *g:ale_python_pyre_auto_uv*
*b:ale_python_pyre_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
pyright *ale-python-pyright* pyright *ale-python-pyright*
@ -1168,6 +1401,33 @@ g:ale_python_pyright_config *g:ale_python_pyright_config*
\} \}
< <
g:ale_python_pyright_auto_pipenv *g:ale_python_pyright_auto_pipenv*
*b:ale_python_pyright_auto_pipenv*
Type: |Number|
Default: `0`
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_pyright_auto_poetry *g:ale_python_pyright_auto_poetry*
*b:ale_python_pyright_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_pyright_auto_uv *g:ale_python_pyright_auto_uv*
*b:ale_python_pyright_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
refurb *ale-python-refurb* refurb *ale-python-refurb*
@ -1229,6 +1489,15 @@ g:ale_python_refurb_auto_poetry *g:ale_python_refurb_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_refurb_auto_uv *g:ale_python_refurb_auto_uv*
*b:ale_python_refurb_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
reorder-python-imports *ale-python-reorder_python_imports* reorder-python-imports *ale-python-reorder_python_imports*
@ -1259,6 +1528,36 @@ g:ale_python_reorder_python_imports_use_global
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
g:ale_python_reorder_python_imports_auto_pipenv
*g:ale_python_reorder_python_imports_auto_pipenv*
*b:ale_python_reorder_python_imports_auto_pipenv*
Type: |Number|
Default: `0`
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_reorder_python_imports_auto_poetry
*g:ale_python_reorder_python_imports_auto_poetry*
*b:ale_python_reorder_python_imports_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_reorder_python_imports_auto_uv
*g:ale_python_reorder_python_imports_auto_uv*
*b:ale_python_reorder_python_imports_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
ruff *ale-python-ruff* ruff *ale-python-ruff*
@ -1322,6 +1621,15 @@ g:ale_python_ruff_auto_poetry *g:ale_python_ruff_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_ruff_auto_uv *g:ale_python_ruff_auto_uv*
*b:ale_python_ruff_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
ruff-format *ale-python-ruff-format* ruff-format *ale-python-ruff-format*
@ -1386,6 +1694,15 @@ g:ale_python_ruff_format_auto_poetry *g:ale_python_ruff_format_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_ruff_format_auto_uv *g:ale_python_ruff_format_auto_uv*
*b:ale_python_ruff_format_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
unimport *ale-python-unimport* unimport *ale-python-unimport*
@ -1410,6 +1727,15 @@ g:ale_python_unimport_auto_poetry *g:ale_python_unimport_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_unimport_auto_uv *g:ale_python_unimport_auto_uv*
*b:ale_python_unimport_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
g:ale_python_unimport_executable *g:ale_python_unimport_executable* g:ale_python_unimport_executable *g:ale_python_unimport_executable*
*b:ale_python_unimport_executable* *b:ale_python_unimport_executable*
Type: |String| Type: |String|
@ -1476,6 +1802,32 @@ g:ale_python_vulture_use_global *g:ale_python_vulture_use_global*
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
g:ale_python_vulture_auto_pipenv *g:ale_python_vulture_auto_pipenv*
*b:ale_python_vulture_auto_pipenv*
Type: |Number|
Default: `0`
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_vulture_auto_poetry *g:ale_python_vulture_auto_poetry*
*b:ale_python_vulture_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_vulture_auto_uv *g:ale_python_vulture_auto_uv*
*b:ale_python_vulture_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
yapf *ale-python-yapf* yapf *ale-python-yapf*
@ -1496,5 +1848,32 @@ g:ale_python_yapf_use_global *g:ale_python_yapf_use_global*
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
g:ale_python_yapf_auto_pipenv *g:ale_python_yapf_auto_pipenv*
*b:ale_python_yapf_auto_pipenv*
Type: |Number|
Default: `0`
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_yapf_auto_poetry *g:ale_python_yapf_auto_poetry*
*b:ale_python_yapf_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_yapf_auto_uv *g:ale_python_yapf_auto_uv*
*b:ale_python_yapf_auto_uv*
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
=============================================================================== ===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View file

@ -258,6 +258,24 @@ g:ale_ruby_syntax_tree_options *g:ale_ruby_syntax_tree_options*
This variable can be changed to modify flags given to SyntaxTree. This variable can be changed to modify flags given to SyntaxTree.
===============================================================================
rubyfmt *ale-ruby-rubyfmt*
g:ale_ruby_rubyfmt_executable *g:ale_ruby_rubyfmt_executable*
*b:ale_ruby_rubyfmt_executable*
Type: |String|
Default: `'rubyfmt'`
This option can be changed to change the path for `rubyfmt`.
g:ale_ruby_rubyfmt_options *g:ale_ruby_rubyfmt_options*
*b:ale_ruby_rubyfmt_options*
Type: |String|
Default: `''`
This option can be changed to pass extra options to `'rubyfmt'`.
=============================================================================== ===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View file

@ -37,6 +37,9 @@ Notes:
* ASM * ASM
* `gcc` * `gcc`
* `llvm-mc` * `llvm-mc`
* Astro
* `eslint`
* `prettier`
* AVRA * AVRA
* `avra` * `avra`
* Awk * Awk
@ -182,6 +185,7 @@ Notes:
* `erblint` * `erblint`
* `erubi` * `erubi`
* `erubis` * `erubis`
* `htmlbeautifier`
* `ruumba` * `ruumba`
* Erlang * Erlang
* `SyntaxErl` * `SyntaxErl`
@ -202,6 +206,9 @@ Notes:
* `fusion-lint` * `fusion-lint`
* Git Commit Messages * Git Commit Messages
* `gitlint` * `gitlint`
* Gleam
* `gleam_format`
* `gleamlsp`
* GLSL * GLSL
* `glslang` * `glslang`
* `glslls` * `glslls`
@ -271,6 +278,8 @@ Notes:
* `rustywind` * `rustywind`
* `tidy` * `tidy`
* `write-good` * `write-good`
* Hurl
* `hurlfmt`
* Idris * Idris
* `idris` * `idris`
* Ink * Ink
@ -290,6 +299,7 @@ Notes:
* `javalsp` * `javalsp`
* `uncrustify` * `uncrustify`
* JavaScript * JavaScript
* `biome`
* `clang-format` * `clang-format`
* `cspell` * `cspell`
* `deno` * `deno`
@ -307,6 +317,7 @@ Notes:
* `xo` * `xo`
* JSON * JSON
* `VSCode JSON language server` * `VSCode JSON language server`
* `biome`
* `clang-format` * `clang-format`
* `cspell` * `cspell`
* `dprint` * `dprint`
@ -319,6 +330,7 @@ Notes:
* JSON5 * JSON5
* `eslint` * `eslint`
* JSONC * JSONC
* `biome`
* `eslint` * `eslint`
* Jsonnet * Jsonnet
* `jsonnet-lint` * `jsonnet-lint`
@ -418,6 +430,8 @@ Notes:
* `ocamllsp` * `ocamllsp`
* `ocp-indent` * `ocp-indent`
* `ols` * `ols`
* Odin
* `ols`
* OpenApi * OpenApi
* `ibm_validator` * `ibm_validator`
* `prettier` * `prettier`
@ -558,10 +572,12 @@ Notes:
* `reek` * `reek`
* `rubocop` * `rubocop`
* `ruby` * `ruby`
* `rubyfmt`
* `rufo` * `rufo`
* `solargraph` * `solargraph`
* `sorbet` * `sorbet`
* `standardrb` * `standardrb`
* `steep`
* `syntax_tree` * `syntax_tree`
* Rust * Rust
* `cargo`!! * `cargo`!!
@ -650,6 +666,7 @@ Notes:
* TOML * TOML
* `dprint` * `dprint`
* TypeScript * TypeScript
* `biome`
* `cspell` * `cspell`
* `deno` * `deno`
* `dprint` * `dprint`
@ -669,6 +686,7 @@ Notes:
* Verilog * Verilog
* `hdl-checker` * `hdl-checker`
* `iverilog` * `iverilog`
* slang
* `verilator` * `verilator`
* `vlog` * `vlog`
* `xvlog` * `xvlog`

View file

@ -2,6 +2,56 @@
ALE TypeScript Integration *ale-typescript-options* ALE TypeScript Integration *ale-typescript-options*
===============================================================================
biome *ale-typescript-biome*
g:ale_biome_executable *g:ale_biome_executable*
*b:ale_biome_executable*
Type: |String|
Default: `'biome'`
g:ale_biome_options *g:ale_biome_options*
*b:ale_biome_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to `biome check` when
applying fixes.
g:ale_biome_use_global *g:ale_biome_use_global*
*b:ale_biome_use_global*
Type: |Number|
Default: `get(g:, 'ale_use_global_executables', 0)`
See |ale-integrations-local-executables|
g:ale_biome_fixer_apply_unsafe *g:ale_biome_fixer_apply_unsafe*
*b:ale_biome_fixer_apply_unsafe*
Type: |Number|
Default: `0`
If set to `1`, biome will apply unsafe fixes along with safe fixes.
g:ale_biome_lsp_project_root *g:ale_biome_lsp_project_root*
*b:ale_biome_lsp_project_root*
Type: |String|
Default: `''`
If this variable is left unset, ALE will try to find the project root by
executing the following steps in the given order:
1. Find an ancestor directory containing a biome.json.
2. Find an ancestor directory containing a biome.jsonc.
3. Find an ancestor directory containing a package.json.
4. Find an ancestor directory containing a .git folder.
5. Use the directory of the current buffer (if the buffer was opened from
a file).
=============================================================================== ===============================================================================
cspell *ale-typescript-cspell* cspell *ale-typescript-cspell*

View file

@ -3,7 +3,7 @@ ALE Verilog/SystemVerilog Integration *ale-verilog-options*
=============================================================================== ===============================================================================
ALE can use six different linters for Verilog HDL: ALE can use seven different linters for Verilog HDL:
HDL Checker HDL Checker
Using `hdl_checker --lsp` Using `hdl_checker --lsp`
@ -11,6 +11,9 @@ ALE can use six different linters for Verilog HDL:
iverilog: iverilog:
Using `iverilog -t null -Wall` Using `iverilog -t null -Wall`
slang:
Using `slang -Weverything`
verilator verilator
Using `verilator --lint-only -Wall` Using `verilator --lint-only -Wall`
@ -21,7 +24,7 @@ ALE can use six different linters for Verilog HDL:
Using `xvlog` Using `xvlog`
Yosys Yosys
Using `ysoys -Q -T -p 'read_verilog'` Using `yosys -Q -T -p 'read_verilog'`
By default, both 'verilog' and 'systemverilog' filetypes are checked. By default, both 'verilog' and 'systemverilog' filetypes are checked.
@ -64,6 +67,15 @@ iverilog *ale-verilog-iverilog*
No additional options No additional options
===============================================================================
slang *ale-verilog-slang*
g:ale_verilog_slang_option *g:ale_verilog_slang_options*
*b:ale_verilog_slang_options*
Type: String
Default: ''
This variable can be changed to modify 'slang' command arguments.
=============================================================================== ===============================================================================
verilator *ale-verilog-verilator* verilator *ale-verilog-verilator*
@ -73,7 +85,7 @@ g:ale_verilog_verilator_options *g:ale_verilog_verilator_options*
Type: |String| Type: |String|
Default: `''` Default: `''`
This variable can be changed to modify 'verilator' command arguments This variable can be changed to modify 'verilator' command arguments.
For example `'-sv --default-language "1800-2012"'` if you want to enable For example `'-sv --default-language "1800-2012"'` if you want to enable
SystemVerilog parsing and select the 2012 version of the language. SystemVerilog parsing and select the 2012 version of the language.

View file

@ -186,11 +186,11 @@ script like so. >
exec docker run -i --rm -v "$(pwd):/data" cytopia/pylint "$@" exec docker run -i --rm -v "$(pwd):/data" cytopia/pylint "$@"
< <
You will run to run Docker commands with `-i` in order to read from stdin. You will want to run Docker commands with `-i` in order to read from stdin.
With the above script in mind, you might configure ALE to lint your Python With the above script in mind, you might configure ALE to lint your Python
project with `pylint` by providing the path to the script to execute, and project with `pylint` by providing the path to the script to execute, and
mappings which describe how to between the two file systems in your mappings which describe how to change between the two file systems in your
`python.vim` |ftplugin| file, like so: > `python.vim` |ftplugin| file, like so: >
if expand('%:p') =~# '^/home/w0rp/git/test-pylint/' if expand('%:p') =~# '^/home/w0rp/git/test-pylint/'
@ -1670,7 +1670,7 @@ g:ale_linters *g:ale_linters*
\ 'vue': ['eslint', 'vls'], \ 'vue': ['eslint', 'vls'],
\ 'zsh': ['shell'], \ 'zsh': ['shell'],
\ 'v': ['v'], \ 'v': ['v'],
\ 'yaml': ['spectral', 'yaml-language-server', 'yamllint'], \ 'yaml': ['actionlint', 'spectral', 'yaml-language-server', 'yamllint'],
\} \}
< <
This option can be used to enable only a particular set of linters for a This option can be used to enable only a particular set of linters for a
@ -2899,6 +2899,9 @@ documented in additional help files.
asm.....................................|ale-asm-options| asm.....................................|ale-asm-options|
gcc...................................|ale-asm-gcc| gcc...................................|ale-asm-gcc|
llvm_mc...............................|ale-asm-llvm_mc| llvm_mc...............................|ale-asm-llvm_mc|
astro...................................|ale-astro-options|
eslint................................|ale-astro-eslint|
prettier..............................|ale-astro-prettier|
avra....................................|ale-avra-options| avra....................................|ale-avra-options|
avra..................................|ale-avra-avra| avra..................................|ale-avra-avra|
awk.....................................|ale-awk-options| awk.....................................|ale-awk-options|
@ -3020,6 +3023,7 @@ documented in additional help files.
eruby...................................|ale-eruby-options| eruby...................................|ale-eruby-options|
erb-formatter.........................|ale-eruby-erbformatter| erb-formatter.........................|ale-eruby-erbformatter|
erblint...............................|ale-eruby-erblint| erblint...............................|ale-eruby-erblint|
htmlbeautifier........................|ale-eruby-htmlbeautifier|
ruumba................................|ale-eruby-ruumba| ruumba................................|ale-eruby-ruumba|
fish....................................|ale-fish-options| fish....................................|ale-fish-options|
fish_indent...........................|ale-fish-fish_indent| fish_indent...........................|ale-fish-fish_indent|
@ -3031,6 +3035,9 @@ documented in additional help files.
fusion-lint...........................|ale-fuse-fusionlint| fusion-lint...........................|ale-fuse-fusionlint|
git commit..............................|ale-gitcommit-options| git commit..............................|ale-gitcommit-options|
gitlint...............................|ale-gitcommit-gitlint| gitlint...............................|ale-gitcommit-gitlint|
gleam...................................|ale-gleam-options|
gleam_format..........................|ale-gleam-gleam_format|
gleamlsp..............................|ale-gleam-gleamlsp|
glsl....................................|ale-glsl-options| glsl....................................|ale-glsl-options|
glslang...............................|ale-glsl-glslang| glslang...............................|ale-glsl-glslang|
glslls................................|ale-glsl-glslls| glslls................................|ale-glsl-glslls|
@ -3095,6 +3102,8 @@ documented in additional help files.
tidy..................................|ale-html-tidy| tidy..................................|ale-html-tidy|
vscodehtml............................|ale-html-vscode| vscodehtml............................|ale-html-vscode|
write-good............................|ale-html-write-good| write-good............................|ale-html-write-good|
hurl....................................|ale-hurl-options|
hurlfmt...............................|ale-hurl-hurlfmt|
idris...................................|ale-idris-options| idris...................................|ale-idris-options|
idris.................................|ale-idris-idris| idris.................................|ale-idris-idris|
ink.....................................|ale-ink-options| ink.....................................|ale-ink-options|
@ -3114,6 +3123,7 @@ documented in additional help files.
eclipselsp............................|ale-java-eclipselsp| eclipselsp............................|ale-java-eclipselsp|
uncrustify............................|ale-java-uncrustify| uncrustify............................|ale-java-uncrustify|
javascript..............................|ale-javascript-options| javascript..............................|ale-javascript-options|
biome.................................|ale-javascript-biome|
clang-format..........................|ale-javascript-clangformat| clang-format..........................|ale-javascript-clangformat|
cspell................................|ale-javascript-cspell| cspell................................|ale-javascript-cspell|
deno..................................|ale-javascript-deno| deno..................................|ale-javascript-deno|
@ -3130,6 +3140,7 @@ documented in additional help files.
standard..............................|ale-javascript-standard| standard..............................|ale-javascript-standard|
xo....................................|ale-javascript-xo| xo....................................|ale-javascript-xo|
json....................................|ale-json-options| json....................................|ale-json-options|
biome.................................|ale-json-biome|
clang-format..........................|ale-json-clangformat| clang-format..........................|ale-json-clangformat|
cspell................................|ale-json-cspell| cspell................................|ale-json-cspell|
dprint................................|ale-json-dprint| dprint................................|ale-json-dprint|
@ -3141,6 +3152,7 @@ documented in additional help files.
spectral..............................|ale-json-spectral| spectral..............................|ale-json-spectral|
vscodejson............................|ale-json-vscode| vscodejson............................|ale-json-vscode|
jsonc...................................|ale-jsonc-options| jsonc...................................|ale-jsonc-options|
biome.................................|ale-jsonc-biome|
eslint................................|ale-jsonc-eslint| eslint................................|ale-jsonc-eslint|
jsonnet.................................|ale-jsonnet-options| jsonnet.................................|ale-jsonnet-options|
jsonnetfmt............................|ale-jsonnet-jsonnetfmt| jsonnetfmt............................|ale-jsonnet-jsonnetfmt|
@ -3220,6 +3232,8 @@ documented in additional help files.
ols...................................|ale-ocaml-ols| ols...................................|ale-ocaml-ols|
ocamlformat...........................|ale-ocaml-ocamlformat| ocamlformat...........................|ale-ocaml-ocamlformat|
ocp-indent............................|ale-ocaml-ocp-indent| ocp-indent............................|ale-ocaml-ocp-indent|
odin....................................|ale-odin-options|
ols...................................|ale-odin-ols|
openapi.................................|ale-openapi-options| openapi.................................|ale-openapi-options|
ibm_validator.........................|ale-openapi-ibm-validator| ibm_validator.........................|ale-openapi-ibm-validator|
prettier..............................|ale-openapi-prettier| prettier..............................|ale-openapi-prettier|
@ -3350,6 +3364,7 @@ documented in additional help files.
sorbet................................|ale-ruby-sorbet| sorbet................................|ale-ruby-sorbet|
standardrb............................|ale-ruby-standardrb| standardrb............................|ale-ruby-standardrb|
syntax_tree...........................|ale-ruby-syntax_tree| syntax_tree...........................|ale-ruby-syntax_tree|
rubyfmt...............................|ale-ruby-rubyfmt|
rust....................................|ale-rust-options| rust....................................|ale-rust-options|
analyzer..............................|ale-rust-analyzer| analyzer..............................|ale-rust-analyzer|
cargo.................................|ale-rust-cargo| cargo.................................|ale-rust-cargo|
@ -3436,6 +3451,7 @@ documented in additional help files.
toml....................................|ale-toml-options| toml....................................|ale-toml-options|
dprint................................|ale-toml-dprint| dprint................................|ale-toml-dprint|
typescript..............................|ale-typescript-options| typescript..............................|ale-typescript-options|
biome.................................|ale-typescript-biome|
cspell................................|ale-typescript-cspell| cspell................................|ale-typescript-cspell|
deno..................................|ale-typescript-deno| deno..................................|ale-typescript-deno|
dprint................................|ale-typescript-dprint| dprint................................|ale-typescript-dprint|
@ -3453,6 +3469,7 @@ documented in additional help files.
verilog/systemverilog...................|ale-verilog-options| verilog/systemverilog...................|ale-verilog-options|
hdl-checker...........................|ale-verilog-hdl-checker| hdl-checker...........................|ale-verilog-hdl-checker|
iverilog..............................|ale-verilog-iverilog| iverilog..............................|ale-verilog-iverilog|
slang.................................|ale-verilog-slang|
verilator.............................|ale-verilog-verilator| verilator.............................|ale-verilog-verilator|
vlog..................................|ale-verilog-vlog| vlog..................................|ale-verilog-vlog|
xvlog.................................|ale-verilog-xvlog| xvlog.................................|ale-verilog-xvlog|

View file

@ -183,6 +183,9 @@ let g:ale_python_auto_pipenv = get(g:, 'ale_python_auto_pipenv', 0)
" Enable automatic detection of poetry for Python linters. " Enable automatic detection of poetry for Python linters.
let g:ale_python_auto_poetry = get(g:, 'ale_python_auto_poetry', 0) let g:ale_python_auto_poetry = get(g:, 'ale_python_auto_poetry', 0)
" Enable automatic detection of uv for Python linters.
let g:ale_python_auto_uv = get(g:, 'ale_python_auto_uv', 0)
" Enable automatic adjustment of environment variables for Python linters. " Enable automatic adjustment of environment variables for Python linters.
" The variables are set based on ALE's virtualenv detection. " The variables are set based on ALE's virtualenv detection.
let g:ale_python_auto_virtualenv = get(g:, 'ale_python_auto_virtualenv', 0) let g:ale_python_auto_virtualenv = get(g:, 'ale_python_auto_virtualenv', 0)

View file

@ -46,6 +46,9 @@ formatting.
* ASM * ASM
* [gcc](https://gcc.gnu.org) * [gcc](https://gcc.gnu.org)
* [llvm-mc](https://llvm.org) * [llvm-mc](https://llvm.org)
* Astro
* [eslint](http://eslint.org/)
* [prettier](https://github.com/prettier/prettier)
* AVRA * AVRA
* [avra](https://github.com/Ro5bert/avra) * [avra](https://github.com/Ro5bert/avra)
* Awk * Awk
@ -191,6 +194,7 @@ formatting.
* [erblint](https://github.com/Shopify/erb-lint) * [erblint](https://github.com/Shopify/erb-lint)
* [erubi](https://github.com/jeremyevans/erubi) * [erubi](https://github.com/jeremyevans/erubi)
* [erubis](https://github.com/kwatch/erubis) * [erubis](https://github.com/kwatch/erubis)
* [htmlbeautifier](https://github.com/threedaymonk/htmlbeautifier)
* [ruumba](https://github.com/ericqweinstein/ruumba) * [ruumba](https://github.com/ericqweinstein/ruumba)
* Erlang * Erlang
* [SyntaxErl](https://github.com/ten0s/syntaxerl) * [SyntaxErl](https://github.com/ten0s/syntaxerl)
@ -211,6 +215,9 @@ formatting.
* [fusion-lint](https://github.com/RyanSquared/fusionscript) * [fusion-lint](https://github.com/RyanSquared/fusionscript)
* Git Commit Messages * Git Commit Messages
* [gitlint](https://github.com/jorisroovers/gitlint) * [gitlint](https://github.com/jorisroovers/gitlint)
* Gleam
* [gleam_format](https://github.com/gleam-lang/gleam)
* [gleamlsp](https://github.com/gleam-lang/gleam)
* GLSL * GLSL
* [glslang](https://github.com/KhronosGroup/glslang) * [glslang](https://github.com/KhronosGroup/glslang)
* [glslls](https://github.com/svenstaro/glsl-language-server) * [glslls](https://github.com/svenstaro/glsl-language-server)
@ -280,6 +287,8 @@ formatting.
* [rustywind](https://github.com/avencera/rustywind) * [rustywind](https://github.com/avencera/rustywind)
* [tidy](http://www.html-tidy.org/) * [tidy](http://www.html-tidy.org/)
* [write-good](https://github.com/btford/write-good) * [write-good](https://github.com/btford/write-good)
* Hurl
* [hurlfmt](https://hurl.dev)
* Idris * Idris
* [idris](http://www.idris-lang.org/) * [idris](http://www.idris-lang.org/)
* Ink * Ink
@ -299,6 +308,7 @@ formatting.
* [javalsp](https://github.com/georgewfraser/vscode-javac) * [javalsp](https://github.com/georgewfraser/vscode-javac)
* [uncrustify](https://github.com/uncrustify/uncrustify) * [uncrustify](https://github.com/uncrustify/uncrustify)
* JavaScript * JavaScript
* [biome](https://biomejs.dev/)
* [clang-format](https://clang.llvm.org/docs/ClangFormat.html) * [clang-format](https://clang.llvm.org/docs/ClangFormat.html)
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell) * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [deno](https://deno.land/) * [deno](https://deno.land/)
@ -316,6 +326,7 @@ formatting.
* [xo](https://github.com/sindresorhus/xo) * [xo](https://github.com/sindresorhus/xo)
* JSON * JSON
* [VSCode JSON language server](https://github.com/hrsh7th/vscode-langservers-extracted) * [VSCode JSON language server](https://github.com/hrsh7th/vscode-langservers-extracted)
* [biome](https://biomejs.dev/)
* [clang-format](https://clang.llvm.org/docs/ClangFormat.html) * [clang-format](https://clang.llvm.org/docs/ClangFormat.html)
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell) :warning: * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell) :warning:
* [dprint](https://dprint.dev) * [dprint](https://dprint.dev)
@ -328,6 +339,7 @@ formatting.
* JSON5 * JSON5
* [eslint](http://eslint.org/) :warning: * [eslint](http://eslint.org/) :warning:
* JSONC * JSONC
* [biome](https://biomejs.dev/)
* [eslint](http://eslint.org/) :warning: * [eslint](http://eslint.org/) :warning:
* Jsonnet * Jsonnet
* [jsonnet-lint](https://jsonnet.org/learning/tools.html) * [jsonnet-lint](https://jsonnet.org/learning/tools.html)
@ -427,6 +439,8 @@ formatting.
* [ocamllsp](https://github.com/ocaml/ocaml-lsp) * [ocamllsp](https://github.com/ocaml/ocaml-lsp)
* [ocp-indent](https://github.com/OCamlPro/ocp-indent) * [ocp-indent](https://github.com/OCamlPro/ocp-indent)
* [ols](https://github.com/freebroccolo/ocaml-language-server) * [ols](https://github.com/freebroccolo/ocaml-language-server)
* Odin
* [ols](https://github.com/DanielGavin/ols)
* OpenApi * OpenApi
* [ibm_validator](https://github.com/IBM/openapi-validator) * [ibm_validator](https://github.com/IBM/openapi-validator)
* [prettier](https://github.com/prettier/prettier) * [prettier](https://github.com/prettier/prettier)
@ -567,10 +581,12 @@ formatting.
* [reek](https://github.com/troessner/reek) * [reek](https://github.com/troessner/reek)
* [rubocop](https://github.com/bbatsov/rubocop) * [rubocop](https://github.com/bbatsov/rubocop)
* [ruby](https://www.ruby-lang.org) * [ruby](https://www.ruby-lang.org)
* [rubyfmt](https://github.com/fables-tales/rubyfmt)
* [rufo](https://github.com/ruby-formatter/rufo) * [rufo](https://github.com/ruby-formatter/rufo)
* [solargraph](https://solargraph.org) * [solargraph](https://solargraph.org)
* [sorbet](https://github.com/sorbet/sorbet) * [sorbet](https://github.com/sorbet/sorbet)
* [standardrb](https://github.com/testdouble/standard) * [standardrb](https://github.com/testdouble/standard)
* [steep](https://github.com/soutaro/steep)
* [syntax_tree](https://github.com/ruby-syntax-tree/syntax_tree) * [syntax_tree](https://github.com/ruby-syntax-tree/syntax_tree)
* Rust * Rust
* [cargo](https://github.com/rust-lang/cargo) :floppy_disk: (see `:help ale-integration-rust` for configuration instructions) * [cargo](https://github.com/rust-lang/cargo) :floppy_disk: (see `:help ale-integration-rust` for configuration instructions)
@ -659,6 +675,7 @@ formatting.
* TOML * TOML
* [dprint](https://dprint.dev) * [dprint](https://dprint.dev)
* TypeScript * TypeScript
* [biome](https://biomejs.dev/)
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell) * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [deno](https://deno.land/) * [deno](https://deno.land/)
* [dprint](https://dprint.dev/) * [dprint](https://dprint.dev/)
@ -678,6 +695,7 @@ formatting.
* Verilog * Verilog
* [hdl-checker](https://pypi.org/project/hdl-checker) * [hdl-checker](https://pypi.org/project/hdl-checker)
* [iverilog](https://github.com/steveicarus/iverilog) * [iverilog](https://github.com/steveicarus/iverilog)
* [slang](https://github.com/MikePopoloski/slang)
* [verilator](http://www.veripool.org/projects/verilator/wiki/Intro) * [verilator](http://www.veripool.org/projects/verilator/wiki/Intro)
* [vlog](https://www.mentor.com/products/fv/questa/) * [vlog](https://www.mentor.com/products/fv/questa/)
* [xvlog](https://www.xilinx.com/products/design-tools/vivado.html) * [xvlog](https://www.xilinx.com/products/design-tools/vivado.html)
@ -708,7 +726,7 @@ formatting.
* XML * XML
* [xmllint](http://xmlsoft.org/xmllint.html) * [xmllint](http://xmlsoft.org/xmllint.html)
* YAML * YAML
* [actionlint](https://github.com/rhysd/actionlint) :warning: * [actionlint](https://github.com/rhysd/actionlint)
* [circleci](https://circleci.com/docs/2.0/local-cli) :floppy_disk: :warning: * [circleci](https://circleci.com/docs/2.0/local-cli) :floppy_disk: :warning:
* [gitlablint](https://github.com/elijah-roberts/gitlab-lint) * [gitlablint](https://github.com/elijah-roberts/gitlab-lint)
* [prettier](https://github.com/prettier/prettier) * [prettier](https://github.com/prettier/prettier)

View file

@ -4,3 +4,7 @@ dist.bat
*.zip *.zip
tags tags
*.sw[a-p] *.sw[a-p]
# Github token.
github_token

View file

@ -0,0 +1,54 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
#version: 1
env_files:
# GoReleaser requires an API token with the 'repo' scope selected to deploy
# the artifacts to GitHub. You can create one here
# https://github.com/settings/tokens/new.
github_token: ./github_token
#before:
# hooks:
# # You may remove this if you don't use go modules.
# - go mod tidy
# # you may remove this if you don't need go generate
# - go generate ./...
builds:
- skip: true
archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: '{{ .Tag }}-next'
changelog:
use: github-native
sort: asc
release:
draft: false
replace_existing_draft: true

View file

@ -1,7 +1,7 @@
*bufexplorer.txt* Buffer Explorer Last Change: 01 May 2023 *bufexplorer.txt* Buffer Explorer Last Change: 13 Aug 2024
Buffer Explorer *buffer-explorer* *bufexplorer* Buffer Explorer *buffer-explorer* *bufexplorer*
Version 7.4.26 Version 7.4.27
Plugin for easily exploring (or browsing) Vim|:buffers|. Plugin for easily exploring (or browsing) Vim|:buffers|.
@ -263,6 +263,10 @@ The default is 1.
=============================================================================== ===============================================================================
CHANGE LOG *bufexplorer-changelog* CHANGE LOG *bufexplorer-changelog*
7.4.27 May 30, 2024
- Thanks to GitHub user NotNormallyAGitUser, for the recommendation to
change the display of the relative path to replace $HOME with "~".
This save valuable screen real estate.
7.4.26 May 01, 2023 7.4.26 May 01, 2023
What's Changed What's Changed
- wipe explorer buffer on hide by @basharh in - wipe explorer buffer on hide by @basharh in
@ -795,9 +799,9 @@ TODO *bufexplorer-todo*
=============================================================================== ===============================================================================
CREDITS *bufexplorer-credits* CREDITS *bufexplorer-credits*
Author: Jeff Lanzarotta <delux256-vim at outlook dot com> Author: Jeff Lanzarotta <my name at gmail dot com>
Credit must go out to Bram Moolenaar and all the Vim developers for Credit must go out to Bram Moolenaar (RIP) and all the Vim developers for
making the world's best editor (IMHO). I also want to thank everyone who making the world's best editor (IMHO). I also want to thank everyone who
helped and gave me suggestions. I wouldn't want to leave anyone out so I helped and gave me suggestions. I wouldn't want to leave anyone out so I
won't list names. won't list names.
@ -805,7 +809,7 @@ won't list names.
=============================================================================== ===============================================================================
COPYRIGHT *bufexplorer-copyright* COPYRIGHT *bufexplorer-copyright*
Copyright (c) 2001-2022, Jeff Lanzarotta Copyright (c) 2001-2024, Jeff Lanzarotta
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View file

@ -0,0 +1,16 @@
https://goreleaser.com/quick-start/
To make a release...
1. Make changes.
2. Commit and push changes.
3. git tag -a v7.4.27 -m "Release v7.4.27."
4. git push origin v7.4.27
5. goreleaser release --clean
6. Go to github and make the release.
If something happens and the tag is messed up, you will need to delete the
local and remote tag and release again. To delete the tag:
1. git tag -d v7.4.27
2. git push --delete origin v7.4.27

View file

@ -1,5 +1,5 @@
"============================================================================ "============================================================================
" Copyright: Copyright (c) 2001-2023, Jeff Lanzarotta " Copyright: Copyright (c) 2001-2024, Jeff Lanzarotta
" All rights reserved. " All rights reserved.
" "
" Redistribution and use in source and binary forms, with or " Redistribution and use in source and binary forms, with or
@ -36,7 +36,7 @@
" Name Of File: bufexplorer.vim " Name Of File: bufexplorer.vim
" Description: Buffer Explorer Vim Plugin " Description: Buffer Explorer Vim Plugin
" Maintainer: Jeff Lanzarotta (my name at gmail dot com) " Maintainer: Jeff Lanzarotta (my name at gmail dot com)
" Last Changed: Monday, 01 May 2023 " Last Changed: Tuesday, 13 August 2024
" Version: See g:bufexplorer_version for version number. " Version: See g:bufexplorer_version for version number.
" Usage: This file should reside in the plugin directory and be " Usage: This file should reside in the plugin directory and be
" automatically sourced. " automatically sourced.
@ -74,7 +74,7 @@ endif
"1}}} "1}}}
" Version number " Version number
let g:bufexplorer_version = "7.4.26" let g:bufexplorer_version = "7.4.27"
" Plugin Code {{{1 " Plugin Code {{{1
" Check for Vim version {{{2 " Check for Vim version {{{2
@ -770,12 +770,12 @@ function! s:BuildBufferList()
" Are we to split the path and file name? " Are we to split the path and file name?
if g:bufExplorerSplitOutPathName if g:bufExplorerSplitOutPathName
let type = (g:bufExplorerShowRelativePath) ? "relativepath" : "path" let type = (g:bufExplorerShowRelativePath) ? "relativepath" : "path"
let path = buf[type] let path = substitute( buf[type], $HOME."\\>", "~", "" )
let pad = (g:bufExplorerShowUnlisted) ? s:allpads.shortname : s:listedpads.shortname let pad = (g:bufExplorerShowUnlisted) ? s:allpads.shortname : s:listedpads.shortname
let line .= buf.shortname." ".strpart(pad.path, s:StringWidth(buf.shortname)) let line .= buf.shortname." ".strpart(pad.path, s:StringWidth(buf.shortname))
else else
let type = (g:bufExplorerShowRelativePath) ? "relativename" : "fullname" let type = (g:bufExplorerShowRelativePath) ? "relativename" : "fullname"
let path = buf[type] let path = substitute( buf[type], $HOME."\\>", "~", "" )
let line .= path let line .= path
endif endif

View file

@ -0,0 +1,20 @@
name: Auto-close PR
on:
pull_request_target:
types: [opened, reopened]
jobs:
close:
name: Run
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- run: |
gh pr close ${{ github.event.pull_request.number }} --comment \
"At the moment we are not accepting contributions to the repository.
Feedback for Copilot.vim can be given in the [Copilot community discussions](https://github.com/orgs/community/discussions/categories/copilot)."
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -1,4 +1,4 @@
# Copilot.vim # GitHub Copilot for Vim and Neovim
GitHub Copilot uses OpenAI Codex to suggest code and entire functions in GitHub Copilot uses OpenAI Codex to suggest code and entire functions in
real-time right from your editor. Trained on billions of lines of public real-time right from your editor. Trained on billions of lines of public
@ -48,7 +48,7 @@ Terms](https://docs.github.com/en/site-policy/github-terms/github-terms-for-addi
git clone https://github.com/github/copilot.vim.git ` git clone https://github.com/github/copilot.vim.git `
$HOME/AppData/Local/nvim/pack/github/start/copilot.vim $HOME/AppData/Local/nvim/pack/github/start/copilot.vim
4. Start Neovim and invoke `:Copilot setup`. 4. Start Vim/Neovim and invoke `:Copilot setup`.
[Node.js]: https://nodejs.org/en/download/ [Node.js]: https://nodejs.org/en/download/
[Neovim]: https://github.com/neovim/neovim/releases/latest [Neovim]: https://github.com/neovim/neovim/releases/latest

View file

@ -1,11 +1,6 @@
if exists('g:autoloaded_copilot')
finish
endif
let g:autoloaded_copilot = 1
scriptencoding utf-8 scriptencoding utf-8
let s:has_nvim_ghost_text = has('nvim-0.6') && exists('*nvim_buf_get_mark') let s:has_nvim_ghost_text = has('nvim-0.7') && exists('*nvim_buf_get_mark')
let s:vim_minimum_version = '9.0.0185' let s:vim_minimum_version = '9.0.0185'
let s:has_vim_ghost_text = has('patch-' . s:vim_minimum_version) && has('textprop') let s:has_vim_ghost_text = has('patch-' . s:vim_minimum_version) && has('textprop')
let s:has_ghost_text = s:has_nvim_ghost_text || s:has_vim_ghost_text let s:has_ghost_text = s:has_nvim_ghost_text || s:has_vim_ghost_text
@ -39,81 +34,68 @@ function! s:EditorConfiguration() abort
\ } \ }
endfunction endfunction
function! s:StatusNotification(params, ...) abort
let status = get(a:params, 'status', '')
if status ==? 'error'
let s:agent_error = a:params.message
else
unlet! s:agent_error
endif
endfunction
function! copilot#Init(...) abort function! copilot#Init(...) abort
call timer_start(0, { _ -> s:Start() }) call copilot#util#Defer({ -> exists('s:client') || s:Start() })
endfunction endfunction
function! s:Running() abort function! s:Running() abort
return exists('s:agent.job') || exists('s:agent.client_id') return exists('s:client.job') || exists('s:client.client_id')
endfunction endfunction
function! s:Start() abort function! s:Start() abort
if s:Running() if s:Running() || exists('s:client.startup_error')
return return
endif endif
let s:agent = copilot#agent#New({'methods': { let s:client = copilot#client#New({'editorConfiguration' : s:EditorConfiguration()})
\ 'statusNotification': function('s:StatusNotification'),
\ 'PanelSolution': function('copilot#panel#Solution'),
\ 'PanelSolutionsDone': function('copilot#panel#SolutionsDone'),
\ 'copilot/openURL': function('s:OpenURL'),
\ },
\ 'editorConfiguration' : s:EditorConfiguration()})
endfunction endfunction
function! s:Stop() abort function! s:Stop() abort
if exists('s:agent') if exists('s:client')
let agent = remove(s:, 'agent') let client = remove(s:, 'client')
call agent.Close() call client.Close()
endif endif
endfunction endfunction
function! copilot#Agent() abort function! copilot#Client() abort
call s:Start() call s:Start()
return s:agent return s:client
endfunction endfunction
function! copilot#RunningAgent() abort function! copilot#RunningClient() abort
if s:Running() if s:Running()
return s:agent return s:client
else else
return v:null return v:null
endif endif
endfunction endfunction
function! s:NodeVersionWarning() abort if has('nvim-0.7') && !has(luaeval('vim.version().api_prerelease') ? 'nvim-0.8.1' : 'nvim-0.8.0')
if exists('s:agent.node_version') && s:agent.node_version =~# '^16\.' let s:editor_warning = 'Neovim 0.7 support is deprecated and will be dropped in a future release of copilot.vim.'
endif
if has('vim_starting') && exists('s:editor_warning')
call copilot#logger#Warn(s:editor_warning)
endif
function! s:EditorVersionWarning() abort
if exists('s:editor_warning')
echohl WarningMsg echohl WarningMsg
echo "Warning: Node.js 16 is approaching end of life and support will be dropped in a future release of copilot.vim." echo 'Warning: ' . s:editor_warning
echohl NONE echohl None
elseif exists('s:agent.node_version_warning')
echohl WarningMsg
echo 'Warning:' s:agent.node_version_warning
echohl NONE
endif endif
endfunction endfunction
function! copilot#Request(method, params, ...) abort function! copilot#Request(method, params, ...) abort
let agent = copilot#Agent() let client = copilot#Client()
return call(agent.Request, [a:method, a:params] + a:000) return call(client.Request, [a:method, a:params] + a:000)
endfunction endfunction
function! copilot#Call(method, params, ...) abort function! copilot#Call(method, params, ...) abort
let agent = copilot#Agent() let client = copilot#Client()
return call(agent.Call, [a:method, a:params] + a:000) return call(client.Call, [a:method, a:params] + a:000)
endfunction endfunction
function! copilot#Notify(method, params, ...) abort function! copilot#Notify(method, params, ...) abort
let agent = copilot#Agent() let client = copilot#Client()
return call(agent.Notify, [a:method, a:params] + a:000) return call(client.Notify, [a:method, a:params] + a:000)
endfunction endfunction
function! copilot#NvimNs() abort function! copilot#NvimNs() abort
@ -125,37 +107,21 @@ function! copilot#Clear() abort
call timer_stop(remove(g:, '_copilot_timer')) call timer_stop(remove(g:, '_copilot_timer'))
endif endif
if exists('b:_copilot') if exists('b:_copilot')
call copilot#agent#Cancel(get(b:_copilot, 'first', {})) call copilot#client#Cancel(get(b:_copilot, 'first', {}))
call copilot#agent#Cancel(get(b:_copilot, 'cycling', {})) call copilot#client#Cancel(get(b:_copilot, 'cycling', {}))
endif endif
call s:UpdatePreview() call s:UpdatePreview()
unlet! b:_copilot unlet! b:_copilot
return '' return ''
endfunction endfunction
function! s:Reject(bufnr) abort
try
let dict = getbufvar(a:bufnr, '_copilot')
if type(dict) == v:t_dict && !empty(get(dict, 'shown_choices', {}))
call copilot#Request('notifyRejected', {'uuids': keys(dict.shown_choices)})
let dict.shown_choices = {}
endif
catch
call copilot#logger#Exception()
endtry
endfunction
function! copilot#Dismiss() abort function! copilot#Dismiss() abort
call s:Reject('%')
call copilot#Clear() call copilot#Clear()
call s:UpdatePreview() call s:UpdatePreview()
return '' return ''
endfunction endfunction
let s:filetype_defaults = { let s:filetype_defaults = {
\ 'yaml': 0,
\ 'markdown': 0,
\ 'help': 0,
\ 'gitcommit': 0, \ 'gitcommit': 0,
\ 'gitrebase': 0, \ 'gitrebase': 0,
\ 'hgcommit': 0, \ 'hgcommit': 0,
@ -192,26 +158,41 @@ endfunction
function! copilot#Enabled() abort function! copilot#Enabled() abort
return get(g:, 'copilot_enabled', 1) return get(g:, 'copilot_enabled', 1)
\ && empty(s:BufferDisabled()) \ && empty(s:BufferDisabled())
\ && empty(copilot#Agent().StartupError())
endfunction endfunction
let s:inline_invoked = 1
let s:inline_automatic = 2
function! copilot#Complete(...) abort function! copilot#Complete(...) abort
if exists('g:_copilot_timer') if exists('g:_copilot_timer')
call timer_stop(remove(g:, '_copilot_timer')) call timer_stop(remove(g:, '_copilot_timer'))
endif endif
let params = copilot#doc#Params() let target = [bufnr(''), getbufvar('', 'changedtick'), line('.'), col('.')]
if !exists('b:_copilot.params') || b:_copilot.params !=# params if !exists('b:_copilot.target') || b:_copilot.target !=# target
let b:_copilot = {'params': params, 'first': if exists('b:_copilot.first')
\ copilot#Request('getCompletions', params)} call copilot#client#Cancel(b:_copilot.first)
endif
if exists('b:_copilot.cycling')
call copilot#client#Cancel(b:_copilot.cycling)
endif
let params = {
\ 'textDocument': {'uri': bufnr('')},
\ 'position': copilot#util#AppendPosition(),
\ 'formattingOptions': {'insertSpaces': &expandtab ? v:true : v:false, 'tabSize': shiftwidth()},
\ 'context': {'triggerKind': s:inline_automatic}}
let b:_copilot = {
\ 'target': target,
\ 'params': params,
\ 'first': copilot#Request('textDocument/inlineCompletion', params)}
let g:_copilot_last = b:_copilot let g:_copilot_last = b:_copilot
endif endif
let completion = b:_copilot.first let completion = b:_copilot.first
if !a:0 if !a:0
return completion.Await() return completion.Await()
else else
call copilot#agent#Result(completion, a:1) call copilot#client#Result(completion, function(a:1, [b:_copilot]))
if a:0 > 1 if a:0 > 1
call copilot#agent#Error(completion, a:2) call copilot#client#Error(completion, function(a:2, [b:_copilot]))
endif endif
endif endif
endfunction endfunction
@ -221,37 +202,37 @@ function! s:HideDuringCompletion() abort
endfunction endfunction
function! s:SuggestionTextWithAdjustments() abort function! s:SuggestionTextWithAdjustments() abort
let empty = ['', 0, 0, {}]
try try
if mode() !~# '^[iR]' || (s:HideDuringCompletion() && pumvisible()) || !exists('b:_copilot.suggestions') if mode() !~# '^[iR]' || (s:HideDuringCompletion() && pumvisible()) || !exists('b:_copilot.suggestions')
return ['', 0, 0, ''] return empty
endif endif
let choice = get(b:_copilot.suggestions, b:_copilot.choice, {}) let choice = get(b:_copilot.suggestions, b:_copilot.choice, {})
if !has_key(choice, 'range') || choice.range.start.line != line('.') - 1 || type(choice.text) !=# v:t_string if !has_key(choice, 'range') || choice.range.start.line != line('.') - 1 || type(choice.insertText) !=# v:t_string
return ['', 0, 0, ''] return empty
endif endif
let line = getline('.') let line = getline('.')
let offset = col('.') - 1 let offset = col('.') - 1
let choice_text = strpart(line, 0, copilot#doc#UTF16ToByteIdx(line, choice.range.start.character)) . choice.text let choice_text = strpart(line, 0, copilot#util#UTF16ToByteIdx(line, choice.range.start.character)) . substitute(choice.insertText, "\n*$", '', '')
let typed = strpart(line, 0, offset) let typed = strpart(line, 0, offset)
let end_offset = copilot#doc#UTF16ToByteIdx(line, choice.range.end.character) let end_offset = copilot#util#UTF16ToByteIdx(line, choice.range.end.character)
if end_offset < 0 if end_offset < 0
let end_offset = len(line) let end_offset = len(line)
endif endif
let delete = strpart(line, offset, end_offset - offset) let delete = strpart(line, offset, end_offset - offset)
let uuid = get(choice, 'uuid', '')
if typed =~# '^\s*$' if typed =~# '^\s*$'
let leading = matchstr(choice_text, '^\s\+') let leading = matchstr(choice_text, '^\s\+')
let unindented = strpart(choice_text, len(leading)) let unindented = strpart(choice_text, len(leading))
if strpart(typed, 0, len(leading)) == leading && unindented !=# delete if strpart(typed, 0, len(leading)) == leading && unindented !=# delete
return [unindented, len(typed) - len(leading), strchars(delete), uuid] return [unindented, len(typed) - len(leading), strchars(delete), choice]
endif endif
elseif typed ==# strpart(choice_text, 0, offset) elseif typed ==# strpart(choice_text, 0, offset)
return [strpart(choice_text, offset), 0, strchars(delete), uuid] return [strpart(choice_text, offset), 0, strchars(delete), choice]
endif endif
catch catch
call copilot#logger#Exception() call copilot#logger#Exception()
endtry endtry
return ['', 0, 0, ''] return empty
endfunction endfunction
@ -271,12 +252,12 @@ function! s:GetSuggestionsCyclingCallback(context, result) abort
let callbacks = remove(a:context, 'cycling_callbacks') let callbacks = remove(a:context, 'cycling_callbacks')
let seen = {} let seen = {}
for suggestion in a:context.suggestions for suggestion in a:context.suggestions
let seen[suggestion.text] = 1 let seen[suggestion.insertText] = 1
endfor endfor
for suggestion in get(a:result, 'completions', []) for suggestion in get(a:result, 'items', [])
if !has_key(seen, suggestion.text) if !has_key(seen, suggestion.insertText)
call add(a:context.suggestions, suggestion) call add(a:context.suggestions, suggestion)
let seen[suggestion.text] = 1 let seen[suggestion.insertText] = 1
endif endif
endfor endfor
for Callback in callbacks for Callback in callbacks
@ -290,9 +271,11 @@ function! s:GetSuggestionsCycling(callback) abort
elseif exists('b:_copilot.cycling') elseif exists('b:_copilot.cycling')
call a:callback(b:_copilot) call a:callback(b:_copilot)
elseif exists('b:_copilot.suggestions') elseif exists('b:_copilot.suggestions')
let params = deepcopy(b:_copilot.first.params)
let params.context.triggerKind = s:inline_invoked
let b:_copilot.cycling_callbacks = [a:callback] let b:_copilot.cycling_callbacks = [a:callback]
let b:_copilot.cycling = copilot#Request('getCompletionsCycling', let b:_copilot.cycling = copilot#Request('textDocument/inlineCompletion',
\ b:_copilot.first.params, \ params,
\ function('s:GetSuggestionsCyclingCallback', [b:_copilot]), \ function('s:GetSuggestionsCyclingCallback', [b:_copilot]),
\ function('s:GetSuggestionsCyclingCallback', [b:_copilot]), \ function('s:GetSuggestionsCyclingCallback', [b:_copilot]),
\ ) \ )
@ -310,10 +293,10 @@ function! copilot#Previous() abort
endfunction endfunction
function! copilot#GetDisplayedSuggestion() abort function! copilot#GetDisplayedSuggestion() abort
let [text, outdent, delete, uuid] = s:SuggestionTextWithAdjustments() let [text, outdent, delete, item] = s:SuggestionTextWithAdjustments()
return { return {
\ 'uuid': uuid, \ 'item': item,
\ 'text': text, \ 'text': text,
\ 'outdentSize': outdent, \ 'outdentSize': outdent,
\ 'deleteSize': delete} \ 'deleteSize': delete}
@ -330,8 +313,8 @@ endfunction
function! s:UpdatePreview() abort function! s:UpdatePreview() abort
try try
let [text, outdent, delete, uuid] = s:SuggestionTextWithAdjustments() let [text, outdent, delete, item] = s:SuggestionTextWithAdjustments()
let text = split(text, "\n", 1) let text = split(text, "\r\n\\=\\|\n", 1)
if empty(text[-1]) if empty(text[-1])
call remove(text, -1) call remove(text, -1)
endif endif
@ -348,7 +331,7 @@ function! s:UpdatePreview() abort
call s:ClearPreview() call s:ClearPreview()
if s:has_nvim_ghost_text if s:has_nvim_ghost_text
let data = {'id': 1} let data = {'id': 1}
let data.virt_text_win_col = virtcol('.') - 1 let data.virt_text_pos = 'overlay'
let append = strpart(getline('.'), col('.') - 1 + delete) let append = strpart(getline('.'), col('.') - 1 + delete)
let data.virt_text = [[text[0] . append . repeat(' ', delete - len(text[0])), s:hlgroup]] let data.virt_text = [[text[0] . append . repeat(' ', delete - len(text[0])), s:hlgroup]]
if len(text) > 1 if len(text) > 1
@ -361,8 +344,27 @@ function! s:UpdatePreview() abort
endif endif
let data.hl_mode = 'combine' let data.hl_mode = 'combine'
call nvim_buf_set_extmark(0, copilot#NvimNs(), line('.')-1, col('.')-1, data) call nvim_buf_set_extmark(0, copilot#NvimNs(), line('.')-1, col('.')-1, data)
else elseif s:has_vim_ghost_text
call prop_add(line('.'), col('.'), {'type': s:hlgroup, 'text': text[0]}) let new_suffix = text[0]
let current_suffix = getline('.')[col('.') - 1 :]
let inset = ''
while delete > 0 && !empty(new_suffix)
let last_char = matchstr(new_suffix, '.$')
let new_suffix = matchstr(new_suffix, '^.\{-\}\ze.$')
if last_char ==# matchstr(current_suffix, '.$')
if !empty(inset)
call prop_add(line('.'), col('.') + len(current_suffix), {'type': s:hlgroup, 'text': inset})
let inset = ''
endif
let current_suffix = matchstr(current_suffix, '^.\{-\}\ze.$')
let delete -= 1
else
let inset = last_char . inset
endif
endwhile
if !empty(new_suffix . inset)
call prop_add(line('.'), col('.'), {'type': s:hlgroup, 'text': new_suffix . inset})
endif
for line in text[1:] for line in text[1:]
call prop_add(line('.'), 0, {'type': s:hlgroup, 'text_align': 'below', 'text': line}) call prop_add(line('.'), 0, {'type': s:hlgroup, 'text_align': 'below', 'text': line})
endfor endfor
@ -370,28 +372,35 @@ function! s:UpdatePreview() abort
call prop_add(line('.'), col('$'), {'type': s:annot_hlgroup, 'text': ' ' . annot}) call prop_add(line('.'), col('$'), {'type': s:annot_hlgroup, 'text': ' ' . annot})
endif endif
endif endif
if !has_key(b:_copilot.shown_choices, uuid) call copilot#Notify('textDocument/didShowCompletion', {'item': item})
let b:_copilot.shown_choices[uuid] = v:true
call copilot#Request('notifyShown', {'uuid': uuid})
endif
catch catch
return copilot#logger#Exception() return copilot#logger#Exception()
endtry endtry
endfunction endfunction
function! s:HandleTriggerResult(result) abort function! s:HandleTriggerResult(state, result) abort
if !exists('b:_copilot') let a:state.suggestions = type(a:result) == type([]) ? a:result : get(empty(a:result) ? {} : a:result, 'items', [])
return let a:state.choice = 0
if get(b:, '_copilot') is# a:state
call s:UpdatePreview()
endif
endfunction
function! s:HandleTriggerError(state, result) abort
let a:state.suggestions = []
let a:state.choice = 0
let a:state.error = a:result
if get(b:, '_copilot') is# a:state
call s:UpdatePreview()
endif endif
let b:_copilot.suggestions = get(a:result, 'completions', [])
let b:_copilot.choice = 0
let b:_copilot.shown_choices = {}
call s:UpdatePreview()
endfunction endfunction
function! copilot#Suggest() abort function! copilot#Suggest() abort
if !s:Running()
return ''
endif
try try
call copilot#Complete(function('s:HandleTriggerResult'), function('s:HandleTriggerResult')) call copilot#Complete(function('s:HandleTriggerResult'), function('s:HandleTriggerError'))
catch catch
call copilot#logger#Exception() call copilot#logger#Exception()
endtry endtry
@ -400,30 +409,52 @@ endfunction
function! s:Trigger(bufnr, timer) abort function! s:Trigger(bufnr, timer) abort
let timer = get(g:, '_copilot_timer', -1) let timer = get(g:, '_copilot_timer', -1)
unlet! g:_copilot_timer
if a:bufnr !=# bufnr('') || a:timer isnot# timer || mode() !=# 'i' if a:bufnr !=# bufnr('') || a:timer isnot# timer || mode() !=# 'i'
return return
endif endif
unlet! g:_copilot_timer
return copilot#Suggest() return copilot#Suggest()
endfunction endfunction
function! copilot#IsMapped() abort function! copilot#Schedule() abort
return get(g:, 'copilot_assume_mapped') || if !s:has_ghost_text || !s:Running() || !copilot#Enabled()
\ hasmapto('copilot#Accept(', 'i')
endfunction
function! copilot#Schedule(...) abort
if !s:has_ghost_text || !copilot#Enabled() || !copilot#IsMapped()
call copilot#Clear() call copilot#Clear()
return return
endif endif
call s:UpdatePreview() call s:UpdatePreview()
let delay = a:0 ? a:1 : get(g:, 'copilot_idle_delay', 15) let delay = get(g:, 'copilot_idle_delay', 45)
call timer_stop(get(g:, '_copilot_timer', -1))
let g:_copilot_timer = timer_start(delay, function('s:Trigger', [bufnr('')])) let g:_copilot_timer = timer_start(delay, function('s:Trigger', [bufnr('')]))
endfunction endfunction
function! copilot#OnInsertLeave() abort function! s:Attach(bufnr, ...) abort
return copilot#Clear() try
return copilot#Client().Attach(a:bufnr)
catch
call copilot#logger#Exception()
endtry
endfunction
function! copilot#OnFileType() abort
if empty(s:BufferDisabled()) && &l:modifiable && &l:buflisted
call copilot#util#Defer(function('s:Attach'), bufnr(''))
endif
endfunction
function! s:Focus(bufnr, ...) abort
if s:Running() && copilot#Client().IsAttached(a:bufnr)
call copilot#Client().Notify('textDocument/didFocus', {'textDocument': {'uri': copilot#Client().Attach(a:bufnr).uri}})
endif
endfunction
function! copilot#OnBufEnter() abort
let bufnr = bufnr('')
call copilot#util#Defer(function('s:Focus'), bufnr)
endfunction
function! copilot#OnInsertLeavePre() abort
call copilot#Clear()
call s:ClearPreview()
endfunction endfunction
function! copilot#OnInsertEnter() abort function! copilot#OnInsertEnter() abort
@ -443,7 +474,6 @@ function! copilot#OnCursorMovedI() abort
endfunction endfunction
function! copilot#OnBufUnload() abort function! copilot#OnBufUnload() abort
call s:Reject(+expand('<abuf>'))
endfunction endfunction
function! copilot#OnVimLeavePre() abort function! copilot#OnVimLeavePre() abort
@ -468,11 +498,19 @@ function! copilot#Accept(...) abort
if empty(text) if empty(text)
let text = s.text let text = s.text
endif endif
call copilot#Request('notifyAccepted', {'uuid': s.uuid, 'acceptedLength': copilot#doc#UTF16Width(text)}) if text ==# s.text && has_key(s.item, 'command')
call copilot#Request('workspace/executeCommand', s.item.command)
else
let line_text = strpart(getline('.'), 0, col('.') - 1) . text
call copilot#Notify('textDocument/didPartiallyAcceptCompletion', {
\ 'item': s.item,
\ 'acceptedLength': copilot#util#UTF16Width(line_text) - s.item.range.start.character})
endif
call s:ClearPreview() call s:ClearPreview()
let s:suggestion_text = text let s:suggestion_text = text
let recall = text =~# "\n" ? "\<C-R>\<C-O>=" : "\<C-R>\<C-R>="
return repeat("\<Left>\<Del>", s.outdentSize) . repeat("\<Del>", s.deleteSize) . return repeat("\<Left>\<Del>", s.outdentSize) . repeat("\<Del>", s.deleteSize) .
\ "\<C-R>\<C-O>=copilot#TextQueuedForInsertion()\<CR>" . (a:0 > 1 ? '' : "\<End>") \ recall . "copilot#TextQueuedForInsertion()\<CR>" . (a:0 > 1 ? '' : "\<End>")
endif endif
let default = get(g:, 'copilot_tab_fallback', pumvisible() ? "\<C-N>" : "\t") let default = get(g:, 'copilot_tab_fallback', pumvisible() ? "\<C-N>" : "\t")
if !a:0 if !a:0
@ -525,21 +563,6 @@ function! copilot#Browser() abort
endif endif
endfunction endfunction
function! s:OpenURL(params) abort
echo a:params.target
let browser = copilot#Browser()
if empty(browser)
return v:false
endif
let status = {}
call copilot#job#Stream(browser + [a:params.target], v:null, v:null, function('s:BrowserCallback', [status]))
let time = reltime()
while empty(status) && reltimefloat(reltime(time)) < 1
sleep 10m
endwhile
return get(status, 'code') ? v:false : v:true
endfunction
let s:commands = {} let s:commands = {}
function! s:EnabledStatusMessage() abort function! s:EnabledStatusMessage() abort
@ -550,8 +573,6 @@ function! s:EnabledStatusMessage() abort
else else
return "Vim " . s:vim_minimum_version . " required to support ghost text" return "Vim " . s:vim_minimum_version . " required to support ghost text"
endif endif
elseif !copilot#IsMapped()
return '<Tab> map has been disabled or is claimed by another plugin'
elseif !get(g:, 'copilot_enabled', 1) elseif !get(g:, 'copilot_enabled', 1)
return 'Disabled globally by :Copilot disable' return 'Disabled globally by :Copilot disable'
elseif buf_disabled is# 5 elseif buf_disabled is# 5
@ -572,7 +593,7 @@ function! s:EnabledStatusMessage() abort
endfunction endfunction
function! s:VerifySetup() abort function! s:VerifySetup() abort
let error = copilot#Agent().StartupError() let error = copilot#Client().StartupError()
if !empty(error) if !empty(error)
echo 'Copilot: ' . error echo 'Copilot: ' . error
return return
@ -589,6 +610,12 @@ function! s:VerifySetup() abort
echo 'Copilot: Telemetry terms not accepted. Invoke :Copilot setup' echo 'Copilot: Telemetry terms not accepted. Invoke :Copilot setup'
return return
endif endif
if status.status ==# 'NotAuthorized'
echo "Copilot: You don't have access to GitHub Copilot. Sign up by visiting https://github.com/settings/copilot"
return
endif
return 1 return 1
endfunction endfunction
@ -597,31 +624,22 @@ function! s:commands.status(opts) abort
return return
endif endif
if exists('s:client.status.status') && s:client.status.status =~# 'Warning\|Error'
echo 'Copilot: ' . s:client.status.status
if !empty(get(s:client.status, 'message', ''))
echon ': ' . s:client.status.message
endif
return
endif
let status = s:EnabledStatusMessage() let status = s:EnabledStatusMessage()
if !empty(status) if !empty(status)
echo 'Copilot: ' . status echo 'Copilot: ' . status
return return
endif endif
let startup_error = copilot#Agent().StartupError() echo 'Copilot: Ready'
if !empty(startup_error) call s:EditorVersionWarning()
echo 'Copilot: ' . startup_error
return
endif
if exists('s:agent_error')
echo 'Copilot: ' . s:agent_error
return
endif
let status = copilot#Call('checkStatus', {})
if status.status ==# 'NotAuthorized'
echo 'Copilot: Not authorized'
return
endif
echo 'Copilot: Enabled and online'
call s:NodeVersionWarning()
endfunction endfunction
function! s:commands.signout(opts) abort function! s:commands.signout(opts) abort
@ -635,7 +653,7 @@ function! s:commands.signout(opts) abort
endfunction endfunction
function! s:commands.setup(opts) abort function! s:commands.setup(opts) abort
let startup_error = copilot#Agent().StartupError() let startup_error = copilot#Client().StartupError()
if !empty(startup_error) if !empty(startup_error)
echo 'Copilot: ' . startup_error echo 'Copilot: ' . startup_error
return return
@ -645,7 +663,7 @@ function! s:commands.setup(opts) abort
let status = copilot#Call('checkStatus', {}) let status = copilot#Call('checkStatus', {})
if has_key(status, 'user') if has_key(status, 'user')
let data = {} let data = {'status': 'AlreadySignedIn', 'user': status.user}
else else
let data = copilot#Call('signInInitiate', {}) let data = copilot#Call('signInInitiate', {})
endif endif
@ -653,23 +671,25 @@ function! s:commands.setup(opts) abort
if has_key(data, 'verificationUri') if has_key(data, 'verificationUri')
let uri = data.verificationUri let uri = data.verificationUri
if has('clipboard') if has('clipboard')
let @+ = data.userCode try
let @* = data.userCode let @+ = data.userCode
catch
endtry
try
let @* = data.userCode
catch
endtry
endif endif
call s:Echo("First copy your one-time code: " . data.userCode) let codemsg = "First copy your one-time code: " . data.userCode . "\n"
try try
if len(&mouse) if len(&mouse)
let mouse = &mouse let mouse = &mouse
set mouse= set mouse=
endif endif
if get(a:opts, 'bang') if get(a:opts, 'bang')
call s:Echo("In your browser, visit " . uri) call s:Echo(codemsg . "In your browser, visit " . uri)
elseif len(browser) elseif len(browser)
call s:Echo("Press ENTER to open GitHub in your browser") call input(codemsg . "Press ENTER to open GitHub in your browser\n")
let c = getchar()
while c isnot# 13 && c isnot# 10 && c isnot# 0
let c = getchar()
endwhile
let status = {} let status = {}
call copilot#job#Stream(browser + [uri], v:null, v:null, function('s:BrowserCallback', [status])) call copilot#job#Stream(browser + [uri], v:null, v:null, function('s:BrowserCallback', [status]))
let time = reltime() let time = reltime()
@ -682,9 +702,9 @@ function! s:commands.setup(opts) abort
call s:Echo("Opened " . uri) call s:Echo("Opened " . uri)
endif endif
else else
call s:Echo("Could not find browser. Visit " . uri) call s:Echo(codemsg . "Could not find browser. Visit " . uri)
endif endif
call s:Echo("Waiting (could take up to 5 seconds)") call s:Echo("Waiting (could take up to 10 seconds)")
let request = copilot#Request('signInConfirm', {'userCode': data.userCode}).Wait() let request = copilot#Request('signInConfirm', {'userCode': data.userCode}).Wait()
finally finally
if exists('mouse') if exists('mouse')
@ -696,6 +716,8 @@ function! s:commands.setup(opts) abort
else else
let status = request.result let status = request.result
endif endif
elseif get(data, 'status', '') isnot# 'AlreadySignedIn'
return 'echoerr ' . string('Copilot: Something went wrong')
endif endif
let user = get(status, 'user', '<unknown>') let user = get(status, 'user', '<unknown>')
@ -704,22 +726,46 @@ function! s:commands.setup(opts) abort
endfunction endfunction
let s:commands.auth = s:commands.setup let s:commands.auth = s:commands.setup
let s:commands.signin = s:commands.setup
function! s:commands.help(opts) abort function! s:commands.help(opts) abort
return a:opts.mods . ' help ' . (len(a:opts.arg) ? ':Copilot_' . a:opts.arg : 'copilot') return a:opts.mods . ' help ' . (len(a:opts.arg) ? ':Copilot_' . a:opts.arg : 'copilot')
endfunction endfunction
function! s:commands.version(opts) abort function! s:commands.version(opts) abort
let info = copilot#agent#EditorInfo() echo 'copilot.vim ' .copilot#client#EditorPluginInfo().version
echo 'copilot.vim ' .info.editorPluginInfo.version let editorInfo = copilot#client#EditorInfo()
echo info.editorInfo.name . ' ' . info.editorInfo.version echo editorInfo.name . ' ' . editorInfo.version
if exists('s:agent.node_version') if s:Running()
echo 'dist/agent.js ' . s:agent.Call('getVersion', {}).version let versions = s:client.Request('getVersion', {})
echo 'Node.js ' . s:agent.node_version if exists('s:client.serverInfo.version')
call s:NodeVersionWarning() echo s:client.serverInfo.name . ' ' . s:client.serverInfo.version
else
echo 'GitHub Copilot Language Server ' . versions.Await().version
endif
if exists('s:client.node_version')
echo 'Node.js ' . s:client.node_version
else
echo 'Node.js ' . substitute(get(versions.Await(), 'runtimeVersion', '?'), '^node/', '', 'g')
endif
else else
echo 'dist/agent.js not running' echo 'Not running'
if exists('s:client.node_version')
echo 'Node.js ' . s:client.node_version
endif
endif endif
if has('win32')
echo 'Windows'
elseif has('macunix')
echo 'macOS'
elseif !has('unix')
echo 'Unknown OS'
elseif isdirectory('/sys/kernel')
echo 'Linux'
else
echo 'UNIX'
endif
call s:EditorVersionWarning()
endfunction endfunction
function! s:UpdateEditorConfiguration() abort function! s:UpdateEditorConfiguration() abort
@ -743,11 +789,8 @@ endfunction
function! s:commands.restart(opts) abort function! s:commands.restart(opts) abort
call s:Stop() call s:Stop()
let err = copilot#Agent().StartupError() echo 'Copilot: Restarting language server'
if !empty(err) call s:Start()
return 'echoerr ' . string('Copilot: ' . err)
endif
echo 'Copilot: Restarting agent.'
endfunction endfunction
function! s:commands.disable(opts) abort function! s:commands.disable(opts) abort
@ -766,6 +809,10 @@ function! s:commands.panel(opts) abort
endif endif
endfunction endfunction
function! s:commands.log(opts) abort
return a:opts.mods . ' split +$ copilot:///log'
endfunction
function! copilot#CommandComplete(arg, lead, pos) abort function! copilot#CommandComplete(arg, lead, pos) abort
let args = matchstr(strpart(a:lead, 0, a:pos), 'C\%[opilot][! ] *\zs.*') let args = matchstr(strpart(a:lead, 0, a:pos), 'C\%[opilot][! ] *\zs.*')
if args !~# ' ' if args !~# ' '
@ -779,33 +826,28 @@ endfunction
function! copilot#Command(line1, line2, range, bang, mods, arg) abort function! copilot#Command(line1, line2, range, bang, mods, arg) abort
let cmd = matchstr(a:arg, '^\%(\\.\|\S\)\+') let cmd = matchstr(a:arg, '^\%(\\.\|\S\)\+')
let arg = matchstr(a:arg, '\s\zs\S.*') let arg = matchstr(a:arg, '\s\zs\S.*')
if cmd ==# 'log'
return a:mods . ' split +$ ' . fnameescape(copilot#logger#File())
endif
if !empty(cmd) && !has_key(s:commands, tr(cmd, '-', '_')) if !empty(cmd) && !has_key(s:commands, tr(cmd, '-', '_'))
return 'echoerr ' . string('Copilot: unknown command ' . string(cmd)) return 'echoerr ' . string('Copilot: unknown command ' . string(cmd))
endif endif
try try
let err = copilot#Agent().StartupError()
if !empty(err)
return 'echo ' . string('Copilot: ' . err)
endif
try
let opts = copilot#Call('checkStatus', {'options': {'localChecksOnly': v:true}})
catch
call copilot#logger#Exception()
let opts = {'status': 'VimException'}
endtry
if empty(cmd) if empty(cmd)
if opts.status ==# 'VimException' if !s:Running()
return a:mods . ' split +$ ' . fnameescape(copilot#logger#File()) let cmd = 'restart'
elseif opts.status !=# 'OK' && opts.status !=# 'MaybeOK'
let cmd = 'setup'
else else
let cmd = 'panel' try
let opts = copilot#Call('checkStatus', {'options': {'localChecksOnly': v:true}})
if opts.status !=# 'OK' && opts.status !=# 'MaybeOK'
let cmd = 'setup'
else
let cmd = 'panel'
endif
catch
call copilot#logger#Exception()
let cmd = 'log'
endtry
endif endif
endif endif
call extend(opts, {'line1': a:line1, 'line2': a:line2, 'range': a:range, 'bang': a:bang, 'mods': a:mods, 'arg': arg}) let opts = {'line1': a:line1, 'line2': a:line2, 'range': a:range, 'bang': a:bang, 'mods': a:mods, 'arg': arg}
let retval = s:commands[tr(cmd, '-', '_')](opts) let retval = s:commands[tr(cmd, '-', '_')](opts)
if type(retval) == v:t_string if type(retval) == v:t_string
return retval return retval

Some files were not shown because too many files have changed in this diff Show more