Skip to content

Commit

Permalink
Updated plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
amix committed Sep 25, 2018
1 parent 6bd9eda commit a6b6493
Show file tree
Hide file tree
Showing 199 changed files with 2,888 additions and 971 deletions.
2 changes: 2 additions & 0 deletions sources_non_forked/ale/ale_linters/apiblueprint/drafter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ function! ale_linters#apiblueprint#drafter#HandleErrors(buffer, lines) abort
\ 'lnum': l:match[3] + 0,
\ 'col': l:match[4] + 0,
\}

if l:match[5] isnot# ''
let l:item.end_lnum = l:match[6] + 0
let l:item.end_col = l:match[7] + 0
endif

call add(l:output, l:item)
endfor

Expand Down
1 change: 1 addition & 0 deletions sources_non_forked/ale/ale_linters/c/clangd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ call ale#Set('c_clangd_options', '')

function! ale_linters#c#clangd#GetProjectRoot(buffer) abort
let l:project_root = ale#path#FindNearestFile(a:buffer, 'compile_commands.json')

return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : ''
endfunction

Expand Down
2 changes: 2 additions & 0 deletions sources_non_forked/ale/ale_linters/clojure/joker.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ function! ale_linters#clojure#joker#HandleJokerFormat(buffer, lines) abort

for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:type = 'E'

if l:match[4] is? 'Parse warning'
let l:type = 'W'
endif

call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
Expand Down
1 change: 1 addition & 0 deletions sources_non_forked/ale/ale_linters/cpp/clangd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ call ale#Set('cpp_clangd_options', '')

function! ale_linters#cpp#clangd#GetProjectRoot(buffer) abort
let l:project_root = ale#path#FindNearestFile(a:buffer, 'compile_commands.json')

return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : ''
endfunction

Expand Down
1 change: 1 addition & 0 deletions sources_non_forked/ale/ale_linters/cucumber/cucumber.vim
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function! ale_linters#cucumber#cucumber#Handle(buffer, lines) abort
endtry

let l:output = []

for l:element in get(l:json, 'elements', [])
for l:step in l:element['steps']
if l:step['result']['status'] is# 'undefined'
Expand Down
2 changes: 0 additions & 2 deletions sources_non_forked/ale/ale_linters/cuda/nvcc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ 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)

return '%e -cuda'
\ . ale#Pad(ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer)))
\ . ale#Pad(ale#Var(a:buffer, 'cuda_nvcc_options'))
Expand All @@ -23,7 +22,6 @@ function! ale_linters#cuda#nvcc#HandleNVCCFormat(buffer, lines) abort
let l:output = []

for l:match in ale#util#GetMatches(a:lines, l:pattern)

let l:item = {
\ 'lnum': str2nr(l:match[2]),
\ 'type': l:match[4] =~# 'error' ? 'E' : 'W',
Expand Down
1 change: 1 addition & 0 deletions sources_non_forked/ale/ale_linters/dafny/dafny.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function! ale_linters#dafny#dafny#Handle(buffer, lines) abort
\ 'type': l:match[4] =~# '^Error' ? 'E' : 'W'
\ })
endfor

return l:output
endfunction

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ call ale#linter#Define('dart', {
\ 'name': 'language_server',
\ 'lsp': 'stdio',
\ 'executable_callback': ale#VarFunc('dart_language_server_executable'),
\ 'command_callback': 'ale_linters#dart#language_server#GetExecutable',
\ 'command': '%e',
\ 'project_root_callback': 'ale_linters#dart#language_server#GetProjectRoot',
\})
2 changes: 2 additions & 0 deletions sources_non_forked/ale/ale_linters/dockerfile/hadolint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ endfunction

function! ale_linters#dockerfile#hadolint#GetCommand(buffer) abort
let l:command = ale_linters#dockerfile#hadolint#GetExecutable(a:buffer)

if l:command is# 'docker'
return 'docker run --rm -i ' . ale#Var(a:buffer, 'dockerfile_hadolint_docker_image')
endif

return 'hadolint -'
endfunction

Expand Down
3 changes: 2 additions & 1 deletion sources_non_forked/ale/ale_linters/elixir/mix.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ function! ale_linters#elixir#mix#Handle(buffer, lines) abort
"
" TODO: Warning format
" warning: variable "foobar" does not exist and is being expanded to "foobar()", please use parentheses to remove the ambiguity or change the variable name

let l:pattern = '\v\(([^\)]+Error)\) ([^:]+):([^:]+): (.+)$'
let l:output = []

Expand All @@ -32,9 +31,11 @@ endfunction

function! ale_linters#elixir#mix#FindProjectRoot(buffer) abort
let l:mix_file = ale#path#FindNearestFile(a:buffer, 'mix.exs')

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

return '.'
endfunction

Expand Down
6 changes: 4 additions & 2 deletions sources_non_forked/ale/ale_linters/gitcommit/gitlint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ function! ale_linters#gitcommit#gitlint#Handle(buffer, lines) abort
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:code = l:match[2]

if l:code is# 'T2' && !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
continue
if !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
if l:code is# 'T2' || l:code is# 'B2'
continue
endif
endif

let l:item = {
Expand Down
6 changes: 3 additions & 3 deletions sources_non_forked/ale/ale_linters/go/gobuild.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
" Description: go build for Go files
" inspired by work from dzhou121 <[email protected]>

call ale#Set('go_go_executable', 'go')
call ale#Set('go_gobuild_options', '')

function! ale_linters#go#gobuild#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'go_gobuild_options')

" Run go test in local directory with relative path
return ale#path#BufferCdString(a:buffer)
\ . 'go test'
\ . ale#Var(a:buffer, 'go_go_executable') . ' test'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' -c -o /dev/null ./'
endfunction
Expand All @@ -21,7 +22,6 @@ function! ale_linters#go#gobuild#GetMatches(lines) abort
" file.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args
" file.go:53:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
" file.go:5:2: expected declaration, found 'STRING' "log"

" go test returns relative paths so use tail of filename as part of pattern matcher
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:? (.+)$'

Expand All @@ -48,7 +48,7 @@ endfunction
call ale#linter#Define('go', {
\ 'name': 'gobuild',
\ 'aliases': ['go build'],
\ 'executable': 'go',
\ 'executable_callback': ale#VarFunc('go_go_executable'),
\ 'command_callback': 'ale_linters#go#gobuild#GetCommand',
\ 'output_stream': 'stderr',
\ 'callback': 'ale_linters#go#gobuild#Handler',
Expand Down
56 changes: 56 additions & 0 deletions sources_non_forked/ale/ale_linters/go/golangci_lint.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
" Author: Sascha Grunert <[email protected]>
" Description: Adds support of golangci-lint

call ale#Set('go_golangci_lint_options', '--enable-all')
call ale#Set('go_golangci_lint_executable', 'golangci-lint')
call ale#Set('go_golangci_lint_package', 0)

function! ale_linters#go#golangci_lint#GetCommand(buffer) abort
let l:filename = expand('#' . a:buffer . ':t')
let l:options = ale#Var(a:buffer, 'go_golangci_lint_options')
let l:lint_package = ale#Var(a:buffer, 'go_golangci_lint_package')

if l:lint_package
return ale#path#BufferCdString(a:buffer)
\ . '%e run '
\ . l:options
endif

return ale#path#BufferCdString(a:buffer)
\ . '%e run '
\ . ale#Escape(l:filename)
\ . ' ' . l:options
endfunction

function! ale_linters#go#golangci_lint#GetMatches(lines) abort
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:?:?:?\s\*?(.+)$'

return ale#util#GetMatches(a:lines, l:pattern)
endfunction

function! ale_linters#go#golangci_lint#Handler(buffer, lines) abort
let l:dir = expand('#' . a:buffer . ':p:h')
let l:output = []

for l:match in ale_linters#go#golangci_lint#GetMatches(a:lines)
" l:match[1] will already be an absolute path, output from
" golangci_lint
call add(l:output, {
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'type': 'E',
\ 'text': l:match[4],
\})
endfor

return l:output
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',
\ 'callback': 'ale_linters#go#golangci_lint#Handler',
\ 'lint_file': 1,
\})
8 changes: 6 additions & 2 deletions sources_non_forked/ale/ale_linters/go/govet.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@
" Author: John Eikenberry <[email protected]>
" Description: updated to work with go1.10

call ale#Set('go_go_executable', 'go')
call ale#Set('go_govet_options', '')

function! ale_linters#go#govet#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'go_govet_options')
return ale#path#BufferCdString(a:buffer) . ' go vet .'

return ale#path#BufferCdString(a:buffer) . ' '
\ . ale#Var(a:buffer, 'go_go_executable') . ' vet '
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' .'
endfunction

call ale#linter#Define('go', {
\ 'name': 'govet',
\ 'aliases': ['go vet'],
\ 'output_stream': 'stderr',
\ 'executable': 'go',
\ 'executable_callback': ale#VarFunc('go_go_executable'),
\ 'command_callback': 'ale_linters#go#govet#GetCommand',
\ 'callback': 'ale#handlers#go#Handler',
\ 'lint_file': 1,
Expand Down
28 changes: 28 additions & 0 deletions sources_non_forked/ale/ale_linters/go/langserver.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
" Author: Horacio Sanson <https://github.com/hsanson>
" Description: Support for go-langserver https://github.com/sourcegraph/go-langserver

call ale#Set('go_langserver_executable', 'go-langserver')
call ale#Set('go_langserver_options', '')

function! ale_linters#go#langserver#GetCommand(buffer) abort
let l:executable = [ale#Escape(ale#Var(a:buffer, 'go_langserver_executable'))]
let l:options = ale#Var(a:buffer, 'go_langserver_options')
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')
endif

let l:options = uniq(sort(l:options))

return join(extend(l:executable, l:options), ' ')
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',
\})
2 changes: 1 addition & 1 deletion sources_non_forked/ale/ale_linters/html/tidy.vim
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function! ale_linters#html#tidy#GetCommand(buffer) abort
" On macOS, old tidy (released on 31 Oct 2006) is installed. It does not
" consider HTML5 so we should avoid it.
let l:executable = ale#Var(a:buffer, 'html_tidy_executable')

if has('mac') && l:executable is# 'tidy' && exists('*exepath')
\ && exepath(l:executable) is# '/usr/bin/tidy'
return ''
Expand All @@ -40,7 +41,6 @@ endfunction
function! ale_linters#html#tidy#Handle(buffer, lines) abort
" Matches patterns lines like the following:
" line 7 column 5 - Warning: missing </title> before </head>

let l:pattern = '^line \(\d\+\) column \(\d\+\) - \(Warning\|Error\): \(.\+\)$'
let l:output = []

Expand Down
3 changes: 2 additions & 1 deletion sources_non_forked/ale/ale_linters/idris/idris.vim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endfunction

function! ale_linters#idris#idris#Handle(buffer, lines) abort
" This was copied almost verbatim from ale#handlers#haskell#HandleGHCFormat

"
" Look for lines like the following:
" foo.idr:2:6:When checking right hand side of main with expected type
" bar.idr:11:11-13:
Expand All @@ -30,6 +30,7 @@ function! ale_linters#idris#idris#Handle(buffer, lines) abort
else
let l:corrected_lines[-1] .= l:line
endif

let l:corrected_lines[-1] = substitute(l:corrected_lines[-1], '\s\+', ' ', 'g')
endif
endfor
Expand Down
2 changes: 1 addition & 1 deletion sources_non_forked/ale/ale_linters/java/javac.vim
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function! ale_linters#java#javac#GetImportPaths(buffer) abort
endif

let l:classpath_command = ale#gradle#BuildClasspathCommand(a:buffer)

if !empty(l:classpath_command)
return l:classpath_command
endif
Expand Down Expand Up @@ -90,7 +91,6 @@ function! ale_linters#java#javac#Handle(buffer, lines) abort
"
" Main.java:13: warning: [deprecation] donaught() in Testclass has been deprecated
" Main.java:16: error: ';' expected

let l:directory = expand('#' . a:buffer . ':p:h')
let l:pattern = '\v^(.*):(\d+): (.+):(.+)$'
let l:col_pattern = '\v^(\s*\^)$'
Expand Down
23 changes: 23 additions & 0 deletions sources_non_forked/ale/ale_linters/java/javalsp.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
" 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')

function! ale_linters#java#javalsp#Executable(buffer) abort
return 'java'
endfunction

function! ale_linters#java#javalsp#Command(buffer) abort
let l:jar = ale#Var(a:buffer, 'java_javalsp_jar')

return ale#Escape('java -cp ' . l:jar . ' -Xverify:none 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',
\ 'language': 'java',
\ 'project_root_callback': 'ale#java#FindProjectRoot',
\})
3 changes: 0 additions & 3 deletions sources_non_forked/ale/ale_linters/javascript/flow.vim
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ function! s:GetDetails(error) abort
let l:detail = ''

for l:extra_error in a:error.extra

if has_key(l:extra_error, 'message')
for l:extra_message in l:extra_error.message
let l:detail = s:ExtraErrorMsg(l:detail, l:extra_message.descr)
Expand All @@ -105,7 +104,6 @@ function! s:GetDetails(error) abort
endfor
endfor
endif

endfor

return l:detail
Expand Down Expand Up @@ -161,7 +159,6 @@ function! ale_linters#javascript#flow#Handle(buffer, lines) abort
endif

call add(l:output, l:errorToAdd)

endfor

return l:output
Expand Down
1 change: 0 additions & 1 deletion sources_non_forked/ale/ale_linters/json/jsonlint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
function! ale_linters#json#jsonlint#Handle(buffer, lines) abort
" Matches patterns like the following:
" line 2, col 15, found: 'STRING' - expected: 'EOF', '}', ',', ']'.

let l:pattern = '^line \(\d\+\), col \(\d*\), \(.\+\)$'
let l:output = []

Expand Down
21 changes: 21 additions & 0 deletions sources_non_forked/ale/ale_linters/julia/languageserver.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
" Author: Bartolomeo Stellato <[email protected]>
" Description: A language server for Julia

" Set julia executable variable
call ale#Set('julia_executable', 'julia')

function! ale_linters#julia#languageserver#GetCommand(buffer) abort
let l:julia_executable = ale#Var(a:buffer, 'julia_executable')
let l:cmd_string = 'using LanguageServer; server = LanguageServer.LanguageServerInstance(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, false); server.runlinter = true; run(server);'

return ale#Escape(l:julia_executable) . ' --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string)
endfunction

call ale#linter#Define('julia', {
\ 'name': 'languageserver',
\ 'lsp': 'stdio',
\ 'executable_callback': ale#VarFunc('julia_executable'),
\ 'command_callback': 'ale_linters#julia#languageserver#GetCommand',
\ 'language': 'julia',
\ 'project_root_callback': 'ale#julia#FindProjectRoot',
\})
Loading

0 comments on commit a6b6493

Please sign in to comment.