summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-08-30 22:08:41 +0100
committerw0rp <devw0rp@gmail.com>2017-08-30 22:08:41 +0100
commited9cdca127abea30ffaf5df0ba1cc5ffe5c5a657 (patch)
tree70ab2d42759b407f64045a2bc53c6be2bb41a332 /doc
parentfca77266bde1ed48b20ec37bab81d05f826e1e6c (diff)
parente4a6da936d68310a5bf4d744f2275e57e0a62724 (diff)
downloadale-ed9cdca127abea30ffaf5df0ba1cc5ffe5c5a657.zip
Merge remote-tracking branch 'randrej/master' into c-clang-tidy
Diffstat (limited to 'doc')
-rw-r--r--doc/ale-c.txt84
-rw-r--r--doc/ale-cpp.txt28
-rw-r--r--doc/ale.txt3
3 files changed, 88 insertions, 27 deletions
diff --git a/doc/ale-c.txt b/doc/ale-c.txt
index 1e1322bc..0c4f8dc9 100644
--- a/doc/ale-c.txt
+++ b/doc/ale-c.txt
@@ -3,6 +3,37 @@ ALE C Integration *ale-c-options*
===============================================================================
+Global Options
+
+g:ale_c_build_dir_names *g:ale_c_build_dir_names*
+ *b: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)
+
+
+g:ale_c_build_dir *g:ale_c_build_dir*
+ *b:ale_c_build_dir*
+
+ Type: |String|
+ Default: `''`
+
+ A path to the directory containing the `compile_commands.json` file to use
+ with c-family linters. Usually setting this option to a non-empty string
+ will override the |g:ale_c_build_dir_names| option to impose a compilation
+ database (it can be useful if multiple builds are in multiple build
+ subdirectories in the project tree).
+ This feature is also most useful for the clang tools linters, wrapped
+ aroung LibTooling (namely clang-tidy here)
+
+===============================================================================
clang *ale-c-clang*
g:ale_c_clang_executable *g:ale_c_clang_executable*
@@ -22,6 +53,59 @@ g:ale_c_clang_options *g:ale_c_clang_options*
===============================================================================
+clangtidy *ale-c-clangtidy*
+
+`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|
+ Default: `['*']`
+
+ 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
+ clang documentation for an up-to-date list of compatible checks:
+ http://clang.llvm.org/extra/clang-tidy/checks/list.html
+
+
+g:ale_c_clangtidy_executable *g:ale_c_clangtidy_executable*
+ *b:ale_c_clangtidy_executable*
+ Type: |String|
+ Default: `'clang-tidy'`
+
+ This variable can be changed to use a different executable for clangtidy.
+
+
+g:ale_c_clangtidy_options *g:ale_c_clangtidy_options*
+ *b:ale_c_clangtidy_options*
+ Type: |String|
+ Default: `''`
+
+ This variable can be changed to modify flags given to clang-tidy.
+
+ - 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.
+
+
+===============================================================================
cppcheck *ale-c-cppcheck*
g:ale_c_cppcheck_executable *g:ale_c_cppcheck_executable*
diff --git a/doc/ale-cpp.txt b/doc/ale-cpp.txt
index 2ece6843..685bb8dc 100644
--- a/doc/ale-cpp.txt
+++ b/doc/ale-cpp.txt
@@ -5,33 +5,9 @@ ALE C++ Integration *ale-cpp-options*
===============================================================================
Global Options
-g:ale_c_build_dir_names *g:ale_c_build_dir_names*
- *b:ale_c_build_dir_names*
+The |g:ale_c_build_dir_names| and |g:ale_c_build_dir| also apply to some C++
+linters too.
- 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)
-
-
-g:ale_c_build_dir *g:ale_c_build_dir*
- *b:ale_c_build_dir*
-
- Type: |String|
- Default: `''`
-
- A path to the directory containing the `compile_commands.json` file to use
- with c-family linters. Usually setting this option to a non-empty string
- will override the |g:ale_c_build_dir_names| option to impose a compilation
- database (it can be useful if multiple builds are in multiple build
- subdirectories in the project tree).
- This feature is also most useful for the clang tools linters, wrapped
- aroung LibTooling (namely clang-tidy here)
===============================================================================
clang *ale-cpp-clang*
diff --git a/doc/ale.txt b/doc/ale.txt
index bbe09900..dfdb2693 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -18,6 +18,7 @@ CONTENTS *ale-contents*
gcc.................................|ale-asm-gcc|
c.....................................|ale-c-options|
clang...............................|ale-c-clang|
+ clangtidy...........................|ale-c-clangtidy|
cppcheck............................|ale-c-cppcheck|
gcc.................................|ale-c-gcc|
clang-format........................|ale-c-clangformat|
@@ -188,7 +189,7 @@ Notes:
* Awk: `gawk`
* Bash: `shell` (-n flag), `shellcheck`
* Bourne Shell: `shell` (-n flag), `shellcheck`
-* C: `cppcheck`, `cpplint`!!, `gcc`, `clang`, `clang-format`
+* C: `cppcheck`, `cpplint`!!, `gcc`, `clang`, `clangtidy`!!, `clang-format`
* C++ (filetype cpp): `clang`, `clangcheck`!!, `clangtidy`!!, `cppcheck`, `cpplint`!!, `gcc`, `clang-format`
* C#: `mcs`
* Chef: `foodcritic`