mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-30 16:14:30 +08:00
Fix the clangtidy linter, and document everything
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
" Author: vdeurzen <tim@kompiler.org>
|
||||
" Author: vdeurzen <tim@kompiler.org>, w0rp <devw0rp@gmail.com>
|
||||
" Description: clang-tidy linter for cpp files
|
||||
|
||||
" Set this option to change the clang-tidy options for warnings for C.
|
||||
if !exists('g:ale_cpp_clangtidy_options')
|
||||
let g:ale_cpp_clangtidy_options = '-std=c++14 -Wall'
|
||||
endif
|
||||
let g:ale_cpp_clangtidy_options =
|
||||
\ get(g:, 'ale_cpp_clangtidy_options', '-std=c++14 -Wall')
|
||||
|
||||
function! ale_linters#cpp#clangtidy#GetCommand(buffer) abort
|
||||
return 'clang-tidy %t -- ' . g:ale_cpp_clangtidy_options
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'clangtidy',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable': 'clang-tidy',
|
||||
\ 'command': g:ale#util#stdin_wrapper . ' -- ' . g:ale_cpp_clangtidy_options,
|
||||
\ 'command_callback': 'ale_linters#cpp#clangtidy#GetCommand',
|
||||
\ 'callback': 'ale#handlers#HandleGCCFormat',
|
||||
\})
|
||||
|
||||
Reference in New Issue
Block a user