summaryrefslogtreecommitdiff
path: root/ale_linters/puppet
diff options
context:
space:
mode:
authorMark Egan-Fuller <mark.eganfuller@bytemark.co.uk>2020-07-03 13:53:24 +0100
committerMark Egan-Fuller <mark.eganfuller@bytemark.co.uk>2020-07-15 12:10:34 +0100
commitd38b92c957f42a789b100f5d7ac0be4c787a91bd (patch)
tree10e1f39448faccf98575ffd0dd5ea2b03170cd1d /ale_linters/puppet
parent26571fa050d9322fbb5b220ceb0f3f975304c60d (diff)
downloadale-d38b92c957f42a789b100f5d7ac0be4c787a91bd.zip
Handling for puppet parser error at end of input.
Add handling for `Syntax error at end of input` which doesn't give a line or column. Fixes #2656
Diffstat (limited to 'ale_linters/puppet')
-rw-r--r--ale_linters/puppet/puppet.vim7
1 files changed, 4 insertions, 3 deletions
diff --git a/ale_linters/puppet/puppet.vim b/ale_linters/puppet/puppet.vim
index b4afe9ac..59228dc8 100644
--- a/ale_linters/puppet/puppet.vim
+++ b/ale_linters/puppet/puppet.vim
@@ -9,13 +9,14 @@ function! ale_linters#puppet#puppet#Handle(buffer, lines) abort
" Error: Could not parse for environment production: Syntax error at '='; expected '}' at /root/puppetcode/modules/pancakes/manifests/init.pp:5"
" Error: Could not parse for environment production: Syntax error at 'parameter1' (file: /tmp/modules/mariadb/manifests/slave.pp, line: 4, column: 5)
" Error: Illegal attempt to assign to 'a Name'. Not an assignable reference (file: /tmp/modules/waffles/manifests/syrup.pp, line: 5, column: 11)
- let l:pattern = '^Error:\%(.*:\)\? \(.\+\) \((file:\|at\) .\+\.pp\(, line: \|:\)\(\d\+\)\(, column: \|:\)\=\(\d*\)'
+ " Error: Could not parse for environment production: Syntax error at end of input (file: /tmp/modules/bob/manifests/init.pp)
+ let l:pattern = '^Error:\%(.*:\)\? \(.\+\) \((file:\|at\) .\+\.pp\(\(, line: \|:\)\(\d\+\)\(, column: \|:\)\=\(\d*\)\|)$\)'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
- \ 'lnum': l:match[4] + 0,
- \ 'col': l:match[6] + 0,
+ \ 'lnum': l:match[5] + 0,
+ \ 'col': l:match[7] + 0,
\ 'text': l:match[1],
\})
endfor