]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/linter/test_c_clang_tidy.vader

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 / test / linter / test_c_clang_tidy.vader
1 Before:
2   Save g:ale_c_parse_makefile
3   let g:ale_c_parse_makefile = 0
4
5   call ale#assert#SetUpLinterTest('c', 'clangtidy')
6   call ale#test#SetFilename('test.c')
7
8 After:
9   call ale#assert#TearDownLinterTest()
10
11 Execute(The clangtidy command default should be correct):
12   AssertLinter 'clang-tidy',
13   \ ale#Escape('clang-tidy') . ' %s'
14
15 Execute(You should be able to set other checks for clang-tidy):
16   let b:ale_c_clangtidy_checks = ['-*', 'clang-analyzer-*']
17
18   AssertLinter 'clang-tidy',
19   \ ale#Escape('clang-tidy')
20   \   . ' -checks=' . ale#Escape('-*,clang-analyzer-*') . ' %s'
21
22 Execute(You should be able to manually set compiler flags for clang-tidy):
23   let b:ale_c_clangtidy_checks = ['*']
24   let b:ale_c_clangtidy_options = '-Wall'
25
26   AssertLinter 'clang-tidy',
27   \ ale#Escape('clang-tidy') . ' -checks=' . ale#Escape('*') . ' %s -- -Wall'
28
29 Execute(You should be able to manually set flags for clang-tidy):
30   let b:ale_c_clangtidy_extra_options = '-config='
31
32   AssertLinter 'clang-tidy',
33   \ ale#Escape('clang-tidy') . ' ' . ale#Escape('-config=') . ' %s'
34
35 Execute(The build directory should be configurable):
36   let b:ale_c_clangtidy_checks = ['*']
37   let b:ale_c_build_dir = '/foo/bar'
38
39   AssertLinter 'clang-tidy',
40   \ ale#Escape('clang-tidy')
41   \   . ' -checks=' . ale#Escape('*') . ' %s'
42   \   . ' -p ' . ale#Escape('/foo/bar')
43
44 Execute(The build directory setting should override the options):
45   let b:ale_c_clangtidy_checks = ['*']
46   let b:ale_c_build_dir = '/foo/bar'
47   let b:ale_c_clangtidy_options = '-Wall'
48
49   AssertLinter 'clang-tidy',
50   \ ale#Escape('clang-tidy')
51   \   . ' -checks=' . ale#Escape('*') . ' %s'
52   \   . ' -p ' . ale#Escape('/foo/bar')
53
54 Execute(The build directory should be used for header files):
55   call ale#test#SetFilename('test.h')
56
57   let b:ale_c_clangtidy_checks = ['*']
58   let b:ale_c_build_dir = '/foo/bar'
59   let b:ale_c_clangtidy_options = '-Wall'
60
61   AssertLinter 'clang-tidy',
62   \ ale#Escape('clang-tidy')
63   \   . ' -checks=' . ale#Escape('*') . ' %s'
64   \   . ' -p ' . ale#Escape('/foo/bar')
65
66 Execute(The executable should be configurable):
67   let b:ale_c_clangtidy_checks = ['*']
68   let b:ale_c_clangtidy_executable = 'foobar'
69
70   AssertLinter 'foobar',
71   \ ale#Escape('foobar') . ' -checks=' . ale#Escape('*') . ' %s'