1
0
Fork 0
mirror of synced 2024-12-22 06:51:06 -05:00

Updated plugins

This commit is contained in:
Amir Salihefendic 2019-03-08 08:04:56 -03:00
parent 1d42b63013
commit f50b2142bc
356 changed files with 6183 additions and 3837 deletions

View file

@ -12,7 +12,7 @@ function! ale_linters#ada#gcc#GetCommand(buffer) abort
" the .ali file may be created even if no code generation is attempted.
" The output file name must match the source file name (except for the
" extension), so here we cannot use the null file as output.
let l:tmp_dir = fnamemodify(ale#engine#CreateDirectory(a:buffer), ':p')
let l:tmp_dir = fnamemodify(ale#command#CreateDirectory(a:buffer), ':p')
let l:out_file = l:tmp_dir . fnamemodify(bufname(a:buffer), ':t:r') . '.o'
" -gnatc: Check syntax and semantics only (no code generation attempted)
@ -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',
\})

View file

@ -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',
\})

View file

@ -1,11 +1,4 @@
" Author: Johannes Wienke <languitar@semipol.de>
" Description: alex for asciidoc files
call ale#linter#Define('help', {
\ 'name': 'alex',
\ 'executable': 'alex',
\ 'command': 'alex %s -t',
\ 'output_stream': 'stderr',
\ 'callback': 'ale#handlers#alex#Handle',
\ 'lint_file': 1,
\})
call ale#handlers#alex#DefineLinter('asciidoc', '--text')

View file

@ -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',
\})

View file

@ -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'
\})

View file

@ -11,9 +11,9 @@ endfunction
function! ale_linters#bib#bibclean#get_type(str) abort
if a:str is# '??'
return 'E'
return 'E'
else
return 'W'
return 'W'
endif
endfunction
@ -36,30 +36,31 @@ function! ale_linters#bib#bibclean#Handle(buffer, lines) abort
let l:msg = ''
for l:line in a:lines
if empty(l:msg)
let l:mlist = ale_linters#bib#bibclean#match_msg(l:line)
if empty(l:msg)
let l:mlist = ale_linters#bib#bibclean#match_msg(l:line)
if !empty(l:mlist)
let l:msg = l:mlist[3]
let l:type = ale_linters#bib#bibclean#get_type(l:mlist[1])
endif
else
if l:type is# 'E'
let l:mlist = ale_linters#bib#bibclean#match_entry(l:line)
else
let l:mlist = ale_linters#bib#bibclean#match_value(l:line)
endif
if !empty(l:mlist)
let l:msg = l:mlist[3]
let l:type = ale_linters#bib#bibclean#get_type(l:mlist[1])
endif
else
if l:type is# 'E'
let l:mlist = ale_linters#bib#bibclean#match_entry(l:line)
else
let l:mlist = ale_linters#bib#bibclean#match_value(l:line)
endif
if !empty(l:mlist)
call add(l:output, {
\ 'lnum': l:mlist[1],
\ 'col': l:mlist[2],
\ 'text': l:msg,
\ 'type': l:type
\})
let l:msg = ''
endif
endif
if !empty(l:mlist)
call add(l:output, {
\ 'lnum': l:mlist[1],
\ 'col': l:mlist[2],
\ 'text': l:msg,
\ 'type': l:type
\})
let l:msg = ''
endif
endif
endfor
return l:output
@ -67,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',
\})

View file

@ -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')},
\})

View file

@ -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'}

View file

@ -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'),
\})

View file

@ -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,
\})

View file

@ -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',
\})

View file

@ -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'),
\})

View file

@ -7,19 +7,19 @@ call ale#Set('c_flawfinder_minlevel', 1)
call ale#Set('c_flawfinder_error_severity', 6)
function! ale_linters#c#flawfinder#GetCommand(buffer) abort
" Set the minimum vulnerability level for flawfinder to bother with
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'c_flawfinder_minlevel')
" Set the minimum vulnerability level for flawfinder to bother with
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'c_flawfinder_minlevel')
return '%e -CDQS'
\ . ale#Pad(ale#Var(a:buffer, 'c_flawfinder_options'))
\ . l:minlevel
\ . ' %t'
return '%e -CDQS'
\ . ale#Pad(ale#Var(a:buffer, 'c_flawfinder_options'))
\ . l:minlevel
\ . ' %t'
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',
\})

View file

@ -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'}

View file

@ -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,
\})

View file

@ -11,7 +11,7 @@ function! ale_linters#clojure#joker#HandleJokerFormat(buffer, lines) abort
let l:type = 'E'
if l:match[4] is? 'Parse warning'
let l:type = 'W'
let l:type = 'W'
endif
call add(l:output, {

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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')},
\})

View file

@ -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'},

View file

@ -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,
\})

View file

@ -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'),
\})

