Skip to content

Commit

Permalink
Updated plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
amix committed Oct 6, 2024
1 parent ee7e062 commit 46294d5
Show file tree
Hide file tree
Showing 202 changed files with 306,918 additions and 203,617 deletions.
11 changes: 11 additions & 0 deletions sources_non_forked/ale/ale_linters/astro/eslint.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
" Author: Hyuksang Kwon <gwonhyuksang@gmail.com>
" Description: eslint for astro files

call ale#linter#Define('astro', {
\ 'name': 'eslint',
\ 'output_stream': 'both',
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
\ 'cwd': function('ale#handlers#eslint#GetCwd'),
\ 'command': function('ale#handlers#eslint#GetCommand'),
\ 'callback': 'ale#handlers#eslint#HandleJSON',
\})
2 changes: 1 addition & 1 deletion sources_non_forked/ale/ale_linters/cmake/cmake_lint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function! ale_linters#cmake#cmake_lint#Command(buffer) abort
let l:executable = ale_linters#cmake#cmake_lint#Executable(a:buffer)
let l:options = ale#Var(a:buffer, 'cmake_cmake_lint_options')

return ale#Escape(l:executable) . ' ' . l:options . ' %t'
return ale#Escape(l:executable) . ' ' . l:options . ' %s'
endfunction

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

call ale#linter#Define('css', {
\ 'name': 'stylelint',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#path#FindExecutable(b, 'css_stylelint', [
\ 'node_modules/.bin/stylelint',
\ ])},
Expand Down
12 changes: 10 additions & 2 deletions sources_non_forked/ale/ale_linters/dart/analysis_server.vim
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
" Author: Nelson Yeung <nelsyeung@gmail.com>
" Description: Check Dart files with dart analysis server LSP

call ale#Set('dart_analysis_server_enable_language_server', 1)
call ale#Set('dart_analysis_server_executable', 'dart')

function! ale_linters#dart#analysis_server#GetProjectRoot(buffer) abort
Expand All @@ -12,12 +13,19 @@ function! ale_linters#dart#analysis_server#GetProjectRoot(buffer) abort
endfunction

function! ale_linters#dart#analysis_server#GetCommand(buffer) abort
let l:language_server = ale#Var(a:buffer, 'dart_analysis_server_enable_language_server')
let l:executable = ale#Var(a:buffer, 'dart_analysis_server_executable')
let l:dart = resolve(exepath(l:executable))

return '%e '
let l:output = '%e '
\ . fnamemodify(l:dart, ':h') . '/snapshots/analysis_server.dart.snapshot'
\ . ' --lsp'

" Enable new language-server command
if l:language_server == 1
let l:output = '%e language-server --protocol=lsp'
endif

return l:output
endfunction

call ale#linter#Define('dart', {
Expand Down
4 changes: 2 additions & 2 deletions sources_non_forked/ale/ale_linters/elm/ls.vim
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function! ale_linters#elm#ls#GetProjectRoot(buffer) abort
return !empty(l:elm_json) ? fnamemodify(l:elm_json, ':p:h') : ''
endfunction

function! ale_linters#elm#ls#GetOptions(buffer) abort
function! ale_linters#elm#ls#GetInitializationOptions(buffer) abort
return {
\ 'elmPath': ale#Var(a:buffer, 'elm_ls_elm_path'),
\ 'elmFormatPath': ale#Var(a:buffer, 'elm_ls_elm_format_path'),
Expand All @@ -37,5 +37,5 @@ call ale#linter#Define('elm', {
\ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#elm#ls#GetProjectRoot'),
\ 'language': 'elm',
\ 'initialization_options': function('elm_ls#GetOptions')
\ 'initialization_options': function('ale_linters#elm#ls#GetInitializationOptions')
\})
23 changes: 21 additions & 2 deletions sources_non_forked/ale/ale_linters/erlang/elvis.vim
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,34 @@ function! s:AbbreviateMessage(text) abort
endfunction

function! s:GetCommand(buffer) abort
let l:file = ale#Escape(expand('#' . a:buffer . ':.'))
let l:cwd = s:GetCwd(a:buffer)

return '%e rock --output-format=parsable ' . l:file
let l:file = !empty(l:cwd)
\ ? expand('#' . a:buffer . ':p')[len(l:cwd) + 1:]
\ : expand('#' . a:buffer . ':.')

return '%e rock --output-format=parsable ' . ale#Escape(l:file)
endfunction

function! s:GetCwd(buffer) abort
let l:markers = ['elvis.config', 'rebar.lock', 'erlang.mk']

for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
for l:marker in l:markers
if filereadable(l:path . '/' . l:marker)
return l:path
endif
endfor
endfor

return ''
endfunction

call ale#linter#Define('erlang', {
\ 'name': 'elvis',
\ 'callback': 'ale_linters#erlang#elvis#Handle',
\ 'executable': {b -> ale#Var(b, 'erlang_elvis_executable')},
\ 'command': function('s:GetCommand'),
\ 'cwd': function('s:GetCwd'),
\ 'lint_file': 1,
\})
9 changes: 8 additions & 1 deletion sources_non_forked/ale/ale_linters/erlang/erlang_ls.vim
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ function! s:GetCommand(buffer) abort
endfunction

function! s:FindProjectRoot(buffer) abort
let l:markers = ['_build/', 'erlang_ls.config', 'rebar.lock']
let l:markers = [
\ '_checkouts/',
\ '_build/',
\ 'deps/',
\ 'erlang_ls.config',
\ 'rebar.lock',
\ 'erlang.mk',
\]

" This is a way to find Erlang/OTP root (the one that is managed
" by kerl or asdf). Useful if :ALEGoToDefinition takes us there.
Expand Down
40 changes: 21 additions & 19 deletions sources_non_forked/ale/ale_linters/erlang/syntaxerl.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,13 @@

call ale#Set('erlang_syntaxerl_executable', 'syntaxerl')

function! ale_linters#erlang#syntaxerl#RunHelpCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'erlang_syntaxerl_executable')

return ale#command#Run(
\ a:buffer,
\ ale#Escape(l:executable) . ' -h',
\ function('ale_linters#erlang#syntaxerl#GetCommand'),
\)
endfunction

function! ale_linters#erlang#syntaxerl#GetCommand(buffer, output, meta) abort
let l:use_b_option = match(a:output, '\C\V-b, --base\>') > -1

return '%e' . (l:use_b_option ? ' -b %s %t' : ' %t')
endfunction

function! ale_linters#erlang#syntaxerl#Handle(buffer, lines) abort
let l:pattern = '\v\C:(\d+):( warning:)? (.+)'
let l:loclist = []

for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:loclist, {
\ 'lnum': l:match[1] + 0,
\ 'lnum': str2nr(l:match[1]),
\ 'text': l:match[3],
\ 'type': empty(l:match[2]) ? 'E' : 'W',
\})
Expand All @@ -34,9 +18,27 @@ function! ale_linters#erlang#syntaxerl#Handle(buffer, lines) abort
return l:loclist
endfunction

function! s:GetExecutable(buffer) abort
return ale#Var(a:buffer, 'erlang_syntaxerl_executable')
endfunction

function! s:GetCommand(buffer) abort
let l:Callback = function('s:GetCommandFromHelpOutput')

return ale#command#Run(a:buffer, '%e -h', l:Callback, {
\ 'executable': s:GetExecutable(a:buffer),
\})
endfunction

function! s:GetCommandFromHelpOutput(buffer, output, metadata) abort
let l:has_b_option = match(a:output, '\V\C-b, --base\>') > -1

return l:has_b_option ? '%e -b %s %t' : '%e %t'
endfunction

