Created
May 1, 2016 14:09
-
-
Save mnowotnik/0cf72d689740828b1eb395e7c63dafa1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" based on : https://gist.github.com/kennyp/1069647 | |
" assumes compile_commands.json is in the current working directory | |
function! s:Oclint () | |
cclose | |
let out = system('oclint -p . '.expand("%")) | |
let errors = split(out, '\n') | |
let errors = map(errors,'split(v:val,":")') | |
let errors = filter(errors,'len(v:val) == 4') | |
let error_list = [] | |
for e_list in errors | |
let error_list += [{'filename': e_list[0], 'lnum': e_list[1], 'col': e_list[2], 'text': e_list[3]}] | |
endfor | |
call setqflist(error_list, 'r') | |
copen | |
endfunction | |
command! Oclint call <SID>Oclint() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment