diff options
214 files changed, 452 insertions, 524 deletions
diff --git a/ale_linters/ada/gcc.vim b/ale_linters/ada/gcc.vim index 7b0c4809..87496b81 100644 --- a/ale_linters/ada/gcc.vim +++ b/ale_linters/ada/gcc.vim @@ -48,7 +48,7 @@ endfunction call ale#linter#Define('ada', { \ 'name': 'gcc', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('ada_gcc_executable'), -\ 'command_callback': 'ale_linters#ada#gcc#GetCommand', +\ 'executable': {b -> ale#Var(b, 'ada_gcc_executable')}, +\ 'command': function('ale_linters#ada#gcc#GetCommand'), \ 'callback': 'ale_linters#ada#gcc#Handle', \}) diff --git a/ale_linters/ansible/ansible_lint.vim b/ale_linters/ansible/ansible_lint.vim index 99fff6c3..c4affa31 100644 --- a/ale_linters/ansible/ansible_lint.vim +++ b/ale_linters/ansible/ansible_lint.vim @@ -50,7 +50,7 @@ endfunction call ale#linter#Define('ansible', { \ 'name': 'ansible_lint', \ 'aliases': ['ansible', 'ansible-lint'], -\ 'executable_callback': 'ale_linters#ansible#ansible_lint#GetExecutable', +\ 'executable': function('ale_linters#ansible#ansible_lint#GetExecutable'), \ 'command': '%e -p %t', \ 'callback': 'ale_linters#ansible#ansible_lint#Handle', \}) diff --git a/ale_linters/asciidoc/textlint.vim b/ale_linters/asciidoc/textlint.vim index 757718b9..308a3a29 100644 --- a/ale_linters/asciidoc/textlint.vim +++ b/ale_linters/asciidoc/textlint.vim @@ -3,7 +3,7 @@ call ale#linter#Define('asciidoc', { \ 'name': 'textlint', -\ 'executable_callback': 'ale#handlers#textlint#GetExecutable', -\ 'command_callback': 'ale#handlers#textlint#GetCommand', +\ 'executable': function('ale#handlers#textlint#GetExecutable'), +\ 'command': function('ale#handlers#textlint#GetCommand'), \ 'callback': 'ale#handlers#textlint#HandleTextlintOutput', \}) diff --git a/ale_linters/asm/gcc.vim b/ale_linters/asm/gcc.vim index fdd0ee83..72b293c0 100644 --- a/ale_linters/asm/gcc.vim +++ b/ale_linters/asm/gcc.vim @@ -28,7 +28,7 @@ endfunction call ale#linter#Define('asm', { \ 'name': 'gcc', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('asm_gcc_executable'), -\ 'command_callback': 'ale_linters#asm#gcc#GetCommand', +\ 'executable': {b -> ale#Var(b, 'asm_gcc_executable')}, +\ 'command': function('ale_linters#asm#gcc#GetCommand'), \ 'callback': 'ale_linters#asm#gcc#Handle', \}) diff --git a/ale_linters/awk/gawk.vim b/ale_linters/awk/gawk.vim index eb92e45e..f795c57d 100644 --- a/ale_linters/awk/gawk.vim +++ b/ale_linters/awk/gawk.vim @@ -15,8 +15,8 @@ endfunction call ale#linter#Define('awk', { \ 'name': 'gawk', -\ 'executable_callback': ale#VarFunc('awk_gawk_executable'), -\ 'command_callback': 'ale_linters#awk#gawk#GetCommand', +\ 'executable': {b -> ale#Var(b, 'awk_gawk_executable')}, +\ 'command': function('ale_linters#awk#gawk#GetCommand'), \ 'callback': 'ale#handlers#gawk#HandleGawkFormat', \ 'output_stream': 'both' \}) diff --git a/ale_linters/bib/bibclean.vim b/ale_linters/bib/bibclean.vim index 1c6b55d0..9056a9c3 100644 --- a/ale_linters/bib/bibclean.vim +++ b/ale_linters/bib/bibclean.vim @@ -68,8 +68,8 @@ endfunction call ale#linter#Define('bib', { \ 'name': 'bibclean', -\ 'executable_callback': ale#VarFunc('bib_bibclean_executable'), -\ 'command_callback': 'ale_linters#bib#bibclean#GetCommand', +\ 'executable': {b -> ale#Var(b, 'bib_bibclean_executable')}, +\ 'command': function('ale_linters#bib#bibclean#GetCommand'), \ 'output_stream': 'stderr', \ 'callback': 'ale_linters#bib#bibclean#Handle', \}) diff --git a/ale_linters/c/ccls.vim b/ale_linters/c/ccls.vim index 5dc2339f..9e3dafe9 100644 --- a/ale_linters/c/ccls.vim +++ b/ale_linters/c/ccls.vim @@ -7,8 +7,8 @@ call ale#Set('c_ccls_init_options', {}) call ale#linter#Define('c', { \ 'name': 'ccls', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('c_ccls_executable'), +\ 'executable': {b -> ale#Var(b, 'c_ccls_executable')}, \ 'command': '%e', -\ 'project_root_callback': 'ale#handlers#ccls#GetProjectRoot', -\ 'initialization_options_callback':ale#VarFunc('c_ccls_init_options'), +\ 'project_root': function('ale#handlers#ccls#GetProjectRoot'), +\ 'initialization_options': {b -> ale#Var(b, 'c_ccls_init_options')}, \}) diff --git a/ale_linters/c/clang.vim b/ale_linters/c/clang.vim index f1bd675b..5b243bfe 100644 --- a/ale_linters/c/clang.vim +++ b/ale_linters/c/clang.vim @@ -18,7 +18,7 @@ endfunction call ale#linter#Define('c', { \ 'name': 'clang', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('c_clang_executable'), +\ 'executable': {b -> ale#Var(b, 'c_clang_executable')}, \ 'command_chain': [ \ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'}, \ {'callback': 'ale_linters#c#clang#GetCommand'} diff --git a/ale_linters/c/clangd.vim b/ale_linters/c/clangd.vim index 6cad601a..918eadcc 100644 --- a/ale_linters/c/clangd.vim +++ b/ale_linters/c/clangd.vim @@ -17,7 +17,7 @@ endfunction call ale#linter#Define('c', { \ 'name': 'clangd', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('c_clangd_executable'), -\ 'command_callback': 'ale_linters#c#clangd#GetCommand', -\ 'project_root_callback': 'ale_linters#c#clangd#GetProjectRoot', +\ 'executable': {b -> ale#Var(b, 'c_clangd_executable')}, +\ 'command': function('ale_linters#c#clangd#GetCommand'), +\ 'project_root': function('ale_linters#c#clangd#GetProjectRoot'), \}) diff --git a/ale_linters/c/clangtidy.vim b/ale_linters/c/clangtidy.vim index 4f334655..6484f8af 100644 --- a/ale_linters/c/clangtidy.vim +++ b/ale_linters/c/clangtidy.vim @@ -35,8 +35,8 @@ endfunction call ale#linter#Define('c', { \ 'name': 'clangtidy', \ 'output_stream': 'stdout', -\ 'executable_callback': ale#VarFunc('c_clangtidy_executable'), -\ 'command_callback': 'ale_linters#c#clangtidy#GetCommand', +\ 'executable': {b -> ale#Var(b, 'c_clangtidy_executable')}, +\ 'command': function('ale_linters#c#clangtidy#GetCommand'), \ 'callback': 'ale#handlers#gcc#HandleGCCFormat', \ 'lint_file': 1, \}) diff --git a/ale_linters/c/cppcheck.vim b/ale_linters/c/cppcheck.vim index 5e8c7936..851f9f11 100644 --- a/ale_linters/c/cppcheck.vim +++ b/ale_linters/c/cppcheck.vim @@ -28,7 +28,7 @@ endfunction call ale#linter#Define('c', { \ 'name': 'cppcheck', \ 'output_stream': 'both', -\ 'executable_callback': ale#VarFunc('c_cppcheck_executable'), -\ 'command_callback': 'ale_linters#c#cppcheck#GetCommand', +\ 'executable': {b -> ale#Var(b, 'c_cppcheck_executable')}, +\ 'command': function('ale_linters#c#cppcheck#GetCommand'), \ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat', \}) diff --git a/ale_linters/c/cquery.vim b/ale_linters/c/cquery.vim index a20782a2..d2be9cd9 100644 --- a/ale_linters/c/cquery.vim +++ b/ale_linters/c/cquery.vim @@ -21,8 +21,8 @@ endfunction call ale#linter#Define('c', { \ 'name': 'cquery', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('c_cquery_executable'), +\ 'executable': {b -> ale#Var(b, 'c_cquery_executable')}, \ 'command': '%e', -\ 'project_root_callback': 'ale_linters#c#cquery#GetProjectRoot', -\ 'initialization_options_callback': 'ale_linters#c#cquery#GetInitializationOptions', +\ 'project_root': function('ale_linters#c#cquery#GetProjectRoot'), +\ 'initialization_options': function('ale_linters#c#cquery#GetInitializationOptions'), \}) diff --git a/ale_linters/c/flawfinder.vim b/ale_linters/c/flawfinder.vim index 94104141..53c36716 100644 --- a/ale_linters/c/flawfinder.vim +++ b/ale_linters/c/flawfinder.vim @@ -19,7 +19,7 @@ endfunction call ale#linter#Define('c', { \ 'name': 'flawfinder', \ 'output_stream': 'stdout', -\ 'executable_callback': ale#VarFunc('c_flawfinder_executable'), -\ 'command_callback': 'ale_linters#c#flawfinder#GetCommand', +\ 'executable': {b -> ale#Var(b, 'c_flawfinder_executable')}, +\ 'command': function('ale_linters#c#flawfinder#GetCommand'), \ 'callback': 'ale#handlers#flawfinder#HandleFlawfinderFormat', \}) diff --git a/ale_linters/c/gcc.vim b/ale_linters/c/gcc.vim index 60ecb712..ccb1912b 100644 --- a/ale_linters/c/gcc.vim +++ b/ale_linters/c/gcc.vim @@ -18,7 +18,7 @@ endfunction call ale#linter#Define('c', { \ 'name': 'gcc', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('c_gcc_executable'), +\ 'executable': {b -> ale#Var(b, 'c_gcc_executable')}, \ 'command_chain': [ \ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'}, \ {'callback': 'ale_linters#c#gcc#GetCommand'} diff --git a/ale_linters/chef/foodcritic.vim b/ale_linters/chef/foodcritic.vim index c86336d6..48beba75 100644 --- a/ale_linters/chef/foodcritic.vim +++ b/ale_linters/chef/foodcritic.vim @@ -34,8 +34,8 @@ endfunction call ale#linter#Define('chef', { \ 'name': 'foodcritic', -\ 'executable_callback': ale#VarFunc('chef_foodcritic_executable'), -\ 'command_callback': 'ale_linters#chef#foodcritic#GetCommand', +\ 'executable': {b -> ale#Var(b, 'chef_foodcritic_executable')}, +\ 'command': function('ale_linters#chef#foodcritic#GetCommand'), \ 'callback': 'ale_linters#chef#foodcritic#Handle', \ 'lint_file': 1, \}) diff --git a/ale_linters/cmake/cmakelint.vim b/ale_linters/cmake/cmakelint.vim index 78676518..d955a265 100644 --- a/ale_linters/cmake/cmakelint.vim +++ b/ale_linters/cmake/cmakelint.vim @@ -18,7 +18,7 @@ endfunction call ale#linter#Define('cmake', { \ 'name': 'cmakelint', -\ 'executable_callback': 'ale_linters#cmake#cmakelint#Executable', -\ 'command_callback': 'ale_linters#cmake#cmakelint#Command', +\ 'executable': function('ale_linters#cmake#cmakelint#Executable'), +\ 'command': function('ale_linters#cmake#cmakelint#Command'), \ 'callback': 'ale#handlers#unix#HandleAsWarning', \}) diff --git a/ale_linters/coffee/coffee.vim b/ale_linters/coffee/coffee.vim index f2539281..8e891639 100644 --- a/ale_linters/coffee/coffee.vim +++ b/ale_linters/coffee/coffee.vim @@ -16,8 +16,8 @@ endfunction call ale#linter#Define('coffee', { \ 'name': 'coffee', -\ 'executable_callback': 'ale_linters#coffee#coffee#GetExecutable', -\ 'command_callback': 'ale_linters#coffee#coffee#GetCommand', +\ 'executable': function('ale_linters#coffee#coffee#GetExecutable'), +\ 'command': function('ale_linters#coffee#coffee#GetCommand'), \ 'output_stream': 'stderr', \ 'callback': 'ale#handlers#gcc#HandleGCCFormat', \}) diff --git a/ale_linters/coffee/coffeelint.vim b/ale_linters/coffee/coffeelint.vim index 6d3df353..b7c85fa7 100644 --- a/ale_linters/coffee/coffeelint.vim +++ b/ale_linters/coffee/coffeelint.vim @@ -37,7 +37,7 @@ endfunction call ale#linter#Define('coffee', { \ 'name': 'coffeelint', -\ 'executable_callback': 'ale_linters#coffee#coffeelint#GetExecutable', -\ 'command_callback': 'ale_linters#coffee#coffeelint#GetCommand', +\ 'executable': function('ale_linters#coffee#coffeelint#GetExecutable'), +\ 'command': function('ale_linters#coffee#coffeelint#GetCommand'), \ 'callback': 'ale_linters#coffee#coffeelint#Handle', \}) diff --git a/ale_linters/cpp/ccls.vim b/ale_linters/cpp/ccls.vim index 501fd685..b265ff70 100644 --- a/ale_linters/cpp/ccls.vim +++ b/ale_linters/cpp/ccls.vim @@ -7,8 +7,8 @@ call ale#Set('cpp_ccls_init_options', {}) call ale#linter#Define('cpp', { \ 'name': 'ccls', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('cpp_ccls_executable'), +\ 'executable': {b -> ale#Var(b, 'cpp_ccls_executable')}, \ 'command': '%e', -\ 'project_root_callback': 'ale#handlers#ccls#GetProjectRoot', -\ 'initialization_options_callback': ale#VarFunc('cpp_ccls_init_options'), +\ 'project_root': function('ale#handlers#ccls#GetProjectRoot'), +\ 'initialization_options': {b -> ale#Var(b, 'cpp_ccls_init_options')}, \}) diff --git a/ale_linters/cpp/clang.vim b/ale_linters/cpp/clang.vim index 649c5993..5a465812 100644 --- a/ale_linters/cpp/clang.vim +++ b/ale_linters/cpp/clang.vim @@ -18,7 +18,7 @@ endfunction call ale#linter#Define('cpp', { \ 'name': 'clang', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('cpp_clang_executable'), +\ 'executable': {b -> ale#Var(b, 'cpp_clang_executable')}, \ 'command_chain': [ \ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'}, \ {'callback': 'ale_linters#cpp#clang#GetCommand'}, diff --git a/ale_linters/cpp/clangcheck.vim b/ale_linters/cpp/clangcheck.vim index c66d6702..b511a413 100644 --- a/ale_linters/cpp/clangcheck.vim +++ b/ale_linters/cpp/clangcheck.vim @@ -27,8 +27,8 @@ endfunction call ale#linter#Define('cpp', { \ 'name': 'clangcheck', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('cpp_clangcheck_executable'), -\ 'command_callback': 'ale_linters#cpp#clangcheck#GetCommand', +\ 'executable': {b -> ale#Var(b, 'cpp_clangcheck_executable')}, +\ 'command': function('ale_linters#cpp#clangcheck#GetCommand'), \ 'callback': 'ale#handlers#gcc#HandleGCCFormat', \ 'lint_file': 1, \}) diff --git a/ale_linters/cpp/clangd.vim b/ale_linters/cpp/clangd.vim index 9139f054..4a8ff4f6 100644 --- a/ale_linters/cpp/clangd.vim +++ b/ale_linters/cpp/clangd.vim @@ -17,7 +17,7 @@ endfunction call ale#linter#Define('cpp', { \ 'name': 'clangd', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('cpp_clangd_executable'), -\ 'command_callback': 'ale_linters#cpp#clangd#GetCommand', -\ 'project_root_callback': 'ale_linters#cpp#clangd#GetProjectRoot', +\ 'executable': {b -> ale#Var(b, 'cpp_clangd_executable')}, +\ 'command': function('ale_linters#cpp#clangd#GetCommand'), +\ 'project_root': function('ale_linters#cpp#clangd#GetProjectRoot'), \}) diff --git a/ale_linters/cpp/clangtidy.vim b/ale_linters/cpp/clangtidy.vim index 9c3da8db..841b795f 100644 --- a/ale_linters/cpp/clangtidy.vim +++ b/ale_linters/cpp/clangtidy.vim @@ -29,8 +29,8 @@ endfunction call ale#linter#Define('cpp', { \ 'name': 'clangtidy', \ 'output_stream': 'stdout', -\ 'executable_callback': ale#VarFunc('cpp_clangtidy_executable'), -\ 'command_callback': 'ale_linters#cpp#clangtidy#GetCommand', +\ 'executable': {b -> ale#Var(b, 'cpp_clangtidy_executable')}, +\ 'command': function('ale_linters#cpp#clangtidy#GetCommand'), \ 'callback': 'ale#handlers#gcc#HandleGCCFormat', \ 'lint_file': 1, \}) diff --git a/ale_linters/cpp/clazy.vim b/ale_linters/cpp/clazy.vim index cbbd0ccf..9b29ac9a 100644 --- a/ale_linters/cpp/clazy.vim +++ b/ale_linters/cpp/clazy.vim @@ -25,8 +25,8 @@ endfunction call ale#linter#Define('cpp', { \ 'name': 'clazy', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('cpp_clazy_executable'), -\ 'command_callback': 'ale_linters#cpp#clazy#GetCommand', +\ 'executable': {b -> ale#Var(b, 'cpp_clazy_executable')}, +\ 'command': function('ale_linters#cpp#clazy#GetCommand'), \ 'callback': 'ale#handlers#gcc#HandleGCCFormat', \ 'lint_file': 1, \}) diff --git a/ale_linters/cpp/cppcheck.vim b/ale_linters/cpp/cppcheck.vim index 229d6133..5173d698 100644 --- a/ale_linters/cpp/cppcheck.vim +++ b/ale_linters/cpp/cppcheck.vim @@ -28,7 +28,7 @@ endfunction call ale#linter#Define('cpp', { \ 'name': 'cppcheck', \ 'output_stream': 'both', -\ 'executable_callback': ale#VarFunc('cpp_cppcheck_executable'), -\ 'command_callback': 'ale_linters#cpp#cppcheck#GetCommand', +\ 'executable': {b -> ale#Var(b, 'cpp_cppcheck_executable')}, +\ 'command': function('ale_linters#cpp#cppcheck#GetCommand'), \ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat', \}) diff --git a/ale_linters/cpp/cpplint.vim b/ale_linters/cpp/cpplint.vim index d135fa79..f1f6ce7f 100644 --- a/ale_linters/cpp/cpplint.vim +++ b/ale_linters/cpp/cpplint.vim @@ -13,8 +13,8 @@ endfunction call ale#linter#Define('cpp', { \ 'name': 'cpplint', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('cpp_cpplint_executable'), -\ 'command_callback': 'ale_linters#cpp#cpplint#GetCommand', +\ 'executable': {b -> ale#Var(b, 'cpp_cpplint_executable')}, +\ 'command': function('ale_linters#cpp#cpplint#GetCommand'), \ 'callback': 'ale#handlers#cpplint#HandleCppLintFormat', \ 'lint_file': 1, \}) diff --git a/ale_linters/cpp/cquery.vim b/ale_linters/cpp/cquery.vim index b1c81989..0dd9f6ad 100644 --- a/ale_linters/cpp/cquery.vim +++ b/ale_linters/cpp/cquery.vim @@ -21,8 +21,8 @@ endfunction call ale#linter#Define('cpp', { \ 'name': 'cquery', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('cpp_cquery_executable'), +\ 'executable': {b -> ale#Var(b, 'cpp_cquery_executable')}, \ 'command': '%e', -\ 'project_root_callback': 'ale_linters#cpp#cquery#GetProjectRoot', -\ 'initialization_options_callback': 'ale_linters#cpp#cquery#GetInitializationOptions', +\ 'project_root': function('ale_linters#cpp#cquery#GetProjectRoot'), +\ 'initialization_options': function('ale_linters#cpp#cquery#GetInitializationOptions'), \}) diff --git a/ale_linters/cpp/flawfinder.vim b/ale_linters/cpp/flawfinder.vim index 0a966604..5bfdea22 100644 --- a/ale_linters/cpp/flawfinder.vim +++ b/ale_linters/cpp/flawfinder.vim @@ -19,7 +19,7 @@ endfunction call ale#linter#Define('cpp', { \ 'name': 'flawfinder', \ 'output_stream': 'stdout', -\ 'executable_callback': ale#VarFunc('cpp_flawfinder_executable'), -\ 'command_callback': 'ale_linters#cpp#flawfinder#GetCommand', +\ 'executable': {b -> ale#Var(b, 'cpp_flawfinder_executable')}, +\ 'command': function('ale_linters#cpp#flawfinder#GetCommand'), \ 'callback': 'ale#handlers#flawfinder#HandleFlawfinderFormat', \}) diff --git a/ale_linters/cpp/gcc.vim b/ale_linters/cpp/gcc.vim index 9935b0bb..831620d5 100644 --- a/ale_linters/cpp/gcc.vim +++ b/ale_linters/cpp/gcc.vim @@ -19,7 +19,7 @@ call ale#linter#Define('cpp', { \ 'name': 'gcc', \ 'aliases': ['g++'], \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('cpp_gcc_executable'), +\ 'executable': {b -> ale#Var(b, 'cpp_gcc_executable')}, \ 'command_chain': [ \ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'}, \ {'callback': 'ale_linters#cpp#gcc#GetCommand'}, diff --git a/ale_linters/crystal/ameba.vim b/ale_linters/crystal/ameba.vim index a1bf9c1d..5dfc7f45 100644 --- a/ale_linters/crystal/ameba.vim +++ b/ale_linters/crystal/ameba.vim @@ -50,8 +50,8 @@ endfunction call ale#linter#Define('crystal', { \ 'name': 'ameba', -\ 'executable_callback': ale#VarFunc('crystal_ameba_executable'), -\ 'command_callback': 'ale_linters#crystal#ameba#GetCommand', +\ 'executable': {b -> ale#Var(b, 'crystal_ameba_executable')}, +\ 'command': function('ale_linters#crystal#ameba#GetCommand'), \ 'callback': 'ale_linters#crystal#ameba#HandleAmebaOutput', \ 'lint_file': 1, \}) diff --git a/ale_linters/crystal/crystal.vim b/ale_linters/crystal/crystal.vim index 81579d63..3c2fefb7 100644 --- a/ale_linters/crystal/crystal.vim +++ b/ale_linters/crystal/crystal.vim @@ -26,6 +26,6 @@ call ale#linter#Define('crystal', { \ 'executable': 'crystal', \ 'output_stream': 'both', \ 'lint_file': 1, -\ 'command_callback': 'ale_linters#crystal#crystal#GetCommand', +\ 'command': function('ale_linters#crystal#crystal#GetCommand'), \ 'callback': 'ale_linters#crystal#crystal#Handle', \}) diff --git a/ale_linters/cs/mcs.vim b/ale_linters/cs/mcs.vim index 8738026d..1b373e73 100644 --- a/ale_linters/cs/mcs.vim +++ b/ale_linters/cs/mcs.vim @@ -32,6 +32,6 @@ call ale#linter#Define('cs',{ \ 'name': 'mcs', \ 'output_stream': 'stderr', \ 'executable': 'mcs', -\ 'command_callback': 'ale_linters#cs#mcs#GetCommand', +\ 'command': function('ale_linters#cs#mcs#GetCommand'), \ 'callback': 'ale_linters#cs#mcs#Handle', \}) diff --git a/ale_linters/cs/mcsc.vim b/ale_linters/cs/mcsc.vim index a169297c..dd067eba 100644 --- a/ale_linters/cs/mcsc.vim +++ b/ale_linters/cs/mcsc.vim @@ -75,7 +75,7 @@ call ale#linter#Define('cs',{ \ 'name': 'mcsc', \ 'output_stream': 'stderr', \ 'executable': 'mcs', -\ 'command_callback': 'ale_linters#cs#mcsc#GetCommand', +\ 'command': function('ale_linters#cs#mcsc#GetCommand'), \ 'callback': 'ale_linters#cs#mcsc#Handle', \ 'lint_file': 1 \}) diff --git a/ale_linters/css/csslint.vim b/ale_linters/css/csslint.vim index 98b7fdd4..50c21ce2 100644 --- a/ale_linters/css/csslint.vim +++ b/ale_linters/css/csslint.vim @@ -13,6 +13,6 @@ endfunction call ale#linter#Define('css', { \ 'name': 'csslint', \ 'executable': 'csslint', -\ 'command_callback': 'ale_linters#css#csslint#GetCommand', +\ 'command': function('ale_linters#css#csslint#GetCommand'), \ 'callback': 'ale#handlers#css#HandleCSSLintFormat', \}) diff --git a/ale_linters/css/stylelint.vim b/ale_linters/css/stylelint.vim index 6f8bef68..38cb0e0b 100644 --- a/ale_linters/css/stylelint.vim +++ b/ale_linters/css/stylelint.vim @@ -11,9 +11,9 @@ endfunction call ale#linter#Define('css', { \ 'name': 'stylelint', -\ 'executable_callback': ale#node#FindExecutableFunc('css_stylelint', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'css_stylelint', [ \ 'node_modules/.bin/stylelint', -\ ]), -\ 'command_callback': 'ale_linters#css#stylelint#GetCommand', +\ ])}, +\ 'command': function('ale_linters#css#stylelint#GetCommand'), \ 'callback': 'ale#handlers#css#HandleStyleLintFormat', \}) diff --git a/ale_linters/cucumber/cucumber.vim b/ale_linters/cucumber/cucumber.vim index e8ae09ff..0cfd815e 100644 --- a/ale_linters/cucumber/cucumber.vim +++ b/ale_linters/cucumber/cucumber.vim @@ -41,6 +41,6 @@ endfunction call ale#linter#Define('cucumber', { \ 'name': 'cucumber', \ 'executable': 'cucumber', -\ 'command_callback': 'ale_linters#cucumber#cucumber#GetCommand', +\ 'command': function('ale_linters#cucumber#cucumber#GetCommand'), \ 'callback': 'ale_linters#cucumber#cucumber#Handle' \}) diff --git a/ale_linters/cuda/nvcc.vim b/ale_linters/cuda/nvcc.vim index db789ff1..f3af07b6 100644 --- a/ale_linters/cuda/nvcc.vim +++ b/ale_linters/cuda/nvcc.vim @@ -42,8 +42,8 @@ endfunction call ale#linter#Define('cuda', { \ 'name': 'nvcc', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('cuda_nvcc_executable'), -\ 'command_callback': 'ale_linters#cuda#nvcc#GetCommand', +\ 'executable': {b -> ale#Var(b, 'cuda_nvcc_executable')}, +\ 'command': function('ale_linters#cuda#nvcc#GetCommand'), \ 'callback': 'ale_linters#cuda#nvcc#HandleNVCCFormat', \ 'lint_file': 1, \}) diff --git a/ale_linters/d/dls.vim b/ale_linters/d/dls.vim index 7210d21e..78d1c152 100644 --- a/ale_linters/d/dls.vim +++ b/ale_linters/d/dls.vim @@ -16,7 +16,7 @@ endfunction call ale#linter#Define('d', { \ 'name': 'dls', \ 'lsp': 'stdio', -\ 'executable_callback': 'ale_linters#d#dls#GetExecutable', -\ 'command_callback': 'ale_linters#d#dls#GetExecutable', -\ 'project_root_callback': 'ale_linters#d#dls#FindProjectRoot', +\ 'executable': function('ale_linters#d#dls#GetExecutable'), +\ 'command': function('ale_linters#d#dls#GetExecutable'), +\ 'project_root': function('ale_linters#d#dls#FindProjectRoot'), \}) diff --git a/ale_linters/dart/dartanalyzer.vim b/ale_linters/dart/dartanalyzer.vim index 26817df5..0a4d9742 100644 --- a/ale_linters/dart/dartanalyzer.vim +++ b/ale_linters/dart/dartanalyzer.vim @@ -29,8 +29,8 @@ endfunction call ale#linter#Define('dart', { \ 'name': 'dartanalyzer', -\ 'executable_callback': ale#VarFunc('dart_dartanalyzer_executable'), -\ 'command_callback': 'ale_linters#dart#dartanalyzer#GetCommand', +\ 'executable': {b -> ale#Var(b, 'dart_dartanalyzer_executable')}, +\ 'command': function('ale_linters#dart#dartanalyzer#GetCommand'), \ 'callback': 'ale_linters#dart#dartanalyzer#Handle', \ 'lint_file': 1, \}) diff --git a/ale_linters/dart/language_server.vim b/ale_linters/dart/language_server.vim index 8e0c139b..d0e639c8 100644 --- a/ale_linters/dart/language_server.vim +++ b/ale_linters/dart/language_server.vim @@ -14,7 +14,7 @@ endfunction call ale#linter#Define('dart', { \ 'name': 'language_server', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('dart_language_server_executable'), +\ 'executable': {b -> ale#Var(b, 'dart_language_server_executable')}, \ 'command': '%e', -\ 'project_root_callback': 'ale_linters#dart#language_server#GetProjectRoot', +\ 'project_root': function('ale_linters#dart#language_server#GetProjectRoot'), \}) diff --git a/ale_linters/dockerfile/dockerfile_lint.vim b/ale_linters/dockerfile/dockerfile_lint.vim index a5a846f2..95768b12 100644 --- a/ale_linters/dockerfile/dockerfile_lint.vim +++ b/ale_linters/dockerfile/dockerfile_lint.vim @@ -55,7 +55,7 @@ endfunction call ale#linter#Define('dockerfile', { \ 'name': 'dockerfile_lint', -\ 'executable_callback': ale#VarFunc('dockerfile_dockerfile_lint_executable'), -\ 'command_callback': 'ale_linters#dockerfile#dockerfile_lint#GetCommand', +\ 'executable': {b -> ale#Var(b, 'dockerfile_dockerfile_lint_executable')}, +\ 'command': function('ale_linters#dockerfile#dockerfile_lint#GetCommand'), \ 'callback': 'ale_linters#dockerfile#dockerfile_lint#Handle', \}) diff --git a/ale_linters/dockerfile/hadolint.vim b/ale_linters/dockerfile/hadolint.vim index dc0f5b9e..e57cd76d 100644 --- a/ale_linters/dockerfile/hadolint.vim +++ b/ale_linters/dockerfile/hadolint.vim @@ -93,7 +93,7 @@ endfunction call ale#linter#Define('dockerfile', { \ 'name': 'hadolint', -\ 'executable_callback': 'ale_linters#dockerfile#hadolint#GetExecutable', -\ 'command_callback': 'ale_linters#dockerfile#hadolint#GetCommand', +\ 'executable': function('ale_linters#dockerfile#hadolint#GetExecutable'), +\ 'command': function('ale_linters#dockerfile#hadolint#GetCommand'), \ 'callback': 'ale_linters#dockerfile#hadolint#Handle', \}) diff --git a/ale_linters/elixir/credo.vim b/ale_linters/elixir/credo.vim index d778471c..8431c0df 100644 --- a/ale_linters/elixir/credo.vim +++ b/ale_linters/elixir/credo.vim @@ -47,6 +47,6 @@ endfunction call ale#linter#Define('elixir', { \ 'name': 'credo', \ 'executable': 'mix', -\ 'command_callback': 'ale_linters#elixir#credo#GetCommand', +\ 'command': function('ale_linters#elixir#credo#GetCommand'), \ 'callback': 'ale_linters#elixir#credo#Handle', \}) diff --git a/ale_linters/elixir/dialyxir.vim b/ale_linters/elixir/dialyxir.vim index d28d3c70..c7da7757 100644 --- a/ale_linters/elixir/dialyxir.vim +++ b/ale_linters/elixir/dialyxir.vim @@ -35,7 +35,7 @@ endfunction call ale#linter#Define('elixir', { \ 'name': 'dialyxir', \ 'executable': 'mix', -\ 'command_callback': 'ale_linters#elixir#dialyxir#GetCommand', +\ 'command': function('ale_linters#elixir#dialyxir#GetCommand'), \ 'callback': 'ale_linters#elixir#dialyxir#Handle', \}) diff --git a/ale_linters/elixir/dogma.vim b/ale_linters/elixir/dogma.vim index dcfb6f28..1c721158 100644 --- a/ale_linters/elixir/dogma.vim +++ b/ale_linters/elixir/dogma.vim @@ -39,7 +39,7 @@ endfunction call ale#linter#Define('elixir', { \ 'name': 'dogma', \ 'executable': 'mix', -\ 'command_callback': 'ale_linters#elixir#dogma#GetCommand', +\ 'command': function('ale_linters#elixir#dogma#GetCommand'), \ 'lint_file': 1, \ 'callback': 'ale_linters#elixir#dogma#Handle', \}) diff --git a/ale_linters/elixir/elixir_ls.vim b/ale_linters/elixir/elixir_ls.vim index 3b299ec6..d5db7cd0 100644 --- a/ale_linters/elixir/elixir_ls.vim +++ b/ale_linters/elixir/elixir_ls.vim @@ -14,8 +14,8 @@ endfunction call ale#linter#Define('elixir', { \ 'name': 'elixir-ls', \ 'lsp': 'stdio', -\ 'executable_callback': 'ale_linters#elixir#elixir_ls#GetExecutable', -\ 'command_callback': 'ale_linters#elixir#elixir_ls#GetExecutable', -\ 'project_root_callback': 'ale#handlers#elixir#FindMixUmbrellaRoot', -\ 'lsp_config_callback': ale#VarFunc('elixir_elixir_ls_config'), +\ 'executable': function('ale_linters#elixir#elixir_ls#GetExecutable'), +\ 'command': function('ale_linters#elixir#elixir_ls#GetExecutable'), +\ 'project_root': function('ale#handlers#elixir#FindMixUmbrellaRoot'), +\ 'lsp_config': {b -> ale#Var(b, 'elixir_elixir_ls_config')}, \}) diff --git a/ale_linters/elixir/mix.vim b/ale_linters/elixir/mix.vim index 59cfe505..abf5d0aa 100644 --- a/ale_linters/elixir/mix.vim +++ b/ale_linters/elixir/mix.vim @@ -46,7 +46,7 @@ endfunction call ale#linter#Define('elixir', { \ 'name': 'mix', \ 'executable': 'mix', -\ 'command_callback': 'ale_linters#elixir#mix#GetCommand', +\ 'command': function('ale_linters#elixir#mix#GetCommand'), \ 'callback': 'ale_linters#elixir#mix#Handle', \ 'lint_file': 1, \}) diff --git a/ale_linters/elm/make.vim b/ale_linters/elm/make.vim index 190f7541..6b93257f 100644 --- a/ale_linters/elm/make.vim +++ b/ale_linters/elm/make.vim @@ -233,8 +233,8 @@ endfunction call ale#linter#Define('elm', { \ 'name': 'make', -\ 'executable_callback': 'ale_linters#elm#make#GetExecutable', +\ 'executable': function('ale_linters#elm#make#GetExecutable'), \ 'output_stream': 'both', -\ 'command_callback': 'ale_linters#elm#make#GetCommand', +\ 'command': function('ale_linters#elm#make#GetCommand'), \ 'callback': 'ale_linters#elm#make#Handle' \}) diff --git a/ale_linters/erlang/erlc.vim b/ale_linters/erlang/erlc.vim index 81ba128b..a83bacc3 100644 --- a/ale_linters/erlang/erlc.vim +++ b/ale_linters/erlang/erlc.vim @@ -91,6 +91,6 @@ endfunction call ale#linter#Define('erlang', { \ 'name': 'erlc', \ 'executable': 'erlc', -\ 'command_callback': 'ale_linters#erlang#erlc#GetCommand', +\ 'command': function('ale_linters#erlang#erlc#GetCommand'), \ 'callback': 'ale_linters#erlang#erlc#Handle', \}) diff --git a/ale_linters/erlang/syntaxerl.vim b/ale_linters/erlang/syntaxerl.vim index 5b679743..2b7276a1 100644 --- a/ale_linters/erlang/syntaxerl.vim +++ b/ale_linters/erlang/syntaxerl.vim @@ -26,7 +26,7 @@ endfunction call ale#linter#Define('erlang', { \ 'name': 'syntaxerl', -\ 'executable_callback': ale#VarFunc('erlang_syntaxerl_executable'), +\ 'executable': {b -> ale#Var(b, 'erlang_syntaxerl_executable')}, \ 'command_chain': [ \ {'callback': {-> '%e -h'}}, \ {'callback': 'ale_linters#erlang#syntaxerl#GetCommand'}, diff --git a/ale_linters/eruby/erb.vim b/ale_linters/eruby/erb.vim index 61d97032..f3438320 100644 --- a/ale_linters/eruby/erb.vim +++ b/ale_linters/eruby/erb.vim @@ -19,7 +19,7 @@ call ale#linter#Define('eruby', { \ 'aliases': ['erubylint'], \ 'executable': 'erb', \ 'output_stream': 'stderr', -\ 'command_callback': 'ale_linters#eruby#erb#GetCommand', +\ 'command': function('ale_linters#eruby#erb#GetCommand'), \ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors', \}) diff --git a/ale_linters/eruby/erubis.vim b/ale_linters/eruby/erubis.vim index 1ebd4a05..755c5803 100644 --- a/ale_linters/eruby/erubis.vim +++ b/ale_linters/eruby/erubis.vim @@ -18,6 +18,6 @@ call ale#linter#Define('eruby', { \ 'name': 'erubis', \ 'executable': 'erubis', \ 'output_stream': 'stderr', -\ 'command_callback': 'ale_linters#eruby#erubis#GetCommand', +\ 'command': function('ale_linters#eruby#erubis#GetCommand'), \ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors', \}) diff --git a/ale_linters/eruby/ruumba.vim b/ale_linters/eruby/ruumba.vim index 24f112e4..e68bb51d 100644 --- a/ale_linters/eruby/ruumba.vim +++ b/ale_linters/eruby/ruumba.vim @@ -56,7 +56,7 @@ endfunction call ale#linter#Define('eruby', { \ 'name': 'ruumba', -\ 'executable_callback': ale#VarFunc('eruby_ruumba_executable'), -\ 'command_callback': 'ale_linters#eruby#ruumba#GetCommand', +\ 'executable': {b -> ale#Var(b, 'eruby_ruumba_executable')}, +\ 'command': function('ale_linters#eruby#ruumba#GetCommand'), \ 'callback': 'ale_linters#eruby#ruumba#Handle', \}) diff --git a/ale_linters/fortran/gcc.vim b/ale_linters/fortran/gcc.vim index f1595789..6e97d6fd 100644 --- a/ale_linters/fortran/gcc.vim +++ b/ale_linters/fortran/gcc.vim @@ -66,7 +66,7 @@ endfunction call ale#linter#Define('fortran', { \ 'name': 'gcc', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('fortran_gcc_executable'), -\ 'command_callback': 'ale_linters#fortran#gcc#GetCommand', +\ 'executable': {b -> ale#Var(b, 'fortran_gcc_executable')}, +\ 'command': function('ale_linters#fortran#gcc#GetCommand'), \ 'callback': 'ale_linters#fortran#gcc#Handle', \}) diff --git a/ale_linters/fortran/language_server.vim b/ale_linters/fortran/language_server.vim index 4e5f5dc4..00aa0577 100644 --- a/ale_linters/fortran/language_server.vim +++ b/ale_linters/fortran/language_server.vim @@ -13,7 +13,7 @@ endfunction call ale#linter#Define('fortran', { \ 'name': 'language_server', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('fortran_language_server_executable'), +\ 'executable': {b -> ale#Var(b, 'fortran_language_server_executable')}, \ 'command': '%e', -\ 'project_root_callback': 'ale_linters#fortran#language_server#GetProjectRoot', +\ 'project_root': function('ale_linters#fortran#language_server#GetProjectRoot'), \}) diff --git a/ale_linters/fuse/fusionlint.vim b/ale_linters/fuse/fusionlint.vim index ab8f143b..ffb25d33 100644 --- a/ale_linters/fuse/fusionlint.vim +++ b/ale_linters/fuse/fusionlint.vim @@ -27,7 +27,7 @@ endfunction call ale#linter#Define('fuse', { \ 'name': 'fusionlint', -\ 'executable_callback': ale#VarFunc('fuse_fusionlint_executable'), -\ 'command_callback': 'ale_linters#fuse#fusionlint#GetCommand', +\ 'executable': {b -> ale#Var(b, 'fuse_fusionlint_executable')}, +\ 'command': function('ale_linters#fuse#fusionlint#GetCommand'), \ 'callback': 'ale_linters#fuse#fusionlint#Handle', \}) diff --git a/ale_linters/gitcommit/gitlint.vim b/ale_linters/gitcommit/gitlint.vim index a9c4822d..4b9cec63 100644 --- a/ale_linters/gitcommit/gitlint.vim +++ b/ale_linters/gitcommit/gitlint.vim @@ -45,7 +45,7 @@ endfunction call ale#linter#Define('gitcommit', { \ 'name': 'gitlint', \ 'output_stream': 'stderr', -\ 'executable_callback': 'ale_linters#gitcommit#gitlint#GetExecutable', -\ 'command_callback': 'ale_linters#gitcommit#gitlint#GetCommand', +\ 'executable': function('ale_linters#gitcommit#gitlint#GetExecutable'), +\ 'command': function('ale_linters#gitcommit#gitlint#GetCommand'), \ 'callback': 'ale_linters#gitcommit#gitlint#Handle', \}) diff --git a/ale_linters/glsl/glslang.vim b/ale_linters/glsl/glslang.vim index d55a5e7c..bbddce90 100644 --- a/ale_linters/glsl/glslang.vim +++ b/ale_linters/glsl/glslang.vim @@ -34,7 +34,7 @@ endfunction call ale#linter#Define('glsl', { \ 'name': 'glslang', -\ 'executable_callback': ale#VarFunc('glsl_glslang_executable'), -\ 'command_callback': 'ale_linters#glsl#glslang#GetCommand', +\ 'executable': {b -> ale#Var(b, 'glsl_glslang_executable')}, +\ 'command': function('ale_linters#glsl#glslang#GetCommand'), \ 'callback': 'ale_linters#glsl#glslang#Handle', \}) diff --git a/ale_linters/glsl/glslls.vim b/ale_linters/glsl/glslls.vim index 8c6d9bd9..b62844c7 100644 --- a/ale_linters/glsl/glslls.vim +++ b/ale_linters/glsl/glslls.vim @@ -24,7 +24,7 @@ endfunction call ale#linter#Define('glsl', { \ 'name': 'glslls', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('glsl_glslls_executable'), -\ 'command_callback': 'ale_linters#glsl#glslls#GetCommand', -\ 'project_root_callback': 'ale_linters#glsl#glslls#GetProjectRoot', +\ 'executable': {b -> ale#Var(b, 'glsl_glslls_executable')}, +\ 'command': function('ale_linters#glsl#glslls#GetCommand'), +\ 'project_root': function('ale_linters#glsl#glslls#GetProjectRoot'), \}) diff --git a/ale_linters/go/bingo.vim b/ale_linters/go/bingo.vim index ba80fbe8..e446bdcc 100644 --- a/ale_linters/go/bingo.vim +++ b/ale_linters/go/bingo.vim @@ -23,7 +23,7 @@ endfunction call ale#linter#Define('go', { \ 'name': 'bingo', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('go_bingo_executable'), -\ 'command_callback': 'ale_linters#go#bingo#GetCommand', -\ 'project_root_callback': 'ale_linters#go#bingo#FindProjectRoot', +\ 'executable': {b -> ale#Var(b, 'go_bingo_executable')}, +\ 'command': function('ale_linters#go#bingo#GetCommand'), +\ 'project_root': function('ale_linters#go#bingo#FindProjectRoot'), \}) diff --git a/ale_linters/go/gobuild.vim b/ale_linters/go/gobuild.vim index cef1ff88..374ded35 100644 --- a/ale_linters/go/gobuild.vim +++ b/ale_linters/go/gobuild.vim @@ -48,8 +48,8 @@ endfunction call ale#linter#Define('go', { \ 'name': 'gobuild', \ 'aliases': ['go build'], -\ 'executable_callback': ale#VarFunc('go_go_executable'), -\ 'command_callback': 'ale_linters#go#gobuild#GetCommand', +\ 'executable': {b -> ale#Var(b, 'go_go_executable')}, +\ 'command': function('ale_linters#go#gobuild#GetCommand'), \ 'output_stream': 'stderr', \ 'callback': 'ale_linters#go#gobuild#Handler', \ 'lint_file': 1, diff --git a/ale_linters/go/golangci_lint.vim b/ale_linters/go/golangci_lint.vim index dd9a3c64..357f7949 100644 --- a/ale_linters/go/golangci_lint.vim +++ b/ale_linters/go/golangci_lint.vim @@ -49,8 +49,8 @@ endfunction call ale#linter#Define('go', { \ 'name': 'golangci-lint', -\ 'executable_callback': ale#VarFunc('go_golangci_lint_executable'), -\ 'command_callback': 'ale_linters#go#golangci_lint#GetCommand', +\ 'executable': {b -> ale#Var(b, 'go_golangci_lint_executable')}, +\ 'command': function('ale_linters#go#golangci_lint#GetCommand'), \ 'callback': 'ale_linters#go#golangci_lint#Handler', \ 'lint_file': 1, \}) diff --git a/ale_linters/go/golint.vim b/ale_linters/go/golint.vim index 4bf14fcc..765e1477 100644 --- a/ale_linters/go/golint.vim +++ b/ale_linters/go/golint.vim @@ -15,7 +15,7 @@ endfunction call ale#linter#Define('go', { \ 'name': 'golint', \ 'output_stream': 'both', -\ 'executable_callback': ale#VarFunc('go_golint_executable'), -\ 'command_callback': 'ale_linters#go#golint#GetCommand', +\ 'executable': {b -> ale#Var(b, 'go_golint_executable')}, +\ 'command': function('ale_linters#go#golint#GetCommand'), \ 'callback': 'ale#handlers#unix#HandleAsWarning', \}) diff --git a/ale_linters/go/gometalinter.vim b/ale_linters/go/gometalinter.vim index d005e1d2..19d70a81 100644 --- a/ale_linters/go/gometalinter.vim +++ b/ale_linters/go/gometalinter.vim @@ -50,8 +50,8 @@ endfunction call ale#linter#Define('go', { \ 'name': 'gometalinter', -\ 'executable_callback': ale#VarFunc('go_gometalinter_executable'), -\ 'command_callback': 'ale_linters#go#gometalinter#GetCommand', +\ 'executable': {b -> ale#Var(b, 'go_gometalinter_executable')}, +\ 'command': function('ale_linters#go#gometalinter#GetCommand'), \ 'callback': 'ale_linters#go#gometalinter#Handler', \ 'lint_file': 1, \}) diff --git a/ale_linters/go/gosimple.vim b/ale_linters/go/gosimple.vim index dbdc3fcf..281a0e53 100644 --- a/ale_linters/go/gosimple.vim +++ b/ale_linters/go/gosimple.vim @@ -8,7 +8,7 @@ endfunction call ale#linter#Define('go', { \ 'name': 'gosimple', \ 'executable': 'gosimple', -\ 'command_callback': 'ale_linters#go#gosimple#GetCommand', +\ 'command': function('ale_linters#go#gosimple#GetCommand'), \ 'callback': 'ale#handlers#go#Handler', \ 'output_stream': 'both', \ 'lint_file': 1, diff --git a/ale_linters/go/gotype.vim b/ale_linters/go/gotype.vim index a678e0f3..159df892 100644 --- a/ale_linters/go/gotype.vim +++ b/ale_linters/go/gotype.vim @@ -13,7 +13,7 @@ call ale#linter#Define('go', { \ 'name': 'gotype', \ 'output_stream': 'stderr', \ 'executable': 'gotype', -\ 'command_callback': 'ale_linters#go#gotype#GetCommand', +\ 'command': function('ale_linters#go#gotype#GetCommand'), \ 'callback': 'ale#handlers#go#Handler', \ 'lint_file': 1, \}) diff --git a/ale_linters/go/govet.vim b/ale_linters/go/govet.vim index 3d0d2adf..bb81d5d0 100644 --- a/ale_linters/go/govet.vim +++ b/ale_linters/go/govet.vim @@ -20,8 +20,8 @@ call ale#linter#Define('go', { \ 'name': 'govet', \ 'aliases': ['go vet'], \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('go_go_executable'), -\ 'command_callback': 'ale_linters#go#govet#GetCommand', +\ 'executable': {b -> ale#Var(b, 'go_go_executable')}, +\ 'command': function('ale_linters#go#govet#GetCommand'), \ 'callback': 'ale#handlers#go#Handler', \ 'lint_file': 1, \}) diff --git a/ale_linters/go/langserver.vim b/ale_linters/go/langserver.vim index e049be7b..776186c7 100644 --- a/ale_linters/go/langserver.vim +++ b/ale_linters/go/langserver.vim @@ -22,7 +22,7 @@ endfunction call ale#linter#Define('go', { \ 'name': 'golangserver', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('go_langserver_executable'), -\ 'command_callback': 'ale_linters#go#langserver#GetCommand', -\ 'project_root_callback': 'ale#go#FindProjectRoot', +\ 'executable': {b -> ale#Var(b, 'go_langserver_executable')}, +\ 'command': function('ale_linters#go#langserver#GetCommand'), +\ 'project_root': function('ale#go#FindProjectRoot'), \}) diff --git a/ale_linters/go/staticcheck.vim b/ale_linters/go/staticcheck.vim index a3464015..26fe0193 100644 --- a/ale_linters/go/staticcheck.vim +++ b/ale_linters/go/staticcheck.vim @@ -26,7 +26,7 @@ endfunction call ale#linter#Define('go', { \ 'name': 'staticcheck', \ 'executable': 'staticcheck', -\ 'command_callback': 'ale_linters#go#staticcheck#GetCommand', +\ 'command': function('ale_linters#go#staticcheck#GetCommand'), \ 'callback': 'ale#handlers#go#Handler', \ 'output_stream': 'both', \ 'lint_file': 1, diff --git a/ale_linters/graphql/eslint.vim b/ale_linters/graphql/eslint.vim index dfcbf9d9..654b8c17 100644 --- a/ale_linters/graphql/eslint.vim +++ b/ale_linters/graphql/eslint.vim @@ -3,7 +3,7 @@ call ale#linter#Define('graphql', { \ 'name': 'eslint', -\ 'executable_callback': 'ale#handlers#eslint#GetExecutable', -\ 'command_callback': 'ale#handlers#eslint#GetCommand', +\ 'executable': function('ale#handlers#eslint#GetExecutable'), +\ 'command': function('ale#handlers#eslint#GetCommand'), \ 'callback': 'ale#handlers#eslint#Handle', \}) diff --git a/ale_linters/graphql/gqlint.vim b/ale_linters/graphql/gqlint.vim index e45bf4c8..d5029de1 100644 --- a/ale_linters/graphql/gqlint.vim +++ b/ale_linters/graphql/gqlint.vim @@ -10,6 +10,6 @@ endfunction call ale#linter#Define('graphql', { \ 'name': 'gqlint', \ 'executable': 'gqlint', -\ 'command_callback': 'ale_linters#graphql#gqlint#GetCommand', +\ 'command': function('ale_linters#graphql#gqlint#GetCommand'), \ 'callback': 'ale#handlers#unix#HandleAsWarning', \}) diff --git a/ale_linters/hack/hack.vim b/ale_linters/hack/hack.vim index aea428cc..822b5c87 100644 --- a/ale_linters/hack/hack.vim +++ b/ale_linters/hack/hack.vim @@ -16,7 +16,7 @@ endfunction call ale#linter#Define('hack', { \ 'name': 'hack', \ 'lsp': 'stdio', -\ 'executable_callback': 'ale_linters#hack#hack#GetExecutable', +\ 'executable': function('ale_linters#hack#hack#GetExecutable'), \ 'command': '%e lsp --from vim-ale', -\ 'project_root_callback': 'ale_linters#hack#hack#GetProjectRoot', +\ 'project_root': function('ale_linters#hack#hack#GetProjectRoot'), \}) diff --git a/ale_linters/hack/hhast.vim b/ale_linters/hack/hhast.vim index f6870b59..5e6d4dec 100644 --- a/ale_linters/hack/hhast.vim +++ b/ale_linters/hack/hhast.vim @@ -33,8 +33,8 @@ endfunction call ale#linter#Define('hack', { \ 'name': 'hhast', \ 'lsp': 'stdio', -\ 'executable_callback': 'ale_linters#hack#hhast#GetExecutable', +\ 'executable': function('ale_linters#hack#hhast#GetExecutable'), \ 'command': '%e --mode lsp --from vim-ale', -\ 'project_root_callback': 'ale_linters#hack#hhast#GetProjectRoot', -\ 'initialization_options_callback': 'ale_linters#hack#hhast#GetInitializationOptions', +\ 'project_root': function('ale_linters#hack#hhast#GetProjectRoot'), +\ 'initialization_options': function('ale_linters#hack#hhast#GetInitializationOptions'), \}) diff --git a/ale_linters/haml/hamllint.vim b/ale_linters/haml/hamllint.vim index 6598f81a..7d7278aa 100644 --- a/ale_linters/haml/hamllint.vim +++ b/ale_linters/haml/hamllint.vim @@ -51,7 +51,7 @@ endfunction call ale#linter#Define('haml', { \ 'name': 'hamllint', -\ 'executable_callback': 'ale_linters#haml#hamllint#GetExecutable', -\ 'command_callback': 'ale_linters#haml#hamllint#GetCommand', +\ 'executable': function('ale_linters#haml#hamllint#GetExecutable'), +\ 'command': function('ale_linters#haml#hamllint#GetCommand'), \ 'callback': 'ale_linters#haml#hamllint#Handle' \}) diff --git a/ale_linters/handlebars/embertemplatelint.vim b/ale_linters/handlebars/embertemplatelint.vim index 4fc0f20d..74bd6a99 100644 --- a/ale_linters/handlebars/embertemplatelint.vim +++ b/ale_linters/handlebars/embertemplatelint.vim @@ -31,9 +31,9 @@ endfunction call ale#linter#Define('handlebars', { \ 'name': 'ember-template-lint', -\ 'executable_callback': ale#node#FindExecutableFunc('handlebars_embertemplatelint', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'handlebars_embertemplatelint', [ \ 'node_modules/.bin/ember-template-lint', -\ ]), +\ ])}, \ 'command': '%e --json %t', \ 'callback': 'ale_linters#handlebars#embertemplatelint#Handle', \}) diff --git a/ale_linters/haskell/cabal_ghc.vim b/ale_linters/haskell/cabal_ghc.vim index 003adf5d..59978e7e 100644 --- a/ale_linters/haskell/cabal_ghc.vim +++ b/ale_linters/haskell/cabal_ghc.vim @@ -14,6 +14,6 @@ call ale#linter#Define('haskell', { \ 'aliases': ['cabal-ghc'], \ 'output_stream': 'stderr', \ 'executable': 'cabal', -\ 'command_callback': 'ale_linters#haskell#cabal_ghc#GetCommand', +\ 'command': function('ale_linters#haskell#cabal_ghc#GetCommand'), \ 'callback': 'ale#handlers#haskell#HandleGHCFormat', \}) diff --git a/ale_linters/haskell/ghc.vim b/ale_linters/haskell/ghc.vim index daf91c8f..9c3906b2 100644 --- a/ale_linters/haskell/ghc.vim +++ b/ale_linters/haskell/ghc.vim @@ -13,6 +13,6 @@ call ale#linter#Define('haskell', { \ 'name': 'ghc', \ 'output_stream': 'stderr', \ 'executable': 'ghc', -\ 'command_callback': 'ale_linters#haskell#ghc#GetCommand', +\ 'command': function('ale_linters#haskell#ghc#GetCommand'), \ 'callback': 'ale#handlers#haskell#HandleGHCFormat', \}) diff --git a/ale_linters/haskell/ghc_mod.vim b/ale_linters/haskell/ghc_mod.vim index 9762be7a..30e96b40 100644 --- a/ale_linters/haskell/ghc_mod.vim +++ b/ale_linters/haskell/ghc_mod.vim @@ -13,7 +13,7 @@ endfunction call ale#linter#Define('haskell', { \ 'name': 'ghc_mod', \ 'aliases': ['ghc-mod'], -\ 'executable_callback': ale#VarFunc('haskell_ghc_mod_executable'), -\ 'command_callback': 'ale_linters#haskell#ghc_mod#GetCommand', +\ 'executable': {b -> ale#Var(b, 'haskell_ghc_mod_executable')}, +\ 'command': function('ale_linters#haskell#ghc_mod#GetCommand'), \ 'callback': 'ale#handlers#haskell#HandleGHCFormat', \}) diff --git a/ale_linters/haskell/hdevtools.vim b/ale_linters/haskell/hdevtools.vim index cc5ce56f..3e55e4f0 100644 --- a/ale_linters/haskell/hdevtools.vim +++ b/ale_linters/haskell/hdevtools.vim @@ -14,7 +14,7 @@ endfunction call ale#linter#Define('haskell', { \ 'name': 'hdevtools', -\ 'executable_callback': ale#VarFunc('haskell_hdevtools_executable'), -\ 'command_callback': 'ale_linters#haskell#hdevtools#GetCommand', +\ 'executable': {b -> ale#Var(b, 'haskell_hdevtools_executable')}, +\ 'command': function('ale_linters#haskell#hdevtools#GetCommand'), \ 'callback': 'ale#handlers#haskell#HandleGHCFormat', \}) diff --git a/ale_linters/haskell/hie.vim b/ale_linters/haskell/hie.vim index cc85fbed..c4b5f1df 100644 --- a/ale_linters/haskell/hie.vim +++ b/ale_linters/haskell/hie.vim @@ -35,7 +35,7 @@ endfunction call ale#linter#Define('haskell', { \ 'name': 'hie', \ 'lsp': 'stdio', -\ 'command_callback': 'ale_linters#haskell#hie#GetCommand', -\ 'executable_callback': ale#VarFunc('haskell_hie_executable'), -\ 'project_root_callback': 'ale_linters#haskell#hie#GetProjectRoot', +\ 'command': function('ale_linters#haskell#hie#GetCommand'), +\ 'executable': {b -> ale#Var(b, 'haskell_hie_executable')}, +\ 'project_root': function('ale_linters#haskell#hie#GetProjectRoot'), \}) diff --git a/ale_linters/haskell/hlint.vim b/ale_linters/haskell/hlint.vim index 0cc7437f..1425251a 100644 --- a/ale_linters/haskell/hlint.vim +++ b/ale_linters/haskell/hlint.vim @@ -40,7 +40,7 @@ endfunction call ale#linter#Define('haskell', { \ 'name': 'hlint', -\ 'executable_callback': ale#VarFunc('haskell_hlint_executable'), -\ 'command_callback': 'ale_linters#haskell#hlint#GetCommand' , +\ 'executable': {b -> ale#Var(b, 'haskell_hlint_executable')}, +\ 'command': function('ale_linters#haskell#hlint#GetCommand') , \ 'callback': 'ale_linters#haskell#hlint#Handle', \}) diff --git a/ale_linters/haskell/stack_build.vim b/ale_linters/haskell/stack_build.vim index 95a54587..8f2d9fd9 100644 --- a/ale_linters/haskell/stack_build.vim +++ b/ale_linters/haskell/stack_build.vim @@ -16,8 +16,8 @@ call ale#linter#Define('haskell', { \ 'name': 'stack_build', \ 'aliases': ['stack-build'], \ 'output_stream': 'stderr', -\ 'executable_callback': 'ale#handlers#haskell#GetStackExecutable', -\ 'command_callback': 'ale_linters#haskell#stack_build#GetCommand', +\ 'executable': function('ale#handlers#haskell#GetStackExecutable'), +\ 'command': function('ale_linters#haskell#stack_build#GetCommand'), \ 'lint_file': 1, \ 'callback': 'ale#handlers#haskell#HandleGHCFormat', \}) diff --git a/ale_linters/haskell/stack_ghc.vim b/ale_linters/haskell/stack_ghc.vim index 99aa2540..06af7f6d 100644 --- a/ale_linters/haskell/stack_ghc.vim +++ b/ale_linters/haskell/stack_ghc.vim @@ -14,7 +14,7 @@ call ale#linter#Define('haskell', { \ 'name': 'stack_ghc', \ 'aliases': ['stack-ghc'], \ 'output_stream': 'stderr', -\ 'executable_callback': 'ale#handlers#haskell#GetStackExecutable', -\ 'command_callback': 'ale_linters#haskell#stack_ghc#GetCommand', +\ 'executable': function('ale#handlers#haskell#GetStackExecutable'), +\ 'command': function('ale_linters#haskell#stack_ghc#GetCommand'), \ 'callback': 'ale#handlers#haskell#HandleGHCFormat', \}) diff --git a/ale_linters/html/htmlhint.vim b/ale_linters/html/htmlhint.vim index 234c1176..3e01f51a 100644 --- a/ale_linters/html/htmlhint.vim +++ b/ale_linters/html/htmlhint.vim @@ -24,9 +24,9 @@ endfunction call ale#linter#Define('html', { \ 'name': 'htmlhint', -\ 'executable_callback': ale#node#FindExecutableFunc('html_htmlhint', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'html_htmlhint', [ \ 'node_modules/.bin/htmlhint', -\ ]), -\ 'command_callback': 'ale_linters#html#htmlhint#GetCommand', +\ ])}, +\ 'command': function('ale_linters#html#htmlhint#GetCommand'), \ 'callback': 'ale#handlers#unix#HandleAsError', \}) diff --git a/ale_linters/html/stylelint.vim b/ale_linters/html/stylelint.vim index 908c4b02..ae8955f3 100644 --- a/ale_linters/html/stylelint.vim +++ b/ale_linters/html/stylelint.vim @@ -21,7 +21,7 @@ endfunction call ale#linter#Define('html', { \ 'name': 'stylelint', -\ 'executable_callback': 'ale_linters#html#stylelint#GetExecutable', -\ 'command_callback': 'ale_linters#html#stylelint#GetCommand', +\ 'executable': function('ale_linters#html#stylelint#GetExecutable'), +\ 'command': function('ale_linters#html#stylelint#GetCommand'), \ 'callback': 'ale#handlers#css#HandleStyleLintFormat', \}) diff --git a/ale_linters/html/tidy.vim b/ale_linters/html/tidy.vim index 4ec29091..1e476d40 100644 --- a/ale_linters/html/tidy.vim +++ b/ale_linters/html/tidy.vim @@ -63,8 +63,8 @@ endfunction call ale#linter#Define('html', { \ 'name': 'tidy', -\ 'executable_callback': ale#VarFunc('html_tidy_executable'), +\ 'executable': {b -> ale#Var(b, 'html_tidy_executable')}, \ 'output_stream': 'stderr', -\ 'command_callback': 'ale_linters#html#tidy#GetCommand', +\ 'command': function('ale_linters#html#tidy#GetCommand'), \ 'callback': 'ale_linters#html#tidy#Handle', \ }) diff --git a/ale_linters/idris/idris.vim b/ale_linters/idris/idris.vim index 42b88158..879e92f2 100644 --- a/ale_linters/idris/idris.vim +++ b/ale_linters/idris/idris.vim @@ -75,7 +75,7 @@ endfunction call ale#linter#Define('idris', { \ 'name': 'idris', -\ 'executable_callback': ale#VarFunc('idris_idris_executable'), -\ 'command_callback': 'ale_linters#idris#idris#GetCommand', +\ 'executable': {b -> ale#Var(b, 'idris_idris_executable')}, +\ 'command': function('ale_linters#idris#idris#GetCommand'), \ 'callback': 'ale_linters#idris#idris#Handle', \}) diff --git a/ale_linters/ispc/ispc.vim b/ale_linters/ispc/ispc.vim index de7ceafa..eb365117 100644 --- a/ale_linters/ispc/ispc.vim +++ b/ale_linters/ispc/ispc.vim @@ -38,8 +38,8 @@ endfunction call ale#linter#Define('ispc', { \ 'name': 'ispc', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('ispc_ispc_executable'), -\ 'command_callback': 'ale_linters#ispc#ispc#GetCommand', +\ 'executable': {b -> ale#Var(b, 'ispc_ispc_executable')}, +\ 'command': function('ale_linters#ispc#ispc#GetCommand'), \ 'callback': 'ale_linters#ispc#ispc#Handle', \ 'lint_file': 1, \}) diff --git a/ale_linters/java/checkstyle.vim b/ale_linters/java/checkstyle.vim index c07b65d0..3159cd55 100644 --- a/ale_linters/java/checkstyle.vim +++ b/ale_linters/java/checkstyle.vim @@ -44,7 +44,7 @@ endif call ale#linter#Define('java', { \ 'name': 'checkstyle', \ 'executable': 'checkstyle', -\ 'command_callback': 'ale_linters#java#checkstyle#GetCommand', +\ 'command': function('ale_linters#java#checkstyle#GetCommand'), \ 'callback': 'ale_linters#java#checkstyle#Handle', \ 'lint_file': 1, \}) diff --git a/ale_linters/java/javac.vim b/ale_linters/java/javac.vim index 2aa01b4f..e903210d 100644 --- a/ale_linters/java/javac.vim +++ b/ale_linters/java/javac.vim @@ -120,7 +120,7 @@ endfunction call ale#linter#Define('java', { \ 'name': 'javac', -\ 'executable_callback': ale#VarFunc('java_javac_executable'), +\ 'executable': {b -> ale#Var(b, 'java_javac_executable')}, \ 'command_chain': [ \ {'callback': 'ale_linters#java#javac#GetImportPaths', 'output_stream': 'stdout'}, \ {'callback': 'ale_linters#java#javac#GetCommand', 'output_stream': 'stderr'}, diff --git a/ale_linters/java/javalsp.vim b/ale_linters/java/javalsp.vim index 6329ab3c..a327363d 100644 --- a/ale_linters/java/javalsp.vim +++ b/ale_linters/java/javalsp.vim @@ -16,8 +16,8 @@ endfunction call ale#linter#Define('java', { \ 'name': 'javalsp', \ 'lsp': 'stdio', -\ 'executable_callback': 'ale_linters#java#javalsp#Executable', -\ 'command_callback': 'ale_linters#java#javalsp#Command', +\ 'executable': function('ale_linters#java#javalsp#Executable'), +\ 'command': function('ale_linters#java#javalsp#Command'), \ 'language': 'java', -\ 'project_root_callback': 'ale#java#FindProjectRoot', +\ 'project_root': function('ale#java#FindProjectRoot'), \}) diff --git a/ale_linters/java/pmd.vim b/ale_linters/java/pmd.vim index b530ad09..a1f4c93c 100644 --- a/ale_linters/java/pmd.vim +++ b/ale_linters/java/pmd.vim @@ -31,6 +31,6 @@ endif call ale#linter#Define('java', { \ 'name': 'pmd', \ 'executable': 'pmd', -\ 'command_callback': 'ale_linters#java#pmd#GetCommand', +\ 'command': function('ale_linters#java#pmd#GetCommand'), \ 'callback': 'ale_linters#java#pmd#Handle', \}) diff --git a/ale_linters/javascript/eslint.vim b/ale_linters/javascript/eslint.vim index 23e16949..8aeac2d8 100644 --- a/ale_linters/javascript/eslint.vim +++ b/ale_linters/javascript/eslint.vim @@ -4,7 +4,7 @@ call ale#linter#Define('javascript', { \ 'name': 'eslint', \ 'output_stream': 'both', -\ 'executable_callback': 'ale#handlers#eslint#GetExecutable', -\ 'command_callback': 'ale#handlers#eslint#GetCommand', +\ 'executable': function('ale#handlers#eslint#GetExecutable'), +\ 'command': function('ale#handlers#eslint#GetCommand'), \ 'callback': 'ale#handlers#eslint#Handle', \}) diff --git a/ale_linters/javascript/flow.vim b/ale_linters/javascript/flow.vim index 0561ab74..05aae030 100755 --- a/ale_linters/javascript/flow.vim +++ b/ale_linters/javascript/flow.vim @@ -168,7 +168,7 @@ endfunction call ale#linter#Define('javascript', { \ 'name': 'flow', -\ 'executable_callback': 'ale_linters#javascript#flow#GetExecutable', +\ 'executable': function('ale_linters#javascript#flow#GetExecutable'), \ 'command_chain': [ \ {'callback': 'ale_linters#javascript#flow#VersionCheck'}, \ {'callback': 'ale_linters#javascript#flow#GetCommand'}, diff --git a/ale_linters/javascript/flow_ls.vim b/ale_linters/javascript/flow_ls.vim index 75377183..accaaa73 100644 --- a/ale_linters/javascript/flow_ls.vim +++ b/ale_linters/javascript/flow_ls.vim @@ -19,10 +19,10 @@ endfunction call ale#linter#Define('javascript', { \ 'name': 'flow-language-server', \ 'lsp': 'stdio', -\ 'executable_callback': ale#node#FindExecutableFunc('javascript_flow_ls', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'javascript_flow_ls', [ \ 'node_modules/.bin/flow', -\ ]), +\ ])}, \ 'command': '%e lsp --from ale-lsp', -\ 'project_root_callback': 'ale_linters#javascript#flow_ls#FindProjectRoot', +\ 'project_root': function('ale_linters#javascript#flow_ls#FindProjectRoot'), \ 'language': 'javascript', \}) diff --git a/ale_linters/javascript/jscs.vim b/ale_linters/javascript/jscs.vim index a38766a6..8905b3a1 100644 --- a/ale_linters/javascript/jscs.vim +++ b/ale_linters/javascript/jscs.vim @@ -53,9 +53,9 @@ endfunction call ale#linter#Define('javascript', { \ 'name': 'jscs', -\ 'executable_callback': ale#node#FindExecutableFunc('javascript_jscs', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'javascript_jscs', [ \ 'node_modules/.bin/jscs', -\ ]), -\ 'command_callback': 'ale_linters#javascript#jscs#GetCommand', +\ ])}, +\ 'command': function('ale_linters#javascript#jscs#GetCommand'), \ 'callback': 'ale_linters#javascript#jscs#Handle', \}) diff --git a/ale_linters/javascript/jshint.vim b/ale_linters/javascript/jshint.vim index cb7f66fc..d80a2250 100644 --- a/ale_linters/javascript/jshint.vim +++ b/ale_linters/javascript/jshint.vim @@ -25,9 +25,9 @@ endfunction call ale#linter#Define('javascript', { \ 'name': 'jshint', -\ 'executable_callback': ale#node#FindExecutableFunc('javascript_jshint', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'javascript_jshint', [ \ 'node_modules/.bin/jshint', -\ ]), -\ 'command_callback': 'ale_linters#javascript#jshint#GetCommand', +\ ])}, +\ 'command': function('ale_linters#javascript#jshint#GetCommand'), \ 'callback': 'ale#handlers#unix#HandleAsError', \}) diff --git a/ale_linters/javascript/standard.vim b/ale_linters/javascript/standard.vim index f16b837a..4cd2c303 100644 --- a/ale_linters/javascript/standard.vim +++ b/ale_linters/javascript/standard.vim @@ -24,7 +24,7 @@ endfunction " standard uses eslint and the output format is the same call ale#linter#Define('javascript', { \ 'name': 'standard', -\ 'executable_callback': 'ale_linters#javascript#standard#GetExecutable', -\ 'command_callback': 'ale_linters#javascript#standard#GetCommand', +\ 'executable': function('ale_linters#javascript#standard#GetExecutable'), +\ 'command': function('ale_linters#javascript#standard#GetCommand'), \ 'callback': 'ale#handlers#eslint#Handle', \}) diff --git a/ale_linters/javascript/tsserver.vim b/ale_linters/javascript/tsserver.vim index 63509022..68c252c5 100644 --- a/ale_linters/javascript/tsserver.vim +++ b/ale_linters/javascript/tsserver.vim @@ -8,10 +8,10 @@ call ale#Set('javascript_tsserver_use_global', get(g:, 'ale_use_global_executabl call ale#linter#Define('javascript', { \ 'name': 'tsserver', \ 'lsp': 'tsserver', -\ 'executable_callback': ale#node#FindExecutableFunc('javascript_tsserver', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'javascript_tsserver', [ \ 'node_modules/.bin/tsserver', -\ ]), +\ ])}, \ 'command': '%e', -\ 'project_root_callback': 'ale#handlers#tsserver#GetProjectRoot', +\ 'project_root': function('ale#handlers#tsserver#GetProjectRoot'), \ 'language': '', \}) diff --git a/ale_linters/javascript/xo.vim b/ale_linters/javascript/xo.vim index bc8657ed..4ba39101 100644 --- a/ale_linters/javascript/xo.vim +++ b/ale_linters/javascript/xo.vim @@ -20,7 +20,7 @@ endfunction " xo uses eslint and the output format is the same call ale#linter#Define('javascript', { \ 'name': 'xo', -\ 'executable_callback': 'ale_linters#javascript#xo#GetExecutable', -\ 'command_callback': 'ale_linters#javascript#xo#GetCommand', +\ 'executable': function('ale_linters#javascript#xo#GetExecutable'), +\ 'command': function('ale_linters#javascript#xo#GetCommand'), \ 'callback': 'ale#handlers#eslint#Handle', \}) diff --git a/ale_linters/julia/languageserver.vim b/ale_linters/julia/languageserver.vim index cd2000de..564bec39 100644 --- a/ale_linters/julia/languageserver.vim +++ b/ale_linters/julia/languageserver.vim @@ -14,8 +14,8 @@ endfunction call ale#linter#Define('julia', { \ 'name': 'languageserver', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('julia_executable'), -\ 'command_callback': 'ale_linters#julia#languageserver#GetCommand', +\ 'executable': {b -> ale#Var(b, 'julia_executable')}, +\ 'command': function('ale_linters#julia#languageserver#GetCommand'), \ 'language': 'julia', -\ 'project_root_callback': 'ale#julia#FindProjectRoot', +\ 'project_root': function('ale#julia#FindProjectRoot'), \}) diff --git a/ale_linters/kotlin/ktlint.vim b/ale_linters/kotlin/ktlint.vim index b8920aa7..f0384005 100644 --- a/ale_linters/kotlin/ktlint.vim +++ b/ale_linters/kotlin/ktlint.vim @@ -4,7 +4,7 @@ call ale#linter#Define('kotlin', { \ 'name': 'ktlint', \ 'executable': 'ktlint', -\ 'command_callback': 'ale#handlers#ktlint#GetCommand', +\ 'command': function('ale#handlers#ktlint#GetCommand'), \ 'callback': 'ale#handlers#ktlint#Handle', \ 'lint_file': 1 \}) diff --git a/ale_linters/kotlin/languageserver.vim b/ale_linters/kotlin/languageserver.vim index aea817ba..af78c0e0 100644 --- a/ale_linters/kotlin/languageserver.vim +++ b/ale_linters/kotlin/languageserver.vim @@ -22,8 +22,8 @@ endfunction call ale#linter#Define('kotlin', { \ 'name': 'languageserver', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('kotlin_languageserver_executable'), +\ 'executable': {b -> ale#Var(b, 'kotlin_languageserver_executable')}, \ 'command': '%e', \ 'language': 'kotlin', -\ 'project_root_callback': 'ale_linters#kotlin#languageserver#GetProjectRoot', +\ 'project_root': function('ale_linters#kotlin#languageserver#GetProjectRoot'), \}) diff --git a/ale_linters/less/lessc.vim b/ale_linters/less/lessc.vim index 37600649..4ec8b00e 100755 --- a/ale_linters/less/lessc.vim +++ b/ale_linters/less/lessc.vim @@ -38,10 +38,10 @@ endfunction call ale#linter#Define('less', { \ 'name': 'lessc', -\ 'executable_callback': ale#node#FindExecutableFunc('less_lessc', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'less_lessc', [ \ 'node_modules/.bin/lessc', -\ ]), -\ 'command_callback': 'ale_linters#less#lessc#GetCommand', +\ ])}, +\ 'command': function('ale_linters#less#lessc#GetCommand'), \ 'callback': 'ale_linters#less#lessc#Handle', \ 'output_stream': 'stderr', \}) diff --git a/ale_linters/less/stylelint.vim b/ale_linters/less/stylelint.vim index 479808c2..efb036c2 100644 --- a/ale_linters/less/stylelint.vim +++ b/ale_linters/less/stylelint.vim @@ -12,9 +12,9 @@ endfunction call ale#linter#Define('less', { \ 'name': 'stylelint', -\ 'executable_callback': ale#node#FindExecutableFunc('less_stylelint', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'less_stylelint', [ \ 'node_modules/.bin/stylelint', -\ ]), -\ 'command_callback': 'ale_linters#less#stylelint#GetCommand', +\ ])}, +\ 'command': function('ale_linters#less#stylelint#GetCommand'), \ 'callback': 'ale#handlers#css#HandleStyleLintFormat', \}) diff --git a/ale_linters/llvm/llc.vim b/ale_linters/llvm/llc.vim index 044f8c44..594be063 100644 --- a/ale_linters/llvm/llc.vim +++ b/ale_linters/llvm/llc.vim @@ -17,8 +17,8 @@ endfunction call ale#linter#Define('llvm', { \ 'name': 'llc', -\ 'executable_callback': ale#VarFunc('llvm_llc_executable'), +\ 'executable': {b -> ale#Var(b, 'llvm_llc_executable')}, \ 'output_stream': 'stderr', -\ 'command_callback': {-> '%e -filetype=null -o=' . g:ale#util#nul_file}, +\ 'command': {-> '%e -filetype=null -o=' . g:ale#util#nul_file}, \ 'callback': 'ale_linters#llvm#llc#HandleErrors', \}) diff --git a/ale_linters/lua/luac.vim b/ale_linters/lua/luac.vim index bca2cd8d..41674a43 100644 --- a/ale_linters/lua/luac.vim +++ b/ale_linters/lua/luac.vim @@ -24,7 +24,7 @@ endfunction call ale#linter#Define('lua', { \ 'name': 'luac', -\ 'executable_callback': ale#VarFunc('lua_luac_executable'), +\ 'executable': {b -> ale#Var(b, 'lua_luac_executable')}, \ 'command': '%e -p -', \ 'output_stream': 'stderr', \ 'callback': 'ale_linters#lua#luac#Handle', diff --git a/ale_linters/lua/luacheck.vim b/ale_linters/lua/luacheck.vim index 669103b8..34be2b5a 100644 --- a/ale_linters/lua/luacheck.vim +++ b/ale_linters/lua/luacheck.vim @@ -38,7 +38,7 @@ endfunction call ale#linter#Define('lua', { \ 'name': 'luacheck', -\ 'executable_callback': ale#VarFunc('lua_luacheck_executable'), -\ 'command_callback': 'ale_linters#lua#luacheck#GetCommand', +\ 'executable': {b -> ale#Var(b, 'lua_luacheck_executable')}, +\ 'command': function('ale_linters#lua#luacheck#GetCommand'), \ 'callback': 'ale_linters#lua#luacheck#Handle', \}) diff --git a/ale_linters/markdown/mdl.vim b/ale_linters/markdown/mdl.vim index 0953144b..305f5359 100644 --- a/ale_linters/markdown/mdl.vim +++ b/ale_linters/markdown/mdl.vim @@ -38,7 +38,7 @@ endfunction call ale#linter#Define('markdown', { \ 'name': 'mdl', -\ 'executable_callback': 'ale_linters#markdown#mdl#GetExecutable', -\ 'command_callback': 'ale_linters#markdown#mdl#GetCommand', +\ 'executable': function('ale_linters#markdown#mdl#GetExecutable'), +\ 'command': function('ale_linters#markdown#mdl#GetCommand'), \ 'callback': 'ale_linters#markdown#mdl#Handle' \}) diff --git a/ale_linters/markdown/remark_lint.vim b/ale_linters/markdown/remark_lint.vim index 4f8d48fa..ed87d1ad 100644 --- a/ale_linters/markdown/remark_lint.vim +++ b/ale_linters/markdown/remark_lint.vim @@ -39,10 +39,10 @@ endfunction call ale#linter#Define('markdown', { \ 'name': 'remark_lint', \ 'aliases': ['remark-lint'], -\ 'executable_callback': ale#node#FindExecutableFunc('markdown_remark_lint', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'markdown_remark_lint', [ \ 'node_modules/.bin/remark', -\ ]), -\ 'command_callback': 'ale_linters#markdown#remark_lint#GetCommand', +\ ])}, +\ 'command': function('ale_linters#markdown#remark_lint#GetCommand'), \ 'callback': 'ale_linters#markdown#remark_lint#Handle', \ 'output_stream': 'stderr', \}) diff --git a/ale_linters/markdown/textlint.vim b/ale_linters/markdown/textlint.vim index 26458506..613c8411 100644 --- a/ale_linters/markdown/textlint.vim +++ b/ale_linters/markdown/textlint.vim @@ -3,7 +3,7 @@ call ale#linter#Define('markdown', { \ 'name': 'textlint', -\ 'executable_callback': 'ale#handlers#textlint#GetExecutable', -\ 'command_callback': 'ale#handlers#textlint#GetCommand', +\ 'executable': function('ale#handlers#textlint#GetExecutable'), +\ 'command': function('ale#handlers#textlint#GetCommand'), \ 'callback': 'ale#handlers#textlint#HandleTextlintOutput', \}) diff --git a/ale_linters/matlab/mlint.vim b/ale_linters/matlab/mlint.vim index 3435045e..f58f8b6d 100644 --- a/ale_linters/matlab/mlint.vim +++ b/ale_linters/matlab/mlint.vim @@ -37,7 +37,7 @@ endfunction call ale#linter#Define('matlab', { \ 'name': 'mlint', -\ 'executable_callback': ale#VarFunc('matlab_mlint_executable'), +\ 'executable': {b -> ale#Var(b, 'matlab_mlint_executable')}, \ 'command': '%e -id %t', \ 'output_stream': 'stderr', \ 'callback': 'ale_linters#matlab#mlint#Handle', diff --git a/ale_linters/mercury/mmc.vim b/ale_linters/mercury/mmc.vim index 76d357f0..8a9ccc0e 100644 --- a/ale_linters/mercury/mmc.vim +++ b/ale_linters/mercury/mmc.vim @@ -33,8 +33,8 @@ endfunction call ale#linter#Define('mercury', { \ 'name': 'mmc', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('mercury_mmc_executable'), -\ 'command_callback': 'ale_linters#mercury#mmc#GetCommand', +\ 'executable': {b -> ale#Var(b, 'mercury_mmc_executable')}, +\ 'command': function('ale_linters#mercury#mmc#GetCommand'), \ 'callback': 'ale_linters#mercury#mmc#Handle', \ 'lint_file': 1, \}) diff --git a/ale_linters/nasm/nasm.vim b/ale_linters/nasm/nasm.vim index cb2119a6..347abc1b 100644 --- a/ale_linters/nasm/nasm.vim +++ b/ale_linters/nasm/nasm.vim @@ -36,7 +36,7 @@ call ale#linter#Define('nasm', { \ 'name': 'nasm', \ 'output_stream': 'stderr', \ 'lint_file': 1, -\ 'executable_callback': ale#VarFunc('nasm_nasm_executable'), -\ 'command_callback': 'ale_linters#nasm#nasm#GetCommand', +\ 'executable': {b -> ale#Var(b, 'nasm_nasm_executable')}, +\ 'command': function('ale_linters#nasm#nasm#GetCommand'), \ 'callback': 'ale_linters#nasm#nasm#Handle', \}) diff --git a/ale_linters/nim/nimcheck.vim b/ale_linters/nim/nimcheck.vim index bff45f7d..b5796dcd 100644 --- a/ale_linters/nim/nimcheck.vim +++ b/ale_linters/nim/nimcheck.vim @@ -59,7 +59,7 @@ call ale#linter#Define('nim', { \ 'name': 'nimcheck', \ 'executable': 'nim', \ 'output_stream': 'both', -\ 'command_callback': 'ale_linters#nim#nimcheck#GetCommand', +\ 'command': function('ale_linters#nim#nimcheck#GetCommand'), \ 'callback': 'ale_linters#nim#nimcheck#Handle', \ 'lint_file': 1, \}) diff --git a/ale_linters/objc/ccls.vim b/ale_linters/objc/ccls.vim index 0aa6a5e5..51ecf056 100644 --- a/ale_linters/objc/ccls.vim +++ b/ale_linters/objc/ccls.vim @@ -7,8 +7,8 @@ call ale#Set('objc_ccls_init_options', {}) call ale#linter#Define('objc', { \ 'name': 'ccls', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('objc_ccls_executable'), +\ 'executable': {b -> ale#Var(b, 'objc_ccls_executable')}, \ 'command': '%e', -\ 'project_root_callback': 'ale#handlers#ccls#GetProjectRoot', -\ 'initialization_options_callback': ale#VarFunc('objc_ccls_init_options'), +\ 'project_root': function('ale#handlers#ccls#GetProjectRoot'), +\ 'initialization_options': {b -> ale#Var(b, 'objc_ccls_init_options')}, \}) diff --git a/ale_linters/objc/clang.vim b/ale_linters/objc/clang.vim index 4e80ac5c..7873dccd 100644 --- a/ale_linters/objc/clang.vim +++ b/ale_linters/objc/clang.vim @@ -18,6 +18,6 @@ call ale#linter#Define('objc', { \ 'name': 'clang', \ 'output_stream': 'stderr', \ 'executable': 'clang', -\ 'command_callback': 'ale_linters#objc#clang#GetCommand', +\ 'command': function('ale_linters#objc#clang#GetCommand'), \ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes', \}) diff --git a/ale_linters/objc/clangd.vim b/ale_linters/objc/clangd.vim index f090e6ce..ab52fec3 100644 --- a/ale_linters/objc/clangd.vim +++ b/ale_linters/objc/clangd.vim @@ -17,7 +17,7 @@ endfunction call ale#linter#Define('objc', { \ 'name': 'clangd', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('objc_clangd_executable'), -\ 'command_callback': 'ale_linters#objc#clangd#GetCommand', -\ 'project_root_callback': 'ale_linters#objc#clangd#GetProjectRoot', +\ 'executable': {b -> ale#Var(b, 'objc_clangd_executable')}, +\ 'command': function('ale_linters#objc#clangd#GetCommand'), +\ 'project_root': function('ale_linters#objc#clangd#GetProjectRoot'), \}) diff --git a/ale_linters/objcpp/clang.vim b/ale_linters/objcpp/clang.vim index d1474f17..4dbe55b3 100644 --- a/ale_linters/objcpp/clang.vim +++ b/ale_linters/objcpp/clang.vim @@ -18,6 +18,6 @@ call ale#linter#Define('objcpp', { \ 'name': 'clang', \ 'output_stream': 'stderr', \ 'executable': 'clang++', -\ 'command_callback': 'ale_linters#objcpp#clang#GetCommand', +\ 'command': function('ale_linters#objcpp#clang#GetCommand'), \ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes', \}) diff --git a/ale_linters/objcpp/clangd.vim b/ale_linters/objcpp/clangd.vim index a09753be..3991d2ac 100644 --- a/ale_linters/objcpp/clangd.vim +++ b/ale_linters/objcpp/clangd.vim @@ -17,7 +17,7 @@ endfunction call ale#linter#Define('objcpp', { \ 'name': 'clangd', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('objcpp_clangd_executable'), -\ 'command_callback': 'ale_linters#objcpp#clangd#GetCommand', -\ 'project_root_callback': 'ale_linters#objcpp#clangd#GetProjectRoot', +\ 'executable': {b -> ale#Var(b, 'objcpp_clangd_executable')}, +\ 'command': function('ale_linters#objcpp#clangd#GetCommand'), +\ 'project_root': function('ale_linters#objcpp#clangd#GetProjectRoot'), \}) diff --git a/ale_linters/ocaml/ols.vim b/ale_linters/ocaml/ols.vim index 077862fc..d8208c52 100644 --- a/ale_linters/ocaml/ols.vim +++ b/ale_linters/ocaml/ols.vim @@ -7,8 +7,8 @@ call ale#Set('ocaml_ols_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#linter#Define('ocaml', { \ 'name': 'ols', \ 'lsp': 'stdio', -\ 'executable_callback': 'ale#handlers#ols#GetExecutable', -\ 'command_callback': 'ale#handlers#ols#GetCommand', +\ 'executable': function('ale#handlers#ols#GetExecutable'), +\ 'command': function('ale#handlers#ols#GetCommand'), \ 'language_callback': 'ale#handlers#ols#GetLanguage', -\ 'project_root_callback': 'ale#handlers#ols#GetProjectRoot', +\ 'project_root': function('ale#handlers#ols#GetProjectRoot'), \}) diff --git a/ale_linters/perl/perl.vim b/ale_linters/perl/perl.vim index 4b954f0d..0f06528a 100644 --- a/ale_linters/perl/perl.vim +++ b/ale_linters/perl/perl.vim @@ -57,8 +57,8 @@ endfunction call ale#linter#Define('perl', { \ 'name': 'perl', -\ 'executable_callback': ale#VarFunc('perl_perl_executable'), +\ 'executable': {b -> ale#Var(b, 'perl_perl_executable')}, \ 'output_stream': 'both', -\ 'command_callback': 'ale_linters#perl#perl#GetCommand', +\ 'command': function('ale_linters#perl#perl#GetCommand'), \ 'callback': 'ale_linters#perl#perl#Handle', \}) diff --git a/ale_linters/perl/perlcritic.vim b/ale_linters/perl/perlcritic.vim index 8619a404..f3154c09 100644 --- a/ale_linters/perl/perlcritic.vim +++ b/ale_linters/perl/perlcritic.vim @@ -55,7 +55,7 @@ endfunction call ale#linter#Define('perl', { \ 'name': 'perlcritic', \ 'output_stream': 'stdout', -\ 'executable_callback': ale#VarFunc('perl_perlcritic_executable'), -\ 'command_callback': 'ale_linters#perl#perlcritic#GetCommand', +\ 'executable': {b -> ale#Var(b, 'perl_perlcritic_executable')}, +\ 'command': function('ale_linters#perl#perlcritic#GetCommand'), \ 'callback': 'ale_linters#perl#perlcritic#Handle', \}) diff --git a/ale_linters/perl6/perl6.vim b/ale_linters/perl6/perl6.vim index 39406ac4..68ef4769 100644 --- a/ale_linters/perl6/perl6.vim +++ b/ale_linters/perl6/perl6.vim @@ -158,9 +158,9 @@ endfunction call ale#linter#Define('perl6', { \ 'name': 'perl6', -\ 'executable_callback': 'ale_linters#perl6#perl6#GetExecutable', +\ 'executable': function('ale_linters#perl6#perl6#GetExecutable'), \ 'output_stream': 'both', -\ 'command_callback': 'ale_linters#perl6#perl6#GetCommand', +\ 'command': function('ale_linters#perl6#perl6#GetCommand'), \ 'callback': 'ale_linters#perl6#perl6#Handle', \}) diff --git a/ale_linters/php/langserver.vim b/ale_linters/php/langserver.vim index ca91db4c..c88281c4 100644 --- a/ale_linters/php/langserver.vim +++ b/ale_linters/php/langserver.vim @@ -13,9 +13,9 @@ endfunction call ale#linter#Define('php', { \ 'name': 'langserver', \ 'lsp': 'stdio', -\ 'executable_callback': ale#node#FindExecutableFunc('php_langserver', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'php_langserver', [ \ 'vendor/bin/php-language-server.php', -\ ]), +\ ])}, \ 'command': 'php %e', -\ 'project_root_callback': 'ale_linters#php#langserver#GetProjectRoot', +\ 'project_root': function('ale_linters#php#langserver#GetProjectRoot'), \}) diff --git a/ale_linters/php/phan.vim b/ale_linters/php/phan.vim index c6f16356..53cb1ea9 100644 --- a/ale_linters/php/phan.vim +++ b/ale_linters/php/phan.vim @@ -67,7 +67,7 @@ endfunction call ale#linter#Define('php', { \ 'name': 'phan', -\ 'executable_callback': 'ale_linters#php#phan#GetExecutable', -\ 'command_callback': 'ale_linters#php#phan#GetCommand', +\ 'executable': function('ale_linters#php#phan#GetExecutable'), +\ 'command': function('ale_linters#php#phan#GetCommand'), \ 'callback': 'ale_linters#php#phan#Handle', \}) diff --git a/ale_linters/php/php.vim b/ale_linters/php/php.vim index 5d87196c..51a109b9 100644 --- a/ale_linters/php/php.vim +++ b/ale_linters/php/php.vim @@ -32,7 +32,7 @@ endfunction call ale#linter#Define('php', { \ 'name': 'php', -\ 'executable_callback': ale#VarFunc('php_php_executable'), +\ 'executable': {b -> ale#Var(b, 'php_php_executable')}, \ 'output_stream': 'stdout', \ 'command': '%e -l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0 --', \ 'callback': 'ale_linters#php#php#Handle', diff --git a/ale_linters/php/phpcs.vim b/ale_linters/php/phpcs.vim index 408c2652..1c92bbb2 100644 --- a/ale_linters/php/phpcs.vim +++ b/ale_linters/php/phpcs.vim @@ -44,10 +44,10 @@ endfunction call ale#linter#Define('php', { \ 'name': 'phpcs', -\ 'executable_callback': ale#node#FindExecutableFunc('php_phpcs', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'php_phpcs', [ \ 'vendor/bin/phpcs', \ 'phpcs' -\ ]), -\ 'command_callback': 'ale_linters#php#phpcs#GetCommand', +\ ])}, +\ 'command': function('ale_linters#php#phpcs#GetCommand'), \ 'callback': 'ale_linters#php#phpcs#Handle', \}) diff --git a/ale_linters/php/phpmd.vim b/ale_linters/php/phpmd.vim index 65f1cc3c..9b1d1e44 100644 --- a/ale_linters/php/phpmd.vim +++ b/ale_linters/php/phpmd.vim @@ -32,7 +32,7 @@ endfunction call ale#linter#Define('php', { \ 'name': 'phpmd', -\ 'executable_callback': ale#VarFunc('php_phpmd_executable'), -\ 'command_callback': 'ale_linters#php#phpmd#GetCommand', +\ 'executable': {b -> ale#Var(b, 'php_phpmd_executable')}, +\ 'command': function('ale_linters#php#phpmd#GetCommand'), \ 'callback': 'ale_linters#php#phpmd#Handle', \}) diff --git a/ale_linters/php/phpstan.vim b/ale_linters/php/phpstan.vim index 1c831e1b..34d4e799 100644 --- a/ale_linters/php/phpstan.vim +++ b/ale_linters/php/phpstan.vim @@ -65,7 +65,7 @@ endfunction call ale#linter#Define('php', { \ 'name': 'phpstan', -\ 'executable_callback': 'ale_linters#php#phpstan#GetExecutable', +\ 'executable': function('ale_linters#php#phpstan#GetExecutable'), \ 'command_chain': [ \ {'callback': 'ale_linters#php#phpstan#VersionCheck'}, \ {'callback': 'ale_linters#php#phpstan#GetCommand'}, diff --git a/ale_linters/php/psalm.vim b/ale_linters/php/psalm.vim index dce59178..3cdb026a 100644 --- a/ale_linters/php/psalm.vim +++ b/ale_linters/php/psalm.vim @@ -13,9 +13,9 @@ endfunction call ale#linter#Define('php', { \ 'name': 'psalm', \ 'lsp': 'stdio', -\ 'executable_callback': ale#node#FindExecutableFunc('psalm_langserver', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'psalm_langserver', [ \ 'vendor/bin/psalm-language-server', -\ ]), +\ ])}, \ 'command': '%e', -\ 'project_root_callback': 'ale_linters#php#psalm#GetProjectRoot', +\ 'project_root': function('ale_linters#php#psalm#GetProjectRoot'), \}) diff --git a/ale_linters/pony/ponyc.vim b/ale_linters/pony/ponyc.vim index 19e7e828..6d4594f9 100644 --- a/ale_linters/pony/ponyc.vim +++ b/ale_linters/pony/ponyc.vim @@ -10,7 +10,7 @@ endfunction call ale#linter#Define('pony', { \ 'name': 'ponyc', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('pony_ponyc_executable'), -\ 'command_callback': 'ale_linters#pony#ponyc#GetCommand', +\ 'executable': {b -> ale#Var(b, 'pony_ponyc_executable')}, +\ 'command': function('ale_linters#pony#ponyc#GetCommand'), \ 'callback': 'ale#handlers#pony#HandlePonycFormat', \}) diff --git a/ale_linters/prolog/swipl.vim b/ale_linters/prolog/swipl.vim index 77261ede..5c601c40 100644 --- a/ale_linters/prolog/swipl.vim +++ b/ale_linters/prolog/swipl.vim @@ -94,7 +94,7 @@ endfunction call ale#linter#Define('prolog', { \ 'name': 'swipl', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('prolog_swipl_executable'), -\ 'command_callback': 'ale_linters#prolog#swipl#GetCommand', +\ 'executable': {b -> ale#Var(b, 'prolog_swipl_executable')}, +\ 'command': function('ale_linters#prolog#swipl#GetCommand'), \ 'callback': 'ale_linters#prolog#swipl#Handle', \}) diff --git a/ale_linters/proto/protoc_gen_lint.vim b/ale_linters/proto/protoc_gen_lint.vim index c8b5c331..c3d10935 100644 --- a/ale_linters/proto/protoc_gen_lint.vim +++ b/ale_linters/proto/protoc_gen_lint.vim @@ -22,6 +22,6 @@ call ale#linter#Define('proto', { \ 'lint_file': 1, \ 'output_stream': 'stderr', \ 'executable': 'protoc', -\ 'command_callback': 'ale_linters#proto#protoc_gen_lint#GetCommand', +\ 'command': function('ale_linters#proto#protoc_gen_lint#GetCommand'), \ 'callback': 'ale#handlers#unix#HandleAsError', \}) diff --git a/ale_linters/pug/puglint.vim b/ale_linters/pug/puglint.vim index 63208986..c4e0e233 100644 --- a/ale_linters/pug/puglint.vim +++ b/ale_linters/pug/puglint.vim @@ -33,10 +33,10 @@ endfunction call ale#linter#Define('pug', { \ 'name': 'puglint', -\ 'executable_callback': ale#node#FindExecutableFunc('pug_puglint', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'pug_puglint', [ \ 'node_modules/.bin/pug-lint', -\ ]), +\ ])}, \ 'output_stream': 'stderr', -\ 'command_callback': 'ale_linters#pug#puglint#GetCommand', +\ 'command': function('ale_linters#pug#puglint#GetCommand'), \ 'callback': 'ale#handlers#unix#HandleAsError', \}) diff --git a/ale_linters/puppet/languageserver.vim b/ale_linters/puppet/languageserver.vim index a3060e65..2078695f 100644 --- a/ale_linters/puppet/languageserver.vim +++ b/ale_linters/puppet/languageserver.vim @@ -30,8 +30,8 @@ endfunction call ale#linter#Define('puppet', { \ 'name': 'languageserver', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('puppet_languageserver_executable'), +\ 'executable': {b -> ale#Var(b, 'puppet_languageserver_executable')}, \ 'command': '%e --stdio', \ 'language': 'puppet', -\ 'project_root_callback': 'ale_linters#puppet#languageserver#GetProjectRoot', +\ 'project_root': function('ale_linters#puppet#languageserver#GetProjectRoot'), \}) diff --git a/ale_linters/puppet/puppet.vim b/ale_linters/puppet/puppet.vim index 0e37bdbd..ae648615 100644 --- a/ale_linters/puppet/puppet.vim +++ b/ale_linters/puppet/puppet.vim @@ -30,8 +30,8 @@ endfunction call ale#linter#Define('puppet', { \ 'name': 'puppet', -\ 'executable_callback': ale#VarFunc('puppet_puppet_executable'), +\ 'executable': {b -> ale#Var(b, 'puppet_puppet_executable')}, \ 'output_stream': 'stderr', -\ 'command_callback': 'ale_linters#puppet#puppet#GetCommand', +\ 'command': function('ale_linters#puppet#puppet#GetCommand'), \ 'callback': 'ale_linters#puppet#puppet#Handle', \}) diff --git a/ale_linters/puppet/puppetlint.vim b/ale_linters/puppet/puppetlint.vim index c9c16f5e..985d6a4d 100644 --- a/ale_linters/puppet/puppetlint.vim +++ b/ale_linters/puppet/puppetlint.vim @@ -12,7 +12,7 @@ endfunction call ale#linter#Define('puppet', { \ 'name': 'puppetlint', -\ 'executable_callback': ale#VarFunc('puppet_puppetlint_executable'), -\ 'command_callback': 'ale_linters#puppet#puppetlint#GetCommand', +\ 'executable': {b -> ale#Var(b, 'puppet_puppetlint_executable')}, +\ 'command': function('ale_linters#puppet#puppetlint#GetCommand'), \ 'callback': 'ale#handlers#gcc#HandleGCCFormat', \}) diff --git a/ale_linters/pyrex/cython.vim b/ale_linters/pyrex/cython.vim index d260698c..84382ba1 100644 --- a/ale_linters/pyrex/cython.vim +++ b/ale_linters/pyrex/cython.vim @@ -32,7 +32,7 @@ endfunction call ale#linter#Define('pyrex', { \ 'name': 'cython', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('pyrex_cython_executable'), -\ 'command_callback': 'ale_linters#pyrex#cython#GetCommand', +\ 'executable': {b -> ale#Var(b, 'pyrex_cython_executable')}, +\ 'command': function('ale_linters#pyrex#cython#GetCommand'), \ 'callback': 'ale_linters#pyrex#cython#Handle', \}) diff --git a/ale_linters/python/bandit.vim b/ale_linters/python/bandit.vim index 5c9500a6..554f5000 100644 --- a/ale_linters/python/bandit.vim +++ b/ale_linters/python/bandit.vim @@ -62,7 +62,7 @@ endfunction call ale#linter#Define('python', { \ 'name': 'bandit', -\ 'executable_callback': 'ale_linters#python#bandit#GetExecutable', -\ 'command_callback': 'ale_linters#python#bandit#GetCommand', +\ 'executable': function('ale_linters#python#bandit#GetExecutable'), +\ 'command': function('ale_linters#python#bandit#GetCommand'), \ 'callback': 'ale_linters#python#bandit#Handle', \}) diff --git a/ale_linters/python/flake8.vim b/ale_linters/python/flake8.vim index 076bd9c4..993d7adb 100644 --- a/ale_linters/python/flake8.vim +++ b/ale_linters/python/flake8.vim @@ -143,7 +143,7 @@ endfunction call ale#linter#Define('python', { \ 'name': 'flake8', -\ 'executable_callback': 'ale_linters#python#flake8#GetExecutable', +\ 'executable': function('ale_linters#python#flake8#GetExecutable'), \ 'command_chain': [ \ {'callback': 'ale_linters#python#flake8#VersionCheck'}, \ {'callback': 'ale_linters#python#flake8#GetCommand', 'output_stream': 'both'}, diff --git a/ale_linters/python/mypy.vim b/ale_linters/python/mypy.vim index 0c90a3c7..c4c6507f 100644 --- a/ale_linters/python/mypy.vim +++ b/ale_linters/python/mypy.vim @@ -75,7 +75,7 @@ endfunction call ale#linter#Define('python', { \ 'name': 'mypy', -\ 'executable_callback': 'ale_linters#python#mypy#GetExecutable', -\ 'command_callback': 'ale_linters#python#mypy#GetCommand', +\ 'executable': function('ale_linters#python#mypy#GetExecutable'), +\ 'command': function('ale_linters#python#mypy#GetCommand'), \ 'callback': 'ale_linters#python#mypy#Handle', \}) diff --git a/ale_linters/python/prospector.vim b/ale_linters/python/prospector.vim index b01cec87..ee47012f 100644 --- a/ale_linters/python/prospector.vim +++ b/ale_linters/python/prospector.vim @@ -93,8 +93,8 @@ endfunction call ale#linter#Define('python', { \ 'name': 'prospector', -\ 'executable_callback': 'ale_linters#python#prospector#GetExecutable', -\ 'command_callback': 'ale_linters#python#prospector#GetCommand', +\ 'executable': function('ale_linters#python#prospector#GetExecutable'), +\ 'command': function('ale_linters#python#prospector#GetCommand'), \ 'callback': 'ale_linters#python#prospector#Handle', \ 'lint_file': 1, \}) diff --git a/ale_linters/python/pycodestyle.vim b/ale_linters/python/pycodestyle.vim index f0269585..fb521bc1 100644 --- a/ale_linters/python/pycodestyle.vim +++ b/ale_linters/python/pycodestyle.vim @@ -69,7 +69,7 @@ endfunction call ale#linter#Define('python', { \ 'name': 'pycodestyle', -\ 'executable_callback': 'ale_linters#python#pycodestyle#GetExecutable', -\ 'command_callback': 'ale_linters#python#pycodestyle#GetCommand', +\ 'executable': function('ale_linters#python#pycodestyle#GetExecutable'), +\ 'command': function('ale_linters#python#pycodestyle#GetCommand'), \ 'callback': 'ale_linters#python#pycodestyle#Handle', \}) diff --git a/ale_linters/python/pydocstyle.vim b/ale_linters/python/pydocstyle.vim index 177f5e0f..3901db4d 100644 --- a/ale_linters/python/pydocstyle.vim +++ b/ale_linters/python/pydocstyle.vim @@ -67,7 +67,7 @@ endfunction call ale#linter#Define('python', { \ 'name': 'pydocstyle', -\ 'executable_callback': 'ale_linters#python#pydocstyle#GetExecutable', -\ 'command_callback': 'ale_linters#python#pydocstyle#GetCommand', +\ 'executable': function('ale_linters#python#pydocstyle#GetExecutable'), +\ 'command': function('ale_linters#python#pydocstyle#GetCommand'), \ 'callback': 'ale_linters#python#pydocstyle#Handle', \}) diff --git a/ale_linters/python/pyflakes.vim b/ale_linters/python/pyflakes.vim index 091408d5..b5127022 100644 --- a/ale_linters/python/pyflakes.vim +++ b/ale_linters/python/pyflakes.vim @@ -43,8 +43,8 @@ endfunction call ale#linter#Define('python', { \ 'name': 'pyflakes', -\ 'executable_callback': 'ale_linters#python#pyflakes#GetExecutable', -\ 'command_callback': 'ale_linters#python#pyflakes#GetCommand', +\ 'executable': function('ale_linters#python#pyflakes#GetExecutable'), +\ 'command': function('ale_linters#python#pyflakes#GetCommand'), \ 'callback': 'ale_linters#python#pyflakes#Handle', \ 'output_stream': 'both', \}) diff --git a/ale_linters/python/pylama.vim b/ale_linters/python/pylama.vim index 4ad25c0f..38dd2836 100644 --- a/ale_linters/python/pylama.vim +++ b/ale_linters/python/pylama.vim @@ -85,8 +85,8 @@ endfunction call ale#linter#Define('python', { \ 'name': 'pylama', -\ 'executable_callback': 'ale_linters#python#pylama#GetExecutable', -\ 'command_callback': 'ale_linters#python#pylama#GetCommand', +\ 'executable': function('ale_linters#python#pylama#GetExecutable'), +\ 'command': function('ale_linters#python#pylama#GetCommand'), \ 'callback': 'ale_linters#python#pylama#Handle', \ 'lint_file': 1, \}) diff --git a/ale_linters/python/pylint.vim b/ale_linters/python/pylint.vim index f0f79cd7..57e82691 100644 --- a/ale_linters/python/pylint.vim +++ b/ale_linters/python/pylint.vim @@ -78,8 +78,8 @@ endfunction call ale#linter#Define('python', { \ 'name': 'pylint', -\ 'executable_callback': 'ale_linters#python#pylint#GetExecutable', -\ 'command_callback': 'ale_linters#python#pylint#GetCommand', +\ 'executable': function('ale_linters#python#pylint#GetExecutable'), +\ 'command': function('ale_linters#python#pylint#GetCommand'), \ 'callback': 'ale_linters#python#pylint#Handle', \ 'lint_file': 1, \}) diff --git a/ale_linters/python/pyls.vim b/ale_linters/python/pyls.vim index 2c2ed94c..c7f91430 100644 --- a/ale_linters/python/pyls.vim +++ b/ale_linters/python/pyls.vim @@ -28,9 +28,9 @@ endfunction call ale#linter#Define('python', { \ 'name': 'pyls', \ 'lsp': 'stdio', -\ 'executable_callback': 'ale_linters#python#pyls#GetExecutable', -\ 'command_callback': 'ale_linters#python#pyls#GetCommand', -\ 'project_root_callback': 'ale#python#FindProjectRoot', +\ 'executable': function('ale_linters#python#pyls#GetExecutable'), +\ 'command': function('ale_linters#python#pyls#GetCommand'), +\ 'project_root': function('ale#python#FindProjectRoot'), \ 'completion_filter': 'ale#completion#python#CompletionItemFilter', -\ 'lsp_config_callback': ale#VarFunc('python_pyls_config'), +\ 'lsp_config': {b -> ale#Var(b, 'python_pyls_config')}, \}) diff --git a/ale_linters/python/pyre.vim b/ale_linters/python/pyre.vim index adc185f2..4edd80f7 100644 --- a/ale_linters/python/pyre.vim +++ b/ale_linters/python/pyre.vim @@ -27,8 +27,8 @@ endfunction call ale#linter#Define('python', { \ 'name': 'pyre', \ 'lsp': 'stdio', -\ 'executable_callback': 'ale_linters#python#pyre#GetExecutable', -\ 'command_callback': 'ale_linters#python#pyre#GetCommand', -\ 'project_root_callback': 'ale#python#FindProjectRoot', +\ 'executable': function('ale_linters#python#pyre#GetExecutable'), +\ 'command': function('ale_linters#python#pyre#GetCommand'), +\ 'project_root': function('ale#python#FindProjectRoot'), \ 'completion_filter': 'ale#completion#python#CompletionItemFilter', \}) diff --git a/ale_linters/python/vulture.vim b/ale_linters/python/vulture.vim index b3908b80..d328d262 100644 --- a/ale_linters/python/vulture.vim +++ b/ale_linters/python/vulture.vim @@ -73,8 +73,8 @@ endfunction call ale#linter#Define('python', { \ 'name': 'vulture', -\ 'executable_callback': 'ale_linters#python#vulture#GetExecutable', -\ 'command_callback': 'ale_linters#python#vulture#GetCommand', +\ 'executable': function('ale_linters#python#vulture#GetExecutable'), +\ 'command': function('ale_linters#python#vulture#GetCommand'), \ 'callback': 'ale_linters#python#vulture#Handle', \ 'lint_file': 1, \}) diff --git a/ale_linters/qml/qmlfmt.vim b/ale_linters/qml/qmlfmt.vim index 12f3e97b..11cc9413 100644 --- a/ale_linters/qml/qmlfmt.vim +++ b/ale_linters/qml/qmlfmt.vim @@ -19,7 +19,7 @@ endfunction call ale#linter#Define('qml', { \ 'name': 'qmlfmt', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('qml_qmlfmt_executable'), +\ 'executable': {b -> ale#Var(b, 'qml_qmlfmt_executable')}, \ 'command': '%e -e', \ 'callback': 'ale_linters#qml#qmlfmt#Handle', \}) diff --git a/ale_linters/r/lintr.vim b/ale_linters/r/lintr.vim index 8f74c9b8..3164c06f 100644 --- a/ale_linters/r/lintr.vim +++ b/ale_linters/r/lintr.vim @@ -29,7 +29,7 @@ endfunction call ale#linter#Define('r', { \ 'name': 'lintr', \ 'executable': 'Rscript', -\ 'command_callback': 'ale_linters#r#lintr#GetCommand', +\ 'command': function('ale_linters#r#lintr#GetCommand'), \ 'callback': 'ale#handlers#gcc#HandleGCCFormat', \ 'output_stream': 'both', \}) diff --git a/ale_linters/reason/ols.vim b/ale_linters/reason/ols.vim index 4e5bd395..66137e1b 100644 --- a/ale_linters/reason/ols.vim +++ b/ale_linters/reason/ols.vim @@ -7,8 +7,8 @@ call ale#Set('reason_ols_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#linter#Define('reason', { \ 'name': 'ols', \ 'lsp': 'stdio', -\ 'executable_callback': 'ale#handlers#ols#GetExecutable', -\ 'command_callback': 'ale#handlers#ols#GetCommand', +\ 'executable': function('ale#handlers#ols#GetExecutable'), +\ 'command': function('ale#handlers#ols#GetCommand'), \ 'language_callback': 'ale#handlers#ols#GetLanguage', -\ 'project_root_callback': 'ale#handlers#ols#GetProjectRoot', +\ 'project_root': function('ale#handlers#ols#GetProjectRoot'), \}) diff --git a/ale_linters/rst/rstcheck.vim b/ale_linters/rst/rstcheck.vim index 8504738b..39e11d6e 100644 --- a/ale_linters/rst/rstcheck.vim +++ b/ale_linters/rst/rstcheck.vim @@ -32,7 +32,7 @@ endfunction call ale#linter#Define('rst', { \ 'name': 'rstcheck', \ 'executable': 'rstcheck', -\ 'command_callback': 'ale_linters#rst#rstcheck#GetCommand', +\ 'command': function('ale_linters#rst#rstcheck#GetCommand'), \ 'callback': 'ale_linters#rst#rstcheck#Handle', \ 'output_stream': 'both', \}) diff --git a/ale_linters/rst/textlint.vim b/ale_linters/rst/textlint.vim index a14411cf..56dd8db8 100644 --- a/ale_linters/rst/textlint.vim +++ b/ale_linters/rst/textlint.vim @@ -3,7 +3,7 @@ call ale#linter#Define('rst', { \ 'name': 'textlint', -\ 'executable_callback': 'ale#handlers#textlint#GetExecutable', -\ 'command_callback': 'ale#handlers#textlint#GetCommand', +\ 'executable': function('ale#handlers#textlint#GetExecutable'), +\ 'command': function('ale#handlers#textlint#GetCommand'), \ 'callback': 'ale#handlers#textlint#HandleTextlintOutput', \}) diff --git a/ale_linters/ruby/brakeman.vim b/ale_linters/ruby/brakeman.vim index 122e0b5b..a8088080 100644 --- a/ale_linters/ruby/brakeman.vim +++ b/ale_linters/ruby/brakeman.vim @@ -44,8 +44,8 @@ endfunction call ale#linter#Define('ruby', { \ 'name': 'brakeman', -\ 'executable_callback': ale#VarFunc('ruby_brakeman_executable'), -\ 'command_callback': 'ale_linters#ruby#brakeman#GetCommand', +\ 'executable': {b -> ale#Var(b, 'ruby_brakeman_executable')}, +\ 'command': function('ale_linters#ruby#brakeman#GetCommand'), \ 'callback': 'ale_linters#ruby#brakeman#Handle', \ 'lint_file': 1, \}) diff --git a/ale_linters/ruby/rails_best_practices.vim b/ale_linters/ruby/rails_best_practices.vim index 20cadca8..680cc364 100644 --- a/ale_linters/ruby/rails_best_practices.vim +++ b/ale_linters/ruby/rails_best_practices.vim @@ -42,8 +42,8 @@ endfunction call ale#linter#Define('ruby', { \ 'name': 'rails_best_practices', -\ 'executable_callback': ale#VarFunc('ruby_rails_best_practices_executable'), -\ 'command_callback': 'ale_linters#ruby#rails_best_practices#GetCommand', +\ 'executable': {b -> ale#Var(b, 'ruby_rails_best_practices_executable')}, +\ 'command': function('ale_linters#ruby#rails_best_practices#GetCommand'), \ 'callback': 'ale_linters#ruby#rails_best_practices#Handle', \ 'lint_file': 1, \}) diff --git a/ale_linters/ruby/reek.vim b/ale_linters/ruby/reek.vim index 53363d31..26f6e36c 100644 --- a/ale_linters/ruby/reek.vim +++ b/ale_linters/ruby/reek.vim @@ -69,7 +69,7 @@ endfunction call ale#linter#Define('ruby', { \ 'name': 'reek', -\ 'executable_callback': ale#VarFunc('ruby_reek_executable'), +\ 'executable': {b -> ale#Var(b, 'ruby_reek_executable')}, \ 'command_chain': [ \ {'callback': 'ale_linters#ruby#reek#VersionCheck'}, \ {'callback': 'ale_linters#ruby#reek#GetCommand'}, diff --git a/ale_linters/ruby/rubocop.vim b/ale_linters/ruby/rubocop.vim index 790ca82c..8b9e9c84 100644 --- a/ale_linters/ruby/rubocop.vim +++ b/ale_linters/ruby/rubocop.vim @@ -25,7 +25,7 @@ endfunction call ale#linter#Define('ruby', { \ 'name': 'rubocop', -\ 'executable_callback': ale#VarFunc('ruby_rubocop_executable'), -\ 'command_callback': 'ale_linters#ruby#rubocop#GetCommand', +\ 'executable': {b -> ale#Var(b, 'ruby_rubocop_executable')}, +\ 'command': function('ale_linters#ruby#rubocop#GetCommand'), \ 'callback': 'ale#ruby#HandleRubocopOutput', \}) diff --git a/ale_linters/ruby/ruby.vim b/ale_linters/ruby/ruby.vim index 2bc4ec4b..2dc55eb0 100644 --- a/ale_linters/ruby/ruby.vim +++ b/ale_linters/ruby/ruby.vim @@ -5,7 +5,7 @@ call ale#Set('ruby_ruby_executable', 'ruby') call ale#linter#Define('ruby', { \ 'name': 'ruby', -\ 'executable_callback': ale#VarFunc('ruby_ruby_executable'), +\ 'executable': {b -> ale#Var(b, 'ruby_ruby_executable')}, \ 'command': '%e -w -c -T1 %t', \ 'output_stream': 'stderr', \ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors', diff --git a/ale_linters/ruby/solargraph.vim b/ale_linters/ruby/solargraph.vim index 5ff0a759..bf54a55c 100644 --- a/ale_linters/ruby/solargraph.vim +++ b/ale_linters/ruby/solargraph.vim @@ -15,8 +15,8 @@ call ale#linter#Define('ruby', { \ 'name': 'solargraph', \ 'lsp': 'stdio', \ 'language': 'ruby', -\ 'executable_callback': ale#VarFunc('ruby_solargraph_executable'), -\ 'command_callback': 'ale_linters#ruby#solargraph#GetCommand', -\ 'project_root_callback': 'ale#ruby#FindProjectRoot', -\ 'initialization_options_callback': ale#VarFunc('ruby_solargraph_options'), +\ 'executable': {b -> ale#Var(b, 'ruby_solargraph_executable')}, +\ 'command': function('ale_linters#ruby#solargraph#GetCommand'), +\ 'project_root': function('ale#ruby#FindProjectRoot'), +\ 'initialization_options': {b -> ale#Var(b, 'ruby_solargraph_options')}, \}) diff --git a/ale_linters/ruby/standardrb.vim b/ale_linters/ruby/standardrb.vim index 95e10934..f075a7d5 100644 --- a/ale_linters/ruby/standardrb.vim +++ b/ale_linters/ruby/standardrb.vim @@ -17,7 +17,7 @@ endfunction " standardrb is based on RuboCop so the callback is the same call ale#linter#Define('ruby', { \ 'name': 'standardrb', -\ 'executable_callback': ale#VarFunc('ruby_standardrb_executable'), -\ 'command_callback': 'ale_linters#ruby#standardrb#GetCommand', +\ 'executable': {b -> ale#Var(b, 'ruby_standardrb_executable')}, +\ 'command': function('ale_linters#ruby#standardrb#GetCommand'), \ 'callback': 'ale#ruby#HandleRubocopOutput', \}) diff --git a/ale_linters/rust/cargo.vim b/ale_linters/rust/cargo.vim index cf6187f8..b4eabfae 100644 --- a/ale_linters/rust/cargo.vim +++ b/ale_linters/rust/cargo.vim @@ -93,7 +93,7 @@ endfunction call ale#linter#Define('rust', { \ 'name': 'cargo', -\ 'executable_callback': 'ale_linters#rust#cargo#GetCargoExecutable', +\ 'executable': function('ale_linters#rust#cargo#GetCargoExecutable'), \ 'command_chain': [ \ {'callback': 'ale_linters#rust#cargo#VersionCheck'}, \ {'callback': 'ale_linters#rust#cargo#GetCommand'}, diff --git a/ale_linters/rust/rls.vim b/ale_linters/rust/rls.vim index 60dd3667..cf34b43c 100644 --- a/ale_linters/rust/rls.vim +++ b/ale_linters/rust/rls.vim @@ -19,7 +19,7 @@ endfunction call ale#linter#Define('rust', { \ 'name': 'rls', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('rust_rls_executable'), -\ 'command_callback': 'ale_linters#rust#rls#GetCommand', -\ 'project_root_callback': 'ale_linters#rust#rls#GetProjectRoot', +\ 'executable': {b -> ale#Var(b, 'rust_rls_executable')}, +\ 'command': function('ale_linters#rust#rls#GetCommand'), +\ 'project_root': function('ale_linters#rust#rls#GetProjectRoot'), \}) diff --git a/ale_linters/rust/rustc.vim b/ale_linters/rust/rustc.vim index 33fb72f4..f140b58b 100644 --- a/ale_linters/rust/rustc.vim +++ b/ale_linters/rust/rustc.vim @@ -27,7 +27,7 @@ endfunction call ale#linter#Define('rust', { \ 'name': 'rustc', \ 'executable': 'rustc', -\ 'command_callback': 'ale_linters#rust#rustc#RustcCommand', +\ 'command': function('ale_linters#rust#rustc#RustcCommand'), \ 'callback': 'ale#handlers#rust#HandleRustErrors', \ 'output_stream': 'stderr', \}) diff --git a/ale_linters/sass/sasslint.vim b/ale_linters/sass/sasslint.vim index 8d24185d..17cd3667 100644 --- a/ale_linters/sass/sasslint.vim +++ b/ale_linters/sass/sasslint.vim @@ -22,7 +22,7 @@ endfunction call ale#linter#Define('sass', { \ 'name': 'sasslint', -\ 'executable_callback': 'ale_linters#sass#sasslint#GetExecutable', -\ 'command_callback': 'ale_linters#sass#sasslint#GetCommand', +\ 'executable': function('ale_linters#sass#sasslint#GetExecutable'), +\ 'command': function('ale_linters#sass#sasslint#GetCommand'), \ 'callback': 'ale#handlers#css#HandleCSSLintFormat', \}) diff --git a/ale_linters/sass/stylelint.vim b/ale_linters/sass/stylelint.vim index b6286f18..7b14c6b4 100644 --- a/ale_linters/sass/stylelint.vim +++ b/ale_linters/sass/stylelint.vim @@ -5,9 +5,9 @@ call ale#Set('sass_stylelint_use_global', get(g:, 'ale_use_global_executables', call ale#linter#Define('sass', { \ 'name': 'stylelint', -\ 'executable_callback': ale#node#FindExecutableFunc('sass_stylelint', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'sass_stylelint', [ \ 'node_modules/.bin/stylelint', -\ ]), +\ ])}, \ 'command': '%e --stdin-filename %s', \ 'callback': 'ale#handlers#css#HandleStyleLintFormat', \}) diff --git a/ale_linters/scala/fsc.vim b/ale_linters/scala/fsc.vim index fbdce20e..94135235 100644 --- a/ale_linters/scala/fsc.vim +++ b/ale_linters/scala/fsc.vim @@ -7,7 +7,7 @@ endfunction call ale#linter#Define('scala', { \ 'name': 'fsc', -\ 'executable_callback': {buf -> s:IsSbt(buf) ? '' : 'fsc'}, +\ 'executable': {buf -> s:IsSbt(buf) ? '' : 'fsc'}, \ 'command': '%e -Ystop-after:parser %t', \ 'callback': 'ale#handlers#scala#HandleScalacLintFormat', \ 'output_stream': 'stderr', diff --git a/ale_linters/scala/sbtserver.vim b/ale_linters/scala/sbtserver.vim index 694241d7..d4f137c2 100644 --- a/ale_linters/scala/sbtserver.vim +++ b/ale_linters/scala/sbtserver.vim @@ -25,7 +25,7 @@ endfunction call ale#linter#Define('scala', { \ 'name': 'sbtserver', \ 'lsp': 'socket', -\ 'address_callback': 'ale_linters#scala#sbtserver#GetAddress', +\ 'address': function('ale_linters#scala#sbtserver#GetAddress'), \ 'language': 'scala', -\ 'project_root_callback': 'ale_linters#scala#sbtserver#GetProjectRoot', +\ 'project_root': function('ale_linters#scala#sbtserver#GetProjectRoot'), \}) diff --git a/ale_linters/scala/scalac.vim b/ale_linters/scala/scalac.vim index 3dbdd925..1dd579b4 100644 --- a/ale_linters/scala/scalac.vim +++ b/ale_linters/scala/scalac.vim @@ -8,7 +8,7 @@ endfunction call ale#linter#Define('scala', { \ 'name': 'scalac', -\ 'executable_callback': {buf -> s:IsSbt(buf) ? '' : 'scalac'}, +\ 'executable': {buf -> s:IsSbt(buf) ? '' : 'scalac'}, \ 'command': '%e -Ystop-after:parser %t', \ 'callback': 'ale#handlers#scala#HandleScalacLintFormat', \ 'output_stream': 'stderr', diff --git a/ale_linters/scala/scalastyle.vim b/ale_linters/scala/scalastyle.vim index 42228cf6..6e9e4c13 100644 --- a/ale_linters/scala/scalastyle.vim +++ b/ale_linters/scala/scalastyle.vim @@ -81,6 +81,6 @@ call ale#linter#Define('scala', { \ 'name': 'scalastyle', \ 'executable': 'scalastyle', \ 'output_stream': 'stdout', -\ 'command_callback': 'ale_linters#scala#scalastyle#GetCommand', +\ 'command': function('ale_linters#scala#scalastyle#GetCommand'), \ 'callback': 'ale_linters#scala#scalastyle#Handle', \}) diff --git a/ale_linters/scss/sasslint.vim b/ale_linters/scss/sasslint.vim index 8b725ba6..cf13546e 100644 --- a/ale_linters/scss/sasslint.vim +++ b/ale_linters/scss/sasslint.vim @@ -22,7 +22,7 @@ endfunction call ale#linter#Define('scss', { \ 'name': 'sasslint', -\ 'executable_callback': 'ale_linters#scss#sasslint#GetExecutable', -\ 'command_callback': 'ale_linters#scss#sasslint#GetCommand', +\ 'executable': function('ale_linters#scss#sasslint#GetExecutable'), +\ 'command': function('ale_linters#scss#sasslint#GetCommand'), \ 'callback': 'ale#handlers#css#HandleCSSLintFormat', \}) diff --git a/ale_linters/scss/stylelint.vim b/ale_linters/scss/stylelint.vim index 2bffa8e1..b5b21536 100644 --- a/ale_linters/scss/stylelint.vim +++ b/ale_linters/scss/stylelint.vim @@ -11,9 +11,9 @@ endfunction call ale#linter#Define('scss', { \ 'name': 'stylelint', -\ 'executable_callback': ale#node#FindExecutableFunc('scss_stylelint', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'scss_stylelint', [ \ 'node_modules/.bin/stylelint', -\ ]), -\ 'command_callback': 'ale_linters#scss#stylelint#GetCommand', +\ ])}, +\ 'command': function('ale_linters#scss#stylelint#GetCommand'), \ 'callback': 'ale#handlers#css#HandleStyleLintFormat', \}) diff --git a/ale_linters/sh/language_server.vim b/ale_linters/sh/language_server.vim index 385d1119..5a3b0e9a 100644 --- a/ale_linters/sh/language_server.vim +++ b/ale_linters/sh/language_server.vim @@ -26,7 +26,7 @@ endfunction call ale#linter#Define('sh', { \ 'name': 'language_server', \ 'lsp': 'stdio', -\ 'executable_callback': 'ale_linters#sh#language_server#GetExecutable', -\ 'command_callback': 'ale_linters#sh#language_server#GetCommand', -\ 'project_root_callback': 'ale_linters#sh#language_server#GetProjectRoot', +\ 'executable': function('ale_linters#sh#language_server#GetExecutable'), +\ 'command': function('ale_linters#sh#language_server#GetCommand'), +\ 'project_root': function('ale_linters#sh#language_server#GetProjectRoot'), \}) diff --git a/ale_linters/sh/shell.vim b/ale_linters/sh/shell.vim index cf5e4e6c..189dc21d 100644 --- a/ale_linters/sh/shell.vim +++ b/ale_linters/sh/shell.vim @@ -51,7 +51,7 @@ endfunction call ale#linter#Define('sh', { \ 'name': 'shell', \ 'output_stream': 'stderr', -\ 'executable_callback': 'ale_linters#sh#shell#GetExecutable', -\ 'command_callback': 'ale_linters#sh#shell#GetCommand', +\ 'executable': function('ale_linters#sh#shell#GetExecutable'), +\ 'command': function('ale_linters#sh#shell#GetCommand'), \ 'callback': 'ale_linters#sh#shell#Handle', \}) diff --git a/ale_linters/sh/shellcheck.vim b/ale_linters/sh/shellcheck.vim index 12864722..bb7048cd 100644 --- a/ale_linters/sh/shellcheck.vim +++ b/ale_linters/sh/shellcheck.vim @@ -108,7 +108,7 @@ endfunction call ale#linter#Define('sh', { \ 'name': 'shellcheck', -\ 'executable_callback': 'ale_linters#sh#shellcheck#GetExecutable', +\ 'executable': function('ale_linters#sh#shellcheck#GetExecutable'), \ 'command_chain': [ \ {'callback': 'ale_linters#sh#shellcheck#VersionCheck'}, \ {'callback': 'ale_linters#sh#shellcheck#GetCommand'}, diff --git a/ale_linters/slim/slimlint.vim b/ale_linters/slim/slimlint.vim index a27736f8..1a4008ae 100644 --- a/ale_linters/slim/slimlint.vim +++ b/ale_linters/slim/slimlint.vim @@ -50,6 +50,6 @@ endfunction call ale#linter#Define('slim', { \ 'name': 'slimlint', \ 'executable': 'slim-lint', -\ 'command_callback': 'ale_linters#slim#slimlint#GetCommand', +\ 'command': function('ale_linters#slim#slimlint#GetCommand'), \ 'callback': 'ale_linters#slim#slimlint#Handle' \}) diff --git a/ale_linters/sml/smlnj.vim b/ale_linters/sml/smlnj.vim index f15579ea..852ea170 100644 --- a/ale_linters/sml/smlnj.vim +++ b/ale_linters/sml/smlnj.vim @@ -3,7 +3,7 @@ call ale#linter#Define('sml', { \ 'name': 'smlnj', -\ 'executable_callback': 'ale#handlers#sml#GetExecutableSmlnjFile', +\ 'executable': function('ale#handlers#sml#GetExecutableSmlnjFile'), \ 'command': 'sml', \ 'callback': 'ale#handlers#sml#Handle', \}) diff --git a/ale_linters/sml/smlnj_cm.vim b/ale_linters/sml/smlnj_cm.vim index bfa4bc05..9ad24af4 100644 --- a/ale_linters/sml/smlnj_cm.vim +++ b/ale_linters/sml/smlnj_cm.vim @@ -12,9 +12,9 @@ endfunction call ale#linter#Define('sml', { \ 'name': 'smlnj_cm', \ 'aliases': ['smlnj-cm'], -\ 'executable_callback': 'ale#handlers#sml#GetExecutableSmlnjCm', +\ 'executable': function('ale#handlers#sml#GetExecutableSmlnjCm'), \ 'lint_file': 1, -\ 'command_callback': 'ale_linters#sml#smlnj_cm#GetCommand', +\ 'command': function('ale_linters#sml#smlnj_cm#GetCommand'), \ 'callback': 'ale#handlers#sml#Handle', \}) diff --git a/ale_linters/spec/rpmlint.vim b/ale_linters/spec/rpmlint.vim index 486bef1e..92ef4d63 100644 --- a/ale_linters/spec/rpmlint.vim +++ b/ale_linters/spec/rpmlint.vim @@ -72,7 +72,7 @@ endfunction call ale#linter#Define('spec', { \ 'name': 'rpmlint', -\ 'executable_callback': ale#VarFunc('spec_rpmlint_executable'), -\ 'command_callback': 'ale_linters#spec#rpmlint#GetCommand', +\ 'executable': {b -> ale#Var(b, 'spec_rpmlint_executable')}, +\ 'command': function('ale_linters#spec#rpmlint#GetCommand'), \ 'callback': 'ale_linters#spec#rpmlint#Handle', \}) diff --git a/ale_linters/stylus/stylelint.vim b/ale_linters/stylus/stylelint.vim index 2256f3c0..ce6f9426 100644 --- a/ale_linters/stylus/stylelint.vim +++ b/ale_linters/stylus/stylelint.vim @@ -12,9 +12,9 @@ endfunction call ale#linter#Define('stylus', { \ 'name': 'stylelint', -\ 'executable_callback': ale#node#FindExecutableFunc('stylus_stylelint', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'stylus_stylelint', [ \ 'node_modules/.bin/stylelint', -\ ]), -\ 'command_callback': 'ale_linters#stylus#stylelint#GetCommand', +\ ])}, +\ 'command': function('ale_linters#stylus#stylelint#GetCommand'), \ 'callback': 'ale#handlers#css#HandleStyleLintFormat', \}) diff --git a/ale_linters/sugarss/stylelint.vim b/ale_linters/sugarss/stylelint.vim index 6b0adf5a..6c705e46 100644 --- a/ale_linters/sugarss/stylelint.vim +++ b/ale_linters/sugarss/stylelint.vim @@ -13,9 +13,9 @@ endfunction call ale#linter#Define('sugarss', { \ 'name': 'stylelint', -\ 'executable_callback': ale#node#FindExecutableFunc('sugarss_stylelint', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'sugarss_stylelint', [ \ 'node_modules/.bin/stylelint', -\ ]), -\ 'command_callback': 'ale_linters#sugarss#stylelint#GetCommand', +\ ])}, +\ 'command': function('ale_linters#sugarss#stylelint#GetCommand'), \ 'callback': 'ale#handlers#css#HandleStyleLintFormat', \}) diff --git a/ale_linters/swift/swiftlint.vim b/ale_linters/swift/swiftlint.vim index 0f2ea8de..237c45d3 100644 --- a/ale_linters/swift/swiftlint.vim +++ b/ale_linters/swift/swiftlint.vim @@ -63,7 +63,7 @@ endfunction call ale#linter#Define('swift', { \ 'name': 'swiftlint', -\ 'executable_callback': 'ale_linters#swift#swiftlint#GetExecutable', -\ 'command_callback': 'ale_linters#swift#swiftlint#GetCommand', +\ 'executable': function('ale_linters#swift#swiftlint#GetExecutable'), +\ 'command': function('ale_linters#swift#swiftlint#GetCommand'), \ 'callback': 'ale_linters#swift#swiftlint#Handle', \}) diff --git a/ale_linters/tcl/nagelfar.vim b/ale_linters/tcl/nagelfar.vim index 05fe581b..5a4940e1 100644 --- a/ale_linters/tcl/nagelfar.vim +++ b/ale_linters/tcl/nagelfar.vim @@ -32,8 +32,8 @@ endfunction call ale#linter#Define('tcl', { \ 'name': 'nagelfar', \ 'output_stream': 'stdout', -\ 'executable_callback': ale#VarFunc('tcl_nagelfar_executable'), -\ 'command_callback': 'ale_linters#tcl#nagelfar#GetCommand', +\ 'executable': {b -> ale#Var(b, 'tcl_nagelfar_executable')}, +\ 'command': function('ale_linters#tcl#nagelfar#GetCommand'), \ 'callback': 'ale_linters#tcl#nagelfar#Handle', \ 'lint_file': 1, \}) diff --git a/ale_linters/terraform/tflint.vim b/ale_linters/terraform/tflint.vim index 0d77835a..6d54a8b1 100644 --- a/ale_linters/terraform/tflint.vim +++ b/ale_linters/terraform/tflint.vim @@ -52,7 +52,7 @@ endfunction call ale#linter#Define('terraform', { \ 'name': 'tflint', -\ 'executable_callback': ale#VarFunc('terraform_tflint_executable'), -\ 'command_callback': 'ale_linters#terraform#tflint#GetCommand', +\ 'executable': {b -> ale#Var(b, 'terraform_tflint_executable')}, +\ 'command': function('ale_linters#terraform#tflint#GetCommand'), \ 'callback': 'ale_linters#terraform#tflint#Handle', \}) diff --git a/ale_linters/tex/chktex.vim b/ale_linters/tex/chktex.vim index 7f1b0c72..160baf0d 100644 --- a/ale_linters/tex/chktex.vim +++ b/ale_linters/tex/chktex.vim @@ -49,6 +49,6 @@ endfunction call ale#linter#Define('tex', { \ 'name': 'chktex', \ 'executable': 'chktex', -\ 'command_callback': 'ale_linters#tex#chktex#GetCommand', +\ 'command': function('ale_linters#tex#chktex#GetCommand'), \ 'callback': 'ale_linters#tex#chktex#Handle' \}) diff --git a/ale_linters/tex/lacheck.vim b/ale_linters/tex/lacheck.vim index ee09fb41..19d69403 100644 --- a/ale_linters/tex/lacheck.vim +++ b/ale_linters/tex/lacheck.vim @@ -37,7 +37,7 @@ endfunction call ale#linter#Define('tex', { \ 'name': 'lacheck', -\ 'executable_callback': ale#VarFunc('tex_lacheck_executable'), +\ 'executable': {b -> ale#Var(b, 'tex_lacheck_executable')}, \ 'command': '%e %t', \ 'callback': 'ale_linters#tex#lacheck#Handle' \}) diff --git a/ale_linters/tex/textlint.vim b/ale_linters/tex/textlint.vim index 0266ed85..5edac46d 100644 --- a/ale_linters/tex/textlint.vim +++ b/ale_linters/tex/textlint.vim @@ -3,7 +3,7 @@ call ale#linter#Define('tex', { \ 'name': 'textlint', -\ 'executable_callback': 'ale#handlers#textlint#GetExecutable', -\ 'command_callback': 'ale#handlers#textlint#GetCommand', +\ 'executable': function('ale#handlers#textlint#GetExecutable'), +\ 'command': function('ale#handlers#textlint#GetCommand'), \ 'callback': 'ale#handlers#textlint#HandleTextlintOutput', \}) diff --git a/ale_linters/text/textlint.vim b/ale_linters/text/textlint.vim index 8fafdd7d..67c4e378 100644 --- a/ale_linters/text/textlint.vim +++ b/ale_linters/text/textlint.vim @@ -3,7 +3,7 @@ call ale#linter#Define('text', { \ 'name': 'textlint', -\ 'executable_callback': 'ale#handlers#textlint#GetExecutable', -\ 'command_callback': 'ale#handlers#textlint#GetCommand', +\ 'executable': function('ale#handlers#textlint#GetExecutable'), +\ 'command': function('ale#handlers#textlint#GetCommand'), \ 'callback': 'ale#handlers#textlint#HandleTextlintOutput', \}) diff --git a/ale_linters/thrift/thrift.vim b/ale_linters/thrift/thrift.vim index 2f2086c9..345c7abe 100644 --- a/ale_linters/thrift/thrift.vim +++ b/ale_linters/thrift/thrift.vim @@ -80,9 +80,8 @@ endfunction call ale#linter#Define('thrift', { \ 'name': 'thrift', -\ 'executable': 'thrift', \ 'output_stream': 'both', -\ 'executable_callback': ale#VarFunc('thrift_thrift_executable'), -\ 'command_callback': 'ale_linters#thrift#thrift#GetCommand', +\ 'executable': {b -> ale#Var(b, 'thrift_thrift_executable')}, +\ 'command': function('ale_linters#thrift#thrift#GetCommand'), \ 'callback': 'ale_linters#thrift#thrift#Handle', \}) diff --git a/ale_linters/typescript/eslint.vim b/ale_linters/typescript/eslint.vim index f1ae54e7..bf849337 100644 --- a/ale_linters/typescript/eslint.vim +++ b/ale_linters/typescript/eslint.vim @@ -3,7 +3,7 @@ call ale#linter#Define('typescript', { \ 'name': 'eslint', -\ 'executable_callback': 'ale#handlers#eslint#GetExecutable', -\ 'command_callback': 'ale#handlers#eslint#GetCommand', +\ 'executable': function('ale#handlers#eslint#GetExecutable'), +\ 'command': function('ale#handlers#eslint#GetCommand'), \ 'callback': 'ale#handlers#eslint#Handle', \}) diff --git a/ale_linters/typescript/tslint.vim b/ale_linters/typescript/tslint.vim index ccdca936..f70c2e45 100644 --- a/ale_linters/typescript/tslint.vim +++ b/ale_linters/typescript/tslint.vim @@ -69,7 +69,7 @@ endfunction call ale#linter#Define('typescript', { \ 'name': 'tslint', -\ 'executable_callback': 'ale#handlers#tslint#GetExecutable', -\ 'command_callback': 'ale_linters#typescript#tslint#GetCommand', +\ 'executable': function('ale#handlers#tslint#GetExecutable'), +\ 'command': function('ale_linters#typescript#tslint#GetCommand'), \ 'callback': 'ale_linters#typescript#tslint#Handle', \}) diff --git a/ale_linters/typescript/tsserver.vim b/ale_linters/typescript/tsserver.vim index 7dc8fa85..840889f3 100644 --- a/ale_linters/typescript/tsserver.vim +++ b/ale_linters/typescript/tsserver.vim @@ -8,10 +8,10 @@ call ale#Set('typescript_tsserver_use_global', get(g:, 'ale_use_global_executabl call ale#linter#Define('typescript', { \ 'name': 'tsserver', \ 'lsp': 'tsserver', -\ 'executable_callback': ale#node#FindExecutableFunc('typescript_tsserver', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'typescript_tsserver', [ \ 'node_modules/.bin/tsserver', -\ ]), +\ ])}, \ 'command': '%e', -\ 'project_root_callback': 'ale#handlers#tsserver#GetProjectRoot', +\ 'project_root': function('ale#handlers#tsserver#GetProjectRoot'), \ 'language': '', \}) diff --git a/ale_linters/verilog/iverilog.vim b/ale_linters/verilog/iverilog.vim index c64a3be6..e081f33f 100644 --- a/ale_linters/verilog/iverilog.vim +++ b/ale_linters/verilog/iverilog.vim @@ -38,6 +38,6 @@ call ale#linter#Define('verilog', { \ 'name': 'iverilog', \ 'output_stream': 'stderr', \ 'executable': 'iverilog', -\ 'command_callback': 'ale_linters#verilog#iverilog#GetCommand', +\ 'command': function('ale_linters#verilog#iverilog#GetCommand'), \ 'callback': 'ale_linters#verilog#iverilog#Handle', \}) diff --git a/ale_linters/verilog/verilator.vim b/ale_linters/verilog/verilator.vim index 18d99043..64bb6e41 100644 --- a/ale_linters/verilog/verilator.vim +++ b/ale_linters/verilog/verilator.vim @@ -53,7 +53,7 @@ call ale#linter#Define('verilog', { \ 'name': 'verilator', \ 'output_stream': 'stderr', \ 'executable': 'verilator', -\ 'command_callback': 'ale_linters#verilog#verilator#GetCommand', +\ 'command': function('ale_linters#verilog#verilator#GetCommand'), \ 'callback': 'ale_linters#verilog#verilator#Handle', \ 'read_buffer': 0, \}) diff --git a/ale_linters/verilog/vlog.vim b/ale_linters/verilog/vlog.vim index c7686291..37d21c4c 100644 --- a/ale_linters/verilog/vlog.vim +++ b/ale_linters/verilog/vlog.vim @@ -30,7 +30,7 @@ endfunction call ale#linter#Define('verilog', { \ 'name': 'vlog', \ 'output_stream': 'stdout', -\ 'executable_callback': ale#VarFunc('verilog_vlog_executable'), -\ 'command_callback': 'ale_linters#verilog#vlog#GetCommand', +\ 'executable': {b -> ale#Var(b, 'verilog_vlog_executable')}, +\ 'command': function('ale_linters#verilog#vlog#GetCommand'), \ 'callback': 'ale_linters#verilog#vlog#Handle', \}) diff --git a/ale_linters/verilog/xvlog.vim b/ale_linters/verilog/xvlog.vim index 52498f8f..98b5aae7 100644 --- a/ale_linters/verilog/xvlog.vim +++ b/ale_linters/verilog/xvlog.vim @@ -29,7 +29,7 @@ endfunction call ale#linter#Define('verilog', { \ 'name': 'xvlog', \ 'output_stream': 'stdout', -\ 'executable_callback': ale#VarFunc('verilog_xvlog_executable'), -\ 'command_callback': 'ale_linters#verilog#xvlog#GetCommand', +\ 'executable': {b -> ale#Var(b, 'verilog_xvlog_executable')}, +\ 'command': function('ale_linters#verilog#xvlog#GetCommand'), \ 'callback': 'ale_linters#verilog#xvlog#Handle', \}) diff --git a/ale_linters/vhdl/ghdl.vim b/ale_linters/vhdl/ghdl.vim index c21be242..b09e620b 100644 --- a/ale_linters/vhdl/ghdl.vim +++ b/ale_linters/vhdl/ghdl.vim @@ -31,7 +31,7 @@ endfunction call ale#linter#Define('vhdl', { \ 'name': 'ghdl', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('vhdl_ghdl_executable'), -\ 'command_callback': 'ale_linters#vhdl#ghdl#GetCommand', +\ 'executable': {b -> ale#Var(b, 'vhdl_ghdl_executable')}, +\ 'command': function('ale_linters#vhdl#ghdl#GetCommand'), \ 'callback': 'ale_linters#vhdl#ghdl#Handle', \}) diff --git a/ale_linters/vhdl/vcom.vim b/ale_linters/vhdl/vcom.vim index e4631b68..1914fd33 100644 --- a/ale_linters/vhdl/vcom.vim +++ b/ale_linters/vhdl/vcom.vim @@ -32,7 +32,7 @@ endfunction call ale#linter#Define('vhdl', { \ 'name': 'vcom', \ 'output_stream': 'stdout', -\ 'executable_callback': ale#VarFunc('vhdl_vcom_executable'), -\ 'command_callback': 'ale_linters#vhdl#vcom#GetCommand', +\ 'executable': {b -> ale#Var(b, 'vhdl_vcom_executable')}, +\ 'command': function('ale_linters#vhdl#vcom#GetCommand'), \ 'callback': 'ale_linters#vhdl#vcom#Handle', \}) diff --git a/ale_linters/vhdl/xvhdl.vim b/ale_linters/vhdl/xvhdl.vim index 6e0d411d..8010ff14 100644 --- a/ale_linters/vhdl/xvhdl.vim +++ b/ale_linters/vhdl/xvhdl.vim @@ -31,7 +31,7 @@ endfunction call ale#linter#Define('vhdl', { \ 'name': 'xvhdl', \ 'output_stream': 'stdout', -\ 'executable_callback': ale#VarFunc('vhdl_xvhdl_executable'), -\ 'command_callback': 'ale_linters#vhdl#xvhdl#GetCommand', +\ 'executable': {b -> ale#Var(b, 'vhdl_xvhdl_executable')}, +\ 'command': function('ale_linters#vhdl#xvhdl#GetCommand'), \ 'callback': 'ale_linters#vhdl#xvhdl#Handle', \}) diff --git a/ale_linters/vim/ale_custom_linting_rules.vim b/ale_linters/vim/ale_custom_linting_rules.vim index 3abe5d4b..822eb30a 100644 --- a/ale_linters/vim/ale_custom_linting_rules.vim +++ b/ale_linters/vim/ale_custom_linting_rules.vim @@ -58,8 +58,8 @@ endfunction call ale#linter#Define('vim', { \ 'name': 'ale_custom_linting_rules', -\ 'executable_callback': 'ale_linters#vim#ale_custom_linting_rules#GetExecutable', -\ 'command_callback': 'ale_linters#vim#ale_custom_linting_rules#GetCommand', +\ 'executable': function('ale_linters#vim#ale_custom_linting_rules#GetExecutable'), +\ 'command': function('ale_linters#vim#ale_custom_linting_rules#GetCommand'), \ 'callback': 'ale_linters#vim#ale_custom_linting_rules#Handle', \ 'read_buffer': 0, \}) diff --git a/ale_linters/vim/vint.vim b/ale_linters/vim/vint.vim index cf2d4afd..3808c47e 100644 --- a/ale_linters/vim/vint.vim +++ b/ale_linters/vim/vint.vim @@ -65,7 +65,7 @@ endfunction call ale#linter#Define('vim', { \ 'name': 'vint', -\ 'executable_callback': 'ale_linters#vim#vint#GetExecutable', +\ 'executable': function('ale_linters#vim#vint#GetExecutable'), \ 'command_chain': [ \ {'callback': 'ale_linters#vim#vint#VersionCommand', 'output_stream': 'stderr'}, \ {'callback': 'ale_linters#vim#vint#GetCommand', 'output_stream': 'stdout'}, diff --git a/ale_linters/vue/vls.vim b/ale_linters/vue/vls.vim index 7116128b..ac451f3c 100644 --- a/ale_linters/vue/vls.vim +++ b/ale_linters/vue/vls.vim @@ -13,10 +13,10 @@ endfunction call ale#linter#Define('vue', { \ 'name': 'vls', \ 'lsp': 'stdio', -\ 'executable_callback': ale#node#FindExecutableFunc('vue_vls', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'vue_vls', [ \ 'node_modules/.bin/vls', -\ ]), +\ ])}, \ 'command': '%e --stdio', \ 'language': 'vue', -\ 'project_root_callback': 'ale_linters#vue#vls#GetProjectRoot', +\ 'project_root': function('ale_linters#vue#vls#GetProjectRoot'), \}) diff --git a/ale_linters/xml/xmllint.vim b/ale_linters/xml/xmllint.vim index b003b096..553d0883 100644 --- a/ale_linters/xml/xmllint.vim +++ b/ale_linters/xml/xmllint.vim @@ -59,7 +59,7 @@ endfunction call ale#linter#Define('xml', { \ 'name': 'xmllint', \ 'output_stream': 'stderr', -\ 'executable_callback': ale#VarFunc('xml_xmllint_executable'), -\ 'command_callback': 'ale_linters#xml#xmllint#GetCommand', +\ 'executable': {b -> ale#Var(b, 'xml_xmllint_executable')}, +\ 'command': function('ale_linters#xml#xmllint#GetCommand'), \ 'callback': 'ale_linters#xml#xmllint#Handle', \ }) diff --git a/ale_linters/yaml/swaglint.vim b/ale_linters/yaml/swaglint.vim index 7362536e..1f140e37 100644 --- a/ale_linters/yaml/swaglint.vim +++ b/ale_linters/yaml/swaglint.vim @@ -32,9 +32,9 @@ endfunction call ale#linter#Define('yaml', { \ 'name': 'swaglint', -\ 'executable_callback': ale#node#FindExecutableFunc('yaml_swaglint', [ +\ 'executable': {b -> ale#node#FindExecutable(b, 'yaml_swaglint', [ \ 'node_modules/.bin/swaglint', -\ ]), +\ ])}, \ 'command': '%e -r compact --stdin', \ 'callback': 'ale_linters#yaml#swaglint#Handle', \}) diff --git a/ale_linters/yaml/yamllint.vim b/ale_linters/yaml/yamllint.vim index 9d2cc7c2..bedb7bf1 100644 --- a/ale_linters/yaml/yamllint.vim +++ b/ale_linters/yaml/yamllint.vim @@ -44,7 +44,7 @@ endfunction call ale#linter#Define('yaml', { \ 'name': 'yamllint', -\ 'executable_callback': ale#VarFunc('yaml_yamllint_executable'), -\ 'command_callback': 'ale_linters#yaml#yamllint#GetCommand', +\ 'executable': {b -> ale#Var(b, 'yaml_yamllint_executable')}, +\ 'command': function('ale_linters#yaml#yamllint#GetCommand'), \ 'callback': 'ale_linters#yaml#yamllint#Handle', \}) diff --git a/ale_linters/yang/yang_lsp.vim b/ale_linters/yang/yang_lsp.vim index 45776f98..81fcaa0e 100644 --- a/ale_linters/yang/yang_lsp.vim +++ b/ale_linters/yang/yang_lsp.vim @@ -9,7 +9,7 @@ endfunction call ale#linter#Define('yang', { \ 'name': 'yang_lsp', \ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('yang_lsp_executable'), -\ 'project_root_callback': 'ale_linters#yang#yang_lsp#GetProjectRoot', +\ 'executable': {b -> ale#Var(b, 'yang_lsp_executable')}, +\ 'project_root': function('ale_linters#yang#yang_lsp#GetProjectRoot'), \ 'command': '%e', \}) diff --git a/autoload/ale.vim b/autoload/ale.vim index f6c23d72..5aa5fbfc 100644 --- a/autoload/ale.vim +++ b/autoload/ale.vim @@ -169,11 +169,6 @@ function! ale#Var(buffer, variable_name) abort return get(l:vars, l:full_name, g:[l:full_name]) endfunction -" As above, but curry the arguments so only the buffer number is required. -function! ale#VarFunc(variable_name) abort - return {buf -> ale#Var(buf, a:variable_name)} -endfunction - " Initialize a variable with a default value, if it isn't already set. " " Every variable name will be prefixed with 'ale_'. diff --git a/autoload/ale/assert.vim b/autoload/ale/assert.vim index 1b004649..6c2586a6 100644 --- a/autoload/ale/assert.vim +++ b/autoload/ale/assert.vim @@ -114,14 +114,6 @@ endfunction function! ale#assert#LSPProject(expected_root) abort let l:buffer = bufnr('') let l:linter = s:GetLinter() - let l:root = ale#util#GetFunction(l:linter.project_root_callback)(l:buffer) - - AssertEqual a:expected_root, l:root -endfunction - -function! ale#assert#LSPProjectFull(expected_root) abort - let l:buffer = bufnr('') - let l:linter = s:GetLinter() let l:root = ale#lsp_linter#FindProjectRoot(l:buffer, l:linter) AssertEqual a:expected_root, l:root @@ -130,7 +122,7 @@ endfunction function! ale#assert#LSPAddress(expected_address) abort let l:buffer = bufnr('') let l:linter = s:GetLinter() - let l:address = ale#util#GetFunction(l:linter.address_callback)(l:buffer) + let l:address = ale#linter#GetAddress(l:buffer, l:linter) AssertEqual a:expected_address, l:address endfunction @@ -143,7 +135,6 @@ function! ale#assert#SetUpLinterTestCommands() abort command! -nargs=+ AssertLSPConfig :call ale#assert#LSPConfig(<args>) command! -nargs=+ AssertLSPLanguage :call ale#assert#LSPLanguage(<args>) command! -nargs=+ AssertLSPProject :call ale#assert#LSPProject(<args>) - command! -nargs=+ AssertLSPProjectFull :call ale#assert#LSPProjectFull(<args>) command! -nargs=+ AssertLSPAddress :call ale#assert#LSPAddress(<args>) endfunction @@ -159,6 +150,12 @@ function! ale#assert#SetUpLinterTest(filetype, name) abort let l:prefix = 'ale_' . a:filetype . '_' . a:name let b:filter_expr = 'v:val[: len(l:prefix) - 1] is# l:prefix' + Save g:ale_lsp_root + let g:ale_lsp_root = {} + + Save b:ale_lsp_root + unlet! b:ale_lsp_root + Save g:ale_c_build_dir unlet! g:ale_c_build_dir @@ -216,10 +213,6 @@ function! ale#assert#TearDownLinterTest() abort delcommand AssertLSPProject endif - if exists(':AssertLSPProjectFull') - delcommand AssertLSPProjectFull - endif - if exists(':AssertLSPAddress') delcommand AssertLSPAddress endif diff --git a/autoload/ale/linter.vim b/autoload/ale/linter.vim index 74d5c14a..4937a6d7 100644 --- a/autoload/ale/linter.vim +++ b/autoload/ale/linter.vim @@ -340,6 +340,8 @@ function! ale#linter#PreProcess(filetype, linter) abort throw '`aliases` must be a List of String values' endif + " TODO: Emit deprecation warnings for deprecated options later. + return l:obj endfunction diff --git a/autoload/ale/node.vim b/autoload/ale/node.vim index 5c579c75..f75280b7 100644 --- a/autoload/ale/node.vim +++ b/autoload/ale/node.vim @@ -23,11 +23,6 @@ function! ale#node#FindExecutable(buffer, base_var_name, path_list) abort return ale#Var(a:buffer, a:base_var_name . '_executable') endfunction -" As above, but curry the arguments so only the buffer number is required. -function! ale#node#FindExecutableFunc(base_var_name, path_list) abort - return {buf -> ale#node#FindExecutable(buf, a:base_var_name, a:path_list)} -endfunction - " Create a executable string which executes a Node.js script command with a " Node.js executable if needed. " diff --git a/doc/ale.txt b/doc/ale.txt index acf86fb1..16f7262d 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -3110,17 +3110,13 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()* for computing the executable, accepting a buffer number. - This value will be used to check if the - program requested is installed or not. + This value will be used to check if the program + requested is installed or not. - Either this or the `executable_callback` argument - must be provided. - - `executable_callback ` A |String| or |Funcref| for a callback function - accepting a buffer number. A |String| should be - returned for the executable to check. This can be - used in place of `executable` when more complicated - processing is needed. + If an `executable` is not defined, the command will + be run without checking if a program is executable + first. Defining an executable path is recommended to + avoid starting too many processes. `command` A |String| for a command to run asynchronously, or a |Funcref| for a function to call for computing the @@ -3130,17 +3126,6 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()* check, and will produce the lines of output given to the `callback`. - `command_callback` A |String| or |Funcref| for a callback function - accepting a buffer number. A |String| should be - returned for a command to run. This can be used in - place of `command` when more complicated processing - is needed. - - If an empty string is returned from the callback, - no jobs for linting will be run for that linter. - This can be used for skipping a linter call, - say if no configuration file was found. - *ale-command-chain* `command_chain` A |List| of |Dictionary| items defining a series of commands to be run. At least one |Dictionary| @@ -3226,22 +3211,20 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()* linter will be defined as an LSP linter which keeps a process for a language server running, and communicates with it directly via a |channel|. - `executable` or `executable_callback` must be set, - and `command` or `command_callback` must be set. + `executable` and `command` must be set. When this argument is set to `'socket'`, then the linter will be defined as an LSP linter via a TCP - socket connection. Either `address` or - `address_callback` must be set. + socket connection. `address` must be set. ALE will not start a server automatically. - When this argument is not empty - `project_root_callback` must be defined. + When this argument is not empty `project_root` must + be defined. - `language` or `language_callback` can be defined to - describe the language for a file. The filetype will - be used as the language by default. + `language` can be defined to describe the language + for a file. The filetype will be used as the language + by default. LSP linters handle diagnostics automatically, so the `callback` argument must not be defined. @@ -3249,12 +3232,11 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()* An optional `completion_filter` callback may be defined for filtering completion results. - An optional `initialization_options` or - `initialization_options_callback` may be defined to - pass initialization options to the LSP. + `initialization_options` may be defined to pass + initialization options to the LSP. - An optional `lsp_config` or `lsp_config_callback` may - be defined to pass configuration settings to the LSP. + `lsp_config` may be defined to pass configuration + settings to the LSP. `address` A |String| representing an address to connect to, or a |Funcref| accepting a buffer number and @@ -3263,13 +3245,6 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()* This argument must only be set if the `lsp` argument is set to `'socket'`. - `address_callback` A |String| or |Funcref| for a callback function - accepting a buffer number. A |String| should be - returned with an address to connect to. - - This argument must only be set if the `lsp` argument - is set to `'socket'`. - `project_root` A |String| representing a path to the project for the file being checked with the language server, or a |Funcref| accepting a buffer number and returning @@ -3281,27 +3256,15 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()* This argument must only be set if the `lsp` argument is also set to a non-empty string. - `project_root_callback` A |String| or |Funcref| for a callback function - accepting a buffer number and returning the - `project_root` |String| as documented above. - `language` A |String| representing the name of the language being checked, or a |Funcref| accepting a buffer number and returning the |String|. This string will be sent to the LSP to tell it what type of language is being checked. - If this or `language_callback` isn't set, the - language will default to the value of the filetype - given to |ale#linter#Define|. - - `language_callback` A |String| or |Funcref| for a callback function - accepting a buffer number. A |String| should be - returned representing the name of the language being - checked. - - This option can be used instead of `language` if a - linter can check multiple languages. + If a language isn't provided, the language will + default to the value of the filetype given to + |ale#linter#Define|. `completion_filter` A |String| or |Funcref| for a callback function accepting a buffer number and a completion item. @@ -3326,13 +3289,6 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()* This will be fed (as JSON) to the LSP in the initialize command. - `initialization_options_callback` - A |String| or |Funcref| for a callback function - accepting a buffer number. A |Dictionary| should be - returned for initialization options to pass the LSP. - This can be used in place of `initialization_options` - when more complicated processing is needed. - `lsp_config` A |Dictionary| for configuring a language server, or a |Funcref| for a callback function accepting a buffer number and returning the |Dictionary|. @@ -3340,23 +3296,12 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()* This will be fed (as JSON) to the LSP in the workspace/didChangeConfiguration command. - `lsp_config_callback` A |String| or |Funcref| for a callback function - accepting a buffer number. A |Dictionary| should be - returned for configuration settings to pass the LSP. - This can be used in place of `lsp_config` when more - complicated processing is needed. - - Only one of `command`, `command_callback`, or `command_chain` should be - specified. `command_callback` is generally recommended when a command string - needs to be generated dynamically, or any global options are used. - `command_chain` is recommended where any system calls need to be made to - retrieve some kind of information before running the final command. + Only one of `command` or `command_chain` should be specified. If temporary files or directories are created for commands run with - `command_callback` or `command_chain`, then these tempoary files or - directories can be managed by ALE, for automatic deletion. - See |ale#engine#ManageFile()| and |ale#engine#ManageDirectory| for more - information. + `command` or `command_chain`, then these temporary files or directories can + be managed by ALE, for automatic deletion. See |ale#command#ManageFile()| + and |ale#command#ManageDirectory| for more information. *ale-command-format-strings* @@ -3374,16 +3319,16 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()* strings will reference the one temporary file. The temporary file will be created inside a temporary directory, and the entire temporary directory will be automatically deleted, following the behaviour of - |ale#engine#ManageDirectory|. This option can be used for some linters which + |ale#command#ManageDirectory|. This option can be used for some linters which do not support reading from stdin. For example: > 'command': 'ghc -fno-code -v0 %t', < Any substring `%e` will be replaced with the escaped executable supplied - with `executable` or `executable_callback`. This provides a convenient way - to define a command string which needs to include a dynamic executable name, - but which is otherwise static. + with `executable`. This provides a convenient way to define a command string + which needs to include a dynamic executable name, but which is otherwise + static. For example: > 'command': '%e --some-argument', @@ -3394,7 +3339,7 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()* If a callback for a command generates part of a command string which might possibly contain `%%`, `%s`, `%t`, or `%e`, where the special formatting - behavior is not desired, the |ale#engine#EscapeCommandPart()| function can + behavior is not desired, the |ale#command#EscapeCommandPart()| function can be used to replace those characters to avoid formatting issues. *ale-linter-loading-behavior* diff --git a/test/lsp/test_lsp_root_detection.vader b/test/lsp/test_lsp_root_detection.vader index 2575a62c..b7827248 100644 --- a/test/lsp/test_lsp_root_detection.vader +++ b/test/lsp/test_lsp_root_detection.vader @@ -16,48 +16,47 @@ Execute(The buffer-specific variable can be a string): let b:ale_lsp_root = '/some/path' call ale#test#SetFilename('other-file.c') - AssertLSPProjectFull '/some/path' + AssertLSPProject '/some/path' Execute(The buffer-specific variable can be a dictionary): let b:ale_lsp_root = {'clangd': '/some/path', 'golangserver': '/other/path'} call ale#test#SetFilename('other-file.c') - AssertLSPProjectFull '/some/path' + AssertLSPProject '/some/path' Execute(The buffer-specific variable can have funcrefs): let b:ale_lsp_root = {'clangd': function('Hook1'), 'golangserver': '/path'} call ale#test#SetFilename('other-file.c') - AssertLSPProjectFull 'abc123' + AssertLSPProject 'abc123' Execute(The global variable can be a dictionary): let g:ale_lsp_root = {'clangd': '/some/path', 'golangserver': '/other/path'} call ale#test#SetFilename('other-file.c') - AssertLSPProjectFull '/some/path' + AssertLSPProject '/some/path' Execute(The global variable can have funcrefs): let g:ale_lsp_root = {'clangd': function('Hook1'), 'golangserver': '/path'} call ale#test#SetFilename('other-file.c') - AssertLSPProjectFull 'abc123' + AssertLSPProject 'abc123' Execute(The buffer-specific variable overrides the global variable): let b:ale_lsp_root = {'clangd': '/some/path', 'golangserver': '/other/path'} let g:ale_lsp_root = {'clangd': '/not/this/path', 'golangserver': '/elsewhere'} call ale#test#SetFilename('other-file.c') - AssertLSPProjectFull '/some/path' + AssertLSPProject '/some/path' Execute(The global variable is queried if the buffer-specific has no value): let b:ale_lsp_root = {'golangserver': '/other/path'} let g:ale_lsp_root = {'clangd': '/some/path', 'golangserver': '/elsewhere'} call ale#test#SetFilename('other-file.c') - AssertLSPProjectFull '/some/path' - + AssertLSPProject '/some/path' Execute(The default hook value is acceptable): call ale#test#SetFilename('other-file.c') - AssertLSPProjectFull '' + AssertLSPProject '' |