2017-08-30 17:11:04 -04:00
|
|
|
Before:
|
2018-07-15 13:24:53 -04:00
|
|
|
call ale#assert#SetUpLinterTest('c', 'clangtidy')
|
2017-08-30 17:11:04 -04:00
|
|
|
call ale#test#SetFilename('test.c')
|
|
|
|
|
|
|
|
After:
|
2018-07-15 13:24:53 -04:00
|
|
|
call ale#assert#TearDownLinterTest()
|
2017-08-30 17:11:04 -04:00
|
|
|
|
|
|
|
Execute(The clangtidy command default should be correct):
|
2018-07-15 13:24:53 -04:00
|
|
|
AssertLinter 'clang-tidy',
|
2018-10-29 18:48:05 -04:00
|
|
|
\ ale#Escape('clang-tidy') . ' %s'
|
2017-08-30 17:11:04 -04:00
|
|
|
|
|
|
|
Execute(You should be able to remove the -checks option for clang-tidy):
|
|
|
|
let b:ale_c_clangtidy_checks = []
|
|
|
|
|
2018-07-15 13:24:53 -04:00
|
|
|
AssertLinter 'clang-tidy',
|
|
|
|
\ ale#Escape('clang-tidy') . ' %s'
|
2017-08-30 17:11:04 -04:00
|
|
|
|
|
|
|
Execute(You should be able to set other checks for clang-tidy):
|
|
|
|
let b:ale_c_clangtidy_checks = ['-*', 'clang-analyzer-*']
|
|
|
|
|
2018-07-15 13:24:53 -04:00
|
|
|
AssertLinter 'clang-tidy',
|
2017-08-30 17:11:04 -04:00
|
|
|
\ ale#Escape('clang-tidy')
|
2018-07-15 13:24:53 -04:00
|
|
|
\ . ' -checks=' . ale#Escape('-*,clang-analyzer-*') . ' %s'
|
2017-08-30 17:11:04 -04:00
|
|
|
|
|
|
|
Execute(You should be able to manually set compiler flags for clang-tidy):
|
2018-10-29 18:48:05 -04:00
|
|
|
let b:ale_c_clangtidy_checks = ['*']
|
2017-08-30 17:11:04 -04:00
|
|
|
let b:ale_c_clangtidy_options = '-Wall'
|
|
|
|
|
2018-07-15 13:24:53 -04:00
|
|
|
AssertLinter 'clang-tidy',
|
|
|
|
\ ale#Escape('clang-tidy') . ' -checks=' . ale#Escape('*') . ' %s -- -Wall'
|
|
|
|
|
2019-06-08 15:12:43 -04:00
|
|
|
Execute(You should be able to manually set flags for clang-tidy):
|
|
|
|
let b:ale_c_clangtidy_extra_options = '-config='
|
|
|
|
|
|
|
|
AssertLinter 'clang-tidy',
|
|
|
|
\ ale#Escape('clang-tidy') . ' ' . ale#Escape('-config=') . ' %s'
|
|
|
|
|
2017-08-30 17:11:04 -04:00
|
|
|
Execute(The build directory should be configurable):
|
2018-10-29 18:48:05 -04:00
|
|
|
let b:ale_c_clangtidy_checks = ['*']
|
2017-08-30 17:11:04 -04:00
|
|
|
let b:ale_c_build_dir = '/foo/bar'
|
|
|
|
|
2018-07-15 13:24:53 -04:00
|
|
|
AssertLinter 'clang-tidy',
|
2017-08-30 17:11:04 -04:00
|
|
|
\ ale#Escape('clang-tidy')
|
2017-10-18 18:42:51 -04:00
|
|
|
\ . ' -checks=' . ale#Escape('*') . ' %s'
|
2018-07-15 13:24:53 -04:00
|
|
|
\ . ' -p ' . ale#Escape('/foo/bar')
|
2017-08-30 17:11:04 -04:00
|
|
|
|
|
|
|
Execute(The build directory setting should override the options):
|
2018-10-29 18:48:05 -04:00
|
|
|
let b:ale_c_clangtidy_checks = ['*']
|
2017-08-30 17:11:04 -04:00
|
|
|
let b:ale_c_build_dir = '/foo/bar'
|
|
|
|
let b:ale_c_clangtidy_options = '-Wall'
|
|
|
|
|
2018-07-15 13:24:53 -04:00
|
|
|
AssertLinter 'clang-tidy',
|
2017-08-30 17:11:04 -04:00
|
|
|
\ ale#Escape('clang-tidy')
|
2017-10-18 18:42:51 -04:00
|
|
|
\ . ' -checks=' . ale#Escape('*') . ' %s'
|
2018-07-15 13:24:53 -04:00
|
|
|
\ . ' -p ' . ale#Escape('/foo/bar')
|
2017-08-30 17:11:04 -04:00
|
|
|
|
|
|
|
Execute(The build directory should be ignored for header files):
|
|
|
|
call ale#test#SetFilename('test.h')
|
|
|
|
|
2018-10-29 18:48:05 -04:00
|
|
|
let b:ale_c_clangtidy_checks = ['*']
|
2017-08-30 17:11:04 -04:00
|
|
|
let b:ale_c_build_dir = '/foo/bar'
|
|
|
|
let b:ale_c_clangtidy_options = '-Wall'
|
|
|
|
|
2018-07-15 13:24:53 -04:00
|
|
|
AssertLinter 'clang-tidy',
|
2017-08-30 17:11:04 -04:00
|
|
|
\ ale#Escape('clang-tidy')
|
2018-07-15 13:24:53 -04:00
|
|
|
\ . ' -checks=' . ale#Escape('*') . ' %s -- -Wall'
|
|
|
|
|
2017-08-30 17:11:04 -04:00
|
|
|
call ale#test#SetFilename('test.h')
|
|
|
|
|
2018-07-15 13:24:53 -04:00
|
|
|
AssertLinter 'clang-tidy',
|
|
|
|
\ ale#Escape('clang-tidy') . ' -checks=' . ale#Escape('*') . ' %s -- -Wall'
|
2017-08-30 17:11:04 -04:00
|
|
|
|
|
|
|
Execute(The executable should be configurable):
|
2018-10-29 18:48:05 -04:00
|
|
|
let b:ale_c_clangtidy_checks = ['*']
|
2017-08-30 17:11:04 -04:00
|
|
|
let b:ale_c_clangtidy_executable = 'foobar'
|
|
|
|
|
2018-07-15 13:24:53 -04:00
|
|
|
AssertLinter 'foobar',
|
|
|
|
\ ale#Escape('foobar') . ' -checks=' . ale#Escape('*') . ' %s'
|