refactor: use ale#Pad for option padding across the codebase (#5091)

Co-authored-by: PsickOSSH <PsickOSSH@protonmail.com>
This commit is contained in:
PsickOSSH
2026-02-07 09:23:48 +01:00
committed by GitHub
parent e762262f44
commit af5a38c697
45 changed files with 49 additions and 49 deletions

View File

@@ -18,7 +18,7 @@ function! ale_linters#cpp#clazy#GetCommand(buffer) abort
return '%e'
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
\ . ' %s'
endfunction

View File

@@ -4,7 +4,7 @@ function! ale_linters#cs#mcs#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'cs_mcs_options')
return 'mcs -unsafe --parse'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
\ . ' %t'
endfunction

View File

@@ -8,7 +8,7 @@ function! ale_linters#go#revive#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'go_revive_options')
return ale#go#EnvString(a:buffer) . '%e'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
\ . ' %t'
endfunction

View File

@@ -13,11 +13,11 @@ function! ale_linters#go#staticcheck#GetCommand(buffer) abort
if l:lint_package
return l:env . '%e'
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
\ . ale#Pad(l:options) . ' .'
endif
return l:env . '%e'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
\ . ' %s:t'
endfunction

View File

@@ -8,7 +8,7 @@ function! ale_linters#groovy#npmgroovylint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'groovy_npmgroovylint_options')
return '%e --failon none --output json'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
\ . ' %t'
endfunction

View File

@@ -15,7 +15,7 @@ function! ale_linters#html#stylelint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'html_stylelint_options')
return ale#Escape(l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
\ . ' --no-color --stdin-filename %s'
endfunction

View File

@@ -19,7 +19,7 @@ function! ale_linters#javascript#standard#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'javascript_standard_options')
return ale#node#Executable(a:buffer, l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
\ . ' --stdin %s'
endfunction

View File

@@ -14,7 +14,7 @@ function! ale_linters#markdown#markdownlint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'markdown_markdownlint_options')
return ale#Escape(l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '') . ' %s'
\ . ale#Pad(l:options) . ' %s'
endfunction
call ale#linter#Define('markdown', {

View File

@@ -17,7 +17,7 @@ function! ale_linters#markdown#mdl#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'markdown_mdl_options')
return ale#Escape(l:executable) . l:exec_args
\ . ' -j' . (!empty(l:options) ? ' ' . l:options : '')
\ . ' -j' . ale#Pad(l:options)
endfunction
function! ale_linters#markdown#mdl#Handle(buffer, lines) abort

View File

@@ -31,7 +31,7 @@ function! ale_linters#php#tlint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'php_tlint_options')
return ale#node#Executable(a:buffer, l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
\ . ' lint %s'
endfunction

View File

@@ -11,7 +11,7 @@ function! ale_linters#proto#buf_lint#GetCommand(buffer) abort
return '%e lint'
\ . (!empty(l:config) ? ' --config=' . ale#Escape(l:config) : '')
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
\ . ' %s#include_package_files=true'
endfunction

View File

@@ -87,7 +87,7 @@ function! ale_linters#python#flake8#GetCommand(buffer, version) abort
let l:options = ale#Var(a:buffer, 'python_flake8_options')
return ale#Escape(l:executable) . l:exec_args
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
\ . ' --format=default'
\ . l:display_name_args . ' -'
endfunction

View File

@@ -12,7 +12,7 @@ function! ale_linters#rego#opacheck#GetCommand(buffer) abort
return ale#Escape(ale_linters#rego#opacheck#GetExecutable(a:buffer))
\ . ' check %s:h --format json '
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
endfunction
function! ale_linters#rego#opacheck#Handle(buffer, lines) abort

View File

@@ -10,7 +10,7 @@ function! ale_linters#ruby#sorbet#GetCommand(buffer) abort
return ale#ruby#EscapeExecutable(l:executable, 'srb')
\ . ' tc'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
\ . ' --lsp'
\ . (l:enable_watchman ? '' : ' --disable-watchman')
endfunction

View File

@@ -20,7 +20,7 @@ function! ale_linters#rust#rustc#RustcCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'rust_rustc_options')
return 'rustc --error-format=json'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
\ . l:dependencies . ' -'
endfunction

View File

@@ -16,7 +16,7 @@ function! ale_linters#sass#sasslint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'sass_sasslint_options')
return ale#node#Executable(a:buffer, l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
\ . ' -v -q -f compact %t'
endfunction

View File

@@ -16,7 +16,7 @@ function! ale_linters#scss#sasslint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'scss_sasslint_options')
return ale#node#Executable(a:buffer, l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
\ . ' -v -q -f compact %t'
endfunction

View File

@@ -10,7 +10,7 @@ function! ale_linters#text#vale#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'vale_options')
return ale#Escape(l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
\ . ' --output=JSON %t'
endfunction

View File

@@ -18,7 +18,7 @@ function! ale_linters#typescript#standard#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'typescript_standard_options')
return ale#node#Executable(a:buffer, l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ale#Pad(l:options)
\ . ' --stdin %s'
endfunction