summaryrefslogtreecommitdiff
path: root/test/command_callback/test_clang_tidy_command_callback.vader
blob: 46d8a3a6ef7bda4b1cdf9c7d4eed250b08f50e91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Before:
  Save g:ale_cpp_clangtidy_checks
  Save g:ale_cpp_clangtidy_options
  runtime ale_linters/cpp/clangtidy.vim

After:
  Restore
  call ale#linter#Reset()

Execute(The clangtidy command default should be correct):
  AssertEqual
  \ 'clang-tidy -checks=''*'' %s',
  \ ale_linters#cpp#clangtidy#GetCommand(bufnr(''))

Execute(You should be able to remove the -checks option for clang-tidy):
  let g:ale_cpp_clangtidy_checks = []
  AssertEqual
  \ 'clang-tidy %s',
  \ ale_linters#cpp#clangtidy#GetCommand(bufnr(''))

Execute(You should be able to set other checks for clang-tidy):
  let g:ale_cpp_clangtidy_checks = ['-*', 'clang-analyzer-*']
  AssertEqual
  \ 'clang-tidy -checks=''-*,clang-analyzer-*'' %s',
  \ ale_linters#cpp#clangtidy#GetCommand(bufnr(''))

Execute(You should be able to manually set compiler flags for clang-tidy):
  let g:ale_cpp_clangtidy_options = '-Wall'
  AssertEqual
  \ 'clang-tidy -checks=''*'' %s -- -Wall',
  \ ale_linters#cpp#clangtidy#GetCommand(bufnr(''))