2017-03-28 22:25:44 +00:00
|
|
|
===============================================================================
|
|
|
|
ALE C Integration *ale-c-options*
|
|
|
|
|
2020-08-20 00:46:29 +00:00
|
|
|
For basic checking of problems with C files, ALE offers the `cc` linter, which
|
|
|
|
runs either `clang`, or `gcc`. See |ale-c-cc|.
|
|
|
|
|
2017-03-28 22:25:44 +00:00
|
|
|
|
2017-08-05 13:21:02 +00:00
|
|
|
===============================================================================
|
|
|
|
Global Options
|
|
|
|
|
2020-08-29 15:05:49 +00:00
|
|
|
g:ale_c_always_make *g:ale_c_always_make*
|
|
|
|
*b:ale_c_always_make*
|
|
|
|
Type: |Number|
|
|
|
|
Default: `has('unix') && !has('macunix')`
|
|
|
|
|
|
|
|
If set to `1`, use `--always-make` for `make`, which means that output will
|
|
|
|
always be parsed from `make` dry runs with GNU make. BSD `make` does not
|
|
|
|
support this option, so you probably want to turn this option off when using
|
|
|
|
a BSD variant.
|
|
|
|
|
|
|
|
|
2017-08-05 13:21:02 +00:00
|
|
|
g:ale_c_build_dir_names *g:ale_c_build_dir_names*
|
|
|
|
*b:ale_c_build_dir_names*
|
|
|
|
|
|
|
|
Type: |List|
|
|
|
|
Default: `['build', 'bin']`
|
|
|
|
|
2020-08-20 00:46:29 +00:00
|
|
|
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)
|
2017-08-05 13:21:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
g:ale_c_build_dir *g:ale_c_build_dir*
|
|
|
|
*b:ale_c_build_dir*
|
|
|
|
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
2018-07-29 18:24:19 +00:00
|
|
|
For programs that can read `compile_commands.json` files, this option can be
|
|
|
|
set to the directory containing the file for the project. ALE will try to
|
|
|
|
determine the location of `compile_commands.json` automatically, but if your
|
|
|
|
file exists in some other directory, you can set this option so ALE will
|
|
|
|
know where it is.
|
|
|
|
|
|
|
|
This directory will be searched instead of |g:ale_c_build_dir_names|.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_c_parse_compile_commands *g:ale_c_parse_compile_commands*
|
|
|
|
*b:ale_c_parse_compile_commands*
|
|
|
|
Type: |Number|
|
2020-08-09 03:19:14 +00:00
|
|
|
Default: `1`
|
2018-07-29 18:24:19 +00:00
|
|
|
|
|
|
|
If set to `1`, ALE will parse `compile_commands.json` files to automatically
|
|
|
|
determine flags for C or C++ compilers. ALE will first search for the
|
|
|
|
nearest `compile_commands.json` file, and then look for
|
|
|
|
`compile_commands.json` files in the directories for
|
|
|
|
|g:ale_c_build_dir_names|.
|
|
|
|
|
2018-03-27 18:24:22 +00:00
|
|
|
|
|
|
|
g:ale_c_parse_makefile *g:ale_c_parse_makefile*
|
|
|
|
*b:ale_c_parse_makefile*
|
|
|
|
Type: |Number|
|
2020-08-09 19:08:42 +00:00
|
|
|
Default: `0`
|
2018-03-27 18:24:22 +00:00
|
|
|
|
|
|
|
If set to `1`, ALE will run `make -n` to automatically determine flags to
|
|
|
|
set for C or C++ compilers. This can make it easier to determine the correct
|
|
|
|
build flags to use for different files.
|
|
|
|
|
2020-08-29 15:05:49 +00:00
|
|
|
NOTE: When using this option on BSD, you may need to set
|
|
|
|
|g:ale_c_always_make| to `0`, and `make -n` will not provide consistent
|
|
|
|
results if binaries have already been built, so use `make clean` when
|
|
|
|
editing your files.
|
|
|
|
|
2020-08-09 19:08:42 +00:00
|
|
|
WARNING: Running `make -n` automatically can execute arbitrary code, even
|
|
|
|
though it's supposed to be a dry run, so enable this option with care. You
|
|
|
|
might prefer to use the buffer-local version of the option instead with
|
|
|
|
|g:ale_pattern_options|, or you own code for checking which project you're
|
|
|
|
in.
|
|
|
|
|
2020-08-09 03:19:14 +00:00
|
|
|
You might want to disable this option if `make -n` takes too long to run for
|
|
|
|
projects you work on.
|
|
|
|
|
|
|
|
If |g:ale_c_parse_compile_commands| or |b:ale_c_parse_compile_commands| is
|
|
|
|
set to `1`, flags taken from `compile_commands.json` will be preferred over
|
|
|
|
`make -n` output.
|
|
|
|
|
2017-08-05 13:21:02 +00:00
|
|
|
|
2020-07-10 21:54:27 +00:00
|
|
|
===============================================================================
|
|
|
|
astyle *ale-c-astyle*
|
|
|
|
|
|
|
|
g:ale_c_astyle_executable *g:ale_c_astyle_executable*
|
|
|
|
*b:ale_c_astyle_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'astyle'`
|
|
|
|
|
|
|
|
This variable can be changed to use a different executable for astyle.
|
|
|
|
|
|
|
|
|
2020-07-28 23:48:27 +00:00
|
|
|
g:ale_c_astyle_project_options *g:ale_c_astyle_project_options*
|
|
|
|
*b:ale_c_astyle_project_options*
|
2020-07-27 01:21:38 +00:00
|
|
|
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
|
2020-07-28 23:48:27 +00:00
|
|
|
present at the project's root directory.
|
2020-07-27 01:21:38 +00:00
|
|
|
|
|
|
|
For example, if .astylrc is specified, the file is searched in the parent
|
2020-07-28 23:48:27 +00:00
|
|
|
directories of the source file's directory.
|
2020-07-27 01:21:38 +00:00
|
|
|
|
|
|
|
|
2017-07-08 13:17:26 +00:00
|
|
|
===============================================================================
|
2020-08-20 00:46:29 +00:00
|
|
|
cc *ale-c-cc*
|
|
|
|
*ale-c-gcc*
|
|
|
|
*ale-c-clang*
|
2017-03-28 22:25:44 +00:00
|
|
|
|
2020-08-20 00:46:29 +00:00
|
|
|
g:ale_c_cc_executable *g:ale_c_cc_executable*
|
|
|
|
*b:ale_c_cc_executable*
|
2017-07-16 20:37:10 +00:00
|
|
|
Type: |String|
|
2020-08-20 00:46:29 +00:00
|
|
|
Default: `'<auto>'`
|
|
|
|
|
|
|
|
This variable can be changed to use a different executable for a C compiler.
|
2017-07-16 20:37:10 +00:00
|
|
|
|
2020-08-20 00:46:29 +00:00
|
|
|
ALE will try to use `clang` if Clang is available, otherwise ALE will
|
|
|
|
default to checking C code with `gcc`.
|
2017-07-16 20:37:10 +00:00
|
|
|
|
|
|
|
|
2020-08-20 00:46:29 +00:00
|
|
|
g:ale_c_cc_options *g:ale_c_cc_options*
|
|
|
|
*b:ale_c_cc_options*
|
2017-03-28 22:25:44 +00:00
|
|
|
Type: |String|
|
|
|
|
Default: `'-std=c11 -Wall'`
|
|
|
|
|
2020-08-20 00:46:29 +00:00
|
|
|
This variable can be change to modify flags given to the C compiler.
|
|
|
|
|
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
ccls *ale-c-ccls*
|
|
|
|
|
|
|
|
g:ale_c_ccls_executable *g:ale_c_ccls_executable*
|
|
|
|
*b:ale_c_ccls_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'ccls'`
|
|
|
|
|
|
|
|
This variable can be changed to use a different executable for ccls.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_c_ccls_init_options *g:ale_c_ccls_init_options*
|
|
|
|
*b:ale_c_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.
|
2017-03-28 22:25:44 +00:00
|
|
|
|
|
|
|
|
2018-07-22 17:30:57 +00:00
|
|
|
===============================================================================
|
|
|
|
clangd *ale-c-clangd*
|
|
|
|
|
|
|
|
g:ale_c_clangd_executable *g:ale_c_clangd_executable*
|
|
|
|
*b:ale_c_clangd_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'clangd'`
|
|
|
|
|
|
|
|
This variable can be changed to use a different executable for clangd.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_c_clangd_options *g:ale_c_clangd_options*
|
|
|
|
*b:ale_c_clangd_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
This variable can be changed to modify flags given to clangd.
|
|
|
|
|
|
|
|
|
2017-09-10 18:42:45 +00:00
|
|
|
===============================================================================
|
|
|
|
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: `''`
|
|
|
|
|
2021-02-14 14:03:04 +00:00
|
|
|
This variable can be changed to modify flags given to clang-format.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_c_clangformat_style_option *g:ale_c_clangformat_style_option*
|
|
|
|
*b:ale_c_clangformat_style_option*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
This variable can be changed to modify only the style flag given to
|
|
|
|
clang-format. The contents of the variable are passed directly to the -style
|
|
|
|
flag of clang-format.
|
|
|
|
|
|
|
|
Example: >
|
|
|
|
{
|
|
|
|
\ BasedOnStyle: Microsoft,
|
|
|
|
\ ColumnLimit: 80,
|
|
|
|
\ AllowShortBlocksOnASingleLine: Always,
|
|
|
|
\ AllowShortFunctionsOnASingleLine: Inline,
|
|
|
|
\ }
|
|
|
|
<
|
|
|
|
If you set this variable, ensure you don't modify -style in
|
|
|
|
|g:ale_c_clangformat_options|, as this will cause clang-format to error.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_c_clangformat_use_local_file *g:ale_c_clangformat_use_local_file*
|
|
|
|
*b:ale_c_clangformat_use_local_file*
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
This variable can be changed to modify whether to use a local .clang-format
|
|
|
|
file. If the file is found, the flag '-style=file' is passed to clang-format
|
|
|
|
and any options configured via |g:ale_c_clangformat_style_option| are not
|
|
|
|
passed.
|
|
|
|
|
|
|
|
If this option is enabled but no .clang-format file is found, default back to
|
|
|
|
|g:ale_c_clangformat_style_option|, if it set.
|
|
|
|
|
|
|
|
If you set this variable, ensure you don't modify -style in
|
|
|
|
|g:ale_c_clangformat_options|, as this will cause clang-format to error.
|
2017-09-10 18:42:45 +00:00
|
|
|
|
|
|
|
|
2017-08-05 13:21:02 +00:00
|
|
|
===============================================================================
|
2017-08-06 11:15:02 +00:00
|
|
|
clangtidy *ale-c-clangtidy*
|
2017-08-05 13:21:02 +00:00
|
|
|
|
|
|
|
`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|
|
2018-10-29 22:48:05 +00:00
|
|
|
Default: `[]`
|
2017-08-05 13:21:02 +00:00
|
|
|
|
|
|
|
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
|
2017-08-06 11:14:09 +00:00
|
|
|
clang documentation for an up-to-date list of compatible checks:
|
|
|
|
http://clang.llvm.org/extra/clang-tidy/checks/list.html
|
2017-08-05 13:21:02 +00:00
|
|
|
|
|
|
|
|
2017-08-06 11:15:02 +00:00
|
|
|
g:ale_c_clangtidy_executable *g:ale_c_clangtidy_executable*
|
|
|
|
*b:ale_c_clangtidy_executable*
|
2017-08-05 13:21:02 +00:00
|
|
|
Type: |String|
|
|
|
|
Default: `'clang-tidy'`
|
|
|
|
|
|
|
|
This variable can be changed to use a different executable for clangtidy.
|
|
|
|
|
|
|
|
|
2017-08-06 11:15:02 +00:00
|
|
|
g:ale_c_clangtidy_options *g:ale_c_clangtidy_options*
|
|
|
|
*b:ale_c_clangtidy_options*
|
2017-08-05 13:21:02 +00:00
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
2019-06-08 19:12:43 +00:00
|
|
|
This variable can be changed to modify compiler flags given to clang-tidy.
|
2017-08-05 13:21:02 +00:00
|
|
|
|
|
|
|
- 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.
|
|
|
|
|
|
|
|
|
2019-06-08 19:12:43 +00:00
|
|
|
g:ale_c_clangtidy_extra_options *g:ale_c_clangtidy_extra_options*
|
|
|
|
*b:ale_c_clangtidy_extra_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
This variable can be changed to modify flags given to clang-tidy.
|
|
|
|
|
|
|
|
|
2019-07-02 07:11:10 +00:00
|
|
|
g:ale_c_clangtidy_fix_errors *g:ale_c_clangtidy_fix_errors*
|
|
|
|
*b:ale_c_clangtidy_fix_errors*
|
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
|
|
|
|
|
|
|
This variable can be changed to disable the `-fix-errors` option for the
|
|
|
|
|clangtidy| fixer.
|
|
|
|
|
|
|
|
|
2017-07-08 13:17:26 +00:00
|
|
|
===============================================================================
|
2017-03-28 22:25:44 +00:00
|
|
|
cppcheck *ale-c-cppcheck*
|
|
|
|
|
2017-07-16 21:11:43 +00:00
|
|
|
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.
|
|
|
|
|
|
|
|
|
2017-03-28 22:25:44 +00:00
|
|
|
g:ale_c_cppcheck_options *g:ale_c_cppcheck_options*
|
2017-04-27 21:04:34 +00:00
|
|
|
*b:ale_c_cppcheck_options*
|
2017-03-28 22:25:44 +00:00
|
|
|
Type: |String|
|
|
|
|
Default: `'--enable=style'`
|
|
|
|
|
|
|
|
This variable can be changed to modify flags given to cppcheck.
|
|
|
|
|
|
|
|
|
2018-07-25 04:23:13 +00:00
|
|
|
===============================================================================
|
|
|
|
cquery *ale-c-cquery*
|
|
|
|
|
|
|
|
g:ale_c_cquery_executable *g:ale_c_cquery_executable*
|
|
|
|
*b:ale_c_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_c_cquery_cache_directory*
|
|
|
|
*b:ale_c_cquery_cache_directory*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'~/.cache/cquery'`
|
|
|
|
|
|
|
|
This variable can be changed to decide which directory cquery uses for its
|
|
|
|
cache.
|
|
|
|
|
|
|
|
|
2018-02-25 14:11:04 +00:00
|
|
|
===============================================================================
|
|
|
|
flawfinder *ale-c-flawfinder*
|
|
|
|
|
|
|
|
g:ale_c_flawfinder_executable *g:ale_c_flawfinder_executable*
|
2018-02-25 14:31:38 +00:00
|
|
|
*b:ale_c_flawfinder_executable*
|
2018-02-25 14:11:04 +00:00
|
|
|
Type: |String|
|
|
|
|
Default: `'flawfinder'`
|
|
|
|
|
|
|
|
This variable can be changed to use a different executable for flawfinder.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_c_flawfinder_minlevel *g:ale_c_flawfinder_minlevel*
|
|
|
|
*b:ale_c_flawfinder_minlevel*
|
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
|
|
|
|
|
|
|
This variable can be changed to ignore risks under the given risk threshold.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_c_flawfinder_options *g:ale-c-flawfinder*
|
|
|
|
*b:ale-c-flawfinder*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
This variable can be used to pass extra options into the flawfinder command.
|
|
|
|
|
2018-03-10 10:44:55 +00:00
|
|
|
g:ale_c_flawfinder_error_severity *g:ale_c_flawfinder_error_severity*
|
|
|
|
*b:ale_c_flawfinder_error_severity*
|
|
|
|
Type: |Number|
|
|
|
|
Default: `6`
|
|
|
|
|
|
|
|
This variable can be changed to set the minimum severity to be treated as an
|
|
|
|
error. This setting also applies to flawfinder for c++.
|
|
|
|
|
2018-02-25 14:11:04 +00:00
|
|
|
|
2018-09-05 00:39:32 +00:00
|
|
|
===============================================================================
|
|
|
|
uncrustify *ale-c-uncrustify*
|
|
|
|
|
|
|
|
g:ale_c_uncrustify_executable *g:ale_c_uncrustify_executable*
|
|
|
|
*b:ale_c_uncrustify_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'uncrustify'`
|
|
|
|
|
|
|
|
This variable can be changed to use a different executable for uncrustify.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_c_uncrustify_options *g:ale_c_uncrustify_options*
|
|
|
|
*b:ale_c_uncrustify_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
This variable can be change to modify flags given to uncrustify.
|
|
|
|
|
|
|
|
|
2017-07-08 13:17:26 +00:00
|
|
|
===============================================================================
|
2017-03-28 22:25:44 +00:00
|
|
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|