Implement Lua ALE setup & overhaul documentation

1. Add ale.setup and ale.setup.buffer for pure Lua configuration.
2. Update many global settings to use Booleans instead of numbers to
   make types easiert to work with in Lua.
3. Radically reformat documentation and fix errors to make
   documentation more usable for Neovim users.
This commit is contained in:
w0rp
2025-03-20 21:33:12 +00:00
parent 53f036fe9f
commit bcd1a12949
146 changed files with 5469 additions and 2642 deletions

View File

@@ -20,16 +20,21 @@ The following C options also apply to some C++ linters too.
===============================================================================
astyle *ale-cpp-astyle*
g:ale_cpp_astyle_executable *g:ale_cpp_astyle_executable*
*ale-options.cpp_astyle_executable*
*g:ale_cpp_astyle_executable*
*b:ale_cpp_astyle_executable*
cpp_astyle_executable
g: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*
*ale-options.cpp_astyle_project_options*
*g:ale_cpp_astyle_project_options*
*b:ale_cpp_astyle_project_options*
cpp_astyle_project_options
g:ale_cpp_astyle_project_options
Type: |String|
Default: `''`
@@ -46,8 +51,11 @@ cc *ale-cpp-cc*
*ale-cpp-gcc*
*ale-cpp-clang*
g:ale_cpp_cc_executable *g:ale_cpp_cc_executable*
*ale-options.cpp_cc_executable*
*g:ale_cpp_cc_executable*
*b:ale_cpp_cc_executable*
cpp_cc_executable
g:ale_cpp_cc_executable
Type: |String|
Default: `'<auto>'`
@@ -56,17 +64,21 @@ g:ale_cpp_cc_executable *g:ale_cpp_cc_executable*
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*
*ale-options.cpp_cc_options*
*g:ale_cpp_cc_options*
*b:ale_cpp_cc_options*
cpp_cc_options
g:ale_cpp_cc_options
Type: |String|
Default: `'-std=c++14 -Wall'`
This variable can be changed to modify flags given to the C++ compiler.
g:ale_cpp_cc_use_header_lang_flag *g:ale_cpp_cc_use_header_lang_flag*
*ale-options.cpp_cc_use_header_lang_flag*
*g:ale_cpp_cc_use_header_lang_flag*
*b:ale_cpp_cc_use_header_lang_flag*
cpp_cc_use_header_lang_flag
g:ale_cpp_cc_use_header_lang_flag
Type: |Number|
Default: `-1`
@@ -76,20 +88,22 @@ g:ale_cpp_cc_use_header_lang_flag *g:ale_cpp_cc_use_header_lang_flag*
This variable can be changed to manually activate or deactivate this flag
for header files.
- When set to `-1`, the default beviour is used, `'-x c++-header'` is used with
Clang and `'-x c++'` is used with other compilers.
- When set to `-1`, the default behavior is used, `'-x c++-header'` is used
with Clang and `'-x c++'` is used with other compilers.
- When set to `0`, the flag is deactivated, `'-x c++'` is always used
independently of the compiler.
- When set to `1`, the flag is activated, `'-x c++-header'` is always used
independently of the compiler.
Gcc does not support `'-x c++-header'` when using `'-'` as input filename,
GCC does not support `'-x c++-header'` when using `'-'` as input filename,
which is what ALE does. This why, by default, ALE only uses `'-x c++-header'`
with Clang.
g:ale_cpp_cc_header_exts *g:ale_cpp_cc_header_exts*
*ale-options.cpp_cc_header_exts*
*g:ale_cpp_cc_header_exts*
*b:ale_cpp_cc_header_exts*
cpp_cc_header_exts
g:ale_cpp_cc_header_exts
Type: |List|
Default: `['h', 'hpp']`
@@ -103,29 +117,35 @@ g:ale_cpp_cc_header_exts *g:ale_cpp_cc_header_exts*
===============================================================================
ccls *ale-cpp-ccls*
g:ale_cpp_ccls_executable *g:ale_cpp_ccls_executable*
*ale-options.cpp_ccls_executable*
*g:ale_cpp_ccls_executable*
*b:ale_cpp_ccls_executable*
cpp_ccls_executable
g: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*
*ale-options.cpp_ccls_init_options*
*g:ale_cpp_ccls_init_options*
*b:ale_cpp_ccls_init_options*
cpp_ccls_init_options
g: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,
\ },
\ }
let g:ale_cpp_ccls_init_options = {
\ '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.
@@ -136,22 +156,29 @@ 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
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*
-------------------------------------------------------------------------------
Options
*ale-options.cpp_clangcheck_executable*
*g:ale_cpp_clangcheck_executable*
*b:ale_cpp_clangcheck_executable*
cpp_clangcheck_executable
g: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*
*ale-options.cpp_clangcheck_options*
*g:ale_cpp_clangcheck_options*
*b:ale_cpp_clangcheck_options*
cpp_clangcheck_options
g:ale_cpp_clangcheck_options
Type: |String|
Default: `''`
@@ -165,16 +192,21 @@ g:ale_cpp_clangcheck_options *g:ale_cpp_clangcheck_options*
===============================================================================
clangd *ale-cpp-clangd*
g:ale_cpp_clangd_executable *g:ale_cpp_clangd_executable*
*ale-options.cpp_clangd_executable*
*g:ale_cpp_clangd_executable*
*b:ale_cpp_clangd_executable*
cpp_clangd_executable
g: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*
*ale-options.cpp_clangd_options*
*g:ale_cpp_clangd_options*
*b:ale_cpp_clangd_options*
cpp_clangd_options
g:ale_cpp_clangd_options
Type: |String|
Default: `''`
@@ -199,8 +231,13 @@ Therefore, `clang-tidy` linter reads the options |g:ale_c_build_dir| and
overrides |g:ale_c_build_dir_names|.
g:ale_cpp_clangtidy_checks *g:ale_cpp_clangtidy_checks*
-------------------------------------------------------------------------------
Options
*ale-options.cpp_clangtidy_checks*
*g:ale_cpp_clangtidy_checks*
*b:ale_cpp_clangtidy_checks*
cpp_clangtidy_checks
g:ale_cpp_clangtidy_checks
Type: |List|
Default: `[]`
@@ -210,17 +247,21 @@ g:ale_cpp_clangtidy_checks *g:ale_cpp_clangtidy_checks*
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*
*ale-options.cpp_clangtidy_executable*
*g:ale_cpp_clangtidy_executable*
*b:ale_cpp_clangtidy_executable*
cpp_clangtidy_executable
g: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*
*ale-options.cpp_clangtidy_options*
*g:ale_cpp_clangtidy_options*
*b:ale_cpp_clangtidy_options*
cpp_clangtidy_options
g:ale_cpp_clangtidy_options
Type: |String|
Default: `''`
@@ -236,17 +277,21 @@ g:ale_cpp_clangtidy_options *g:ale_cpp_clangtidy_options*
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*
*ale-options.cpp_clangtidy_extra_options*
*g:ale_cpp_clangtidy_extra_options*
*b:ale_cpp_clangtidy_extra_options*
cpp_clangtidy_extra_options
g: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*
*ale-options.cpp_clangtidy_fix_errors*
*g:ale_cpp_clangtidy_fix_errors*
*b:ale_cpp_clangtidy_fix_errors*
cpp_clangtidy_fix_errors
g:ale_cpp_clangtidy_fix_errors
Type: |Number|
Default: `1`
@@ -257,16 +302,21 @@ g:ale_cpp_clangtidy_fix_errors *g:ale_cpp_clangtidy_fix_errors*
===============================================================================
clazy *ale-cpp-clazy*
g:ale_cpp_clazy_executable *g:ale_cpp_clazy_executable*
*ale-options.cpp_clazy_executable*
*g:ale_cpp_clazy_executable*
*b:ale_cpp_clazy_executable*
cpp_clazy_executable
g: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*
*ale-options.cpp_clazy_checks*
*g:ale_cpp_clazy_checks*
*b:ale_cpp_clazy_checks*
cpp_clazy_checks
g:ale_cpp_clazy_checks
Type: |List|
Default: `['level1']`
@@ -276,9 +326,11 @@ g:ale_cpp_clazy_checks *g:ale_cpp_clazy_checks*
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*
*ale-options.cpp_clazy_options*
*g:ale_cpp_clazy_options*
*b:ale_cpp_clazy_options*
cpp_clazy_options
g:ale_cpp_clazy_options
Type: |String|
Default: `''`
@@ -288,16 +340,21 @@ g:ale_cpp_clazy_options *g:ale_cpp_clazy_options*
===============================================================================
cppcheck *ale-cpp-cppcheck*
g:ale_cpp_cppcheck_executable *g:ale_cpp_cppcheck_executable*
*ale-options.cpp_cppcheck_executable*
*g:ale_cpp_cppcheck_executable*
*b:ale_cpp_cppcheck_executable*
cpp_cppcheck_executable
g: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*
*ale-options.cpp_cppcheck_options*
*g:ale_cpp_cppcheck_options*
*b:ale_cpp_cppcheck_options*
cpp_cppcheck_options
g:ale_cpp_cppcheck_options
Type: |String|
Default: `'--enable=style'`
@@ -307,31 +364,41 @@ g:ale_cpp_cppcheck_options *g:ale_cpp_cppcheck_options*
===============================================================================
cpplint *ale-cpp-cpplint*
g:ale_cpp_cpplint_executable *g:ale_cpp_cpplint_executable*
*ale-options.cpp_cpplint_executable*
*g:ale_cpp_cpplint_executable*
*b:ale_cpp_cpplint_executable*
cpp_cpplint_executable
g: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*
*ale-options.cpp_cpplint_options*
*g:ale_cpp_cpplint_options*
*b:ale_cpp_cpplint_options*
cpp_cpplint_options
g:ale_cpp_cpplint_options
Type: |String|
Default: `''`
This variable can be changed to modify flags given to cpplint.
g:ale_c_cpplint_executable *g:ale_c_cpplint_executable*
*ale-options.c_cpplint_executable*
*g:ale_c_cpplint_executable*
*b:ale_c_cpplint_executable*
c_cpplint_executable
g:ale_c_cpplint_executable
Type: |String|
Default: `'cpplint'`
This variable can be changed to use a different executable for cpplint.
g:ale_c_cpplint_options *g:ale_c_cpplint_options*
*ale-options.c_cpplint_options*
*g:ale_c_cpplint_options*
*b:ale_c_cpplint_options*
c_cpplint_options
g:ale_c_cpplint_options
Type: |String|
Default: `''`
@@ -341,16 +408,21 @@ g:ale_c_cpplint_options *g:ale_c_cpplint_options*
===============================================================================
cquery *ale-cpp-cquery*
g:ale_cpp_cquery_executable *g:ale_cpp_cquery_executable*
*ale-options.cpp_cquery_executable*
*g:ale_cpp_cquery_executable*
*b:ale_cpp_cquery_executable*
cpp_cquery_executable
g: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*
*ale-options.cpp_cquery_cache_directory*
*g:ale_cpp_cquery_cache_directory*
*b:ale_cpp_cquery_cache_directory*
cpp_cquery_cache_directory
g:ale_cpp_cquery_cache_directory
Type: |String|
Default: `'~/.cache/cquery'`
@@ -367,24 +439,31 @@ See |ale-cspell-options|
===============================================================================
flawfinder *ale-cpp-flawfinder*
g:ale_cpp_flawfinder_executable *g:ale_cpp_flawfinder_executable*
*ale-options.cpp_flawfinder_executable*
*g:ale_cpp_flawfinder_executable*
*b:ale_cpp_flawfinder_executable*
cpp_flawfinder_executable
g: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*
*ale-options.cpp_flawfinder_minlevel*
*g:ale_cpp_flawfinder_minlevel*
*b:ale_cpp_flawfinder_minlevel*
cpp_flawfinder_minlevel
g: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*
*ale-options.cpp_flawfinder_options*
*g:ale_cpp_flawfinder_options*
*b:ale-cpp-flawfinder*
cpp_flawfinder_options
g:ale_cpp_flawfinder_options
Type: |String|
Default: `''`