]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/ale_linters/cpp/clazy.vim

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '294584081929424aec883f90c7d6515b3743358d' as '.vim/bundle/vim-lsp-ale'
[etc/vim.git] / .vim / bundle / ale / ale_linters / cpp / clazy.vim
1 " Description: clazy linter for cpp files (clang-based and Qt-oriented)
2
3 call ale#Set('cpp_clazy_executable', 'clazy-standalone')
4 " Set this option to check the checks clazy will apply.
5 call ale#Set('cpp_clazy_checks', ['level1'])
6 " Set this option to manually set some options for clazy.
7 " This will disable compile_commands.json detection.
8 call ale#Set('cpp_clazy_options', '')
9 call ale#Set('c_build_dir', '')
10
11 function! ale_linters#cpp#clazy#GetCommand(buffer) abort
12     let l:checks = join(ale#Var(a:buffer, 'cpp_clazy_checks'), ',')
13     let l:build_dir = ale#c#GetBuildDirectory(a:buffer)
14
15     " Get the extra options if we couldn't find a build directory.
16     let l:options = ale#Var(a:buffer, 'cpp_clazy_options')
17
18     return '%e'
19     \   . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
20     \   . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
21     \   . (!empty(l:options) ? ' ' . l:options : '')
22     \   . ' %s'
23 endfunction
24
25 call ale#linter#Define('cpp', {
26 \   'name': 'clazy',
27 \   'output_stream': 'stderr',
28 \   'executable': {b -> ale#Var(b, 'cpp_clazy_executable')},
29 \   'command': function('ale_linters#cpp#clazy#GetCommand'),
30 \   'callback': 'ale#handlers#gcc#HandleGCCFormat',
31 \   'lint_file': 1,
32 \})