diff options
author | Leena Miettinen <riitta-leena.miettinen@qt.io> | 2018-02-16 16:20:51 +0100 |
---|---|---|
committer | Leena Miettinen <riitta-leena.miettinen@qt.io> | 2018-02-20 11:31:58 +0000 |
commit | f05e4d3c8d4c108bb6408d097b18c01d9a599cc3 (patch) | |
tree | 66f982bf00eef1ff5406d4e8b5b9e2279000401e /doc | |
parent | b114b0c95eb88b11a4832af8a315c03bcbfa6eb7 (diff) | |
download | qt-creator-f05e4d3c8d4c108bb6408d097b18c01d9a599cc3.tar.gz |
Doc: Update info about Clang code model configuration
Change-Id: Ib20447e081f38d9f24357a717fd8ebdd489b335a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/images/qtcreator-clang-code-model-options.png | bin | 71706 -> 60132 bytes | |||
-rw-r--r-- | doc/images/qtcreator-clang-tidy.png | bin | 0 -> 16381 bytes | |||
-rw-r--r-- | doc/images/qtcreator-clazy.png | bin | 0 -> 19987 bytes | |||
-rw-r--r-- | doc/src/editors/creator-clang-codemodel.qdoc | 104 |
4 files changed, 66 insertions, 38 deletions
diff --git a/doc/images/qtcreator-clang-code-model-options.png b/doc/images/qtcreator-clang-code-model-options.png Binary files differindex 1c35af1fb0..99351af363 100644 --- a/doc/images/qtcreator-clang-code-model-options.png +++ b/doc/images/qtcreator-clang-code-model-options.png diff --git a/doc/images/qtcreator-clang-tidy.png b/doc/images/qtcreator-clang-tidy.png Binary files differnew file mode 100644 index 0000000000..156eb23d9d --- /dev/null +++ b/doc/images/qtcreator-clang-tidy.png diff --git a/doc/images/qtcreator-clazy.png b/doc/images/qtcreator-clazy.png Binary files differnew file mode 100644 index 0000000000..5b59b0d15a --- /dev/null +++ b/doc/images/qtcreator-clazy.png diff --git a/doc/src/editors/creator-clang-codemodel.qdoc b/doc/src/editors/creator-clang-codemodel.qdoc index 673159fd90..239fe842aa 100644 --- a/doc/src/editors/creator-clang-codemodel.qdoc +++ b/doc/src/editors/creator-clang-codemodel.qdoc @@ -93,27 +93,68 @@ \li Code completion \li Syntactic and semantic highlighting \li Diagnostics + \li Clang-Tidy checks + \li Clazy checks \li Tooltips - \li Clang-Tidy and Clazy checks \li Renaming of local symbols \endlist To use the plugin, you must activate it and configure it in \QC. - \section1 Using Clang-Tidy and Clazy + \section1 Code Model Warnings - \l{https://clang.llvm.org/extra/clang-tidy/}{Clang-Tidy} and - \l{https://github.com/KDE/clazy/blob/master/README.md}{Clazy} are delivered - as parts of the Clang library delivered with \QC. + The predefined configurations request Clang warnings at the following + levels: - Clang-Tidy provides an extensible framework for diagnosing and fixing - typical programming errors, such as style violations, interface misuse, or - issues that can be found via static analysis. + \list + + \li \uicontrol {Pedantic Warnings} uses the \c -Wpendantic option that + requests all the warnings demanded by strict ISO C and ISO C++. + + \li \uicontrol {Warnings for Questionable Constructs} combines the + \c -Wall and \c -Wextra options to request all warnings about easily + avoidable questionable constructions and some additional warnings. + + \li \uicontrol {Warnings for Almost Everything} uses the \c -Weverything + option with negative options to suppress some warnings. + + \endlist + + You can edit the predefined configurations to request specific warnings + beginning with \c -W. Each of these warnings also has a negative version + that begins with \c -Wno. + + Keep in mind that some options turn on other options. For more information, + see \l{https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html} + {Options to Request or Suppress Warnings} or the GCC or Clang manual pages. + + \section1 Using Clang-Tidy Checks - Clazy helps Clang understand Qt semantics. It prints out Qt related compiler - warnings, ranging from unnecessary memory allocation to misuse of API and - provides refactoring actions for fixing some of the issues. + \l{https://clang.llvm.org/extra/clang-tidy/}{Clang-Tidy} is delivered + as a part of the Clang library delivered with \QC. It provides diagnostics + and fixes for typical programming errors, such as style violations, + interface misuse, or issues that can be found via static analysis. + + \QC integrates the fixes and diagnostics into the Clang library, and + therefore they cannot be easily changed or extended when used with \QC. + + \section1 Using Clazy + + \l{https://github.com/KDE/clazy/blob/master/README.md}{Clazy} is delivered + as a part of the Clang library delivered with \QC. It helps Clang understand + Qt semantics. It prints out Qt related compiler warnings, ranging from + unnecessary memory allocation to misuse of API and provides refactoring + actions for fixing some of the issues. + + The Clazy checks are divided into levels from 0 to 3. Each level adds checks + to the previous level. The checks at level 0 are very stable and provide + hardly any false positives, while the checks at level 3 can be considered + experimental. + + For more information about the checks run at each level, see + \l{https://github.com/KDE/clazy/blob/master/README.md#list-of-checks} + {List of Checks} in the Clazy documentation. \section1 Activating Clang Code Model @@ -159,44 +200,31 @@ edit the value for the \uicontrol {Do not index files greater than} check box. To index all files, deselect the check box. - \li In the \uicontrol {Clang Code Model Warnings} group, configure the - diagnostics that Clang should issue. + \li In \uicontrol {Clang Dianostics}, select one of the predefined + configurations, or select \uicontrol Copy to create a copy of a + configuration and edit it to fit your needs. \list - \li In the \uicontrol {Configuration to use} list, select one of - the predefined configurations, or select \uicontrol Copy to - create a copy of a configuration and edit it to fit your - needs. + \li In the \uicontrol Clang tab, edit the predefined + configuration to request specific warnings. - \li \uicontrol {Pedantic Warnings} uses the \c -Wpendantic - option that requests all the warnings demanded by strict - ISO C and ISO C++. + \li In the \uicontrol {Clang-Tidy} tab, select the checks to + perform. - \li \uicontrol {Warnings for Questionable Constructs} combines - the \c -Wall and \c -Wextra options to request all warnings - about easily avoidable questionable constructions and some - additional warnings. + \image qtcreator-clang-tidy.png - \li \uicontrol {Warnings for Almost Everything} uses the \c - -Weverything option with negative options to suppress some - warnings. + \li In the \uicontrol Clazy tab, select the level of Clazy + checks to perform. - \endlist - - You can edit the predefined configurations to request specific - warnings beginning with \c -W. Each of these warnings also has a - negative version that begins with \c -Wno. Keep in mind that some - options turn on other options. For more information, see - \l{https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html} - {Options to Request or Suppress Warnings} or the GCC or Clang - manual pages. + \image qtcreator-clazy.png - \li In the \uicontrol {Clang Plugins} field, select the Clang-Tidy and - Clazy checks to perform. + \endlist \endlist + \section1 Specifying Clang Settings at Project Level + You can specify Clang settings at project level in the build settings of the project by selecting \uicontrol Projects > \uicontrol {Clang Code Model}. In addition to configuring the diagnostics, |