All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 " Author: harttle <yangjvn@126.com>
2 " Description: fecs http://fecs.baidu.com/
4 call ale#Set('javascript_fecs_executable', 'fecs')
5 call ale#Set('javascript_fecs_use_global', get(g:, 'ale_use_global_executables', 0))
7 function! ale#handlers#fecs#GetCommand(buffer) abort
8 return '%e check --colors=false --rule=true %t'
11 function! ale#handlers#fecs#GetExecutable(buffer) abort
12 return ale#path#FindExecutable(a:buffer, 'javascript_fecs', [
13 \ 'node_modules/.bin/fecs',
14 \ 'node_modules/fecs/bin/fecs',
18 function! ale#handlers#fecs#Handle(buffer, lines) abort
19 " Matches patterns looking like the following
21 " fecs WARN → line 20, col 25: Unexpected console statement. (no-console)
22 " fecs ERROR → line 24, col 36: Missing radix parameter. (radix)
24 let l:pattern = '\v^.*(WARN|ERROR)\s+→\s+line (\d+),\s+col\s+(\d+):\s+(.*)$'
27 for l:match in ale#util#GetMatches(a:lines, l:pattern)
29 \ 'lnum': l:match[2] + 0,
30 \ 'col': l:match[3] + 0,
34 let l:code_match = matchlist(l:match[4], '\v^(.{-})\s*\((.+)\)$')
36 if !empty(l:code_match)
37 let l:obj.code = l:code_match[2]
38 let l:obj.text = l:code_match[1]
41 if l:match[1] is# 'WARN'
43 elseif l:match[1] is# 'ERROR'
47 call add(l:output, l:obj)