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.
1 ===============================================================================
2 ALE C Integration *ale-c-options*
4 For basic checking of problems with C files, ALE offers the `cc` linter, which
5 runs either `clang`, or `gcc`. See |ale-c-cc|.
8 ===============================================================================
10 *ale-options.c_always_make*
16 Default: `has('unix') && !has('macunix')`
18 If set to `1`, use `--always-make` for `make`, which means that output will
19 always be parsed from `make` dry runs with GNU make. BSD `make` does not
20 support this option, so you probably want to turn this option off when using
23 *ale-options.c_build_dir_names*
24 *g:ale_c_build_dir_names*
25 *b:ale_c_build_dir_names*
27 g:ale_c_build_dir_names
29 Default: `['build', 'bin']`
31 A list of directory names to be used when searching upwards from C files
32 to discover compilation databases with. For directory named `'foo'`, ALE
33 will search for `'foo/compile_commands.json'` in all directories on and
34 above the directory containing the C file to find path to compilation
35 database. This feature is useful for the clang tools wrapped around
36 LibTooling (namely here, clang-tidy)
38 *ale-options.c_build_dir*
46 For programs that can read `compile_commands.json` files, this option can be
47 set to the directory containing the file for the project. ALE will try to
48 determine the location of `compile_commands.json` automatically, but if your
49 file exists in some other directory, you can set this option so ALE will
52 This directory will be searched instead of |g:ale_c_build_dir_names|.
54 *ale-options.c_parse_compile_commands*
55 *g:ale_c_parse_compile_commands*
56 *b:ale_c_parse_compile_commands*
57 c_parse_compile_commands
58 g:ale_c_parse_compile_commands
62 If set to `1`, ALE will parse `compile_commands.json` files to automatically
63 determine flags for C or C++ compilers. ALE will first search for the
64 nearest `compile_commands.json` file, and then look for
65 `compile_commands.json` files in the directories for
66 |g:ale_c_build_dir_names|.
68 *ale-options.c_parse_makefile*
69 *g:ale_c_parse_makefile*
70 *b:ale_c_parse_makefile*
72 g:ale_c_parse_makefile
76 If set to `1`, ALE will run `make -n` to automatically determine flags to
77 set for C or C++ compilers. This can make it easier to determine the correct
78 build flags to use for different files.
80 NOTE: When using this option on BSD, you may need to set
81 |g:ale_c_always_make| to `0`, and `make -n` will not provide consistent
82 results if binaries have already been built, so use `make clean` when
85 WARNING: Running `make -n` automatically can execute arbitrary code, even
86 though it's supposed to be a dry run, so enable this option with care. You
87 might prefer to use the buffer-local version of the option instead with
88 |g:ale_pattern_options|, or you own code for checking which project you're
91 You might want to disable this option if `make -n` takes too long to run for
94 If |g:ale_c_parse_compile_commands| or |b:ale_c_parse_compile_commands| is
95 set to `1`, flags taken from `compile_commands.json` will be preferred over
99 ===============================================================================
100 astyle *ale-c-astyle*
102 *ale-options.c_astyle_executable*
103 *g:ale_c_astyle_executable*
104 *b:ale_c_astyle_executable*
106 g:ale_c_astyle_executable
110 This variable can be changed to use a different executable for astyle.
112 *ale-options.c_astyle_project_options*
113 *g:ale_c_astyle_project_options*
114 *b:ale_c_astyle_project_options*
115 c_astyle_project_options
116 g:ale_c_astyle_project_options
120 This variable can be changed to use an option file for project level
121 configurations. Provide only the filename of the option file that should be
122 present at the project's root directory.
124 For example, if .astylrc is specified, the file is searched in the parent
125 directories of the source file's directory.
128 ===============================================================================
133 *ale-options.c_cc_executable*
134 *g:ale_c_cc_executable*
135 *b:ale_c_cc_executable*
137 g:ale_c_cc_executable
141 This variable can be changed to use a different executable for a C compiler.
143 ALE will try to use `clang` if Clang is available, otherwise ALE will
144 default to checking C code with `gcc`.
146 *ale-options.c_cc_options*
152 Default: `'-std=c11 -Wall'`
154 This variable can be changed to modify flags given to the C compiler.
156 *ale-options.c_cc_use_header_lang_flag*
157 *g:ale_c_cc_use_header_lang_flag*
158 *b:ale_c_cc_use_header_lang_flag*
159 c_cc_use_header_lang_flag
160 g:ale_c_cc_use_header_lang_flag
164 By default, ALE will use `'-x c-header'` instead of `'-x c'` for header files
167 This variable can be changed to manually activate or deactivate this flag
170 - When set to `-1`, the default beviour is used, `'-x c-header'` is used with
171 Clang and `'-x c'` is used with other compilers.
172 - When set to `0`, the flag is deactivated, `'-x c'` is always used
173 independently of the compiler.
174 - When set to `1`, the flag is activated, `'-x c-header'` is always used
175 independently of the compiler.
177 Gcc does not support `'-x c-header'` when using `'-'` as input filename,
178 which is what ALE does. This why, by default, ALE only uses `'-x c-header'`
181 *ale-options.c_cc_header_exts*
182 *g:ale_c_cc_header_exts*
183 *b:ale_c_cc_header_exts*
185 g:ale_c_cc_header_exts
189 This variable can be changed to modify the list of extensions of the files
190 considered as header files.
192 This variable is only used when `'-x c-header'` is used instead of `'-x c'`,
193 see |g:ale_c_cc_use_header_lang_flag|.
196 ===============================================================================
199 *ale-options.c_ccls_executable*
200 *g:ale_c_ccls_executable*
201 *b:ale_c_ccls_executable*
203 g:ale_c_ccls_executable
207 This variable can be changed to use a different executable for ccls.
209 *ale-options.c_ccls_init_options*
210 *g:ale_c_ccls_init_options*
211 *b:ale_c_ccls_init_options*
213 g:ale_c_ccls_init_options
217 This variable can be changed to customize ccls initialization options.
220 let g:ale_c_ccls_init_options = {
221 \ 'cacheDirectory': '/tmp/ccls',
222 \ 'cacheFormat': 'binary',
229 For all available options and explanations, visit
230 https://github.com/MaskRay/ccls/wiki/Customization#initialization-options.
233 ===============================================================================
234 clangcheck *ale-c-clangcheck*
236 `clang-check` will be run only when files are saved to disk, so that
237 `compile_commands.json` files can be used. It is recommended to use this
238 linter in combination with `compile_commands.json` files.
239 Therefore, `clang-check` linter reads the options |g:ale_c_build_dir| and
240 |g:ale_c_build_dir_names|. Also, setting |g:ale_c_build_dir| actually
241 overrides |g:ale_c_build_dir_names|.
244 -------------------------------------------------------------------------------
246 *ale-options.c_clangcheck_executable*
247 *g:ale_c_clangcheck_executable*
248 *b:ale_c_clangcheck_executable*
249 c_clangcheck_executable
250 g:ale_c_clangcheck_executable
252 Default: `'clang-check'`
254 This variable can be changed to use a different executable for clangcheck.
256 *ale-options.c_clangcheck_options*
257 *g:ale_c_clangcheck_options*
258 *b:ale_c_clangcheck_options*
260 g:ale_c_clangcheck_options
264 This variable can be changed to modify flags given to clang-check.
266 This variable should not be set to point to build subdirectory with
267 `-p path/to/build` option, as it is handled by the |g:ale_c_build_dir|
271 ===============================================================================
272 clangd *ale-c-clangd*
274 *ale-options.c_clangd_executable*
275 *g:ale_c_clangd_executable*
276 *b:ale_c_clangd_executable*
278 g:ale_c_clangd_executable
282 This variable can be changed to use a different executable for clangd.
284 *ale-options.c_clangd_options*
285 *g:ale_c_clangd_options*
286 *b:ale_c_clangd_options*
288 g:ale_c_clangd_options
292 This variable can be changed to modify flags given to clangd.
295 ===============================================================================
296 clang-format *ale-c-clangformat*
298 *ale-options.c_clangformat_executable*
299 *g:ale_c_clangformat_executable*
300 *b:ale_c_clangformat_executable*
301 c_clangformat_executable
302 g:ale_c_clangformat_executable
304 Default: `'clang-format'`
306 This variable can be changed to use a different executable for clang-format.
308 *ale-options.c_clangformat_options*
309 *g:ale_c_clangformat_options*
310 *b:ale_c_clangformat_options*
311 c_clangformat_options
312 g:ale_c_clangformat_options
316 This variable can be changed to modify flags given to clang-format.
318 *ale-options.c_clangformat_style_option*
319 *g:ale_c_clangformat_style_option*
320 *b:ale_c_clangformat_style_option*
321 c_clangformat_style_option
322 g:ale_c_clangformat_style_option
326 This variable can be changed to modify only the style flag given to
327 clang-format. The contents of the variable are passed directly to the -style
328 flag of clang-format.
331 let g:ale_c_clangformat_style_option = {
332 \ 'BasedOnStyle': 'Microsoft',
334 \ 'AllowShortBlocksOnASingleLine': 'Always',
335 \ 'AllowShortFunctionsOnASingleLine': 'Inline',
338 If you set this variable, ensure you don't modify -style in
339 |g:ale_c_clangformat_options|, as this will cause clang-format to error.
341 *ale-options.c_clangformat_use_local_file*
342 *g:ale_c_clangformat_use_local_file*
343 *b:ale_c_clangformat_use_local_file*
344 c_clangformat_use_local_file
345 g:ale_c_clangformat_use_local_file
349 This variable can be changed to modify whether to use a local .clang-format
350 file. If the file is found, the flag '-style=file' is passed to clang-format
351 and any options configured via |g:ale_c_clangformat_style_option| are not
354 If this option is enabled but no .clang-format file is found, default back to
355 |g:ale_c_clangformat_style_option|, if it set.
357 If you set this variable, ensure you don't modify -style in
358 |g:ale_c_clangformat_options|, as this will cause clang-format to error.
361 ===============================================================================
362 clangtidy *ale-c-clangtidy*
364 `clang-tidy` will be run only when files are saved to disk, so that
365 `compile_commands.json` files can be used. It is recommended to use this
366 linter in combination with `compile_commands.json` files.
367 Therefore, `clang-tidy` linter reads the options |g:ale_c_build_dir| and
368 |g:ale_c_build_dir_names|. Also, setting |g:ale_c_build_dir| actually
369 overrides |g:ale_c_build_dir_names|.
372 -------------------------------------------------------------------------------
374 *ale-options.c_clangtidy_checks*
375 *g:ale_c_clangtidy_checks*
376 *b:ale_c_clangtidy_checks*
378 g:ale_c_clangtidy_checks
382 The checks to enable for clang-tidy with the `-checks` argument.
384 All options will be joined with commas, and escaped appropriately for
385 the shell. The `-checks` flag can be removed entirely by setting this
386 option to an empty List.
388 Not all of clangtidy checks are applicable for C. You should consult the
389 clang documentation for an up-to-date list of compatible checks:
390 http://clang.llvm.org/extra/clang-tidy/checks/list.html
392 *ale-options.c_clangtidy_executable*
393 *g:ale_c_clangtidy_executable*
394 *b:ale_c_clangtidy_executable*
395 c_clangtidy_executable
396 g:ale_c_clangtidy_executable
398 Default: `'clang-tidy'`
400 This variable can be changed to use a different executable for clangtidy.
402 *ale-options.c_clangtidy_options*
403 *g:ale_c_clangtidy_options*
404 *b:ale_c_clangtidy_options*
406 g:ale_c_clangtidy_options
410 This variable can be changed to modify compiler flags given to clang-tidy.
412 - Setting this variable to a non-empty string,
413 - and working in a buffer where no compilation database is found using
414 |g:ale_c_build_dir_names| or |g:ale_c_build_dir|,
415 will cause the `--` argument to be passed to `clang-tidy`, which will mean
416 that detection of `compile_commands.json` files for compile command
417 databases will be disabled.
418 Only set this option if you want to control compiler flags
419 entirely manually, and no `compile_commands.json` file is in one
420 of the |g:ale_c_build_dir_names| directories of the project tree.
422 *ale-options.c_clangtidy_extra_options*
423 *g:ale_c_clangtidy_extra_options*
424 *b:ale_c_clangtidy_extra_options*
425 c_clangtidy_extra_options
426 g:ale_c_clangtidy_extra_options
430 This variable can be changed to modify flags given to clang-tidy.
432 *ale-options.c_clangtidy_fix_errors*
433 *g:ale_c_clangtidy_fix_errors*
434 *b:ale_c_clangtidy_fix_errors*
435 c_clangtidy_fix_errors
436 g:ale_c_clangtidy_fix_errors
440 This variable can be changed to disable the `-fix-errors` option for the
444 ===============================================================================
445 cppcheck *ale-c-cppcheck*
447 *ale-options.c_cppcheck_executable*
448 *g:ale_c_cppcheck_executable*
449 *b:ale_c_cppcheck_executable*
450 c_cppcheck_executable
451 g:ale_c_cppcheck_executable
453 Default: `'cppcheck'`
455 This variable can be changed to use a different executable for cppcheck.
457 *ale-options.c_cppcheck_options*
458 *g:ale_c_cppcheck_options*
459 *b:ale_c_cppcheck_options*
461 g:ale_c_cppcheck_options
463 Default: `'--enable=style'`
465 This variable can be changed to modify flags given to cppcheck.
468 ===============================================================================
469 cquery *ale-c-cquery*
471 *ale-options.c_cquery_executable*
472 *g:ale_c_cquery_executable*
473 *b:ale_c_cquery_executable*
475 g:ale_c_cquery_executable
479 This variable can be changed to use a different executable for cquery.
481 *ale-options.c_cquery_cache_directory*
482 *g:ale_c_cquery_cache_directory*
483 *b:ale_c_cquery_cache_directory*
484 c_cquery_cache_directory
485 g:ale_c_cquery_cache_directory
487 Default: `'~/.cache/cquery'`
489 This variable can be changed to decide which directory cquery uses for its
493 ===============================================================================
494 cspell *ale-c-cspell*
496 See |ale-cspell-options|
499 ===============================================================================
500 flawfinder *ale-c-flawfinder*
502 *ale-options.c_flawfinder_executable*
503 *g:ale_c_flawfinder_executable*
504 *b:ale_c_flawfinder_executable*
505 c_flawfinder_executable
506 g:ale_c_flawfinder_executable
508 Default: `'flawfinder'`
510 This variable can be changed to use a different executable for flawfinder.
512 *ale-options.c_flawfinder_minlevel*
513 *g:ale_c_flawfinder_minlevel*
514 *b:ale_c_flawfinder_minlevel*
515 c_flawfinder_minlevel
516 g:ale_c_flawfinder_minlevel
520 This variable can be changed to ignore risks under the given risk threshold.
522 *ale-options.c_flawfinder_options*
523 *g:ale_c_flawfinder_options*
526 g:ale_c_flawfinder_options
530 This variable can be used to pass extra options into the flawfinder command.
532 *ale-options.c_flawfinder_error_severity*
533 *g:ale_c_flawfinder_error_severity*
534 *b:ale_c_flawfinder_error_severity*
535 c_flawfinder_error_severity
536 g:ale_c_flawfinder_error_severity
540 This variable can be changed to set the minimum severity to be treated as an
541 error. This setting also applies to flawfinder for c++.
544 ===============================================================================
545 uncrustify *ale-c-uncrustify*
547 *ale-options.c_uncrustify_executable*
548 *g:ale_c_uncrustify_executable*
549 *b:ale_c_uncrustify_executable*
550 c_uncrustify_executable
551 g:ale_c_uncrustify_executable
553 Default: `'uncrustify'`
555 This variable can be changed to use a different executable for uncrustify.
557 *ale-options.c_uncrustify_options*
558 *g:ale_c_uncrustify_options*
559 *b:ale_c_uncrustify_options*
561 g:ale_c_uncrustify_options
565 This variable can be change to modify flags given to uncrustify.
568 ===============================================================================
569 vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: