Skip to content

Commit

Permalink
Updated plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
amix committed Jul 19, 2018
1 parent 2f164fe commit cc997dc
Show file tree
Hide file tree
Showing 99 changed files with 1,572 additions and 1,151 deletions.
4 changes: 2 additions & 2 deletions sources_non_forked/ale/ale_linters/awk/gawk.vim
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ function! ale_linters#awk#gawk#GetCommand(buffer) abort
" note the --source 'BEGIN ...' is to prevent
" gawk from attempting to execute the body of the script
" it is linting.
return ale_linters#awk#gawk#GetExecutable(a:buffer)
return ale#Escape(ale_linters#awk#gawk#GetExecutable(a:buffer))
\ . " --source 'BEGIN { exit } END { exit 1 }'"
\ . ' ' . ale#Var(a:buffer, 'awk_gawk_options')
\ . ale#Pad(ale#Var(a:buffer, 'awk_gawk_options'))
\ . ' ' . '-f %t --lint /dev/null'
endfunction

Expand Down
1 change: 0 additions & 1 deletion sources_non_forked/ale/ale_linters/cpp/cquery.vim
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ call ale#linter#Define('cpp', {
\ 'command_callback': 'ale_linters#cpp#cquery#GetCommand',
\ 'project_root_callback': 'ale_linters#cpp#cquery#GetProjectRoot',
\ 'initialization_options_callback': 'ale_linters#cpp#cquery#GetInitializationOptions',
\ 'language': 'cpp',
\})
6 changes: 5 additions & 1 deletion sources_non_forked/ale/ale_linters/cs/mcs.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
let g:ale_cs_mcs_options = get(g:, 'ale_cs_mcs_options', '')

function! ale_linters#cs#mcs#GetCommand(buffer) abort
return 'mcs -unsafe --parse ' . ale#Var(a:buffer, 'cs_mcs_options') . ' %t'
let l:options = ale#Var(a:buffer, 'cs_mcs_options')

return 'mcs -unsafe --parse'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' %t'
endfunction

function! ale_linters#cs#mcs#Handle(buffer, lines) abort
Expand Down
10 changes: 5 additions & 5 deletions sources_non_forked/ale/ale_linters/cs/mcsc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ function! ale_linters#cs#mcsc#GetCommand(buffer) abort
\ : ''

" register temporary module target file with ale
let l:out = tempname()
call ale#engine#ManageFile(a:buffer, l:out)
" register temporary module target file with ALE.
let l:out = ale#engine#CreateFile(a:buffer)

" The code is compiled as a module and the output is redirected to a
" temporary file.
return ale#path#CdString(s:GetWorkingDirectory(a:buffer))
\ . 'mcs -unsafe'
\ . ' ' . ale#Var(a:buffer, 'cs_mcsc_options')
\ . ' ' . l:lib_option
\ . ' ' . l:r_option
\ . ale#Pad(ale#Var(a:buffer, 'cs_mcsc_options'))
\ . ale#Pad(l:lib_option)
\ . ale#Pad(l:r_option)
\ . ' -out:' . l:out
\ . ' -t:module'
\ . ' -recurse:' . ale#Escape('*.cs')
Expand Down
2 changes: 1 addition & 1 deletion sources_non_forked/ale/ale_linters/cuda/nvcc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endfunction

function! ale_linters#cuda#nvcc#GetCommand(buffer) abort
" Unused: use ale#util#nul_file
" let l:output_file = tempname() . '.ii'
" let l:output_file = ale#util#Tempname() . '.ii'
" call ale#engine#ManageFile(a:buffer, l:output_file)

return ale#Escape(ale_linters#cuda#nvcc#GetExecutable(a:buffer))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ call ale#linter#Define('dart', {
\ 'lsp': 'stdio',
\ 'executable_callback': 'ale_linters#dart#language_server#GetExecutable',
\ 'command_callback': 'ale_linters#dart#language_server#GetExecutable',
\ 'language': 'dart',
\ 'project_root_callback': 'ale_linters#dart#language_server#GetProjectRoot',
\})
9 changes: 1 addition & 8 deletions sources_non_forked/ale/ale_linters/elm/make.vim
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,7 @@ function! ale_linters#elm#make#HandleElm018Line(line, output) abort
endfunction

function! ale_linters#elm#make#FileIsBuffer(path) abort
let l:is_windows = has('win32')
let l:temp_dir = l:is_windows ? $TMP : $TMPDIR

if has('win32')
return a:path[0:len(l:temp_dir) - 1] is? l:temp_dir
else
return a:path[0:len(l:temp_dir) - 1] is# l:temp_dir
endif
return ale#path#IsTempName(a:path)
endfunction

function! ale_linters#elm#make#ParseMessage(message) abort
Expand Down
2 changes: 1 addition & 1 deletion sources_non_forked/ale/ale_linters/erlang/erlc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,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 = tempname()
let l:output_file = ale#util#Tempname()
call ale#engine#ManageFile(a:buffer, l:output_file)

return 'erlc -o ' . ale#Escape(l:output_file)
Expand Down
9 changes: 3 additions & 6 deletions sources_non_forked/ale/ale_linters/fuse/fusionlint.vim
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
" Author: RyanSquared <[email protected]>
" Description: `fusion-lint` linter for FusionScript files

let g:ale_fuse_fusionlint_executable =
\ get(g:, 'ale_fuse_fusionlint_executable', 'fusion-lint')

let g:ale_fuse_fusionlint_options =
\ get(g:, 'ale_fuse_fusionlint_options', '')
call ale#Set('fuse_fusionlint_executable', 'fusion-lint')
call ale#Set('fuse_fusionlint_options', '')

function! ale_linters#fuse#fusionlint#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'fuse_fusionlint_executable')
endfunction

function! ale_linters#fuse#fusionlint#GetCommand(buffer) abort
return ale#Escape(ale_linters#fuse#fusionlint#GetExecutable(a:buffer))
\ . ' ' . ale#Var(a:buffer, 'fuse_fusionlint_options')
\ . ale#Pad(ale#Var(a:buffer, 'fuse_fusionlint_options'))
\ . ' --filename %s -i'
endfunction

Expand Down
6 changes: 3 additions & 3 deletions sources_non_forked/ale/ale_linters/glsl/glslang.vim
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ function! ale_linters#glsl#glslang#GetExecutable(buffer) abort
endfunction

function! ale_linters#glsl#glslang#GetCommand(buffer) abort
return ale_linters#glsl#glslang#GetExecutable(a:buffer)
\ . ' ' . ale#Var(a:buffer, 'glsl_glslang_options')
\ . ' ' . '-C %t'
return ale#Escape(ale_linters#glsl#glslang#GetExecutable(a:buffer))
\ . ale#Pad(ale#Var(a:buffer, 'glsl_glslang_options'))
\ . ' -C %t'
endfunction

function! ale_linters#glsl#glslang#Handle(buffer, lines) abort
Expand Down
1 change: 0 additions & 1 deletion sources_non_forked/ale/ale_linters/glsl/glslls.vim
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,5 @@ call ale#linter#Define('glsl', {
\ 'lsp': 'stdio',
\ 'executable_callback': 'ale_linters#glsl#glslls#GetExecutable',
\ 'command_callback': 'ale_linters#glsl#glslls#GetCommand',
\ 'language': 'glsl',
\ 'project_root_callback': 'ale_linters#glsl#glslls#GetProjectRoot',
\})
3 changes: 1 addition & 2 deletions sources_non_forked/ale/ale_linters/go/gotype.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

function! ale_linters#go#gotype#GetCommand(buffer) abort
if expand('#' . a:buffer . ':p') =~# '_test\.go$'
return
return ''
endif


return ale#path#BufferCdString(a:buffer) . ' gotype .'
endfunction

Expand Down
6 changes: 3 additions & 3 deletions sources_non_forked/ale/ale_linters/java/javac.vim
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ function! ale_linters#java#javac#GetCommand(buffer, import_paths) abort
return ale#path#BufferCdString(a:buffer)
\ . ale#Escape(l:executable)
\ . ' -Xlint'
\ . ' ' . l:cp_option
\ . ' ' . l:sp_option
\ . ale#Pad(l:cp_option)
\ . ale#Pad(l:sp_option)
\ . ' -d ' . ale#Escape(l:class_file_directory)
\ . ' ' . ale#Var(a:buffer, 'java_javac_options')
\ . ale#Pad(ale#Var(a:buffer, 'java_javac_options'))
\ . ' %t'
endfunction

Expand Down
38 changes: 38 additions & 0 deletions sources_non_forked/ale/ale_linters/javascript/flow_ls.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
" Author: t_t <[email protected]>
" Description: Integrate ALE with flow-language-server.

call ale#Set('javascript_flow_ls_executable', 'flow')
call ale#Set('javascript_flow_ls_use_global',
\ get(g:, 'ale_use_global_executables', 0)
\)

function! ale_linters#javascript#flow_ls#GetExecutable(buffer) abort
return ale#node#FindExecutable(a:buffer, 'javascript_flow_ls', [
\ 'node_modules/.bin/flow',
\])
endfunction

function! ale_linters#javascript#flow_ls#GetCommand(buffer) abort
let l:executable = ale_linters#javascript#flow_ls#GetExecutable(a:buffer)

return ale#Escape(l:executable) . ' lsp --from ale-lsp'
endfunction

function! ale_linters#javascript#flow_ls#FindProjectRoot(buffer) abort
let l:flow_config = ale#path#FindNearestFile(a:buffer, '.flowconfig')

if !empty(l:flow_config)
return fnamemodify(l:flow_config, ':h')
endif

return ''
endfunction

call ale#linter#Define('javascript', {
\ 'name': 'flow-language-server',
\ 'lsp': 'stdio',
\ 'executable_callback': 'ale_linters#javascript#flow_ls#GetExecutable',
\ 'command_callback': 'ale_linters#javascript#flow_ls#GetCommand',
\ 'project_root_callback': 'ale_linters#javascript#flow_ls#FindProjectRoot',
\ 'language': 'javascript',
\})
38 changes: 38 additions & 0 deletions sources_non_forked/ale/ale_linters/kotlin/languageserver.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
" Author: MTDL9 <https://github.com/MTDL9>
" Description: Support for the Kotlin language server https://github.com/fwcd/KotlinLanguageServer

call ale#Set('kotlin_languageserver_executable', 'kotlin-language-server')

function! ale_linters#kotlin#languageserver#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'kotlin_languageserver_executable')
endfunction

function! ale_linters#kotlin#languageserver#GetCommand(buffer) abort
let l:executable = ale_linters#kotlin#languageserver#GetExecutable(a:buffer)
return ale#Escape(l:executable)
endfunction

function! ale_linters#kotlin#languageserver#GetProjectRoot(buffer) abort
let l:gradle_root = ale#gradle#FindProjectRoot(a:buffer)

if !empty(l:gradle_root)
return l:gradle_root
endif

let l:maven_pom_file = ale#path#FindNearestFile(a:buffer, 'pom.xml')

if !empty(l:maven_pom_file)
return fnamemodify(l:maven_pom_file, ':h')
endif

return ''
endfunction

call ale#linter#Define('kotlin', {
\ 'name': 'languageserver',
\ 'lsp': 'stdio',
\ 'executable_callback': 'ale_linters#kotlin#languageserver#GetExecutable',
\ 'command_callback': 'ale_linters#kotlin#languageserver#GetCommand',
\ 'language': 'kotlin',
\ 'project_root_callback': 'ale_linters#kotlin#languageserver#GetProjectRoot',
\})
3 changes: 1 addition & 2 deletions sources_non_forked/ale/ale_linters/llvm/llc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ endfunction

function! ale_linters#llvm#llc#GetCommand(buffer) abort
return ale#Escape(ale_linters#llvm#llc#GetExecutable(a:buffer))
\ . ' -filetype=null -o='
\ . ale#Escape(g:ale#util#nul_file)
\ . ' -filetype=null -o=' . g:ale#util#nul_file
endfunction

function! ale_linters#llvm#llc#HandleErrors(buffer, lines) abort
Expand Down
23 changes: 20 additions & 3 deletions sources_non_forked/ale/ale_linters/markdown/remark_lint.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
" Author rhysd https://rhysd.github.io/, Dirk Roorda (dirkroorda), Adrián González Rus (@adrigzr)
" Description: remark-lint for Markdown files
call ale#Set('markdown_remark_lint_executable', 'remark')
call ale#Set('markdown_remark_lint_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('markdown_remark_lint_options', '')

function! ale_linters#markdown#remark_lint#GetExecutable(buffer) abort
return ale#node#FindExecutable(a:buffer, 'markdown_remark_lint', [
\ 'node_modules/.bin/remark',
\])
endfunction

function! ale_linters#markdown#remark_lint#GetCommand(buffer) abort
let l:executable = ale_linters#markdown#remark_lint#GetExecutable(a:buffer)
let l:options = ale#Var(a:buffer, 'markdown_remark_lint_options')

return ale#node#Executable(a:buffer, l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' --no-stdout --no-color'
endfunction

function! ale_linters#markdown#remark_lint#Handle(buffer, lines) abort
" matches: ' 1:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint'
Expand All @@ -26,9 +44,8 @@ endfunction

call ale#linter#Define('markdown', {
\ 'name': 'remark-lint',
\ 'executable': 'remark',
\ 'command': 'remark --no-stdout --no-color %s',
\ 'executable_callback': 'ale_linters#markdown#remark_lint#GetExecutable',
\ 'command_callback': 'ale_linters#markdown#remark_lint#GetCommand',
\ 'callback': 'ale_linters#markdown#remark_lint#Handle',
\ 'lint_file': 1,
\ 'output_stream': 'stderr',
\})
2 changes: 1 addition & 1 deletion sources_non_forked/ale/ale_linters/nasm/nasm.vim
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ endfunction

call ale#linter#Define('nasm', {
\ 'name': 'nasm',
\ 'executable': 'nasm',
\ 'output_stream': 'stderr',
\ 'lint_file': 1,
\ 'executable_callback': 'ale_linters#nasm#nasm#GetExecutable',
\ 'command_callback': 'ale_linters#nasm#nasm#GetCommand',
\ 'callback': 'ale_linters#nasm#nasm#Handle',
\})
1 change: 0 additions & 1 deletion sources_non_forked/ale/ale_linters/php/langserver.vim
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ call ale#linter#Define('php', {
\ 'lsp': 'stdio',
\ 'executable_callback': 'ale_linters#php#langserver#GetExecutable',
\ 'command_callback': 'ale_linters#php#langserver#GetCommand',
\ 'language': 'php',
\ 'project_root_callback': 'ale_linters#php#langserver#GetProjectRoot',
\})
45 changes: 45 additions & 0 deletions sources_non_forked/ale/ale_linters/puppet/languageserver.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
" Author: Alexander Olofsson <[email protected]>
" Description: Puppet Language Server integration for ALE

call ale#Set('puppet_languageserver_executable', 'puppet-languageserver')

function! ale_linters#puppet#languageserver#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'puppet_languageserver_executable')
endfunction

function! ale_linters#puppet#languageserver#GetCommand(buffer) abort
let l:exe = ale#Escape(ale_linters#puppet#languageserver#GetExecutable(a:buffer))

return l:exe . ' --stdio'
endfunction

function! ale_linters#puppet#languageserver#GetProjectRoot(buffer) abort
" Note: The metadata.json file is recommended for Puppet 4+ modules, but
" there's no requirement to have it, so fall back to the other possible
" Puppet module directories
let l:root_path = ale#path#FindNearestFile(a:buffer, 'metadata.json')
if !empty(l:root_path)
return fnamemodify(l:root_path, ':h')
endif

for l:test_path in [
\ 'manifests',
\ 'templates',
\]
let l:root_path = ale#path#FindNearestDirectory(a:buffer, l:test_path)
if !empty(l:root_path)
return fnamemodify(l:root_path, ':h:h')
endif
endfor

return ''
endfunction

call ale#linter#Define('puppet', {
\ 'name': 'languageserver',
\ 'lsp': 'stdio',
\ 'executable_callback': 'ale_linters#puppet#languageserver#GetExecutable',
\ 'command_callback': 'ale_linters#puppet#languageserver#GetCommand',
\ 'language': 'puppet',
\ 'project_root_callback': 'ale_linters#puppet#languageserver#GetProjectRoot',
\})
1 change: 0 additions & 1 deletion sources_non_forked/ale/ale_linters/python/pyls.vim
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ call ale#linter#Define('python', {
\ 'lsp': 'stdio',
\ 'executable_callback': 'ale_linters#python#pyls#GetExecutable',
\ 'command_callback': 'ale_linters#python#pyls#GetCommand',
\ 'language': 'python',
\ 'project_root_callback': 'ale#python#FindProjectRoot',
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
\})
1 change: 0 additions & 1 deletion sources_non_forked/ale/ale_linters/python/pyre.vim
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ call ale#linter#Define('python', {
\ 'lsp': 'stdio',
\ 'executable_callback': 'ale_linters#python#pyre#GetExecutable',
\ 'command_callback': 'ale_linters#python#pyre#GetCommand',
\ 'language': 'python',
\ 'project_root_callback': 'ale#python#FindProjectRoot',
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
\})
Loading

0 comments on commit cc997dc

Please sign in to comment.