summaryrefslogtreecommitdiff
path: root/doc/ale-c.txt
blob: fc2c45c7e78a3e4e01bed656ebd0e7b5389d0969 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
===============================================================================
ALE C Integration                                               *ale-c-options*


===============================================================================
Global Options

g:ale_c_build_dir_names                               *g:ale_c_build_dir_names*
                                                      *b:ale_c_build_dir_names*

  Type: |List|
  Default: `['build', 'bin']`

  A list of directory names to be used when searching upwards from cpp
  files to discover compilation databases with. For directory named `'foo'`,
  ALE will search for `'foo/compile_commands.json'` in all directories on and above
  the directory containing the cpp file to find path to compilation database.
  This feature is useful for the clang tools wrapped around LibTooling (namely
  here, clang-tidy)


g:ale_c_build_dir                                           *g:ale_c_build_dir*
                                                            *b:ale_c_build_dir*

  Type: |String|
  Default: `''`

  A path to the directory containing the `compile_commands.json` file to use
  with c-family linters. Usually setting this option to a non-empty string
  will override the |g:ale_c_build_dir_names| option to impose a compilation
  database (it can be useful if multiple builds are in multiple build
  subdirectories in the project tree).
  This feature is also most useful for the clang tools linters, wrapped
  aroung LibTooling (namely clang-tidy here)

===============================================================================
clang                                                             *ale-c-clang*

g:ale_c_clang_executable                             *g:ale_c_clang_executable*
                                                     *b:ale_c_clang_executable*
  Type: |String|
  Default: `'clang'`

  This variable can be changed to use a different executable for clang.


g:ale_c_clang_options                                   *g:ale_c_clang_options*
                                                        *b:ale_c_clang_options*
  Type: |String|
  Default: `'-std=c11 -Wall'`

  This variable can be changed to modify flags given to clang.


===============================================================================
clang-format                                                *ale-c-clangformat*

g:ale_c_clangformat_executable                 *g:ale_c_clangformat_executable*
                                               *b:ale_c_clangformat_executable*
  Type: |String|
  Default: `'clang-format'`

  This variable can be changed to use a different executable for clang-format.


g:ale_c_clangformat_options                       *g:ale_c_clangformat_options*
                                                  *b:ale_c_clangformat_options*
  Type: |String|
  Default: `''`

  This variable can be change to modify flags given to clang-format.


===============================================================================
clangtidy                                                     *ale-c-clangtidy*

`clang-tidy` will be run only when files are saved to disk, so that
`compile_commands.json` files can be used. It is recommended to use this
linter in combination with `compile_commands.json` files.
Therefore, `clang-tidy` linter reads the options |g:ale_c_build_dir| and
|g:ale_c_build_dir_names|. Also, setting |g:ale_c_build_dir| actually
overrides |g:ale_c_build_dir_names|.


g:ale_c_clangtidy_checks                             *g:ale_c_clangtidy_checks*
                                                     *b:ale_c_clangtidy_checks*
  Type: |List|
  Default: `['*']`

  The checks to enable for clang-tidy with the `-checks` argument.

  All options will be joined with commas, and escaped appropriately for
  the shell. The `-checks` flag can be removed entirely by setting this
  option to an empty List.

  Not all of clangtidy checks are applicable for C. You should consult the
  clang documentation for an up-to-date list of compatible checks:
  http://clang.llvm.org/extra/clang-tidy/checks/list.html


g:ale_c_clangtidy_executable                     *g:ale_c_clangtidy_executable*
                                                 *b:ale_c_clangtidy_executable*
  Type: |String|
  Default: `'clang-tidy'`

  This variable can be changed to use a different executable for clangtidy.


g:ale_c_clangtidy_options                           *g:ale_c_clangtidy_options*
                                                    *b:ale_c_clangtidy_options*
  Type: |String|
  Default: `''`

  This variable can be changed to modify flags given to clang-tidy.

  - Setting this variable to a non-empty string,
  - and working in a buffer where no compilation database is found using
    |g:ale_c_build_dir_names| or |g:ale_c_build_dir|,
  will cause the `--` argument to be passed to `clang-tidy`, which will mean
  that detection of `compile_commands.json` files for compile command
  databases will be disabled.
  Only set this option if you want to control compiler flags
  entirely manually, and no `compile_commands.json` file is in one
  of the |g:ale_c_build_dir_names| directories of the project tree.


===============================================================================
cppcheck                                                       *ale-c-cppcheck*

g:ale_c_cppcheck_executable                       *g:ale_c_cppcheck_executable*
                                                  *b:ale_c_cppcheck_executable*
  Type: |String|
  Default: `'cppcheck'`

  This variable can be changed to use a different executable for cppcheck.


g:ale_c_cppcheck_options                             *g:ale_c_cppcheck_options*
                                                     *b:ale_c_cppcheck_options*
  Type: |String|
  Default: `'--enable=style'`

  This variable can be changed to modify flags given to cppcheck.


===============================================================================
gcc                                                                 *ale-c-gcc*

g:ale_c_gcc_executable                                 *g:ale_c_gcc_executable*
                                                       *b:ale_c_gcc_executable*
  Type: |String|
  Default: `'gcc'`

  This variable can be changed to use a different executable for gcc.


g:ale_c_gcc_options                                       *g:ale_c_gcc_options*
                                                          *b:ale_c_gcc_options*
  Type: |String|
  Default: `'-std=c11 -Wall'`

  This variable can be change to modify flags given to gcc.


===============================================================================
  vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: