mirror of
https://github.com/amix/vimrc
synced 2025-08-07 22:35:01 +08:00
Updated plugins
This commit is contained in:
@ -1,14 +1,11 @@
|
||||
" Author: toastal <toastal@protonmail.com>
|
||||
" Author: toastal <toastal@posteo.net>
|
||||
" 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,
|
||||
\ 'command': l:executable
|
||||
\ . ' format'
|
||||
\}
|
||||
endfunction
|
||||
|
@ -1,18 +1,14 @@
|
||||
" Author: toastal <toastal@protonmail.com>
|
||||
" Author: toastal <toastal@posteo.net>
|
||||
" 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,
|
||||
\ 'command': l:executable
|
||||
\ . ' freeze'
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'dhall_freeze_options'))
|
||||
\}
|
||||
endfunction
|
||||
|
@ -1,14 +1,11 @@
|
||||
" Author: toastal <toastal@protonmail.com>
|
||||
" Author: toastal <toastal@posteo.net>
|
||||
" 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,
|
||||
\ 'command': l:executable
|
||||
\ . ' lint'
|
||||
\}
|
||||
endfunction
|
||||
|
18
sources_non_forked/ale/autoload/ale/fixers/dotnet_format.vim
Normal file
18
sources_non_forked/ale/autoload/ale/fixers/dotnet_format.vim
Normal file
@ -0,0 +1,18 @@
|
||||
" Author: ghsang <gwonhyuksang@gmail.com>
|
||||
" Description: Integration of dotnet format with ALE.
|
||||
|
||||
call ale#Set('cs_dotnet_format_executable', 'dotnet')
|
||||
call ale#Set('cs_dotnet_format_options', '')
|
||||
|
||||
function! ale#fixers#dotnet_format#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'cs_dotnet_format_executable')
|
||||
let l:options = ale#Var(a:buffer, 'cs_dotnet_format_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' format'
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' --folder --include %t "$(dirname %t)"',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
21
sources_non_forked/ale/autoload/ale/fixers/golines.vim
Normal file
21
sources_non_forked/ale/autoload/ale/fixers/golines.vim
Normal file
@ -0,0 +1,21 @@
|
||||
" Author Pig Frown <pigfrown@protonmail.com>
|
||||
" Description: Fix Go files long lines with golines"
|
||||
|
||||
call ale#Set('go_golines_executable', 'golines')
|
||||
|
||||
call ale#Set('go_golines_options', '')
|
||||
|
||||
function! ale#fixers#golines#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'go_golines_executable')
|
||||
let l:options = ale#Var(a:buffer, 'go_golines_options')
|
||||
let l:env = ale#go#EnvString(a:buffer)
|
||||
|
||||
if !executable(l:executable)
|
||||
return 0
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'command': l:env . ale#Escape(l:executable)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\}
|
||||
endfunction
|
@ -5,6 +5,7 @@ call ale#Set('python_isort_executable', 'isort')
|
||||
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)
|
||||
call ale#Set('python_isort_auto_poetry', 0)
|
||||
|
||||
function! ale#fixers#isort#GetExecutable(buffer) abort
|
||||
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_isort_auto_pipenv'))
|
||||
@ -12,24 +13,34 @@ function! ale#fixers#isort#GetExecutable(buffer) abort
|
||||
return 'pipenv'
|
||||
endif
|
||||
|
||||
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_isort_auto_poetry'))
|
||||
\ && ale#python#PoetryPresent(a:buffer)
|
||||
return 'poetry'
|
||||
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:cmd = [ale#Escape(l:executable)]
|
||||
|
||||
if !executable(l:executable) && l:executable isnot# 'pipenv'
|
||||
return 0
|
||||
if l:executable =~? 'pipenv\|poetry$'
|
||||
call extend(l:cmd, ['run', 'isort'])
|
||||
endif
|
||||
|
||||
call add(l:cmd, '--filename %s')
|
||||
|
||||
let l:options = ale#Var(a:buffer, 'python_isort_options')
|
||||
|
||||
if !empty(l:options)
|
||||
call add(l:cmd, l:options)
|
||||
endif
|
||||
|
||||
call add(l:cmd, '-')
|
||||
|
||||
return {
|
||||
\ 'cwd': '%s:h',
|
||||
\ 'command': ale#Escape(l:executable) . l:exec_args
|
||||
\ . ale#Pad('--filename %s')
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' -',
|
||||
\ 'command': join(l:cmd, ' ')
|
||||
\}
|
||||
endfunction
|
||||
|
18
sources_non_forked/ale/autoload/ale/fixers/jsonnetfmt.vim
Normal file
18
sources_non_forked/ale/autoload/ale/fixers/jsonnetfmt.vim
Normal file
@ -0,0 +1,18 @@
|
||||
" Authors: Trevor Whitney <trevorjwhitney@gmail.com> and Takuya Kosugiyama <re@itkq.jp>
|
||||
" Description: Integration of jsonnetfmt with ALE.
|
||||
|
||||
call ale#Set('jsonnet_jsonnetfmt_executable', 'jsonnetfmt')
|
||||
call ale#Set('jsonnet_jsonnetfmt_options', '')
|
||||
|
||||
function! ale#fixers#jsonnetfmt#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'jsonnet_jsonnetfmt_executable')
|
||||
let l:options = ale#Var(a:buffer, 'jsonnet_jsonnetfmt_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' -i'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
24
sources_non_forked/ale/autoload/ale/fixers/purs_tidy.vim
Normal file
24
sources_non_forked/ale/autoload/ale/fixers/purs_tidy.vim
Normal file
@ -0,0 +1,24 @@
|
||||
" Author: toastal <toastal@posteo.net>
|
||||
" Description: Integration of purs-tidy with ALE.
|
||||
|
||||
call ale#Set('purescript_tidy_executable', 'purs-tidy')
|
||||
call ale#Set('purescript_tidy_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('purescript_tidy_options', '')
|
||||
|
||||
function! ale#fixers#purs_tidy#GetExecutable(buffer) abort
|
||||
return ale#path#FindExecutable(a:buffer, 'purescript_tidy', [
|
||||
\ 'node_modules/purescript-tidy/bin/index.js',
|
||||
\ 'node_modules/.bin/purs-tidy',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#purs_tidy#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#purs_tidy#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'purescript_tidy_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' format'
|
||||
\ . ale#Pad(l:options)
|
||||
\}
|
||||
endfunction
|
@ -21,12 +21,10 @@ endfunction
|
||||
|
||||
function! ale#fixers#rubocop#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'ruby_rubocop_executable')
|
||||
let l:config = ale#path#FindNearestFile(a:buffer, '.rubocop.yml')
|
||||
let l:options = ale#Var(a:buffer, 'ruby_rubocop_options')
|
||||
let l:auto_correct_all = ale#Var(a:buffer, 'ruby_rubocop_auto_correct_all')
|
||||
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'rubocop')
|
||||
\ . (!empty(l:config) ? ' --config ' . ale#Escape(l:config) : '')
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . (l:auto_correct_all ? ' --auto-correct-all' : ' --auto-correct')
|
||||
\ . ' --force-exclusion --stdin %s'
|
||||
|
Reference in New Issue
Block a user