summaryrefslogtreecommitdiff
path: root/doc/ale-cpp.txt
blob: 17894e6ea99cd5e05e3e316d45b69640a5510379 (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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
===============================================================================
ALE C++ Integration                                           *ale-cpp-options*

For basic checking of problems with C++ files, ALE offers the `cc` linter,
which runs either `clang++`, or `gcc`. See |ale-cpp-cc|.


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

The following C options also apply to some C++ linters too.

* |g:ale_c_always_make|
* |g:ale_c_build_dir_names|
* |g:ale_c_build_dir|
* |g:ale_c_parse_makefile|
* |g:ale_c_parse_compile_commands|


===============================================================================
astyle                                                         *ale-cpp-astyle*

g:ale_cpp_astyle_executable                       *g:ale_cpp_astyle_executable*
                                                  *b:ale_cpp_astyle_executable*
  Type: |String|
  Default: `'astyle'`

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


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

  This variable can be changed to use an option file for project level
  configurations. Provide only the filename of the option file that should be
  present at the project's root directory.

  For example, if .astylrc is specified, the file is searched in the parent
  directories of the source file's directory.


===============================================================================
cc                                                                 *ale-cpp-cc*
                                                                  *ale-cpp-gcc*
                                                                *ale-cpp-clang*

g:ale_cpp_cc_executable                               *g:ale_cpp_cc_executable*
                                                      *b:ale_cpp_cc_executable*
  Type: |String|
  Default: `'<auto>'`

  This variable can be changed to use a different executable for a C++ compiler.

  ALE will try to use `clang++` if Clang is available, otherwise ALE will
  default to checking C++ code with `gcc`.


g:ale_cpp_cc_options                                     *g:ale_cpp_cc_options*
                                                         *b:ale_cpp_cc_options*
  Type: |String|
  Default: `'-std=c++14 -Wall'`

  This variable can be change to modify flags given to the C++ compiler.


===============================================================================
ccls                                                             *ale-cpp-ccls*

g:ale_cpp_ccls_executable                           *g:ale_cpp_ccls_executable*
                                                    *b:ale_cpp_ccls_executable*
  Type: |String|
  Default: `'ccls'`

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


g:ale_cpp_ccls_init_options                       *g:ale_cpp_ccls_init_options*
                                                  *b:ale_cpp_ccls_init_options*
  Type: |Dictionary|
  Default: `{}`

  This variable can be changed to customize ccls initialization options.
  Example: >
      {
    \   'cacheDirectory': '/tmp/ccls',
    \   'cacheFormat': 'binary',
    \   'diagnostics': {
    \     'onOpen': 0,
    \     'opChange': 1000,
    \   },
    \ }
<
  Visit https://github.com/MaskRay/ccls/wiki/Initialization-options for all
  available options and explanations.


===============================================================================
clangcheck                                                 *ale-cpp-clangcheck*

`clang-check` 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-check` 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_cpp_clangcheck_executable               *g:ale_cpp_clangcheck_executable*
                                              *b:ale_cpp_clangcheck_executable*
  Type: |String|
  Default: `'clang-check'`

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


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

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

  This variable should not be set to point to build subdirectory with
  `-p path/to/build` option, as it is handled by the |g:ale_c_build_dir|
  option.


===============================================================================
clangd                                                         *ale-cpp-clangd*

g:ale_cpp_clangd_executable                       *g:ale_cpp_clangd_executable*
                                                  *b:ale_cpp_clangd_executable*
  Type: |String|
  Default: `'clangd'`

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


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

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


===============================================================================
clang-format                                              *ale-cpp-clangformat*

See |ale-c-clangformat| for information about the available options.
Note that the C options are also used for C++.


===============================================================================
clangtidy                                                   *ale-cpp-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_cpp_clangtidy_checks                         *g:ale_cpp_clangtidy_checks*
                                                   *b:ale_cpp_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.


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

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


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

  This variable can be changed to modify compiler 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.


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

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


g:ale_cpp_clangtidy_fix_errors                 *g:ale_cpp_clangtidy_fix_errors*
                                               *b:ale_cpp_clangtidy_fix_errors*
  Type: |Number|
  Default: `1`

  This variable can be changed to disable the `-fix-errors` option for the
  |clangtidy| fixer.


===============================================================================
clazy                                                           *ale-cpp-clazy*

g:ale_cpp_clazy_executable                         *g:ale_cpp_clazy_executable*
                                                   *b:ale_cpp_clazy_executable*
  Type: |String|
  Default: `'clazy-standalone'`

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


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

  The checks to enable for clazy 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.


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

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


===============================================================================
cppcheck                                                     *ale-cpp-cppcheck*

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

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


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

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


===============================================================================
cpplint                                                       *ale-cpp-cpplint*

g:ale_cpp_cpplint_executable                     *g:ale_cpp_cpplint_executable*
                                                 *b:ale_cpp_cpplint_executable*
  Type: |String|
  Default: `'cpplint'`

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


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

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


===============================================================================
cquery                                                         *ale-cpp-cquery*

g:ale_cpp_cquery_executable                       *g:ale_cpp_cquery_executable*
                                                  *b:ale_cpp_cquery_executable*
  Type: |String|
  Default: `'cquery'`

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


g:ale_cpp_cquery_cache_directory             *g:ale_cpp_cquery_cache_directory*
                                             *b:ale_cpp_cquery_cache_directory*
  Type: |String|
  Default: `'~/.cache/cquery'`

  This variable can be changed to decide which directory cquery uses for its
  cache.


===============================================================================
flawfinder                                                 *ale-cpp-flawfinder*

g:ale_cpp_flawfinder_executable               *g:ale_cpp_flawfinder_executable*
                                              *b:ale_cpp_flawfinder_executable*
  Type: |String|
  Default: `'flawfinder'`

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


g:ale_cpp_flawfinder_minlevel                   *g:ale_cpp_flawfinder_minlevel*
                                                *b:ale_cpp_flawfinder_minlevel*
  Type: |Number|
  Default: `1`

  This variable can be changed to ignore risks under the given risk threshold.


g:ale_cpp_flawfinder_options                             *g:ale-cpp-flawfinder*
                                                         *b:ale-cpp-flawfinder*
  Type: |String|
  Default: `''`

  This variable can be used to pass extra options into the flawfinder command.


===============================================================================
uncrustify                                                 *ale-cpp-uncrustify*

See |ale-c-uncrustify| for information about the available options.


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