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: Alexander Olofsson <alexander.olofsson@liu.se>
3 call ale#Set('puppet_puppet_executable', 'puppet')
4 call ale#Set('puppet_puppet_options', '')
6 function! ale_linters#puppet#puppet#Handle(buffer, lines) abort
7 " Matches patterns like the following:
8 " Error: Could not parse for environment production: Syntax error at ':' at /root/puppetcode/modules/nginx/manifests/init.pp:43:12
9 " Error: Could not parse for environment production: Syntax error at '='; expected '}' at /root/puppetcode/modules/pancakes/manifests/init.pp:5"
10 " Error: Could not parse for environment production: Syntax error at 'parameter1' (file: /tmp/modules/mariadb/manifests/slave.pp, line: 4, column: 5)
11 " Error: Illegal attempt to assign to 'a Name'. Not an assignable reference (file: /tmp/modules/waffles/manifests/syrup.pp, line: 5, column: 11)
12 " Error: Could not parse for environment production: Syntax error at end of input (file: /tmp/modules/bob/manifests/init.pp)
13 let l:pattern = '^Error:\%(.*:\)\? \(.\+\) \((file:\|at\) .\+\.pp\(\(, line: \|:\)\(\d\+\)\(, column: \|:\)\=\(\d*\)\|)$\)'
16 for l:match in ale#util#GetMatches(a:lines, l:pattern)
18 \ 'lnum': l:match[5] + 0,
19 \ 'col': l:match[7] + 0,
27 function! ale_linters#puppet#puppet#GetCommand(buffer) abort
28 return '%e parser validate --color=false '
29 \ . ale#Pad(ale#Var(a:buffer, 'puppet_puppet_options'))
33 call ale#linter#Define('puppet', {
35 \ 'executable': {b -> ale#Var(b, 'puppet_puppet_executable')},
36 \ 'output_stream': 'stderr',
37 \ 'command': function('ale_linters#puppet#puppet#GetCommand'),
38 \ 'callback': 'ale_linters#puppet#puppet#Handle',