From 037c04f8aaefd46f00332d8f5eef4309c6c2c164 Mon Sep 17 00:00:00 2001 From: Vivian De Smedt Date: Fri, 7 Mar 2025 17:05:09 +0100 Subject: [PATCH] Format djlint.vim according to formatting rules. --- ale_linters/html/djlint.vim | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/ale_linters/html/djlint.vim b/ale_linters/html/djlint.vim index 9e12fa02a9..c9cbbd2bb2 100644 --- a/ale_linters/html/djlint.vim +++ b/ale_linters/html/djlint.vim @@ -14,33 +14,35 @@ function! ale_linters#html#djlint#GetCommand(buffer) abort let l:options = ale#Var(a:buffer, 'html_djlint_options') return ale#Escape(l:executable) - \ . (!empty(l:options) ? ' ' . l:options : '') . ' %s' + \ . (!empty(l:options) ? ' ' . l:options : '') . ' %s' endfunction -function! ale_linters#html#djlint#Handle(buffer, lines) +function! ale_linters#html#djlint#Handle(buffer, lines) abort let l:output = [] let l:pattern = '\v^([A-Z]\d+) (\d+):(\d+) (.*)$' let l:i = 0 + for l:match in ale#util#GetMatches(a:lines, l:pattern) let l:i += 1 let l:item = { - \ 'lnum': l:match[2] + 0, - \ 'col': l:match[3] + 0, - \ 'vcol': 1, - \ 'text': l:match[4], - \ 'code': l:match[1], - \ 'type': 'W', - \} + \ 'lnum': l:match[2] + 0, + \ 'col': l:match[3] + 0, + \ 'vcol': 1, + \ 'text': l:match[4], + \ 'code': l:match[1], + \ 'type': 'W', + \} call add(l:output, l:item) endfor + return l:output endfunction call ale#linter#Define('html', { - \ 'name': 'djlint', - \ 'executable': function('ale_linters#html#djlint#GetExecutable'), - \ 'command': function('ale_linters#html#djlint#GetCommand'), - \ 'callback': 'ale_linters#html#djlint#Handle', - \}) +\ 'name': 'djlint', +\ 'executable': function('ale_linters#html#djlint#GetExecutable'), +\ 'command': function('ale_linters#html#djlint#GetCommand'), +\ 'callback': 'ale_linters#html#djlint#Handle', +\}) " vim:ts=4:sw=4:et: