mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-16 16:17:12 +08:00
#3299 Merge gcc and clang into a cc linter
Users can easily be confused when they set some options for a C or C++ compiler, and another compiler is run with different options, which still reports errors. To remedy this, the existing `gcc` and `clang` linters have been replaced with a `cc` linter that will run either compiler. This is a breaking change for ALE v3.0.0.
This commit is contained in:
117
doc/ale-c.txt
117
doc/ale-c.txt
@@ -1,6 +1,9 @@
|
||||
===============================================================================
|
||||
ALE C Integration *ale-c-options*
|
||||
|
||||
For basic checking of problems with C files, ALE offers the `cc` linter, which
|
||||
runs either `clang`, or `gcc`. See |ale-c-cc|.
|
||||
|
||||
|
||||
===============================================================================
|
||||
Global Options
|
||||
@@ -11,12 +14,12 @@ g:ale_c_build_dir_names *g:ale_c_build_dir_names*
|
||||
Type: |List|
|
||||
Default: `['build', 'bin']`
|
||||
|
||||
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)
|
||||
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)
|
||||
|
||||
|
||||
g:ale_c_build_dir *g:ale_c_build_dir*
|
||||
@@ -94,22 +97,58 @@ g:ale_c_astyle_project_options *g:ale_c_astyle_project_options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
clang *ale-c-clang*
|
||||
cc *ale-c-cc*
|
||||
*ale-c-gcc*
|
||||
*ale-c-clang*
|
||||
|
||||
g:ale_c_clang_executable *g:ale_c_clang_executable*
|
||||
*b:ale_c_clang_executable*
|
||||
g:ale_c_cc_executable *g:ale_c_cc_executable*
|
||||
*b:ale_c_cc_executable*
|
||||
Type: |String|
|
||||
Default: `'clang'`
|
||||
Default: `'<auto>'`
|
||||
|
||||
This variable can be changed to use a different executable for clang.
|
||||
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_c_clang_options *g:ale_c_clang_options*
|
||||
*b:ale_c_clang_options*
|
||||
g:ale_c_cc_options *g:ale_c_cc_options*
|
||||
*b:ale_c_cc_options*
|
||||
Type: |String|
|
||||
Default: `'-std=c11 -Wall'`
|
||||
|
||||
This variable can be changed to modify flags given to clang.
|
||||
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.
|
||||
|
||||
|
||||
===============================================================================
|
||||
@@ -294,25 +333,6 @@ g:ale_c_flawfinder_error_severity *g:ale_c_flawfinder_error_severity*
|
||||
error. This setting also applies to flawfinder for c++.
|
||||
|
||||
|
||||
===============================================================================
|
||||
gcc *ale-c-gcc*
|
||||
|
||||
g:ale_c_gcc_executable *g:ale_c_gcc_executable*
|
||||
*b:ale_c_gcc_executable*
|
||||
Type: |String|
|
||||
Default: `'gcc'`
|
||||
|
||||
This variable can be changed to use a different executable for gcc.
|
||||
|
||||
|
||||
g:ale_c_gcc_options *g:ale_c_gcc_options*
|
||||
*b:ale_c_gcc_options*
|
||||
Type: |String|
|
||||
Default: `'-std=c11 -Wall'`
|
||||
|
||||
This variable can be change to modify flags given to gcc.
|
||||
|
||||
|
||||
===============================================================================
|
||||
uncrustify *ale-c-uncrustify*
|
||||
|
||||
@@ -332,36 +352,5 @@ g:ale_c_uncrustify_options *g:ale_c_uncrustify_options*
|
||||
This variable can be change to modify flags given to uncrustify.
|
||||
|
||||
|
||||
===============================================================================
|
||||
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.
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
125
doc/ale-cpp.txt
125
doc/ale-cpp.txt
@@ -1,6 +1,9 @@
|
||||
===============================================================================
|
||||
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
|
||||
@@ -38,41 +41,58 @@ g:ale_cpp_astyle_project_options *g:ale_cpp_astyle_project_options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
clang *ale-cpp-clang*
|
||||
cc *ale-cpp-cc*
|
||||
*ale-cpp-gcc*
|
||||
*ale-cpp-clang*
|
||||
|
||||
g:ale_cpp_clang_executable *g:ale_cpp_clang_executable*
|
||||
*b:ale_cpp_clang_executable*
|
||||
g:ale_cpp_cc_executable *g:ale_cpp_cc_executable*
|
||||
*b:ale_cpp_cc_executable*
|
||||
Type: |String|
|
||||
Default: `'clang++'`
|
||||
Default: `'<auto>'`
|
||||
|
||||
This variable can be changed to use a different executable for clang.
|
||||
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_clang_options *g:ale_cpp_clang_options*
|
||||
*b:ale_cpp_clang_options*
|
||||
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 changed to modify flags given to clang.
|
||||
This variable can be change to modify flags given to the C++ compiler.
|
||||
|
||||
|
||||
===============================================================================
|
||||
clangd *ale-cpp-clangd*
|
||||
ccls *ale-cpp-ccls*
|
||||
|
||||
g:ale_cpp_clangd_executable *g:ale_cpp_clangd_executable*
|
||||
*b:ale_cpp_clangd_executable*
|
||||
g:ale_cpp_ccls_executable *g:ale_cpp_ccls_executable*
|
||||
*b:ale_cpp_ccls_executable*
|
||||
Type: |String|
|
||||
Default: `'clangd'`
|
||||
Default: `'ccls'`
|
||||
|
||||
This variable can be changed to use a different executable for clangd.
|
||||
This variable can be changed to use a different executable for ccls.
|
||||
|
||||
|
||||
g:ale_cpp_clangd_options *g:ale_cpp_clangd_options*
|
||||
*b:ale_cpp_clangd_options*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
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 modify flags given to clangd.
|
||||
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.
|
||||
|
||||
|
||||
===============================================================================
|
||||
@@ -106,6 +126,25 @@ g:ale_cpp_clangcheck_options *g:ale_cpp_clangcheck_options*
|
||||
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*
|
||||
|
||||
@@ -295,61 +334,11 @@ g:ale_cpp_flawfinder_options *g:ale-cpp-flawfinder*
|
||||
This variable can be used to pass extra options into the flawfinder command.
|
||||
|
||||
|
||||
===============================================================================
|
||||
gcc *ale-cpp-gcc*
|
||||
|
||||
g:ale_cpp_gcc_executable *g:ale_cpp_gcc_executable*
|
||||
*b:ale_cpp_gcc_executable*
|
||||
Type: |String|
|
||||
Default: `'gcc'`
|
||||
|
||||
This variable can be changed to use a different executable for gcc.
|
||||
|
||||
|
||||
g:ale_cpp_gcc_options *g:ale_cpp_gcc_options*
|
||||
*b:ale_cpp_gcc_options*
|
||||
Type: |String|
|
||||
Default: `'-std=c++14 -Wall'`
|
||||
|
||||
This variable can be changed to modify flags given to gcc.
|
||||
|
||||
|
||||
===============================================================================
|
||||
uncrustify *ale-cpp-uncrustify*
|
||||
|
||||
See |ale-c-uncrustify| for information about the available options.
|
||||
|
||||
|
||||
===============================================================================
|
||||
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.
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
@@ -48,7 +48,7 @@ Notes:
|
||||
* C
|
||||
* `astyle`
|
||||
* `ccls`
|
||||
* `clang`
|
||||
* `clang` (`cc`)
|
||||
* `clangd`
|
||||
* `clang-format`
|
||||
* `clangtidy`!!
|
||||
@@ -56,7 +56,7 @@ Notes:
|
||||
* `cpplint`!!
|
||||
* `cquery`
|
||||
* `flawfinder`
|
||||
* `gcc`
|
||||
* `gcc` (`cc`)
|
||||
* `uncrustify`
|
||||
* C#
|
||||
* `csc`!!
|
||||
@@ -66,7 +66,7 @@ Notes:
|
||||
* C++ (filetype cpp)
|
||||
* `astyle`
|
||||
* `ccls`
|
||||
* `clang`
|
||||
* `clang` (`cc`)
|
||||
* `clangcheck`!!
|
||||
* `clangd`
|
||||
* `clang-format`
|
||||
@@ -76,7 +76,7 @@ Notes:
|
||||
* `cpplint`!!
|
||||
* `cquery`
|
||||
* `flawfinder`
|
||||
* `gcc`
|
||||
* `gcc` (`cc`)
|
||||
* `uncrustify`
|
||||
* Chef
|
||||
* `cookstyle`
|
||||
|
||||
12
doc/ale.txt
12
doc/ale.txt
@@ -2322,16 +2322,15 @@ documented in additional help files.
|
||||
bibclean..............................|ale-bib-bibclean|
|
||||
c.......................................|ale-c-options|
|
||||
astyle................................|ale-c-astyle|
|
||||
clang.................................|ale-c-clang|
|
||||
cc....................................|ale-c-cc|
|
||||
ccls..................................|ale-c-ccls|
|
||||
clangd................................|ale-c-clangd|
|
||||
clang-format..........................|ale-c-clangformat|
|
||||
clangtidy.............................|ale-c-clangtidy|
|
||||
cppcheck..............................|ale-c-cppcheck|
|
||||
cquery................................|ale-c-cquery|
|
||||
flawfinder............................|ale-c-flawfinder|
|
||||
gcc...................................|ale-c-gcc|
|
||||
uncrustify............................|ale-c-uncrustify|
|
||||
ccls..................................|ale-c-ccls|
|
||||
chef....................................|ale-chef-options|
|
||||
cookstyle.............................|ale-chef-cookstyle|
|
||||
foodcritic............................|ale-chef-foodcritic|
|
||||
@@ -2345,9 +2344,10 @@ documented in additional help files.
|
||||
cmake-format..........................|ale-cmake-cmakeformat|
|
||||
cpp.....................................|ale-cpp-options|
|
||||
astyle................................|ale-cpp-astyle|
|
||||
clang.................................|ale-cpp-clang|
|
||||
clangd................................|ale-cpp-clangd|
|
||||
cc....................................|ale-cpp-cc|
|
||||
ccls..................................|ale-cpp-ccls|
|
||||
clangcheck............................|ale-cpp-clangcheck|
|
||||
clangd................................|ale-cpp-clangd|
|
||||
clang-format..........................|ale-cpp-clangformat|
|
||||
clangtidy.............................|ale-cpp-clangtidy|
|
||||
clazy.................................|ale-cpp-clazy|
|
||||
@@ -2355,9 +2355,7 @@ documented in additional help files.
|
||||
cpplint...............................|ale-cpp-cpplint|
|
||||
cquery................................|ale-cpp-cquery|
|
||||
flawfinder............................|ale-cpp-flawfinder|
|
||||
gcc...................................|ale-cpp-gcc|
|
||||
uncrustify............................|ale-cpp-uncrustify|
|
||||
ccls..................................|ale-cpp-ccls|
|
||||
c#......................................|ale-cs-options|
|
||||
csc...................................|ale-cs-csc|
|
||||
mcs...................................|ale-cs-mcs|
|
||||
|
||||
Reference in New Issue
Block a user