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: w0rp - <devw0rp@gmail.com>
2 " Description: pug-lint for checking Pug/Jade files.
4 call ale#Set('pug_puglint_options', '')
5 call ale#Set('pug_puglint_executable', 'pug-lint')
6 call ale#Set('pug_puglint_use_global', get(g:, 'ale_use_global_executables', 0))
8 function! s:FindConfig(buffer) abort
15 let l:config = ale#path#FindNearestFile(a:buffer, l:filename)
25 function! ale_linters#pug#puglint#GetCommand(buffer) abort
26 let l:options = ale#Var(a:buffer, 'pug_puglint_options')
27 let l:config = s:FindConfig(a:buffer)
29 return '%e' . ale#Pad(l:options)
30 \ . (!empty(l:config) ? ' -c ' . ale#Escape(l:config) : '')
34 function! ale_linters#pug#puglint#Handle(buffer, lines) abort
35 for l:line in a:lines[:10]
36 if l:line =~# '^SyntaxError: '
39 \ 'text': 'puglint configuration error (type :ALEDetail for more information)',
40 \ 'detail': join(a:lines, "\n"),
45 return ale#handlers#unix#HandleAsError(a:buffer, a:lines)
48 call ale#linter#Define('pug', {
50 \ 'executable': {b -> ale#path#FindExecutable(b, 'pug_puglint', [
51 \ 'node_modules/.bin/pug-lint',
53 \ 'output_stream': 'stderr',
54 \ 'command': function('ale_linters#pug#puglint#GetCommand'),
55 \ 'callback': 'ale_linters#pug#puglint#Handle',