call ale#linter#Define('erlang', {
\ 'name': 'syntaxerl',
\ 'executable': {b -> ale#Var(b, 'erlang_syntaxerl_executable')},
\ 'command': {b -> ale_linters#erlang#syntaxerl#RunHelpCommand(b)},
\ 'callback': 'ale_linters#erlang#syntaxerl#Handle',
\ 'executable': function('s:GetExecutable'),
\ 'command': function('s:GetCommand'),
\})
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
" Author: Sam Saffron <sam.saffron@gmail.com>
" Description: Ember-template-lint for checking GJS (Glimmer JS) files

scriptencoding utf-8

call ale#handlers#embertemplatelint#DefineLinter('glimmer')
2 changes: 1 addition & 1 deletion sources_non_forked/ale/ale_linters/go/golangci_lint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

function! ale_linters#go#golangci_lint#GetCommand(buffer) abort
let l:filename = expand('#' . a:buffer . ':t')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,62 +1,6 @@
" Author: Adrian Zalewski <aazalewski@hotmail.com>
" Description: Ember-template-lint for checking Handlebars files

call ale#Set('handlebars_embertemplatelint_executable', 'ember-template-lint')
call ale#Set('handlebars_embertemplatelint_use_global', get(g:, 'ale_use_global_executables', 0))
scriptencoding utf-8

function! ale_linters#handlebars#embertemplatelint#GetExecutable(buffer) abort
return ale#path#FindExecutable(a:buffer, 'handlebars_embertemplatelint', [
\ 'node_modules/.bin/ember-template-lint',
\])
endfunction

function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer, version) abort
if ale#semver#GTE(a:version, [4, 0, 0])
" --json was removed in favor of --format=json in ember-template-lint@4.0.0
return '%e --format=json --filename %s'
endif

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

function! ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck(buffer) abort
return ale#semver#RunWithVersionCheck(
\ a:buffer,
\ ale_linters#handlebars#embertemplatelint#GetExecutable(a:buffer),
\ '%e --version',
\ function('ale_linters#handlebars#embertemplatelint#GetCommand'),
\)
endfunction

function! ale_linters#handlebars#embertemplatelint#Handle(buffer, lines) abort
let l:output = []
let l:json = ale#util#FuzzyJSONDecode(a:lines, {})

for l:error in get(values(l:json), 0, [])
if has_key(l:error, 'fatal')
call add(l:output, {
\ 'lnum': get(l:error, 'line', 1),
\ 'col': get(l:error, 'column', 1),
\ 'text': l:error.message,
\ 'type': l:error.severity == 1 ? 'W' : 'E',
\})
else
call add(l:output, {
\ 'lnum': l:error.line,
\ 'col': l:error.column,
\ 'text': l:error.rule . ': ' . l:error.message,
\ 'type': l:error.severity == 1 ? 'W' : 'E',
\})
endif
endfor

return l:output
endfunction

call ale#linter#Define('handlebars', {
\ 'name': 'embertemplatelint',
\ 'aliases': ['ember-template-lint'],
\ 'executable': function('ale_linters#handlebars#embertemplatelint#GetExecutable'),
\ 'command': function('ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck'),
\ 'callback': 'ale_linters#handlebars#embertemplatelint#Handle',
\})
call ale#handlers#embertemplatelint#DefineLinter('handlebars')
1 change: 1 addition & 0 deletions sources_non_forked/ale/ale_linters/html/stylelint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ endfunction

call ale#linter#Define('html', {
\ 'name': 'stylelint',
\ 'output_stream': 'both',
\ 'executable': function('ale_linters#html#stylelint#GetExecutable'),
\ 'command': function('ale_linters#html#stylelint#GetCommand'),
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
Expand Down
69 changes: 69 additions & 0 deletions sources_non_forked/ale/ale_linters/hurl/hurlfmt.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
" Description: Hurl linter using hurlfmt --check.
" https://hurl.dev/

call ale#Set('hurl_hurlfmt_executable', 'hurlfmt')

