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.
2 Save g:ale_c_parse_makefile
3 let g:ale_c_parse_makefile = 0
5 call ale#assert#SetUpLinterTest('c', 'clangtidy')
6 call ale#test#SetFilename('test.c')
9 call ale#assert#TearDownLinterTest()
11 Execute(The clangtidy command default should be correct):
12 AssertLinter 'clang-tidy',
13 \ ale#Escape('clang-tidy') . ' %s'
15 Execute(You should be able to set other checks for clang-tidy):
16 let b:ale_c_clangtidy_checks = ['-*', 'clang-analyzer-*']
18 AssertLinter 'clang-tidy',
19 \ ale#Escape('clang-tidy')
20 \ . ' -checks=' . ale#Escape('-*,clang-analyzer-*') . ' %s'
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'
26 AssertLinter 'clang-tidy',
27 \ ale#Escape('clang-tidy') . ' -checks=' . ale#Escape('*') . ' %s -- -Wall'
29 Execute(You should be able to manually set flags for clang-tidy):
30 let b:ale_c_clangtidy_extra_options = '-config='
32 AssertLinter 'clang-tidy',
33 \ ale#Escape('clang-tidy') . ' ' . ale#Escape('-config=') . ' %s'
35 Execute(The build directory should be configurable):
36 let b:ale_c_clangtidy_checks = ['*']
37 let b:ale_c_build_dir = '/foo/bar'
39 AssertLinter 'clang-tidy',
40 \ ale#Escape('clang-tidy')
41 \ . ' -checks=' . ale#Escape('*') . ' %s'
42 \ . ' -p ' . ale#Escape('/foo/bar')
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'
49 AssertLinter 'clang-tidy',
50 \ ale#Escape('clang-tidy')
51 \ . ' -checks=' . ale#Escape('*') . ' %s'
52 \ . ' -p ' . ale#Escape('/foo/bar')
54 Execute(The build directory should be used for header files):
55 call ale#test#SetFilename('test.h')
57 let b:ale_c_clangtidy_checks = ['*']
58 let b:ale_c_build_dir = '/foo/bar'
59 let b:ale_c_clangtidy_options = '-Wall'
61 AssertLinter 'clang-tidy',
62 \ ale#Escape('clang-tidy')
63 \ . ' -checks=' . ale#Escape('*') . ' %s'
64 \ . ' -p ' . ale#Escape('/foo/bar')
66 Execute(The executable should be configurable):
67 let b:ale_c_clangtidy_checks = ['*']
68 let b:ale_c_clangtidy_executable = 'foobar'
70 AssertLinter 'foobar',
71 \ ale#Escape('foobar') . ' -checks=' . ale#Escape('*') . ' %s'