mirror of
https://github.com/dense-analysis/ale
synced 2025-03-06 21:29:25 +00:00
Parse clj-kondo lines that don't include row/col (#3946)
Some custom linter hooks don't include these numbers.
This commit is contained in:
parent
cb0f0e1d0b
commit
9b5a3581eb
@ -16,7 +16,7 @@ endfunction
|
||||
function! ale_linters#clojure#clj_kondo#HandleCljKondoFormat(buffer, lines) abort
|
||||
" output format
|
||||
" <filename>:<line>:<column>: <issue type>: <message>
|
||||
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+):? ((Exception|error|warning): ?(.+))$'
|
||||
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+)?:(\d+)?:? ((Exception|error|warning): ?(.+))$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
|
@ -73,3 +73,17 @@ Execute(the clojure clj-kondo handler should be able to handle windows files):
|
||||
\ ale_linters#clojure#clj_kondo#HandleCljKondoFormat(0, [
|
||||
\ 'C:\my\operating\system\is\silly\core.clj:123:44: error: Unexpected )',
|
||||
\ ])
|
||||
|
||||
Execute(the clojure clj-kondo handler should be able to lines without row/col):
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'lnum': 0,
|
||||
\ 'col': 0,
|
||||
\ 'type': 'E',
|
||||
\ 'text': 'error: Unexpected )',
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#clojure#clj_kondo#HandleCljKondoFormat(0, [
|
||||
\ 'test.clj::: error: Unexpected )',
|
||||
\ ])
|
||||
|
Loading…
Reference in New Issue
Block a user