diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.h')
| -rw-r--r-- | clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.h b/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.h index 4ff0aca5652..12d7b37a652 100644 --- a/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.h +++ b/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.h @@ -16,25 +16,31 @@ namespace clang { namespace tidy { namespace readability { -/// \brief Checks that bodies of 'if' statements and loops ('for', 'range-for', -/// 'do-while', and 'while') are inside braces +/// Checks that bodies of `if` statements and loops (`for`, `range-for`, +/// `do-while`, and `while`) are inside braces /// /// Before: -/// if (condition) -/// statement; +/// +/// \code +/// if (condition) +/// statement; +/// \endcode /// /// After: -/// if (condition) { -/// statement; -/// } +/// +/// \code +/// if (condition) { +/// statement; +/// } +/// \endcode /// /// Additionally, one can define an option `ShortStatementLines` defining the /// minimal number of lines that the statement should have in order to trigger /// this check. +/// /// The number of lines is counted from the end of condition or initial keyword -/// (do/else) until the last line of the inner statement. -/// Default value 0 means that braces will be added to all statements (not -/// having them already). +/// (`do`/`else`) until the last line of the inner statement. Default value 0 +/// means that braces will be added to all statements (not having them already). class BracesAroundStatementsCheck : public ClangTidyCheck { public: BracesAroundStatementsCheck(StringRef Name, ClangTidyContext *Context); |