View file

@ -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,
\})

View file

@ -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,
\})

View file

@ -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',
\})

View file

@ -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,
\})

View file

@ -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'),
\})

View file

@ -7,19 +7,19 @@ call ale#Set('cpp_flawfinder_minlevel', 1)
call ale#Set('c_flawfinder_error_severity', 6)
function! ale_linters#cpp#flawfinder#GetCommand(buffer) abort
" Set the minimum vulnerability level for flawfinder to bother with
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'cpp_flawfinder_minlevel')
" Set the minimum vulnerability level for flawfinder to bother with
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'cpp_flawfinder_minlevel')
return '%e -CDQS'
\ . ale#Var(a:buffer, 'cpp_flawfinder_options')
\ . l:minlevel
\ . ' %t'
return '%e -CDQS'
\ . ale#Var(a:buffer, 'cpp_flawfinder_options')
\ . l:minlevel
\ . ' %t'
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',
\})

View file

@ -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'},

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -30,7 +30,7 @@ function! ale_linters#cs#mcsc#GetCommand(buffer) abort
" register temporary module target file with ale
" register temporary module target file with ALE.
let l:out = ale#engine#CreateFile(a:buffer)
let l:out = ale#command#CreateFile(a:buffer)
" The code is compiled as a module and the output is redirected to a
" temporary file.
@ -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
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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'
\})

View file

@ -7,7 +7,7 @@ call ale#Set('cuda_nvcc_options', '-std=c++11')
function! ale_linters#cuda#nvcc#GetCommand(buffer) abort
" Unused: use ale#util#nul_file
" let l:output_file = ale#util#Tempname() . '.ii'
" call ale#engine#ManageFile(a:buffer, l:output_file)
" call ale#command#ManageFile(a:buffer, l:output_file)
return '%e -cuda'
\ . ale#Pad(ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer)))
\ . ale#Pad(ale#Var(a:buffer, 'cuda_nvcc_options'))
@ -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,
\})

View file

@ -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'),
\})

View file

@ -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,
\})

View file

@ -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'),
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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')},
\})

View file

@ -32,7 +32,7 @@ endfunction
function! ale_linters#elixir#mix#GetCommand(buffer) abort
let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
let l:temp_dir = ale#engine#CreateDirectory(a:buffer)
let l:temp_dir = ale#command#CreateDirectory(a:buffer)
let l:mix_build_path = has('win32')
\ ? 'set MIX_BUILD_PATH=' . ale#Escape(l:temp_dir) . ' &&'
@ -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,
\})

View file

@ -189,7 +189,10 @@ endfunction
" Return the command to execute the linter in the projects directory.
" If it doesn't, then this will fail when imports are needed.
function! ale_linters#elm#make#GetCommand(buffer) abort
let l:executable = ale_linters#elm#make#GetExecutable(a:buffer)
let l:root_dir = ale_linters#elm#make#GetRootDir(a:buffer)
let l:is_v19 = ale_linters#elm#make#IsVersionGte19(a:buffer)
let l:is_using_elm_test = l:executable =~# 'elm-test$'
if empty(l:root_dir)
let l:dir_set_cmd = ''
@ -197,11 +200,20 @@ function! ale_linters#elm#make#GetCommand(buffer) abort
let l:dir_set_cmd = 'cd ' . ale#Escape(l:root_dir) . ' && '
endif
" elm-test needs to know the path of elm-make if elm isn't installed globally.
" https://github.com/rtfeldman/node-test-runner/blob/57728f10668f2d2ab3179e7e3208bcfa9a1f19aa/README.md#--compiler
if l:is_v19 && l:is_using_elm_test
let l:elm_make_executable = ale#node#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
let l:elm_test_compiler_flag = ' --compiler ' . l:elm_make_executable . ' '
else
let l:elm_test_compiler_flag = ' '
endif
" The elm compiler, at the time of this writing, uses '/dev/null' as
" a sort of flag to tell the compiler not to generate an output file,
" which is why this is hard coded here.
" Source: https://github.com/elm-lang/elm-compiler/blob/19d5a769b30ec0b2fc4475985abb4cd94cd1d6c3/builder/src/Generate/Output.hs#L253
return l:dir_set_cmd . '%e make --report=json --output=/dev/null %t'
return l:dir_set_cmd . '%e make --report=json --output=/dev/null' . l:elm_test_compiler_flag . '%t'
endfunction
function! ale_linters#elm#make#GetExecutable(buffer) abort
@ -210,10 +222,10 @@ function! ale_linters#elm#make#GetExecutable(buffer) abort
if l:is_test && l:is_v19
return ale#node#FindExecutable(
\ a:buffer,
\ 'elm_make',
\ ['node_modules/.bin/elm-test', 'node_modules/.bin/elm']
\ )
\ a:buffer,
\ 'elm_make',
\ ['node_modules/.bin/elm-test', 'node_modules/.bin/elm']
\)
else
return ale#node#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
endif
@ -221,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'
\})

