Skip to content

Commit

Permalink
Updated plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
amix committed Jan 7, 2024
1 parent 86762cf commit f676f79
Show file tree
Hide file tree
Showing 172 changed files with 3,224 additions and 1,201 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
call ale#Set('ansible_language_server_executable', 'ansible-language-server')
call ale#Set('ansible_language_server_config', {})

function! ale_linters#ansible#ansible_language_server#Executable(buffer) abort
function! ale_linters#ansible#language_server#Executable(buffer) abort
return ale#Var(a:buffer, 'ansible_language_server_executable')
endfunction

function! ale_linters#ansible#ansible_language_server#GetCommand(buffer) abort
let l:executable = ale_linters#ansible#ansible_language_server#Executable(a:buffer)
function! ale_linters#ansible#language_server#GetCommand(buffer) abort
let l:executable = ale_linters#ansible#language_server#Executable(a:buffer)

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

function! ale_linters#ansible#ansible_language_server#FindProjectRoot(buffer) abort
function! ale_linters#ansible#language_server#FindProjectRoot(buffer) abort
let l:dir = fnamemodify(
\ ale#path#FindNearestFile(a:buffer, 'ansible.cfg'),
\ ':h'
Expand All @@ -37,10 +37,11 @@ function! ale_linters#ansible#ansible_language_server#FindProjectRoot(buffer) ab
endfunction

call ale#linter#Define('ansible', {
\ 'name': 'ansible-language-server',
\ 'name': 'language_server',
\ 'aliases': ['ansible_language_server', 'ansible-language-server'],
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#ansible#ansible_language_server#Executable'),
\ 'command': function('ale_linters#ansible#ansible_language_server#GetCommand'),
\ 'project_root': function('ale_linters#ansible#ansible_language_server#FindProjectRoot'),
\ 'executable': function('ale_linters#ansible#language_server#Executable'),
\ 'command': function('ale_linters#ansible#language_server#GetCommand'),
\ 'project_root': function('ale_linters#ansible#language_server#FindProjectRoot'),
\ 'lsp_config': {b -> ale#Var(b, 'ansible_language_server_config')}
\})
38 changes: 38 additions & 0 deletions sources_non_forked/ale/ale_linters/c/clangcheck.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
" Author: gagbo <gagbobada@gmail.com>
" : luibo <ng.akhoa98@gmail.com>
" : Jorengarenar <jorengarenar@outlook.com>
" Description: clang-check linter for C files
" modified from cpp/clangcheck.vim to match for C

call ale#Set('c_clangcheck_executable', 'clang-check')
call ale#Set('c_clangcheck_options', '')
call ale#Set('c_build_dir', '')

function! ale_linters#c#clangcheck#GetCommand(buffer) abort
let l:user_options = ale#Var(a:buffer, 'c_clangcheck_options')

" Try to find compilation database to link automatically
let l:build_dir = ale#Var(a:buffer, 'c_build_dir')

if empty(l:build_dir)
let [l:root, l:json_file] = ale#c#FindCompileCommands(a:buffer)
let l:build_dir = ale#path#Dirname(l:json_file)
endif

" The extra arguments in the command are used to prevent .plist files from
" being generated. These are only added if no build directory can be
" detected.
return '%e -analyze %s'
\ . (empty(l:build_dir) ? ' --extra-arg=-Xclang --extra-arg=-analyzer-output=text --extra-arg=-fno-color-diagnostics': '')
\ . ale#Pad(l:user_options)
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
endfunction

call ale#linter#Define('c', {
\ 'name': 'clangcheck',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'c_clangcheck_executable')},
\ 'command': function('ale_linters#c#clangcheck#GetCommand'),
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
\ 'lint_file': 1,
\})
31 changes: 31 additions & 0 deletions sources_non_forked/ale/ale_linters/cairo/scarb.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
" Author: 0xhyoga <0xhyoga@gmx.com>,
" Description: scarb for cairo files

