Skip to content

Commit fae0b73

Browse files
committed
Updated plugins
1 parent 5a2572d commit fae0b73

File tree

154 files changed

+3506
-1354
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+3506
-1354
lines changed

sources_non_forked/ale/ale_linters/c/clang.vim

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ call ale#linter#Define('c', {
1919
\ 'name': 'clang',
2020
\ 'output_stream': 'stderr',
2121
\ 'executable': {b -> ale#Var(b, 'c_clang_executable')},
22-
\ 'command_chain': [
23-
\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
24-
\ {'callback': 'ale_linters#c#clang#GetCommand'}
25-
\ ],
22+
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#c#clang#GetCommand'))},
2623
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
2724
\})

sources_non_forked/ale/ale_linters/c/gcc.vim

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ call ale#linter#Define('c', {
1919
\ 'name': 'gcc',
2020
\ 'output_stream': 'stderr',
2121
\ 'executable': {b -> ale#Var(b, 'c_gcc_executable')},
22-
\ 'command_chain': [
23-
\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
24-
\ {'callback': 'ale_linters#c#gcc#GetCommand'}
25-
\ ],
22+
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#c#gcc#GetCommand'))},
2623
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
2724
\})
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
" Author: Raphael Hoegger - https://github.com/pfuender
2+
" Description: Cookstyle (RuboCop based), a code style analyzer for Ruby files
3+
4+
call ale#Set('chef_cookstyle_executable', 'cookstyle')
5+
call ale#Set('chef_cookstyle_options', '')
6+
7+
function! ale_linters#chef#cookstyle#GetCommand(buffer) abort
8+
let l:options = ale#Var(a:buffer, 'chef_cookstyle_options')
9+
10+
return '%e' . ale#Pad(escape(l:options, '~')) . ' --force-exclusion --format json --stdin ' . ' %s'
11+
endfunction
12+
13+
function! ale_linters#chef#cookstyle#Handle(buffer, lines) abort
14+
if len(a:lines) == 0
15+
return []
16+
endif
17+
18+
let l:errors = ale#util#FuzzyJSONDecode(a:lines[0], {})
19+
20+
if !has_key(l:errors, 'summary')
21+
\|| l:errors['summary']['offense_count'] == 0
22+
\|| empty(l:errors['files'])
23+
return []
24+
endif
25+
26+
let l:output = []
27+
28+
for l:error in l:errors['files'][0]['offenses']
29+
let l:start_col = str2nr(l:error['location']['start_column'])
30+
let l:end_col = str2nr(l:error['location']['last_column'])
31+
32+
if !l:end_col
33+
let l:end_col = l:start_col + 1
34+
endif
35+
36+
call add(l:output, {
37+
\ 'lnum': str2nr(l:error['location']['line']),
38+
\ 'col': l:start_col,
39+
\ 'end_col': l:end_col,
40+
\ 'code': l:error['cop_name'],
41+
\ 'text': l:error['message'],
42+
\ 'type': l:error['severity'] is? 'convention' ? 'W' : 'E',
43+
\})
44+
endfor
45+
46+
return l:output
47+
endfunction
48+
49+
call ale#linter#Define('chef', {
50+
\ 'name': 'cookstyle',
51+
\ 'executable': {b -> ale#Var(b, 'chef_cookstyle_executable')},
52+
\ 'command': function('ale_linters#chef#cookstyle#GetCommand'),
53+
\ 'callback': 'ale_linters#chef#cookstyle#Handle',
54+
\})
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
" Author: Masashi Iizuka <liquidz.uo@gmail.com>
2+
" Description: linter for clojure using clj-kondo https://github.com/borkdude/clj-kondo
3+
4+
function! ale_linters#clojure#clj_kondo#HandleCljKondoFormat(buffer, lines) abort
5+
" output format
6+
" <filename>:<line>:<column>: <issue type>: <message>
7+
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+):? ((Exception|error|warning): ?(.+))$'
8+
let l:output = []
9+
10+
for l:match in ale#util#GetMatches(a:lines, l:pattern)
11+
let l:type = 'E'
12+
13+
if l:match[4] is? 'warning'
14+
let l:type = 'W'
15+
endif
16+
17+
call add(l:output, {
18+
\ 'lnum': l:match[1] + 0,
19+
\ 'col': l:match[2] + 0,
20+
\ 'text': l:match[3],
21+
\ 'type': l:type,
22+
\})
23+
endfor
24+
25+
return l:output
26+
endfunction
27+
28+
call ale#linter#Define('clojure', {
29+
\ 'name': 'clj-kondo',
30+
\ 'output_stream': 'stdout',
31+
\ 'executable': 'clj-kondo',
32+
\ 'command': 'clj-kondo --lint %t',
33+
\ 'callback': 'ale_linters#clojure#clj_kondo#HandleCljKondoFormat',
34+
\})

sources_non_forked/ale/ale_linters/cpp/clang.vim

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ call ale#linter#Define('cpp', {
1919
\ 'name': 'clang',
2020
\ 'output_stream': 'stderr',
2121
\ 'executable': {b -> ale#Var(b, 'cpp_clang_executable')},
22-
\ 'command_chain': [
23-
\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
24-
\ {'callback': 'ale_linters#cpp#clang#GetCommand'},
25-
\ ],
22+
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#cpp#clang#GetCommand'))},
2623
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
2724
\})

