Skip to content

Commit 6f6c156

Browse files
committed
Fix Pug linting
1 parent 62a45f8 commit 6f6c156

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

autoload/ale/handlers.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function! s:HandleUnixFormat(buffer, lines, type) abort
1212
" file.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args
1313
" file.go:53:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
1414
" file.go:5:2: expected declaration, found 'STRING' "log"
15-
let l:pattern = '^' . s:path_pattern . ':\(\d\+\):\?\(\d\+\)\?: \(.\+\)$'
15+
let l:pattern = '^' . s:path_pattern . ':\(\d\+\):\?\(\d\+\)\?:\? \(.\+\)$'
1616
let l:output = []
1717

1818
for l:line in a:lines

test/test_common_handlers.vader

+10
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ Execute (Run HandleUnixFormatAsError):
8686
let g:loclist = ale#handlers#HandleUnixFormatAsError(42, [
8787
\ 'file.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args',
8888
\ 'file.go:53:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)',
89+
\ 'test.pug:1:1 ".b" is not a valid class name. Class names must begin with "-", "_" or a letter and can only contain "_", "-", a-z and 0-9.',
8990
\])
9091

9192
Then (The loclist should be correct):
@@ -108,6 +109,15 @@ Then (The loclist should be correct):
108109
\ 'type': 'E',
109110
\ 'text': 'if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)',
110111
\ },
112+
\ {
113+
\ 'bufnr': 42,
114+
\ 'vcol': 0,
115+
\ 'nr': -1,
116+
\ 'lnum': 1,
117+
\ 'col': 1,
118+
\ 'type': 'E',
119+
\ 'text': '".b" is not a valid class name. Class names must begin with "-", "_" or a letter and can only contain "_", "-", a-z and 0-9.',
120+
\ },
111121
\], g:loclist
112122

113123
Execute (Run HandleUnixFormatAsWarning):

0 commit comments

Comments
 (0)