function! ale_linters#cairo#scarb#GetScarbExecutable(bufnr) abort
if ale#path#FindNearestFile(a:bufnr, 'Scarb.toml') isnot# ''
return 'scarb'
else
" if there is no Scarb.toml file, we don't use scarb even if it exists,
" so we return '', because executable('') apparently always fails
return ''
endif
endfunction

function! ale_linters#cairo#scarb#GetCommand(buffer, version) abort
return 'scarb build'
endfunction

call ale#linter#Define('cairo', {
\ 'name': 'scarb',
\ 'executable': function('ale_linters#cairo#scarb#GetScarbExecutable'),
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale_linters#cairo#scarb#GetScarbExecutable(buffer),
\ '%e --version',
\ function('ale_linters#cairo#scarb#GetCommand'),
\ )},
\ 'callback': 'ale#handlers#cairo#HandleCairoErrors',
\ 'output_stream': 'both',
\ 'lint_file': 1,
\})

2 changes: 1 addition & 1 deletion sources_non_forked/ale/ale_linters/dafny/dafny.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
" Author: Taylor Blau <me@ttaylorr.com>
call ale#Set('dafny_dafny_timelimit', 10)

function! ale_linters#dafny#dafny#Handle(buffer, lines) abort
let l:pattern = '\v(.*)\((\d+),(\d+)\): (.*): (.*)'
Expand Down Expand Up @@ -31,7 +32,6 @@ function! ale_linters#dafny#dafny#GetCommand(buffer) abort
return printf('dafny %%s /compile:0 /timeLimit:%d', ale#Var(a:buffer, 'dafny_dafny_timelimit'))
endfunction

call ale#Set('dafny_dafny_timelimit', 10)
call ale#linter#Define('dafny', {
\ 'name': 'dafny',
\ 'executable': 'dafny',
Expand Down
3 changes: 2 additions & 1 deletion sources_non_forked/ale/ale_linters/elixir/elixir_ls.vim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ function! ale_linters#elixir#elixir_ls#GetExecutable(buffer) abort
endfunction

call ale#linter#Define('elixir', {
\ 'name': 'elixir-ls',
\ 'name': 'elixir_ls',
\ 'aliases': ['elixir-ls', 'elixirls'],
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#elixir#elixir_ls#GetExecutable'),
\ 'command': function('ale_linters#elixir#elixir_ls#GetExecutable'),
Expand Down
19 changes: 19 additions & 0 deletions sources_non_forked/ale/ale_linters/elixir/lexical.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
" Author: Axel Clark <axelclark@pm.me>
" Description: Lexical integration (https://github.com/lexical-lsp/lexical)

call ale#Set('elixir_lexical_release', 'lexical')

function! ale_linters#elixir#lexical#GetExecutable(buffer) abort
let l:dir = ale#path#Simplify(ale#Var(a:buffer, 'elixir_lexical_release'))
let l:cmd = has('win32') ? '\start_lexical.bat' : '/start_lexical.sh'

return l:dir . l:cmd
endfunction

call ale#linter#Define('elixir', {
\ 'name': 'lexical',
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#elixir#lexical#GetExecutable'),
\ 'command': function('ale_linters#elixir#lexical#GetExecutable'),
\ 'project_root': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
\})
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ call ale#Set('elm_ls_elm_format_path', '')
call ale#Set('elm_ls_elm_test_path', '')
call ale#Set('elm_ls_elm_analyse_trigger', 'change')

function! elm_ls#GetRootDir(buffer) abort
function! ale_linters#elm#ls#GetProjectRoot(buffer) abort
let l:elm_json = ale#path#FindNearestFile(a:buffer, 'elm.json')

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

