install.fairie/dotfiles/.vim/plugged/ale/ale_linters/qml/qmllint.vim
Git E2E Dev Test Username e149692cc9 git subrepo clone https://github.com/dense-analysis/ale.git ./dotfiles/.vim/plugged/ale
subrepo:
  subdir:   "dotfiles/.vim/plugged/ale"
  merged:   "e4b205440"
upstream:
  origin:   "https://github.com/dense-analysis/ale.git"
  branch:   "master"
  commit:   "e4b205440"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:37:09 -04:00

29 lines
794 B
VimL

" Author: pylipp (www.github.com/pylipp)
" Description: qmllint for QML files
" Find lines like
" /home/foo_user42/code-base/qml/Screen.qml:11 : Expected token `}'
function! ale_linters#qml#qmllint#Handle(buffer, lines) abort
let l:pattern = '\v^[/_-a-zA-z0-9\. ]+:(\d+) : (.*)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:item = {
\ 'lnum': l:match[1] + 0,
\ 'col': 0,
\ 'text': l:match[2],
\ 'type': 'E',
\}
call add(l:output, l:item)
endfor
return l:output
endfunction
call ale#linter#Define('qml', {
\ 'name': 'qmllint',
\ 'output_stream': 'stderr',
\ 'executable': 'qmllint',
\ 'command': 'qmllint %t',
\ 'callback': 'ale_linters#qml#qmllint#Handle',
\})