Skip to content

Instantly share code, notes, and snippets.

@mnowotnik
Created May 1, 2016 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnowotnik/0cf72d689740828b1eb395e7c63dafa1 to your computer and use it in GitHub Desktop.
Save mnowotnik/0cf72d689740828b1eb395e7c63dafa1 to your computer and use it in GitHub Desktop.
" 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