summaryrefslogtreecommitdiff
path: root/ale_linters/cpp/clangtidy.vim
diff options
context:
space:
mode:
authorfenuks <fenuks@protonmail.com>2018-08-24 10:52:33 +0100
committerw0rp <devw0rp@gmail.com>2018-08-24 10:52:33 +0100
commit9d7c48038cbbc696fe2d1e9c4b2d9eff2dd726c3 (patch)
treed034973b8a46a11c883bfbd775298e5162e80c46 /ale_linters/cpp/clangtidy.vim
parent08d141edfb9cacea2ddba347581e670f4a04caa7 (diff)
downloadale-9d7c48038cbbc696fe2d1e9c4b2d9eff2dd726c3.zip
Add clazy as cpp linter
Diffstat (limited to 'ale_linters/cpp/clangtidy.vim')
-rw-r--r--ale_linters/cpp/clangtidy.vim20
1 files changed, 1 insertions, 19 deletions
diff --git a/ale_linters/cpp/clangtidy.vim b/ale_linters/cpp/clangtidy.vim
index 930087a8..2f3089b4 100644
--- a/ale_linters/cpp/clangtidy.vim
+++ b/ale_linters/cpp/clangtidy.vim
@@ -10,27 +10,9 @@ call ale#Set('cpp_clangtidy_checks', ['*'])
call ale#Set('cpp_clangtidy_options', '')
call ale#Set('c_build_dir', '')
-function! s:GetBuildDirectory(buffer) abort
- " Don't include build directory for header files, as compile_commands.json
- " files don't consider headers to be translation units, and provide no
- " commands for compiling header files.
- if expand('#' . a:buffer) =~# '\v\.(h|hpp)$'
- return ''
- endif
-
- let l:build_dir = ale#Var(a:buffer, 'c_build_dir')
-
- " c_build_dir has the priority if defined
- if !empty(l:build_dir)
- return l:build_dir
- endif
-
- return ale#path#Dirname(ale#c#FindCompileCommands(a:buffer))
-endfunction
-
function! ale_linters#cpp#clangtidy#GetCommand(buffer) abort
let l:checks = join(ale#Var(a:buffer, 'cpp_clangtidy_checks'), ',')
- let l:build_dir = s:GetBuildDirectory(a:buffer)
+ let l:build_dir = ale#c#GetBuildDirectory(a:buffer)
" Get the extra options if we couldn't find a build directory.
let l:options = empty(l:build_dir)