mirror of
https://github.com/amix/vimrc
synced 2025-08-07 22:35:01 +08:00
Updated plugins
This commit is contained in:
@ -0,0 +1,16 @@
|
||||
" Author: (bosr) <bosr@bosr.cc>
|
||||
" Description: Integration of apple/swift-format formatter with ALE.
|
||||
|
||||
function! ale#fixers#appleswiftformat#Fix(buffer) abort
|
||||
let l:command_args = ale#swift#GetAppleSwiftFormatCommand(a:buffer) . ' format --in-place %t'
|
||||
let l:config_args = ale#swift#GetAppleSwiftFormatConfigArgs(a:buffer)
|
||||
|
||||
if l:config_args isnot# ''
|
||||
let l:command_args = l:command_args . ' ' . l:config_args
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command': l:command_args,
|
||||
\}
|
||||
endfunction
|
@ -19,7 +19,9 @@ function! ale#fixers#autoimport#Fix(buffer) abort
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'command': ale#path#BufferCdString(a:buffer)
|
||||
\ . ale#Escape(l:executable) . (!empty(l:options) ? ' ' . l:options : '') . ' -',
|
||||
\ 'cwd': '%s:h',
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' -',
|
||||
\}
|
||||
endfunction
|
||||
|
@ -17,25 +17,25 @@ function! ale#fixers#black#GetExecutable(buffer) abort
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#black#Fix(buffer) abort
|
||||
let l:cd_string = ale#Var(a:buffer, 'python_black_change_directory')
|
||||
\ ? ale#path#BufferCdString(a:buffer)
|
||||
\ : ''
|
||||
|
||||
let l:executable = ale#fixers#black#GetExecutable(a:buffer)
|
||||
|
||||
let l:exec_args = l:executable =~? 'pipenv$'
|
||||
\ ? ' run black'
|
||||
\ : ''
|
||||
|
||||
let l:options = ale#Var(a:buffer, 'python_black_options')
|
||||
|
||||
if expand('#' . a:buffer . ':e') is? 'pyi'
|
||||
let l:options .= '--pyi'
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'command': l:cd_string . ale#Escape(l:executable) . l:exec_args
|
||||
let l:result = {
|
||||
\ 'command': ale#Escape(l:executable) . l:exec_args
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' -',
|
||||
\}
|
||||
|
||||
if ale#Var(a:buffer, 'python_black_change_directory')
|
||||
let l:result.cwd = '%s:h'
|
||||
endif
|
||||
|
||||
return l:result
|
||||
endfunction
|
||||
|
26
sources_non_forked/ale/autoload/ale/fixers/buildifier.vim
Normal file
26
sources_non_forked/ale/autoload/ale/fixers/buildifier.vim
Normal file
@ -0,0 +1,26 @@
|
||||
" Author: Jon Parise <jon@indelible.org>
|
||||
" Description: Format Bazel BUILD and .bzl files with buildifier.
|
||||
"
|
||||
call ale#Set('bazel_buildifier_executable', 'buildifier')
|
||||
call ale#Set('bazel_buildifier_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('bazel_buildifier_options', '')
|
||||
|
||||
function! ale#fixers#buildifier#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'bazel_buildifier', [
|
||||
\ 'buildifier',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#buildifier#Fix(buffer) abort
|
||||
let l:executable = ale#Escape(ale#fixers#buildifier#GetExecutable(a:buffer))
|
||||
let l:options = ale#Var(a:buffer, 'bazel_buildifier_options')
|
||||
let l:filename = ale#Escape(bufname(a:buffer))
|
||||
|
||||
let l:command = l:executable . ' -mode fix -lint fix -path ' . l:filename
|
||||
|
||||
if l:options isnot# ''
|
||||
let l:command .= ' ' . l:options
|
||||
endif
|
||||
|
||||
return {'command': l:command . ' -'}
|
||||
endfunction
|
@ -5,6 +5,8 @@ scriptencoding utf-8
|
||||
call ale#Set('c_clangformat_executable', 'clang-format')
|
||||
call ale#Set('c_clangformat_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('c_clangformat_options', '')
|
||||
call ale#Set('c_clangformat_style_option', '')
|
||||
call ale#Set('c_clangformat_use_local_file', 0)
|
||||
|
||||
function! ale#fixers#clangformat#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'c_clangformat', [
|
||||
@ -16,6 +18,24 @@ function! ale#fixers#clangformat#Fix(buffer) abort
|
||||
let l:executable = ale#Escape(ale#fixers#clangformat#GetExecutable(a:buffer))
|
||||
let l:filename = ale#Escape(bufname(a:buffer))
|
||||
let l:options = ale#Var(a:buffer, 'c_clangformat_options')
|
||||
let l:style_option = ale#Var(a:buffer, 'c_clangformat_style_option')
|
||||
let l:use_local_file = ale#Var(a:buffer, 'c_clangformat_use_local_file')
|
||||
|
||||
if l:style_option isnot# ''
|
||||
let l:style_option = '-style=' . "'" . l:style_option . "'"
|
||||
endif
|
||||
|
||||
if l:use_local_file
|
||||
let l:config = ale#path#FindNearestFile(a:buffer, '.clang-format')
|
||||
|
||||
if !empty(l:config)
|
||||
let l:style_option = '-style=file'
|
||||
endif
|
||||
endif
|
||||
|
||||
if l:style_option isnot# ''
|
||||
let l:options .= ' ' . l:style_option
|
||||
endif
|
||||
|
||||
let l:command = l:executable . ' --assume-filename=' . l:filename
|
||||
|
||||
|
17
sources_non_forked/ale/autoload/ale/fixers/deno.vim
Normal file
17
sources_non_forked/ale/autoload/ale/fixers/deno.vim
Normal file
@ -0,0 +1,17 @@
|
||||
function! ale#fixers#deno#Fix(buffer) abort
|
||||
let l:executable = ale#handlers#deno#GetExecutable(a:buffer)
|
||||
|
||||
if !executable(l:executable)
|
||||
return 0
|
||||
endif
|
||||
|
||||
let l:options = ' fmt -'
|
||||
|
||||
if ale#Var(a:buffer, 'deno_unstable')
|
||||
let l:options = l:options . ' --unstable'
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . l:options
|
||||
\}
|
||||
endfunction
|
@ -1,23 +0,0 @@
|
||||
" Author: Pat Brisbin <pbrisbin@gmail.com>
|
||||
" Description: Integration of dhall-format with ALE.
|
||||
|
||||
call ale#Set('dhall_format_executable', 'dhall')
|
||||
|
||||
function! ale#fixers#dhall#GetExecutable(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'dhall_format_executable')
|
||||
|
||||
" Dhall is written in Haskell and commonly installed with Stack
|
||||
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'dhall')
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#dhall#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#dhall#GetExecutable(a:buffer)
|
||||
|
||||
return {
|
||||
\ 'command': l:executable
|
||||
\ . ' format'
|
||||
\ . ' --inplace'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
14
sources_non_forked/ale/autoload/ale/fixers/dhall_format.vim
Normal file
14
sources_non_forked/ale/autoload/ale/fixers/dhall_format.vim
Normal file
@ -0,0 +1,14 @@
|
||||
" Author: toastal <toastal@protonmail.com>
|
||||
" Description: Dhall’s built-in formatter
|
||||
"
|
||||
function! ale#fixers#dhall_format#Fix(buffer) abort
|
||||
let l:executable = ale#dhall#GetExecutableWithOptions(a:buffer)
|
||||
let l:command = l:executable
|
||||
\ . ' format'
|
||||
\ . ' --inplace %t'
|
||||
|
||||
return {
|
||||
\ 'command': l:command,
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
18
sources_non_forked/ale/autoload/ale/fixers/dhall_freeze.vim
Normal file
18
sources_non_forked/ale/autoload/ale/fixers/dhall_freeze.vim
Normal file
@ -0,0 +1,18 @@
|
||||
" Author: toastal <toastal@protonmail.com>
|
||||
" Description: Dhall’s package freezing
|
||||
|
||||
call ale#Set('dhall_freeze_options', '')
|
||||
|
||||
function! ale#fixers#dhall_freeze#Freeze(buffer) abort
|
||||
let l:executable = ale#dhall#GetExecutableWithOptions(a:buffer)
|
||||
let l:command = l:executable
|
||||
\ . ' freeze'
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'dhall_freeze_options'))
|
||||
\ . ' --inplace %t'
|
||||
|
||||
|
||||
return {
|
||||
\ 'command': l:command,
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
14
sources_non_forked/ale/autoload/ale/fixers/dhall_lint.vim
Normal file
14
sources_non_forked/ale/autoload/ale/fixers/dhall_lint.vim
Normal file
@ -0,0 +1,14 @@
|
||||
" Author: toastal <toastal@protonmail.com>
|
||||
" Description: Dhall’s built-in linter/formatter
|
||||
|
||||
function! ale#fixers#dhall_lint#Fix(buffer) abort
|
||||
let l:executable = ale#dhall#GetExecutableWithOptions(a:buffer)
|
||||
let l:command = l:executable
|
||||
\ . ' lint'
|
||||
\ . ' --inplace %t'
|
||||
|
||||
return {
|
||||
\ 'command': l:command,
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
21
sources_non_forked/ale/autoload/ale/fixers/erlfmt.vim
Normal file
21
sources_non_forked/ale/autoload/ale/fixers/erlfmt.vim
Normal file
@ -0,0 +1,21 @@
|
||||
" Author: AntoineGagne - https://github.com/AntoineGagne
|
||||
" Description: Integration of erlfmt with ALE.
|
||||
|
||||
call ale#Set('erlang_erlfmt_executable', 'erlfmt')
|
||||
call ale#Set('erlang_erlfmt_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('erlang_erlfmt_options', '')
|
||||
|
||||
function! ale#fixers#erlfmt#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'erlang_erlfmt', ['erlfmt'])
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#erlfmt#Fix(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'erlang_erlfmt_options')
|
||||
let l:executable = ale#fixers#erlfmt#GetExecutable(a:buffer)
|
||||
|
||||
let l:command = ale#Escape(l:executable) . (empty(l:options) ? '' : ' ' . l:options) . ' %s'
|
||||
|
||||
return {
|
||||
\ 'command': l:command
|
||||
\}
|
||||
endfunction
|
@ -53,8 +53,8 @@ function! ale#fixers#eslint#ApplyFixForVersion(buffer, version) abort
|
||||
" Use --fix-to-stdout with eslint_d
|
||||
if l:executable =~# 'eslint_d$' && ale#semver#GTE(a:version, [3, 19, 0])
|
||||
return {
|
||||
\ 'command': ale#handlers#eslint#GetCdString(a:buffer)
|
||||
\ . ale#node#Executable(a:buffer, l:executable)
|
||||
\ 'cwd': ale#handlers#eslint#GetCwd(a:buffer),
|
||||
\ 'command': ale#node#Executable(a:buffer, l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . ' --stdin-filename %s --stdin --fix-to-stdout',
|
||||
\ 'process_with': 'ale#fixers#eslint#ProcessEslintDOutput',
|
||||
@ -64,8 +64,8 @@ function! ale#fixers#eslint#ApplyFixForVersion(buffer, version) abort
|
||||
" 4.9.0 is the first version with --fix-dry-run
|
||||
if ale#semver#GTE(a:version, [4, 9, 0])
|
||||
return {
|
||||
\ 'command': ale#handlers#eslint#GetCdString(a:buffer)
|
||||
\ . ale#node#Executable(a:buffer, l:executable)
|
||||
\ 'cwd': ale#handlers#eslint#GetCwd(a:buffer),
|
||||
\ 'command': ale#node#Executable(a:buffer, l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . ' --stdin-filename %s --stdin --fix-dry-run --format=json',
|
||||
\ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput',
|
||||
@ -73,8 +73,8 @@ function! ale#fixers#eslint#ApplyFixForVersion(buffer, version) abort
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'command': ale#handlers#eslint#GetCdString(a:buffer)
|
||||
\ . ale#node#Executable(a:buffer, l:executable)
|
||||
\ 'cwd': ale#handlers#eslint#GetCwd(a:buffer),
|
||||
\ 'command': ale#node#Executable(a:buffer, l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (!empty(l:config) ? ' -c ' . ale#Escape(l:config) : '')
|
||||
\ . ' --fix %t',
|
||||
|
19
sources_non_forked/ale/autoload/ale/fixers/fish_indent.vim
Normal file
19
sources_non_forked/ale/autoload/ale/fixers/fish_indent.vim
Normal file
@ -0,0 +1,19 @@
|
||||
" Author: Chen YuanYuan <cyyever@outlook.com>
|
||||
" Description: Integration of fish_indent with ALE.
|
||||
|
||||
call ale#Set('fish_fish_indent_executable', 'fish_indent')
|
||||
call ale#Set('fish_fish_indent_options', '')
|
||||
|
||||
function! ale#fixers#fish_indent#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'fish_fish_indent_executable')
|
||||
let l:options = ale#Var(a:buffer, 'fish_fish_indent_options')
|
||||
let l:filename = ale#Escape(bufname(a:buffer))
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' -w '
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
@ -2,24 +2,33 @@
|
||||
" Description: Fixing Python imports with isort.
|
||||
|
||||
call ale#Set('python_isort_executable', 'isort')
|
||||
call ale#Set('python_isort_options', '')
|
||||
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_auto_pipenv', 0)
|
||||
|
||||
function! ale#fixers#isort#GetExecutable(buffer) abort
|
||||
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_isort_auto_pipenv'))
|
||||
\ && ale#python#PipenvPresent(a:buffer)
|
||||
return 'pipenv'
|
||||
endif
|
||||
|
||||
return ale#python#FindExecutable(a:buffer, 'python_isort', ['isort'])
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#isort#Fix(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'python_isort_options')
|
||||
let l:executable = ale#fixers#isort#GetExecutable(a:buffer)
|
||||
let l:exec_args = l:executable =~? 'pipenv$'
|
||||
\ ? ' run isort'
|
||||
\ : ''
|
||||
|
||||
let l:executable = ale#python#FindExecutable(
|
||||
\ a:buffer,
|
||||
\ 'python_isort',
|
||||
\ ['isort'],
|
||||
\)
|
||||
|
||||
if !executable(l:executable)
|
||||
if !executable(l:executable) && l:executable isnot# 'pipenv'
|
||||
return 0
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'command': ale#path#BufferCdString(a:buffer)
|
||||
\ . ale#Escape(l:executable) . (!empty(l:options) ? ' ' . l:options : '') . ' -',
|
||||
\ 'cwd': '%s:h',
|
||||
\ 'command': ale#Escape(l:executable) . l:exec_args
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' -',
|
||||
\}
|
||||
endfunction
|
||||
|
15
sources_non_forked/ale/autoload/ale/fixers/nixfmt.vim
Normal file
15
sources_non_forked/ale/autoload/ale/fixers/nixfmt.vim
Normal file
@ -0,0 +1,15 @@
|
||||
scriptencoding utf-8
|
||||
" Author: houstdav000 <houstdav000@gh0st.sh>
|
||||
" Description: Fix files with nixfmt
|
||||
|
||||
call ale#Set('nix_nixfmt_executable', 'nixfmt')
|
||||
call ale#Set('nix_nixfmt_options', '')
|
||||
|
||||
function! ale#fixers#nixfmt#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'nix_nixfmt_executable')
|
||||
let l:options = ale#Var(a:buffer, 'nix_nixfmt_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ale#Pad(l:options),
|
||||
\}
|
||||
endfunction
|
@ -34,19 +34,11 @@ function! ale#fixers#prettier#ProcessPrettierDOutput(buffer, output) abort
|
||||
return a:output
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#prettier#GetProjectRoot(buffer) abort
|
||||
function! ale#fixers#prettier#GetCwd(buffer) abort
|
||||
let l:config = ale#path#FindNearestFile(a:buffer, '.prettierignore')
|
||||
|
||||
if !empty(l:config)
|
||||
return fnamemodify(l:config, ':h')
|
||||
endif
|
||||
|
||||
" Fall back to the directory of the buffer
|
||||
return fnamemodify(bufname(a:buffer), ':p:h')
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#prettier#CdProjectRoot(buffer) abort
|
||||
return ale#path#CdString(ale#fixers#prettier#GetProjectRoot(a:buffer))
|
||||
return !empty(l:config) ? fnamemodify(l:config, ':h') : '%s:h'
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#prettier#ApplyFixForVersion(buffer, version) abort
|
||||
@ -82,8 +74,11 @@ function! ale#fixers#prettier#ApplyFixForVersion(buffer, version) abort
|
||||
\ 'graphql': 'graphql',
|
||||
\ 'markdown': 'markdown',
|
||||
\ 'vue': 'vue',
|
||||
\ 'svelte': 'svelte',
|
||||
\ 'yaml': 'yaml',
|
||||
\ 'openapi': 'yaml',
|
||||
\ 'html': 'html',
|
||||
\ 'ruby': 'ruby',
|
||||
\}
|
||||
|
||||
for l:filetype in l:filetypes
|
||||
@ -101,8 +96,8 @@ function! ale#fixers#prettier#ApplyFixForVersion(buffer, version) abort
|
||||
" Special error handling needed for prettier_d
|
||||
if l:executable =~# 'prettier_d$'
|
||||
return {
|
||||
\ 'command': ale#path#BufferCdString(a:buffer)
|
||||
\ . ale#Escape(l:executable)
|
||||
\ 'cwd': '%s:h',
|
||||
\ 'command':ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --stdin-filepath %s --stdin',
|
||||
\ 'process_with': 'ale#fixers#prettier#ProcessPrettierDOutput',
|
||||
@ -112,8 +107,8 @@ function! ale#fixers#prettier#ApplyFixForVersion(buffer, version) abort
|
||||
" 1.4.0 is the first version with --stdin-filepath
|
||||
if ale#semver#GTE(a:version, [1, 4, 0])
|
||||
return {
|
||||
\ 'command': ale#fixers#prettier#CdProjectRoot(a:buffer)
|
||||
\ . ale#Escape(l:executable)
|
||||
\ 'cwd': ale#fixers#prettier#GetCwd(a:buffer),
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --stdin-filepath %s --stdin',
|
||||
\}
|
||||
|
@ -37,8 +37,8 @@ function! ale#fixers#prettier_eslint#ApplyFixForVersion(buffer, version) abort
|
||||
" 4.4.0 is the first version with --stdin-filepath
|
||||
if ale#semver#GTE(a:version, [4, 4, 0])
|
||||
return {
|
||||
\ 'command': ale#path#BufferCdString(a:buffer)
|
||||
\ . ale#Escape(l:executable)
|
||||
\ 'cwd': '%s:h',
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . l:eslint_config_option
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --stdin-filepath %s --stdin',
|
||||
|
26
sources_non_forked/ale/autoload/ale/fixers/protolint.vim
Normal file
26
sources_non_forked/ale/autoload/ale/fixers/protolint.vim
Normal file
@ -0,0 +1,26 @@
|
||||
" Author: Yohei Yoshimuta <yoheimuta@gmail.com>
|
||||
" Description: Integration of protolint with ALE.
|
||||
|
||||
call ale#Set('proto_protolint_executable', 'protolint')
|
||||
call ale#Set('proto_protolint_config', '')
|
||||
|
||||
function! ale#fixers#protolint#GetExecutable(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'proto_protolint_executable')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#protolint#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#protolint#GetExecutable(a:buffer)
|
||||
let l:config = ale#Var(a:buffer, 'proto_protolint_config')
|
||||
|
||||
return {
|
||||
\ 'command': l:executable
|
||||
\ . (!empty(l:config) ? ' -config_path=' . ale#Escape(l:config) : '')
|
||||
\ . ' -fix'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
|
||||
|
17
sources_non_forked/ale/autoload/ale/fixers/ptop.vim
Normal file
17
sources_non_forked/ale/autoload/ale/fixers/ptop.vim
Normal file
@ -0,0 +1,17 @@
|
||||
" Author: BarrOff https://github.com/BarrOff
|
||||
" Description: Integration of ptop with ALE.
|
||||
|
||||
call ale#Set('pascal_ptop_executable', 'ptop')
|
||||
call ale#Set('pascal_ptop_options', '')
|
||||
|
||||
function! ale#fixers#ptop#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'pascal_ptop_executable')
|
||||
let l:options = ale#Var(a:buffer, 'pascal_ptop_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %s %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
@ -12,12 +12,12 @@ function! ale#fixers#standardrb#GetCommand(buffer) abort
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'standardrb')
|
||||
\ . (!empty(l:config) ? ' --config ' . ale#Escape(l:config) : '')
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --fix --force-exclusion %t'
|
||||
\ . ' --fix --force-exclusion --stdin %s'
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#standardrb#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#fixers#standardrb#GetCommand(a:buffer),
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'process_with': 'ale#fixers#rubocop#PostProcess'
|
||||
\}
|
||||
endfunction
|
||||
|
@ -17,11 +17,10 @@ function! ale#fixers#stylelint#Fix(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'stylelint_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#path#BufferCdString(a:buffer)
|
||||
\ . ale#node#Executable(a:buffer, l:executable)
|
||||
\ . ' %t'
|
||||
\ 'cwd': '%s:h',
|
||||
\ 'command': ale#node#Executable(a:buffer, l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . ' --fix',
|
||||
\ 'read_temporary_file': 1,
|
||||
\ . ' --fix --stdin --stdin-filename %s',
|
||||
\ 'read_temporary_file': 0,
|
||||
\}
|
||||
endfunction
|
||||
|
13
sources_non_forked/ale/autoload/ale/fixers/vfmt.vim
Normal file
13
sources_non_forked/ale/autoload/ale/fixers/vfmt.vim
Normal file
@ -0,0 +1,13 @@
|
||||
" Author: fiatjaf <fiatjaf@alhur.es>
|
||||
" Description: Integration of `v fmt` with ALE.
|
||||
|
||||
call ale#Set('v_vfmt_options', '')
|
||||
|
||||
function! ale#fixers#vfmt#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'v_v_executable')
|
||||
let l:options = ale#Var(a:buffer, 'v_vfmt_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ' fmt' . ale#Pad(l:options)
|
||||
\}
|
||||
endfunction
|
@ -1,23 +1,36 @@
|
||||
" Author: Albert Marquez - https://github.com/a-marquez
|
||||
" Description: Fixing files with XO.
|
||||
|
||||
call ale#Set('javascript_xo_executable', 'xo')
|
||||
call ale#Set('javascript_xo_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('javascript_xo_options', '')
|
||||
function! ale#fixers#xo#Fix(buffer) abort
|
||||
let l:executable = ale#handlers#xo#GetExecutable(a:buffer)
|
||||
let l:options = ale#handlers#xo#GetOptions(a:buffer)
|
||||
|
||||
function! ale#fixers#xo#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'javascript_xo', [
|
||||
\ 'node_modules/xo/cli.js',
|
||||
\ 'node_modules/.bin/xo',
|
||||
\])
|
||||
return ale#semver#RunWithVersionCheck(
|
||||
\ a:buffer,
|
||||
\ l:executable,
|
||||
\ '%e --version',
|
||||
\ {b, v -> ale#fixers#xo#ApplyFixForVersion(b, v, l:executable, l:options)}
|
||||
\)
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#xo#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#xo#GetExecutable(a:buffer)
|
||||
function! ale#fixers#xo#ApplyFixForVersion(buffer, version, executable, options) abort
|
||||
let l:executable = ale#node#Executable(a:buffer, a:executable)
|
||||
let l:options = ale#Pad(a:options)
|
||||
|
||||
" 0.30.0 is the first version with a working --stdin --fix
|
||||
if ale#semver#GTE(a:version, [0, 30, 0])
|
||||
return {
|
||||
\ 'command': l:executable
|
||||
\ . ' --stdin --stdin-filename %s'
|
||||
\ . ' --fix'
|
||||
\ . l:options,
|
||||
\}
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'command': ale#node#Executable(a:buffer, l:executable)
|
||||
\ . ' --fix %t',
|
||||
\ 'command': l:executable
|
||||
\ . ' --fix %t'
|
||||
\ . l:options,
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
|
@ -7,7 +7,6 @@ call ale#Set('yaml_yamlfix_use_global', get(g:, 'ale_use_global_executables', 0)
|
||||
|
||||
function! ale#fixers#yamlfix#Fix(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'yaml_yamlfix_options')
|
||||
|
||||
let l:executable = ale#python#FindExecutable(
|
||||
\ a:buffer,
|
||||
\ 'yaml_yamlfix',
|
||||
@ -19,7 +18,8 @@ function! ale#fixers#yamlfix#Fix(buffer) abort
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'command': ale#path#BufferCdString(a:buffer)
|
||||
\ . ale#Escape(l:executable) . (!empty(l:options) ? ' ' . l:options : '') . ' -',
|
||||
\ 'cwd': '%s:h',
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' -',
|
||||
\}
|
||||
endfunction
|
||||
|
Reference in New Issue
Block a user