]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/doc/ale-cpp.txt

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

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.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / doc / ale-cpp.txt
1 ===============================================================================
2 ALE C++ Integration                                           *ale-cpp-options*
3
4 For basic checking of problems with C++ files, ALE offers the `cc` linter,
5 which runs either `clang++`, or `gcc`. See |ale-cpp-cc|.
6
7
8 ===============================================================================
9 Global Options
10
11 The following C options also apply to some C++ linters too.
12
13 * |g:ale_c_always_make|
14 * |g:ale_c_build_dir_names|
15 * |g:ale_c_build_dir|
16 * |g:ale_c_parse_makefile|
17 * |g:ale_c_parse_compile_commands|
18
19
20 ===============================================================================
21 astyle                                                         *ale-cpp-astyle*
22
23                                             *ale-options.cpp_astyle_executable*
24                                                   *g:ale_cpp_astyle_executable*
25                                                   *b:ale_cpp_astyle_executable*
26 cpp_astyle_executable
27 g:ale_cpp_astyle_executable
28   Type: |String|
29   Default: `'astyle'`
30
31   This variable can be changed to use a different executable for astyle.
32
33                                        *ale-options.cpp_astyle_project_options*
34                                              *g:ale_cpp_astyle_project_options*
35                                              *b:ale_cpp_astyle_project_options*
36 cpp_astyle_project_options
37 g:ale_cpp_astyle_project_options
38   Type: |String|
39   Default: `''`
40
41   This variable can be changed to use an option file for project level
42   configurations. Provide only the filename of the option file that should be
43   present at the project's root directory.
44
45   For example, if .astylrc is specified, the file is searched in the parent
46   directories of the source file's directory.
47
48
49 ===============================================================================
50 cc                                                                 *ale-cpp-cc*
51                                                                   *ale-cpp-gcc*
52                                                                 *ale-cpp-clang*
53
54                                                 *ale-options.cpp_cc_executable*
55                                                       *g:ale_cpp_cc_executable*
56                                                       *b:ale_cpp_cc_executable*
57 cpp_cc_executable
58 g:ale_cpp_cc_executable
59   Type: |String|
60   Default: `'<auto>'`
61
62   This variable can be changed to use a different executable for a C++ compiler.
63
64   ALE will try to use `clang++` if Clang is available, otherwise ALE will
65   default to checking C++ code with `gcc`.
66
67                                                    *ale-options.cpp_cc_options*
68                                                          *g:ale_cpp_cc_options*
69                                                          *b:ale_cpp_cc_options*
70 cpp_cc_options
71 g:ale_cpp_cc_options
72   Type: |String|
73   Default: `'-std=c++14 -Wall'`
74
75   This variable can be changed to modify flags given to the C++ compiler.
76
77                                       *ale-options.cpp_cc_use_header_lang_flag*
78                                             *g:ale_cpp_cc_use_header_lang_flag*
79                                             *b:ale_cpp_cc_use_header_lang_flag*
80 cpp_cc_use_header_lang_flag
81 g:ale_cpp_cc_use_header_lang_flag
82   Type: |Number|
83   Default: `-1`
84
85   By default, ALE will use `'-x c++-header'` instead of `'-x c++'` for header
86   files when using Clang.
87
88   This variable can be changed to manually activate or deactivate this flag
89   for header files.
90
91   - When set to `-1`, the default behavior is used, `'-x c++-header'` is used
92     with Clang and `'-x c++'` is used with other compilers.
93   - When set to `0`, the flag is deactivated, `'-x c++'` is always used
94     independently of the compiler.
95   - When set to `1`, the flag is activated, `'-x c++-header'` is always used
96     independently of the compiler.
97
98   GCC does not support `'-x c++-header'` when using `'-'` as input filename,
99   which is what ALE does. This why, by default, ALE only uses `'-x c++-header'`
100   with Clang.
101
102                                                *ale-options.cpp_cc_header_exts*
103                                                      *g:ale_cpp_cc_header_exts*
104                                                      *b:ale_cpp_cc_header_exts*
105 cpp_cc_header_exts
106 g:ale_cpp_cc_header_exts
107   Type: |List|
108   Default: `['h', 'hpp']`
109
110   This variable can be changed to modify the list of extensions of the files
111   considered as header files.
112
113   This variable is only used when `'-x c++-header'` is used instead of `'-x c++'`,
114   see |g:ale_cpp_cc_use_header_lang_flag|.
115
116
117 ===============================================================================
118 ccls                                                             *ale-cpp-ccls*
119
120                                               *ale-options.cpp_ccls_executable*
121                                                     *g:ale_cpp_ccls_executable*
122                                                     *b:ale_cpp_ccls_executable*
123 cpp_ccls_executable
124 g:ale_cpp_ccls_executable
125   Type: |String|
126   Default: `'ccls'`
127
128   This variable can be changed to use a different executable for ccls.
129
130                                             *ale-options.cpp_ccls_init_options*
131                                                   *g:ale_cpp_ccls_init_options*
132                                                   *b:ale_cpp_ccls_init_options*
133 cpp_ccls_init_options
134 g:ale_cpp_ccls_init_options
135   Type: |Dictionary|
136   Default: `{}`
137
138   This variable can be changed to customize ccls initialization options.
139   Example: >
140
141   let g:ale_cpp_ccls_init_options = {
142   \   'cacheDirectory': '/tmp/ccls',
143   \   'cacheFormat': 'binary',
144   \   'diagnostics': {
145   \       'onOpen': 0,
146   \       'opChange': 1000,
147   \   },
148   \}
149 <
150   Visit https://github.com/MaskRay/ccls/wiki/Initialization-options for all
151   available options and explanations.
152
153
154 ===============================================================================
155 clangcheck                                                 *ale-cpp-clangcheck*
156
157 `clang-check` will be run only when files are saved to disk, so that
158 `compile_commands.json` files can be used. It is recommended to use this
159 linter in combination with `compile_commands.json` files.  Therefore,
160 `clang-check` linter reads the options |g:ale_c_build_dir| and
161 |g:ale_c_build_dir_names|. Also, setting |g:ale_c_build_dir| actually
162 overrides |g:ale_c_build_dir_names|.
163
164
165 -------------------------------------------------------------------------------
166 Options
167                                         *ale-options.cpp_clangcheck_executable*
168                                               *g:ale_cpp_clangcheck_executable*
169                                               *b:ale_cpp_clangcheck_executable*
170 cpp_clangcheck_executable
171 g:ale_cpp_clangcheck_executable
172   Type: |String|
173   Default: `'clang-check'`
174
175   This variable can be changed to use a different executable for clangcheck.
176
177                                            *ale-options.cpp_clangcheck_options*
178                                                  *g:ale_cpp_clangcheck_options*
179                                                  *b:ale_cpp_clangcheck_options*
180 cpp_clangcheck_options
181 g:ale_cpp_clangcheck_options
182   Type: |String|
183   Default: `''`
184
185   This variable can be changed to modify flags given to clang-check.
186
187   This variable should not be set to point to build subdirectory with
188   `-p path/to/build` option, as it is handled by the |g:ale_c_build_dir|
189   option.
190
191
192 ===============================================================================
193 clangd                                                         *ale-cpp-clangd*
194
195                                             *ale-options.cpp_clangd_executable*
196                                                   *g:ale_cpp_clangd_executable*
197                                                   *b:ale_cpp_clangd_executable*
198 cpp_clangd_executable
199 g:ale_cpp_clangd_executable
200   Type: |String|
201   Default: `'clangd'`
202
203   This variable can be changed to use a different executable for clangd.
204
205                                                *ale-options.cpp_clangd_options*
206                                                      *g:ale_cpp_clangd_options*
207                                                      *b:ale_cpp_clangd_options*
208 cpp_clangd_options
209 g:ale_cpp_clangd_options
210   Type: |String|
211   Default: `''`
212
213   This variable can be changed to modify flags given to clangd.
214
215
216 ===============================================================================
217 clang-format                                              *ale-cpp-clangformat*
218
219 See |ale-c-clangformat| for information about the available options.
220 Note that the C options are also used for C++.
221
222
223 ===============================================================================
224 clangtidy                                                   *ale-cpp-clangtidy*
225
226 `clang-tidy` will be run only when files are saved to disk, so that
227 `compile_commands.json` files can be used. It is recommended to use this
228 linter in combination with `compile_commands.json` files.
229 Therefore, `clang-tidy` linter reads the options |g:ale_c_build_dir| and
230 |g:ale_c_build_dir_names|. Also, setting |g:ale_c_build_dir| actually
231 overrides |g:ale_c_build_dir_names|.
232
233
234 -------------------------------------------------------------------------------
235 Options
236                                              *ale-options.cpp_clangtidy_checks*
237                                                    *g:ale_cpp_clangtidy_checks*
238                                                    *b:ale_cpp_clangtidy_checks*
239 cpp_clangtidy_checks
240 g:ale_cpp_clangtidy_checks
241   Type: |List|
242   Default: `[]`
243
244   The checks to enable for clang-tidy with the `-checks` argument.
245
246   All options will be joined with commas, and escaped appropriately for
247   the shell. The `-checks` flag can be removed entirely by setting this
248   option to an empty List.
249
250                                          *ale-options.cpp_clangtidy_executable*
251                                                *g:ale_cpp_clangtidy_executable*
252                                                *b:ale_cpp_clangtidy_executable*
253 cpp_clangtidy_executable
254 g:ale_cpp_clangtidy_executable
255   Type: |String|
256   Default: `'clang-tidy'`
257
258   This variable can be changed to use a different executable for clangtidy.
259
260                                             *ale-options.cpp_clangtidy_options*
261                                                   *g:ale_cpp_clangtidy_options*
262                                                   *b:ale_cpp_clangtidy_options*
263 cpp_clangtidy_options
264 g:ale_cpp_clangtidy_options
265   Type: |String|
266   Default: `''`
267
268   This variable can be changed to modify compiler flags given to clang-tidy.
269
270   - Setting this variable to a non-empty string,
271   - and working in a buffer where no compilation database is found using
272     |g:ale_c_build_dir_names| or |g:ale_c_build_dir|,
273   will cause the `--` argument to be passed to `clang-tidy`, which will mean
274   that detection of `compile_commands.json` files for compile command
275   databases will be disabled.
276   Only set this option if you want to control compiler flags
277   entirely manually, and no `compile_commands.json` file is in one
278   of the |g:ale_c_build_dir_names| directories of the project tree.
279
280                                       *ale-options.cpp_clangtidy_extra_options*
281                                             *g:ale_cpp_clangtidy_extra_options*
282                                             *b:ale_cpp_clangtidy_extra_options*
283 cpp_clangtidy_extra_options
284 g:ale_cpp_clangtidy_extra_options
285   Type: |String|
286   Default: `''`
287
288   This variable can be changed to modify flags given to clang-tidy.
289
290                                          *ale-options.cpp_clangtidy_fix_errors*
291                                                *g:ale_cpp_clangtidy_fix_errors*
292                                                *b:ale_cpp_clangtidy_fix_errors*
293 cpp_clangtidy_fix_errors
294 g:ale_cpp_clangtidy_fix_errors
295   Type: |Number|
296   Default: `1`
297
298   This variable can be changed to disable the `-fix-errors` option for the
299   |clangtidy| fixer.
300
301
302 ===============================================================================
303 clazy                                                           *ale-cpp-clazy*
304
305                                              *ale-options.cpp_clazy_executable*
306                                                    *g:ale_cpp_clazy_executable*
307                                                    *b:ale_cpp_clazy_executable*
308 cpp_clazy_executable
309 g:ale_cpp_clazy_executable
310   Type: |String|
311   Default: `'clazy-standalone'`
312
313   This variable can be changed to use a different executable for clazy.
314
315                                                  *ale-options.cpp_clazy_checks*
316                                                        *g:ale_cpp_clazy_checks*
317                                                        *b:ale_cpp_clazy_checks*
318 cpp_clazy_checks
319 g:ale_cpp_clazy_checks
320   Type: |List|
321   Default: `['level1']`
322
323   The checks to enable for clazy with the `-checks` argument.
324
325   All options will be joined with commas, and escaped appropriately for
326   the shell. The `-checks` flag can be removed entirely by setting this
327   option to an empty List.
328
329                                                 *ale-options.cpp_clazy_options*
330                                                       *g:ale_cpp_clazy_options*
331                                                       *b:ale_cpp_clazy_options*
332 cpp_clazy_options
333 g:ale_cpp_clazy_options
334   Type: |String|
335   Default: `''`
336
337   This variable can be changed to modify flags given to clazy.
338
339
340 ===============================================================================
341 cppcheck                                                     *ale-cpp-cppcheck*
342
343                                           *ale-options.cpp_cppcheck_executable*
344                                                 *g:ale_cpp_cppcheck_executable*
345                                                 *b:ale_cpp_cppcheck_executable*
346 cpp_cppcheck_executable
347 g:ale_cpp_cppcheck_executable
348   Type: |String|
349   Default: `'cppcheck'`
350
351   This variable can be changed to use a different executable for cppcheck.
352
353                                              *ale-options.cpp_cppcheck_options*
354                                                    *g:ale_cpp_cppcheck_options*
355                                                    *b:ale_cpp_cppcheck_options*
356 cpp_cppcheck_options
357 g:ale_cpp_cppcheck_options
358   Type: |String|
359   Default: `'--enable=style'`
360
361   This variable can be changed to modify flags given to cppcheck.
362
363
364 ===============================================================================
365 cpplint                                                       *ale-cpp-cpplint*
366
367                                            *ale-options.cpp_cpplint_executable*
368                                                  *g:ale_cpp_cpplint_executable*
369                                                  *b:ale_cpp_cpplint_executable*
370 cpp_cpplint_executable
371 g:ale_cpp_cpplint_executable
372   Type: |String|
373   Default: `'cpplint'`
374
375   This variable can be changed to use a different executable for cpplint.
376
377                                               *ale-options.cpp_cpplint_options*
378                                                     *g:ale_cpp_cpplint_options*
379                                                     *b:ale_cpp_cpplint_options*
380 cpp_cpplint_options
381 g:ale_cpp_cpplint_options
382   Type: |String|
383   Default: `''`
384
385   This variable can be changed to modify flags given to cpplint.
386
387                                              *ale-options.c_cpplint_executable*
388                                                    *g:ale_c_cpplint_executable*
389                                                    *b:ale_c_cpplint_executable*
390 c_cpplint_executable
391 g:ale_c_cpplint_executable
392   Type: |String|
393   Default: `'cpplint'`
394
395   This variable can be changed to use a different executable for cpplint.
396
397                                                 *ale-options.c_cpplint_options*
398                                                       *g:ale_c_cpplint_options*
399                                                       *b:ale_c_cpplint_options*
400 c_cpplint_options
401 g:ale_c_cpplint_options
402   Type: |String|
403   Default: `''`
404
405   This variable can be changed to modify flags given to cpplint.
406
407
408 ===============================================================================
409 cquery                                                         *ale-cpp-cquery*
410
411                                             *ale-options.cpp_cquery_executable*
412                                                   *g:ale_cpp_cquery_executable*
413                                                   *b:ale_cpp_cquery_executable*
414 cpp_cquery_executable
415 g:ale_cpp_cquery_executable
416   Type: |String|
417   Default: `'cquery'`
418
419   This variable can be changed to use a different executable for cquery.
420
421                                        *ale-options.cpp_cquery_cache_directory*
422                                              *g:ale_cpp_cquery_cache_directory*
423                                              *b:ale_cpp_cquery_cache_directory*
424 cpp_cquery_cache_directory
425 g:ale_cpp_cquery_cache_directory
426   Type: |String|
427   Default: `'~/.cache/cquery'`
428
429   This variable can be changed to decide which directory cquery uses for its
430   cache.
431
432
433 ===============================================================================
434 cspell                                                         *ale-cpp-cspell*
435
436 See |ale-cspell-options|
437
438
439 ===============================================================================
440 flawfinder                                                 *ale-cpp-flawfinder*
441
442                                         *ale-options.cpp_flawfinder_executable*
443                                               *g:ale_cpp_flawfinder_executable*
444                                               *b:ale_cpp_flawfinder_executable*
445 cpp_flawfinder_executable
446 g:ale_cpp_flawfinder_executable
447   Type: |String|
448   Default: `'flawfinder'`
449
450   This variable can be changed to use a different executable for flawfinder.
451
452                                           *ale-options.cpp_flawfinder_minlevel*
453                                                 *g:ale_cpp_flawfinder_minlevel*
454                                                 *b:ale_cpp_flawfinder_minlevel*
455 cpp_flawfinder_minlevel
456 g:ale_cpp_flawfinder_minlevel
457   Type: |Number|
458   Default: `1`
459
460   This variable can be changed to ignore risks under the given risk threshold.
461
462                                            *ale-options.cpp_flawfinder_options*
463                                                  *g:ale_cpp_flawfinder_options*
464                                                          *b:ale-cpp-flawfinder*
465 cpp_flawfinder_options
466 g:ale_cpp_flawfinder_options
467   Type: |String|
468   Default: `''`
469
470   This variable can be used to pass extra options into the flawfinder command.
471
472
473 ===============================================================================
474 uncrustify                                                 *ale-cpp-uncrustify*
475
476 See |ale-c-uncrustify| for information about the available options.
477
478
479 ===============================================================================
480   vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: