From af5a38c697e0ba062f04347d5165d97d7d1894a3 Mon Sep 17 00:00:00 2001 From: PsickOSSH <145741792+PsickOSSH@users.noreply.github.com> Date: Sat, 7 Feb 2026 09:23:48 +0100 Subject: [PATCH] refactor: use ale#Pad for option padding across the codebase (#5091) Co-authored-by: PsickOSSH --- ale_linters/cpp/clazy.vim | 2 +- ale_linters/cs/mcs.vim | 2 +- ale_linters/go/revive.vim | 2 +- ale_linters/go/staticcheck.vim | 4 ++-- ale_linters/groovy/npmgroovylint.vim | 2 +- ale_linters/html/stylelint.vim | 2 +- ale_linters/javascript/standard.vim | 2 +- ale_linters/markdown/markdownlint.vim | 2 +- ale_linters/markdown/mdl.vim | 2 +- ale_linters/php/tlint.vim | 2 +- ale_linters/proto/buf_lint.vim | 2 +- ale_linters/python/flake8.vim | 2 +- ale_linters/rego/opacheck.vim | 2 +- ale_linters/ruby/sorbet.vim | 2 +- ale_linters/rust/rustc.vim | 2 +- ale_linters/sass/sasslint.vim | 2 +- ale_linters/scss/sasslint.vim | 2 +- ale_linters/text/vale.vim | 2 +- ale_linters/typescript/standard.vim | 2 +- autoload/ale/fixers/autoflake.vim | 2 +- autoload/ale/fixers/autoimport.vim | 2 +- autoload/ale/fixers/autopep8.vim | 2 +- autoload/ale/fixers/biome.vim | 2 +- autoload/ale/fixers/erblint.vim | 2 +- autoload/ale/fixers/gnatpp.vim | 2 +- autoload/ale/fixers/mix_format.vim | 2 +- autoload/ale/fixers/npmgroovylint.vim | 2 +- autoload/ale/fixers/prettier.vim | 6 +++--- autoload/ale/fixers/prettier_eslint.vim | 4 ++-- autoload/ale/fixers/pymarkdown.vim | 2 +- autoload/ale/fixers/remark_lint.vim | 2 +- autoload/ale/fixers/reorder_python_imports.vim | 2 +- autoload/ale/fixers/rubocop.vim | 2 +- autoload/ale/fixers/sorbet.vim | 2 +- autoload/ale/fixers/sqlformat.vim | 2 +- autoload/ale/fixers/standard.vim | 2 +- autoload/ale/fixers/standardrb.vim | 2 +- autoload/ale/fixers/syntax_tree.vim | 2 +- autoload/ale/fixers/yamlfix.vim | 2 +- autoload/ale/handlers/djlint.vim | 2 +- autoload/ale/handlers/eslint.vim | 2 +- autoload/ale/handlers/shellcheck.vim | 2 +- autoload/ale/handlers/textlint.vim | 2 +- autoload/ale/handlers/writegood.vim | 2 +- autoload/ale/preview.vim | 2 +- 45 files changed, 49 insertions(+), 49 deletions(-) diff --git a/ale_linters/cpp/clazy.vim b/ale_linters/cpp/clazy.vim index 9b29ac9a..117c7f62 100644 --- a/ale_linters/cpp/clazy.vim +++ b/ale_linters/cpp/clazy.vim @@ -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 diff --git a/ale_linters/cs/mcs.vim b/ale_linters/cs/mcs.vim index 1b373e73..a523a626 100644 --- a/ale_linters/cs/mcs.vim +++ b/ale_linters/cs/mcs.vim @@ -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 diff --git a/ale_linters/go/revive.vim b/ale_linters/go/revive.vim index b14b5ab9..b60c8d16 100644 --- a/ale_linters/go/revive.vim +++ b/ale_linters/go/revive.vim @@ -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 diff --git a/ale_linters/go/staticcheck.vim b/ale_linters/go/staticcheck.vim index 36622440..c7b9d144 100644 --- a/ale_linters/go/staticcheck.vim +++ b/ale_linters/go/staticcheck.vim @@ -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 diff --git a/ale_linters/groovy/npmgroovylint.vim b/ale_linters/groovy/npmgroovylint.vim index 4141bd25..c28d9c29 100644 --- a/ale_linters/groovy/npmgroovylint.vim +++ b/ale_linters/groovy/npmgroovylint.vim @@ -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 diff --git a/ale_linters/html/stylelint.vim b/ale_linters/html/stylelint.vim index a95e4080..5249492a 100644 --- a/ale_linters/html/stylelint.vim +++ b/ale_linters/html/stylelint.vim @@ -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 diff --git a/ale_linters/javascript/standard.vim b/ale_linters/javascript/standard.vim index addf41dd..ef795d66 100644 --- a/ale_linters/javascript/standard.vim +++ b/ale_linters/javascript/standard.vim @@ -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 diff --git a/ale_linters/markdown/markdownlint.vim b/ale_linters/markdown/markdownlint.vim index 424c9f24..ca5f3130 100644 --- a/ale_linters/markdown/markdownlint.vim +++ b/ale_linters/markdown/markdownlint.vim @@ -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', { diff --git a/ale_linters/markdown/mdl.vim b/ale_linters/markdown/mdl.vim index fd44de6e..ccc7c758 100644 --- a/ale_linters/markdown/mdl.vim +++ b/ale_linters/markdown/mdl.vim @@ -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 diff --git a/ale_linters/php/tlint.vim b/ale_linters/php/tlint.vim index 80bdd1f6..e15eae04 100644 --- a/ale_linters/php/tlint.vim +++ b/ale_linters/php/tlint.vim @@ -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 diff --git a/ale_linters/proto/buf_lint.vim b/ale_linters/proto/buf_lint.vim index a22f8e53..8eb257e7 100644 --- a/ale_linters/proto/buf_lint.vim +++ b/ale_linters/proto/buf_lint.vim @@ -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 diff --git a/ale_linters/python/flake8.vim b/ale_linters/python/flake8.vim index 0ec7fbb5..caed6908 100644 --- a/ale_linters/python/flake8.vim +++ b/ale_linters/python/flake8.vim @@ -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 diff --git a/ale_linters/rego/opacheck.vim b/ale_linters/rego/opacheck.vim index 479091d3..a2534ea1 100644 --- a/ale_linters/rego/opacheck.vim +++ b/ale_linters/rego/opacheck.vim @@ -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 diff --git a/ale_linters/ruby/sorbet.vim b/ale_linters/ruby/sorbet.vim index abe758bb..67fbe1d6 100644 --- a/ale_linters/ruby/sorbet.vim +++ b/ale_linters/ruby/sorbet.vim @@ -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 diff --git a/ale_linters/rust/rustc.vim b/ale_linters/rust/rustc.vim index bc6431ba..1ff730ba 100644 --- a/ale_linters/rust/rustc.vim +++ b/ale_linters/rust/rustc.vim @@ -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 diff --git a/ale_linters/sass/sasslint.vim b/ale_linters/sass/sasslint.vim index ff396e68..8c0fc63a 100644 --- a/ale_linters/sass/sasslint.vim +++ b/ale_linters/sass/sasslint.vim @@ -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 diff --git a/ale_linters/scss/sasslint.vim b/ale_linters/scss/sasslint.vim index 99027051..aad8cda6 100644 --- a/ale_linters/scss/sasslint.vim +++ b/ale_linters/scss/sasslint.vim @@ -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 diff --git a/ale_linters/text/vale.vim b/ale_linters/text/vale.vim index 42285dd4..6521e5cc 100644 --- a/ale_linters/text/vale.vim +++ b/ale_linters/text/vale.vim @@ -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 diff --git a/ale_linters/typescript/standard.vim b/ale_linters/typescript/standard.vim index 1d524a10..1f09b0ee 100644 --- a/ale_linters/typescript/standard.vim +++ b/ale_linters/typescript/standard.vim @@ -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 diff --git a/autoload/ale/fixers/autoflake.vim b/autoload/ale/fixers/autoflake.vim index 9f8b04fc..a83e5df1 100644 --- a/autoload/ale/fixers/autoflake.vim +++ b/autoload/ale/fixers/autoflake.vim @@ -38,7 +38,7 @@ function! ale#fixers#autoflake#Fix(buffer) abort return { \ 'command': ale#Escape(l:executable) . l:exec_args - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' --in-place ' \ . ' %t', \ 'read_temporary_file': 1, diff --git a/autoload/ale/fixers/autoimport.vim b/autoload/ale/fixers/autoimport.vim index 8d35419e..678ec207 100644 --- a/autoload/ale/fixers/autoimport.vim +++ b/autoload/ale/fixers/autoimport.vim @@ -39,7 +39,7 @@ function! ale#fixers#autoimport#Fix(buffer) abort return { \ 'cwd': '%s:h', \ 'command': ale#Escape(l:executable) . l:exec_args - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' -', \} endfunction diff --git a/autoload/ale/fixers/autopep8.vim b/autoload/ale/fixers/autopep8.vim index f9af46f8..f83aebe5 100644 --- a/autoload/ale/fixers/autopep8.vim +++ b/autoload/ale/fixers/autopep8.vim @@ -38,7 +38,7 @@ function! ale#fixers#autopep8#Fix(buffer) abort return { \ 'command': ale#Escape(l:executable) . l:exec_args - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' -', \} endfunction diff --git a/autoload/ale/fixers/biome.vim b/autoload/ale/fixers/biome.vim index 76e9b0d1..65a9f2ba 100644 --- a/autoload/ale/fixers/biome.vim +++ b/autoload/ale/fixers/biome.vim @@ -6,6 +6,6 @@ function! ale#fixers#biome#Fix(buffer) abort return { \ 'command': ale#Escape(l:executable) . ' check ' \ . '--write --stdin-file-path %s' . l:unsafe - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \} endfunction diff --git a/autoload/ale/fixers/erblint.vim b/autoload/ale/fixers/erblint.vim index 41aca0c8..7f9c3154 100644 --- a/autoload/ale/fixers/erblint.vim +++ b/autoload/ale/fixers/erblint.vim @@ -28,7 +28,7 @@ function! ale#fixers#erblint#GetCommand(buffer) abort let l:options = ale#Var(a:buffer, 'eruby_erblint_options') return ale#ruby#EscapeExecutable(l:executable, 'erblint') - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' --autocorrect --stdin %s' endfunction diff --git a/autoload/ale/fixers/gnatpp.vim b/autoload/ale/fixers/gnatpp.vim index bf3d484e..bc2115e2 100644 --- a/autoload/ale/fixers/gnatpp.vim +++ b/autoload/ale/fixers/gnatpp.vim @@ -10,7 +10,7 @@ function! ale#fixers#gnatpp#Fix(buffer) abort return { \ 'command': ale#Escape(l:executable) - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' %t', \ 'read_temporary_file': 1, \} diff --git a/autoload/ale/fixers/mix_format.vim b/autoload/ale/fixers/mix_format.vim index 7a091701..0839a5ae 100644 --- a/autoload/ale/fixers/mix_format.vim +++ b/autoload/ale/fixers/mix_format.vim @@ -13,7 +13,7 @@ function! ale#fixers#mix_format#GetCommand(buffer) abort let l:options = ale#Var(a:buffer, 'elixir_mix_format_options') return l:executable . ' format' - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' %t' endfunction diff --git a/autoload/ale/fixers/npmgroovylint.vim b/autoload/ale/fixers/npmgroovylint.vim index 39e43cf6..3dd99855 100644 --- a/autoload/ale/fixers/npmgroovylint.vim +++ b/autoload/ale/fixers/npmgroovylint.vim @@ -9,7 +9,7 @@ function! ale#fixers#npmgroovylint#Fix(buffer) abort return { \ 'command': ale#Escape(l:executable) - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' %t', \ 'read_temporary_file': 1, \} diff --git a/autoload/ale/fixers/prettier.vim b/autoload/ale/fixers/prettier.vim index c9210e63..b0dc9d4d 100644 --- a/autoload/ale/fixers/prettier.vim +++ b/autoload/ale/fixers/prettier.vim @@ -99,7 +99,7 @@ function! ale#fixers#prettier#ApplyFixForVersion(buffer, version) abort return { \ 'cwd': '%s:h', \ 'command':ale#Escape(l:executable) - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' --stdin-filepath %s --stdin', \ 'process_with': 'ale#fixers#prettier#ProcessPrettierDOutput', \} @@ -110,7 +110,7 @@ function! ale#fixers#prettier#ApplyFixForVersion(buffer, version) abort return { \ 'cwd': ale#fixers#prettier#GetCwd(a:buffer), \ 'command': ale#Escape(l:executable) - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' --stdin-filepath %s --stdin', \} endif @@ -118,7 +118,7 @@ function! ale#fixers#prettier#ApplyFixForVersion(buffer, version) abort return { \ 'command': ale#Escape(l:executable) \ . ' %t' - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' --write', \ 'read_temporary_file': 1, \} diff --git a/autoload/ale/fixers/prettier_eslint.vim b/autoload/ale/fixers/prettier_eslint.vim index 0b9c88b7..f45e9f69 100644 --- a/autoload/ale/fixers/prettier_eslint.vim +++ b/autoload/ale/fixers/prettier_eslint.vim @@ -40,7 +40,7 @@ function! ale#fixers#prettier_eslint#ApplyFixForVersion(buffer, version) abort \ 'cwd': '%s:h', \ 'command': ale#Escape(l:executable) \ . l:eslint_config_option - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' --stdin-filepath %s --stdin', \} endif @@ -49,7 +49,7 @@ function! ale#fixers#prettier_eslint#ApplyFixForVersion(buffer, version) abort \ 'command': ale#Escape(l:executable) \ . ' %t' \ . l:eslint_config_option - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' --write', \ 'read_temporary_file': 1, \} diff --git a/autoload/ale/fixers/pymarkdown.vim b/autoload/ale/fixers/pymarkdown.vim index 0ff782a9..1aa5a6bd 100644 --- a/autoload/ale/fixers/pymarkdown.vim +++ b/autoload/ale/fixers/pymarkdown.vim @@ -39,7 +39,7 @@ function! ale#fixers#pymarkdown#Fix(buffer) abort return { \ 'command': ale#Escape(l:executable) . l:exec_args \ . ' fix' - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' %t', \ 'read_temporary_file': 1, \} diff --git a/autoload/ale/fixers/remark_lint.vim b/autoload/ale/fixers/remark_lint.vim index 85593b44..b6460ba2 100644 --- a/autoload/ale/fixers/remark_lint.vim +++ b/autoload/ale/fixers/remark_lint.vim @@ -18,7 +18,7 @@ function! ale#fixers#remark_lint#Fix(buffer) abort return { \ 'command': ale#Escape(l:executable) - \ . (!empty(l:options) ? ' ' . l:options : ''), + \ . ale#Pad(l:options), \} endfunction diff --git a/autoload/ale/fixers/reorder_python_imports.vim b/autoload/ale/fixers/reorder_python_imports.vim index 6e10c1d6..cad36f3e 100644 --- a/autoload/ale/fixers/reorder_python_imports.vim +++ b/autoload/ale/fixers/reorder_python_imports.vim @@ -38,6 +38,6 @@ function! ale#fixers#reorder_python_imports#Fix(buffer) abort return { \ 'command': ale#Escape(l:executable) . l:exec_args - \ . (!empty(l:options) ? ' ' . l:options : '') . ' -', + \ . ale#Pad(l:options) . ' -', \} endfunction diff --git a/autoload/ale/fixers/rubocop.vim b/autoload/ale/fixers/rubocop.vim index c0d4315e..0a0cf782 100644 --- a/autoload/ale/fixers/rubocop.vim +++ b/autoload/ale/fixers/rubocop.vim @@ -26,7 +26,7 @@ function! ale#fixers#rubocop#GetCommand(buffer, version) abort let l:editor_mode = ale#semver#GTE(a:version, [1, 61, 0]) return ale#ruby#EscapeExecutable(l:executable, 'rubocop') - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . (l:auto_correct_all ? ' --auto-correct-all' : ' --auto-correct') \ . (l:editor_mode ? ' --editor-mode' : '') \ . ' --force-exclusion --stdin %s' diff --git a/autoload/ale/fixers/sorbet.vim b/autoload/ale/fixers/sorbet.vim index 7c12fa1e..92b71781 100644 --- a/autoload/ale/fixers/sorbet.vim +++ b/autoload/ale/fixers/sorbet.vim @@ -7,7 +7,7 @@ function! ale#fixers#sorbet#GetCommand(buffer) abort return ale#ruby#EscapeExecutable(l:executable, 'srb') \ . ' tc' - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' --autocorrect --file %t' endfunction diff --git a/autoload/ale/fixers/sqlformat.vim b/autoload/ale/fixers/sqlformat.vim index 6319c1ac..150fd229 100644 --- a/autoload/ale/fixers/sqlformat.vim +++ b/autoload/ale/fixers/sqlformat.vim @@ -10,7 +10,7 @@ function! ale#fixers#sqlformat#Fix(buffer) abort return { \ 'command': ale#Escape(l:executable) - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' -' \} endfunction diff --git a/autoload/ale/fixers/standard.vim b/autoload/ale/fixers/standard.vim index b9d60ebb..62c486b8 100644 --- a/autoload/ale/fixers/standard.vim +++ b/autoload/ale/fixers/standard.vim @@ -26,7 +26,7 @@ function! ale#fixers#standard#Fix(buffer) abort return { \ 'command': ale#node#Executable(a:buffer, l:executable) - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' --fix --stdin < %s > %t', \ 'read_temporary_file': 1, \} diff --git a/autoload/ale/fixers/standardrb.vim b/autoload/ale/fixers/standardrb.vim index acb310c6..1f3c05e4 100644 --- a/autoload/ale/fixers/standardrb.vim +++ b/autoload/ale/fixers/standardrb.vim @@ -11,7 +11,7 @@ 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 : '') + \ . ale#Pad(l:options) \ . ' --fix --force-exclusion --stdin %s' endfunction diff --git a/autoload/ale/fixers/syntax_tree.vim b/autoload/ale/fixers/syntax_tree.vim index 08823a88..270e21a6 100644 --- a/autoload/ale/fixers/syntax_tree.vim +++ b/autoload/ale/fixers/syntax_tree.vim @@ -7,7 +7,7 @@ function! ale#fixers#syntax_tree#GetCommand(buffer) abort return ale#ruby#EscapeExecutable(l:executable, 'stree') \ . ' format' - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' %t' endfunction diff --git a/autoload/ale/fixers/yamlfix.vim b/autoload/ale/fixers/yamlfix.vim index 6654a25c..e310079d 100644 --- a/autoload/ale/fixers/yamlfix.vim +++ b/autoload/ale/fixers/yamlfix.vim @@ -20,6 +20,6 @@ function! ale#fixers#yamlfix#Fix(buffer) abort return { \ 'cwd': '%s:h', \ 'command': ale#Escape(l:executable) - \ . (!empty(l:options) ? ' ' . l:options : '') . ' -', + \ . ale#Pad(l:options) . ' -', \} endfunction diff --git a/autoload/ale/handlers/djlint.vim b/autoload/ale/handlers/djlint.vim index 57015248..f0ece47c 100644 --- a/autoload/ale/handlers/djlint.vim +++ b/autoload/ale/handlers/djlint.vim @@ -39,7 +39,7 @@ function! ale#handlers#djlint#GetCommand(buffer) abort endif return ale#Escape(l:executable) - \ . (!empty(l:options) ? ' ' . l:options : '') . ' %s' + \ . ale#Pad(l:options) . ' %s' endfunction function! ale#handlers#djlint#Handle(buffer, lines) abort diff --git a/autoload/ale/handlers/eslint.vim b/autoload/ale/handlers/eslint.vim index eea06f51..f752b23e 100644 --- a/autoload/ale/handlers/eslint.vim +++ b/autoload/ale/handlers/eslint.vim @@ -54,7 +54,7 @@ function! ale#handlers#eslint#GetCommand(buffer) abort let l:options = ale#Var(a:buffer, 'javascript_eslint_options') return ale#node#Executable(a:buffer, l:executable) - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' -f json --stdin --stdin-filename %s' endfunction diff --git a/autoload/ale/handlers/shellcheck.vim b/autoload/ale/handlers/shellcheck.vim index 80e0bfd7..f84d5965 100644 --- a/autoload/ale/handlers/shellcheck.vim +++ b/autoload/ale/handlers/shellcheck.vim @@ -57,7 +57,7 @@ function! ale#handlers#shellcheck#GetCommand(buffer, version) abort return '%e' \ . (!empty(l:dialect) ? ' -s ' . l:dialect : '') - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . (!empty(l:exclude_option) ? ' -e ' . l:exclude_option : '') \ . l:external_option \ . ' -f ' . l:format . ' -' diff --git a/autoload/ale/handlers/textlint.vim b/autoload/ale/handlers/textlint.vim index 7a648617..0c4eee0a 100644 --- a/autoload/ale/handlers/textlint.vim +++ b/autoload/ale/handlers/textlint.vim @@ -17,7 +17,7 @@ function! ale#handlers#textlint#GetCommand(buffer) abort let l:options = ale#Var(a:buffer, 'textlint_options') return ale#node#Executable(a:buffer, l:executable) - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' -f json --stdin --stdin-filename %s' endfunction diff --git a/autoload/ale/handlers/writegood.vim b/autoload/ale/handlers/writegood.vim index b5b91b3f..26dbee6c 100644 --- a/autoload/ale/handlers/writegood.vim +++ b/autoload/ale/handlers/writegood.vim @@ -22,7 +22,7 @@ function! ale#handlers#writegood#GetCommand(buffer) abort let l:options = ale#Var(a:buffer, 'writegood_options') return ale#node#Executable(a:buffer, l:executable) - \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ale#Pad(l:options) \ . ' %t' endfunction diff --git a/autoload/ale/preview.vim b/autoload/ale/preview.vim index 1aca03ea..dad815de 100644 --- a/autoload/ale/preview.vim +++ b/autoload/ale/preview.vim @@ -81,7 +81,7 @@ function! ale#preview#ShowSelection(item_list, ...) abort \ l:filename \ . ':' . l:item.line \ . ':' . l:item.column - \ . (!empty(l:match) ? ' ' . l:match : ''), + \ . ale#Pad(l:match), \) endfor