function! elm_ls#GetOptions(buffer) abort
function! ale_linters#elm#ls#GetOptions(buffer) abort
return {
\ 'elmPath': ale#Var(a:buffer, 'elm_ls_elm_path'),
\ 'elmFormatPath': ale#Var(a:buffer, 'elm_ls_elm_format_path'),
Expand All @@ -26,15 +26,16 @@ function! elm_ls#GetOptions(buffer) abort
endfunction

call ale#linter#Define('elm', {
\ 'name': 'elm_ls',
\ 'name': 'ls',
\ 'aliases': ['elm_ls'],
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#path#FindExecutable(b, 'elm_ls', [
\ 'node_modules/.bin/elm-language-server',
\ 'node_modules/.bin/elm-lsp',
\ 'elm-lsp'
\ ])},
\ 'command': '%e --stdio',
\ 'project_root': function('elm_ls#GetRootDir'),
\ 'project_root': function('ale_linters#elm#ls#GetProjectRoot'),
\ 'language': 'elm',
\ 'initialization_options': function('elm_ls#GetOptions')
\})
4 changes: 2 additions & 2 deletions sources_non_forked/ale/ale_linters/eruby/erb.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ function! ale_linters#eruby#erb#GetCommand(buffer) abort

" Rails-flavored eRuby does not comply with the standard as understood by
" ERB, so we'll have to do some substitution. This does not reduce the
" effectiveness of the linter-the translated code is still evaluated.
return 'ruby -r erb -e ' . ale#Escape('puts ERB.new($stdin.read.gsub(%{<%=},%{<%}), nil, %{-}).src') . '< %t | ruby -c'
" effectiveness of the linterthe translated code is still evaluated.
return 'ruby -r erb -e ' . ale#Escape('puts ERB.new($stdin.read.gsub(%{<%=},%{<%}), trim_mode: %{-}).src') . '< %t | ruby -c'
endfunction

call ale#linter#Define('eruby', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ endfunction

call ale#linter#Define('fortran', {
\ 'name': 'language_server',
\ 'aliases': ['fortls'],
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'fortran_language_server_executable')},
\ 'command': '%e',
Expand Down
17 changes: 6 additions & 11 deletions sources_non_forked/ale/ale_linters/go/gobuild.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
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#go#EnvString(a:buffer)
\ . ale#Var(a:buffer, 'go_go_executable') . ' test'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' -c -o /dev/null ./'
endfunction

function! ale_linters#go#gobuild#GetMatches(lines) abort
" Matches patterns like the following:
"
Expand Down Expand Up @@ -50,7 +40,12 @@ call ale#linter#Define('go', {
\ 'aliases': ['go build'],
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#go#gobuild#GetCommand'),
\ 'command': {b ->
\ ale#go#EnvString(b)
\ . ale#Escape(ale#Var(b, 'go_go_executable')) . ' test'
\ . ale#Pad(ale#Var(b, 'go_gobuild_options'))
\ . ' -c -o /dev/null ./'
\ },
\ 'output_stream': 'stderr',
\ 'callback': 'ale_linters#go#gobuild#Handler',
\ 'lint_file': 1,
Expand Down
21 changes: 7 additions & 14 deletions sources_non_forked/ale/ale_linters/go/govet.vim
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
" Author: neersighted <bjorn@neersighted.com>
" Author: neersighted <bjorn@neersighted.com>, John Eikenberry <jae@zhar.net>
" Description: go vet for Go files
"
" Author: John Eikenberry <jae@zhar.net>
" 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#go#EnvString(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': {b -> ale#Var(b, 'go_go_executable')},
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#go#govet#GetCommand'),
\ 'command': {b ->
\ ale#go#EnvString(b)
\ . '%e vet'
\ . ale#Pad(ale#Var(b, 'go_govet_options'))
\ . ' .'
\ },
\ 'callback': 'ale#handlers#go#Handler',
\ 'lint_file': 1,
\})
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer, version) a
return '%e --format=json --filename %s'
endif

if ale#semver#GTE(a:version, [1, 6, 0])
" Reading from stdin was introduced in ember-template-lint@1.6.0
return '%e --json --filename %s'
endif