sources_non_forked/ale/ale_linters/cpp/gcc.vim

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ call ale#linter#Define('cpp', {
2020
\ 'aliases': ['g++'],
2121
\ 'output_stream': 'stderr',
2222
\ 'executable': {b -> ale#Var(b, 'cpp_gcc_executable')},
23-
\ 'command_chain': [
24-
\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
25-
\ {'callback': 'ale_linters#cpp#gcc#GetCommand'},
26-
\ ],
23+
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#cpp#gcc#GetCommand'))},
2724
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
2825
\})
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
" Author: harttle <yangjvn@126.com>
2+
" Description: fecs for CSS files
3+
4+
call ale#linter#Define('css', {
5+
\ 'name': 'fecs',
6+
\ 'executable': function('ale#handlers#fecs#GetExecutable'),
7+
\ 'command': function('ale#handlers#fecs#GetCommand'),
8+
\ 'callback': 'ale#handlers#fecs#Handle',
9+
\})

sources_non_forked/ale/ale_linters/d/dmd.vim

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Author: w0rp <devw0rp@gmail.com>
22
" Description: "dmd for D files"
33

4-
function! ale_linters#d#dmd#DUBCommand(buffer) abort
4+
function! ale_linters#d#dmd#GetDUBCommand(buffer) abort
55
" If we can't run dub, then skip this command.
66
if !executable('dub')
77
" Returning an empty string skips to the DMD command.
@@ -21,7 +21,18 @@ function! ale_linters#d#dmd#DUBCommand(buffer) abort
2121
\ . ' && dub describe --import-paths'
2222
endfunction
2323

24-
function! ale_linters#d#dmd#DMDCommand(buffer, dub_output) abort
24+
function! ale_linters#d#dmd#RunDUBCommand(buffer) abort
25+
let l:command = ale_linters#d#dmd#GetDUBCommand(a:buffer)
26+
27+
if empty(l:command)
28+
" If we can't run DUB, just run DMD.
29+
return ale_linters#d#dmd#DMDCommand(a:buffer, [], {})
30+
endif
31+
32+
return ale#command#Run(a:buffer, l:command, function('ale_linters#d#dmd#DMDCommand'))
33+
endfunction
34+
35+
function! ale_linters#d#dmd#DMDCommand(buffer, dub_output, meta) abort
2536
let l:import_list = []
2637

2738
" Build a list of import paths generated from DUB, if available.
@@ -57,9 +68,7 @@ endfunction
5768
call ale#linter#Define('d', {
5869
\ 'name': 'dmd',
5970
\ 'executable': 'dmd',
60-
\ 'command_chain': [
61-
\ {'callback': 'ale_linters#d#dmd#DUBCommand', 'output_stream': 'stdout'},
62-
\ {'callback': 'ale_linters#d#dmd#DMDCommand', 'output_stream': 'stderr'},
63-
\ ],
71+
\ 'command': function('ale_linters#d#dmd#RunDUBCommand'),
6472
\ 'callback': 'ale_linters#d#dmd#Handle',
73+
\ 'output_stream': 'stderr',
6574
\})

sources_non_forked/ale/ale_linters/elixir/elixir_ls.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ call ale#Set('elixir_elixir_ls_config', {})
66

77
function! ale_linters#elixir#elixir_ls#GetExecutable(buffer) abort
88
let l:dir = ale#path#Simplify(ale#Var(a:buffer, 'elixir_elixir_ls_release'))
9-
let l:cmd = ale#Has('win32') ? '\language_server.bat' : '/language_server.sh'
9+
let l:cmd = has('win32') ? '\language_server.bat' : '/language_server.sh'
1010

1111
return l:dir . l:cmd
1212
endfunction

sources_non_forked/ale/ale_linters/erlang/syntaxerl.vim

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,17 @@
33

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

6-
function! ale_linters#erlang#syntaxerl#GetCommand(buffer, output) abort
6+
function! ale_linters#erlang#syntaxerl#RunHelpCommand(buffer) abort
7+
let l:executable = ale#Var(a:buffer, 'erlang_syntaxerl_executable')
8+
9+
return ale#command#Run(
10+
\ a:buffer,
11+
\ ale#Escape(l:executable) . ' -h',
12+
\ function('ale_linters#erlang#syntaxerl#GetCommand'),
13+
\)
14+
endfunction
15+
16+
function! ale_linters#erlang#syntaxerl#GetCommand(buffer, output, meta) abort
717
let l:use_b_option = match(a:output, '\C\V-b, --base\>') > -1
818

919
return '%e' . (l:use_b_option ? ' -b %s %t' : ' %t')
@@ -27,9 +37,6 @@ endfunction
2737
call ale#linter#Define('erlang', {
2838
\ 'name': 'syntaxerl',
2939
\ 'executable': {b -> ale#Var(b, 'erlang_syntaxerl_executable')},
30-
\ 'command_chain': [
31-
\ {'callback': {-> '%e -h'}},
32-
\ {'callback': 'ale_linters#erlang#syntaxerl#GetCommand'},
33-
\ ],
40+
\ 'command': {b -> ale_linters#erlang#syntaxerl#RunHelpCommand(b)},
3441
\ 'callback': 'ale_linters#erlang#syntaxerl#Handle',
3542
\})

0 commit comments

Comments
 (0)