View file

@ -4,7 +4,7 @@ let g:ale_erlang_erlc_options = get(g:, 'ale_erlang_erlc_options', '')
function! ale_linters#erlang#erlc#GetCommand(buffer) abort
let l:output_file = ale#util#Tempname()
call ale#engine#ManageFile(a:buffer, l:output_file)
call ale#command#ManageFile(a:buffer, l:output_file)
return 'erlc -o ' . ale#Escape(l:output_file)
\ . ' ' . ale#Var(a:buffer, 'erlang_erlc_options')
@ -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',
\})

View file

@ -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'},

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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'),
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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'),
\})

View file

@ -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'),
\})

View file

@ -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,

View file

@ -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,
\})

View file

@ -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',
\})

View file

@ -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,
\})

View file

@ -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,

View file

@ -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,
\})

View file

@ -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,
\})

View file

@ -10,8 +10,8 @@ function! ale_linters#go#langserver#GetCommand(buffer) abort
let l:options = substitute(l:options, '-gocodecompletion', '', 'g')
let l:options = filter(split(l:options, ' '), 'empty(v:val) != 1')
if(ale#Var(a:buffer, 'completion_enabled') == 1)
call add(l:options, '-gocodecompletion')
if ale#Var(a:buffer, 'completion_enabled')
call add(l:options, '-gocodecompletion')
endif
let l:options = uniq(sort(l:options))
@ -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'),
\})

View file

@ -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,

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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'),
\})

View file

@ -9,7 +9,7 @@ function! ale_linters#hack#hhast#GetProjectRoot(buffer) abort
let l:hhconfig = ale#path#FindNearestFile(a:buffer, '.hhconfig')
if empty(l:hhconfig)
return ''
return ''
endif
let l:root = fnamemodify(l:hhconfig, ':h')
@ -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'),
\})

View file

@ -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'
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -9,39 +9,33 @@ function! ale_linters#haskell#hie#GetProjectRoot(buffer) abort
" If it's empty, search for the cabal file
if empty(l:project_file)
let l:cabal_file = fnamemodify(bufname(a:buffer), ':p:h')
let l:paths = ''
while empty(matchstr(l:cabal_file, '^\(\/\|\(\w:\\\)\)$'))
let l:cabal_file = fnamemodify(l:cabal_file, ':h')
let l:paths = l:paths . l:cabal_file . ','
endwhile
" Search all of the paths except for the root filesystem path.
let l:paths = join(
\ ale#path#Upwards(expand('#' . a:buffer . ':p:h'))[:-2],
\ ','
\)
let l:project_file = globpath(l:paths, '*.cabal')
endif
" Either extract the project directory or take the current working
" directory
if !empty(l:project_file)
let l:project_file = fnamemodify(l:project_file, ':h')
else
let l:project_file = expand('#' . a:buffer . ':p:h')
" If we still can't find one, use the current file.
if empty(l:project_file)
let l:project_file = expand('#' . a:buffer . ':p')
endif
return l:project_file
return fnamemodify(l:project_file, ':h')
endfunction
function! ale_linters#haskell#hie#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'haskell_hie_executable')
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'hie')
\ . ' --lsp'
\ . ' --lsp'
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'),
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -1,11 +1,20 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: ghc for Haskell files, using Stack
call ale#Set('haskell_stack_ghc_options', '-fno-code -v0')
function! ale_linters#haskell#stack_ghc#GetCommand(buffer) abort
return ale#handlers#haskell#GetStackExecutable(a:buffer)
\ . ' ghc -- '
\ . ale#Var(a:buffer, 'haskell_stack_ghc_options')
\ . ' %t'
endfunction
call ale#linter#Define('haskell', {
\ 'name': 'stack_ghc',
\ 'aliases': ['stack-ghc'],
\ 'output_stream': 'stderr',
\ 'executable_callback': 'ale#handlers#haskell#GetStackExecutable',
\ 'command': 'stack ghc -- -fno-code -v0 %t',
\ 'executable': function('ale#handlers#haskell#GetStackExecutable'),
\ 'command': function('ale_linters#haskell#stack_ghc#GetCommand'),
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
\})

View file

@ -1,11 +1,4 @@
" Author: Johannes Wienke <languitar@semipol.de>
" Description: alex for help files
call ale#linter#Define('help', {
\ 'name': 'alex',
\ 'executable': 'alex',
\ 'command': 'alex %s -t',
\ 'output_stream': 'stderr',
\ 'callback': 'ale#handlers#alex#Handle',
\ 'lint_file': 1,
\})
call ale#handlers#alex#DefineLinter('help', '--text')

View file

