C++'s alternative tokens are a good way to improve readability and
minimise bugs by expressing intention using words instead of symbols
(which can both be more easily misspelt _and_ misread).
This warning analyses the binary logical and bitwise operators and warns
if they aren't spelt using the alternative tokens. Bitwise compound
assignment and != operators are not in scope since there's nothing to
misspel or misread.
Future work:
- add a way for the compiler to detect when the pipe operator (|) is not being used for a bitwise-or operation
- add preprocessor support
- add config options
Following from gone thread due to file rename.
Not the entire RST, but the one-sentence or first-paragraph "pitch". For example, let's see bugprone-branch-clone's class's doc-comment:
/// A check for detecting if/else if/else chains where two or more branches are /// Type I clones of each other (that is, they contain identical code), for /// detecting switch statements where two or more consecutive branches are /// Type I clones of each other, and for detecting conditional operators where /// the true and false expressions are Type I clones of each other. /// /// For the user-facing documentation see: /// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-branch-clone.html class BranchCloneCheck : public ClangTidyCheck {Or another one selected randomly, performance-no-automatic-move:
/// Finds local variables that cannot be automatically moved due to constness. /// /// For the user-facing documentation see: /// http://clang.llvm.org/extra/clang-tidy/checks/performance-no-automatic-move.html class NoAutomaticMoveCheck : public ClangTidyCheck {So there is a one-paragraph summary of the check itself (it could be shorter than here...), and there is a text that's generated from a template (I think add-new-check.py sets the new check's files as such when you run it), which basically just links the upstream official website render of your check's documentation HTML.