function! ale_linters#hurl#hurlfmt#GetCommand(buffer) abort
return '%e'
\ . ' --check --no-color '
endfunction

function! ale_linters#hurl#hurlfmt#HandleOutput(buffer, lines) abort
" Matches patterns:
"
" error: Parsing space
" --> test.hurl:11:48
" |
" 8 | header "Content-Type"= "application/json; charset=utf-8"
" | ^ expecting a space
" |
"
" error: Parsing URL
" --> test.hurl:11:48
" |
" 11 | PUT https://jsonplaceholder.typicode.com/posts/{post_id}}
" | ^ illegal character <{>
" |
"
" Note: hurlfmt seems to report always the first error only so we assume
" there is only one error to make parsing easier.
let l:output = []

if empty(a:lines)
return l:output
endif

let l:pattern = '\v(error|warning): (.+) --\> (.+):(\d+):(\d+) .+ \^ (.+) |'
let l:lines = join(a:lines, ' ')

for l:match in ale#util#GetMatches(l:lines, l:pattern)
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'lnum': match[4] + 0,
\ 'col': match[5] + 0,
\ 'end_col': match[5] + 0,
\ 'text': match[2] . ' : ' . match[6],
\ 'type': (match[1] is# 'error') ? 'E' : 'W'
\})
endfor

return l:output
endfunction

function! ale_linters#hurl#hurlfmt#GetType(severity) abort
if a:severity is? 'convention'
\|| a:severity is? 'warning'
\|| a:severity is? 'refactor'
return 'W'
endif

return 'E'
endfunction

call ale#linter#Define('hurl', {
\ 'name': 'hurlfmt',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'hurl_hurlfmt_executable')},
\ 'command': function('ale_linters#hurl#hurlfmt#GetCommand'),
\ 'callback': 'ale_linters#hurl#hurlfmt#HandleOutput',
\})
11 changes: 11 additions & 0 deletions sources_non_forked/ale/ale_linters/javascript/biome.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
" Author: Filip Gospodinov <f@gospodinov.ch>
" Description: biome for JavaScript files

call ale#linter#Define('javascript', {
\ 'name': 'biome',
\ 'lsp': 'stdio',
\ 'language': function('ale#handlers#biome#GetLanguage'),
\ 'executable': function('ale#handlers#biome#GetExecutable'),
\ 'command': '%e lsp-proxy',
\ 'project_root': function('ale#handlers#biome#GetProjectRoot'),
\})
10 changes: 10 additions & 0 deletions sources_non_forked/ale/ale_linters/json/biome.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
" Description: biome for json files

call ale#linter#Define('json', {
\ 'name': 'biome',
\ 'lsp': 'stdio',
\ 'language': function('ale#handlers#biome#GetLanguage'),
\ 'executable': function('ale#handlers#biome#GetExecutable'),
\ 'command': '%e lsp-proxy',
\ 'project_root': function('ale#handlers#biome#GetProjectRoot'),
\})
10 changes: 10 additions & 0 deletions sources_non_forked/ale/ale_linters/jsonc/biome.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
" Description: biome for jsonc files

call ale#linter#Define('jsonc', {
\ 'name': 'biome',
\ 'lsp': 'stdio',
\ 'language': function('ale#handlers#biome#GetLanguage'),
\ 'executable': function('ale#handlers#biome#GetExecutable'),
\ 'command': '%e lsp-proxy',
\ 'project_root': function('ale#handlers#biome#GetProjectRoot'),
\})
1 change: 1 addition & 0 deletions sources_non_forked/ale/ale_linters/less/stylelint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ endfunction

call ale#linter#Define('less', {
\ 'name': 'stylelint',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#path#FindExecutable(b, 'less_stylelint', [
\ 'node_modules/.bin/stylelint',
\ ])},
Expand Down
Loading

0 comments on commit 46294d5

Please sign in to comment.