@ -1,11 +1,4 @@
" Author: Johannes Wienke <languitar@semipol.de>
" Description: alex for HTML files
call ale#linter#Define('html', {
\ 'name': 'alex',
\ 'executable': 'alex',
\ 'command': 'alex %s -t',
\ 'output_stream': 'stderr',
\ 'callback': 'ale#handlers#alex#Handle',
\ 'lint_file': 1,
\})
call ale#handlers#alex#DefineLinter('html', '--html')

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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',
\ })

View file

@ -49,11 +49,11 @@ function! ale_linters#idris#idris#Handle(buffer, lines) abort
let l:errors = matchlist(l:match[5], '\v([wW]arning|[eE]rror) - ?(.*)')
if len(l:errors) > 0
let l:ghc_type = l:errors[1]
let l:text = l:errors[2]
let l:ghc_type = l:errors[1]
let l:text = l:errors[2]
else
let l:ghc_type = ''
let l:text = l:match[5][:0] is# ' ' ? l:match[5][1:] : l:match[5]
let l:ghc_type = ''
let l:text = l:match[5][:0] is# ' ' ? l:match[5][1:] : l:match[5]
endif
if l:ghc_type is? 'Warning'
@ -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',
\})

View file

@ -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,
\})

View file

@ -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,
\})

View file

@ -55,15 +55,14 @@ function! ale_linters#java#javac#GetCommand(buffer, import_paths) abort
if isdirectory(l:jaxb_dir)
call add(l:sp_dirs, l:jaxb_dir)
endif
endif
" Automatically include the test directory, but only for test code.
if expand('#' . a:buffer . ':p') =~? '\vsrc[/\\]test[/\\]java'
let l:test_dir = fnamemodify(l:src_dir, ':h:h:h')
\ . (has('win32') ? '\test\java\' : '/test/java/')
" Automatically include the test directory, but only for test code.
if expand('#' . a:buffer . ':p') =~? '\vsrc[/\\]test[/\\]java'
let l:test_dir = ale#path#FindNearestDirectory(a:buffer, 'src/test/java')
if isdirectory(l:test_dir)
call add(l:sp_dirs, l:test_dir)
endif
if isdirectory(l:test_dir)
call add(l:sp_dirs, l:test_dir)
endif
endif
@ -73,7 +72,7 @@ function! ale_linters#java#javac#GetCommand(buffer, import_paths) abort
endif
" Create .class files in a temporary directory, which we will delete later.
let l:class_file_directory = ale#engine#CreateDirectory(a:buffer)
let l:class_file_directory = ale#command#CreateDirectory(a:buffer)
" Always run javac from the directory the file is in, so we can resolve
" relative paths correctly.
@ -120,7 +119,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'},

View file

@ -1,7 +1,6 @@
" Author: Horacio Sanson <https://github.com/hsanson>
" Description: Support for the Java language server https://github.com/georgewfraser/vscode-javac
call ale#Set('java_javalsp_jar', 'javacs.jar')
call ale#Set('java_javalsp_executable', 'java')
function! ale_linters#java#javalsp#Executable(buffer) abort
@ -9,17 +8,16 @@ function! ale_linters#java#javalsp#Executable(buffer) abort
endfunction
function! ale_linters#java#javalsp#Command(buffer) abort
let l:jar = ale#Var(a:buffer, 'java_javalsp_jar')
let l:executable = ale_linters#java#javalsp#Executable(a:buffer)
return ale#Escape(l:executable) . ' -cp ' . l:jar . ' -Xverify:none org.javacs.Main'
return ale#Escape(l:executable) . ' -Xverify:none -m javacs/org.javacs.Main'
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'),
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -54,7 +54,8 @@ function! ale_linters#javascript#flow#GetCommand(buffer, version_lines) abort
return ale#Escape(l:executable)
\ . ' check-contents'
\ . (l:use_respect_pragma ? ' --respect-pragma': '')
\ . ' --json --from ale %s'
\ . ' --json --from ale %s < %t'
\ . (!has('win32') ? '; echo' : '')
endfunction
" Filter lines of flow output until we find the first line where the JSON
@ -155,7 +156,8 @@ function! ale_linters#javascript#flow#Handle(buffer, lines) abort
\}
if has_key(l:error, 'extra')
let l:errorToAdd.detail = s:GetDetails(l:error)
let l:errorToAdd.detail = l:errorToAdd.text
\ . "\n" . s:GetDetails(l:error)
endif
call add(l:output, l:errorToAdd)
@ -166,11 +168,11 @@ 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'},
\ ],
\ 'callback': 'ale_linters#javascript#flow#Handle',
\ 'add_newline': !has('win32'),
\ 'read_buffer': 0,
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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',
\})

View file

@ -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',
\})

Some files were not shown because too many files have changed in this diff Show more