diff options
author | Leena Miettinen <riitta-leena.miettinen@qt.io> | 2019-12-17 15:12:49 +0100 |
---|---|---|
committer | Leena Miettinen <riitta-leena.miettinen@qt.io> | 2020-01-21 13:22:20 +0000 |
commit | c16e205a7712cd0f0d8b68cfcaa7baf41acb368f (patch) | |
tree | 98e0b09a0192799bed8cf4f58d25f9abe5fa06d6 | |
parent | 68fbd15299847858c95c7991b812f80ae475ad28 (diff) |
Doc: Describe saving Clang-Tidy configuration as a file
Fixes: QTCREATORBUG-23223
Change-Id: Ia78220bb959e9bafb9101e3f130ab75180c1b816
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
-rw-r--r-- | doc/src/analyze/creator-clang-static-analyzer.qdoc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/src/analyze/creator-clang-static-analyzer.qdoc b/doc/src/analyze/creator-clang-static-analyzer.qdoc index b378553495..b098943269 100644 --- a/doc/src/analyze/creator-clang-static-analyzer.qdoc +++ b/doc/src/analyze/creator-clang-static-analyzer.qdoc @@ -181,4 +181,28 @@ at each level. To include the checks from the lower levels automatically, select the \uicontrol {Enable lower levels automatically} check box. + \section2 Creating Clang-Tidy Configuration Files + + Clang-Tidy reads the configuration for each source file from a .clang-tidy + file located in the closest parent directory of the source file. If any + configuration options have a corresponding command-line option, the + command-line option takes precedence. The effective configuration can be + inspected using \c {-dump-config}. + + \QC creates the configuration for you based on the checks you select. To + store the checks in file format, you can create a .clang-tidy file, as + follows: + + \list 1 + \li Select \uicontrol {Edit Checks as String} and copy the contents of + the field. + \li Pipe the output of \c {clang-tidy -dump-config} into a file named + \c {.clang-tidy}. For example: + \c {clang-tidy -checks=-*,bugprone-*,cppcoreguidelines-avoid-* -dump-config > .clang-tidy} + \li Move the .clang-tidy file to the parent directory of the sources. + \endlist + + To add more checks using \QC later on, copy the checks from your .clang-tidy + file into the \uicontrol {Edit Checks as String} field, select additional + checks, and copy-paste the contents of the field to the .clang-tidy file. */ |