return '%e --json %t'
return '%e --json --filename %s'
endfunction

function! ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck(buffer) abort
Expand Down
5 changes: 3 additions & 2 deletions sources_non_forked/ale/ale_linters/haskell/hls.vim
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ function! ale_linters#haskell#hls#FindRootFile(buffer) abort

for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
for l:root_file in l:serach_root_files
if filereadable(l:path . l:root_file)
return l:path
if filereadable(l:path . '/' . l:root_file)
" Add on / so fnamemodify(..., ':h') below keeps the path.
return l:path . '/'
endif
endfor
endfor
Expand Down
2 changes: 1 addition & 1 deletion sources_non_forked/ale/ale_linters/html/angular.vim
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ endfunction

call ale#linter#Define('html', {
\ 'name': 'angular',
\ 'aliases': ['angular-language-server'],
\ 'aliases': ['angular-language-server', 'angularls'],
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#html#angular#GetExecutable'),
\ 'command': function('ale_linters#html#angular#GetCommand'),
Expand Down
1 change: 1 addition & 0 deletions sources_non_forked/ale/ale_linters/java/javalsp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ endfunction

call ale#linter#Define('java', {
\ 'name': 'javalsp',
\ 'aliases': ['java_language_server'],
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#java#javalsp#Executable'),
\ 'command': function('ale_linters#java#javalsp#Command'),
Expand Down
3 changes: 2 additions & 1 deletion sources_non_forked/ale/ale_linters/javascript/flow_ls.vim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ function! ale_linters#javascript#flow_ls#FindProjectRoot(buffer) abort
endfunction

call ale#linter#Define('javascript', {
\ 'name': 'flow-language-server',
\ 'name': 'flow_ls',
\ 'aliaes': ['flow-language-server'],
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#path#FindExecutable(b, 'javascript_flow_ls', [
\ 'node_modules/.bin/flow',
Expand Down
18 changes: 17 additions & 1 deletion sources_non_forked/ale/ale_linters/json/vscodejson.vim
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
" Author: Dalius Dobravolskas <dalius.dobravolskas@gmail.com>
" Description: VSCode json language server

call ale#Set('json_vscodejson_executable', '<auto>')

function! ale_linters#json#vscodejson#GetExecutable(buffer) abort
let l:executable = ale#Var(a:buffer, 'json_vscodejson_executable')

if l:executable is# '<auto>'
if ale#engine#IsExecutable(a:buffer, 'vscode-json-languageserver')
let l:executable = 'vscode-json-languageserver'
else
let l:executable = 'vscode-json-language-server'
endif
endif

return l:executable
endfunction

function! ale_linters#json#vscodejson#GetProjectRoot(buffer) abort
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')

Expand All @@ -10,7 +26,7 @@ endfunction
call ale#linter#Define('json', {
\ 'name': 'vscodejson',
\ 'lsp': 'stdio',
\ 'executable': 'vscode-json-language-server',
\ 'executable': function('ale_linters#json#vscodejson#GetExecutable'),
\ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#json#vscodejson#GetProjectRoot'),
\})
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ endfunction

call ale#linter#Define('julia', {
\ 'name': 'languageserver',
\ 'aliases': ['julials'],
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'julia_executable')},
\ 'command': function('ale_linters#julia#languageserver#GetCommand'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ endfunction

call ale#linter#Define('kotlin', {
\ 'name': 'languageserver',
\ 'aliaes': ['kotlin_language_server'],
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'kotlin_languageserver_executable')},
\ 'command': '%e',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ call ale#Set('lua_language_server_config', {})

call ale#linter#Define('lua', {
\ 'name': 'lua_language_server',
\ 'aliases': ['lua-language-server'],
\ 'aliases': ['lua-language-server', 'lua_ls'],
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'lua_language_server_executable')},
\ 'command': '%e',
Expand Down
Loading

0 comments on commit f676f79

Please sign in to comment.