Skip to content

Having trouble defining custom linter #4378

Discussion options

You must be logged in to vote

Thanks for the help @hsanson that did it! For anyone else that finds this, here's the linter I used

function! ale_linters#vhdl#vsg_ale#GetCommand(buffer)
    return "vsg --config ./vsg_config.yaml -of syntastic -f " . expand('%p')
endfunction

function! ale_linters#vhdl#vsg_ale#Handle(buffer, lines)
    let l:pattern = '^\(\w\{-}\):\s\+\(.*\)(\(\d\+\))\(\w\+\)\s\+--\s\+\(.*\)$'
    let l:output = []

    for l:match in ale#util#GetMatches(a:lines, l:pattern)
        call add(l:output, {
        \   'lnum': l:match[3],
        \   'col': 0,
        \   'text': l:match[2] . ": " . l:match[4] . " - Solution: " . l:match[5],
        \})
    endfor
    return l:output
endfunction

call ale#lin…

Replies: 6 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@hsanson
Comment options

Comment options

You must be logged in to vote
1 reply
@cassepipe
Comment options

Answer selected by SethGower
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants