clang-tidy是基于LLVM-Clang开发的一个能够对源代码进行静态检查的工具。通过这个列表https://clang.llvm.org/extra/clang-tidy/checks/list.html,我们能看到官方提供的各类check。比如,为了预防bug而检测明显的infinite loop和除零行为 通过执行clang-tidy -list-checks -checks=*命令,我们可以查看当前可用的所有check。
先确认配置文件是否正确,进入方法ParsedAST::build,搜索getTidyOptionsForFile,将这行打印的级别调整为Error,即将打印函数替换为elog,编译运行,打印出来是包含自定义Check的,排除该原因。 然后是艰难的各种打log调试,在ClangTidyCheckFactories::registerCheckFactory方法中打印注册了哪些Check,这倒是发现了可疑的地方,clangd...
在 Android Studio 中启用 clang-tidy 支持后,可以在检查面板里调整要应用的 check 项。检查面板中列出...
Port of LLVM to the MOS 6502 and related processors - [clang-tidy] Check number of arguments to size/length in readability-… · llvm-mos/llvm-mos@57da040
.. title:: clang-tidy - clang-analyzer-optin.taint.TaintedAlloc .. meta:: :http-equiv=refresh: 5;URL=https://clang.llvm.org/docs/analyzer/checkers.html#optin-taint-taintedalloc clang-analyzer-optin.taint.TaintedAlloc === Check for memory allocations, where the size parameter might be a ...
好的代码一定是整洁的,并且能够帮助阅读的人快速理解和定位。好的代码可以加快应用的开发迭代速度,不必...
Remove clang-tidy check readability-misleading-indentation. This check is redundant, since we are forcing the use of braces in conditional blocks with clang-tidy check readability-braces-around-statements and clang-format will ensure that the code is well indented. The removal of this check should...
+namespace clang::tidy::modernize { + +UseIntegerSignComparisonCheck::UseIntegerSignComparisonCheck( + StringRef Name, ClangTidyContext *Context) + : ClangTidyCheck(Name, Context), + IncludeInserter(Options.getLocalOrGlobal("IncludeStyle", ...
if (BinaryOp == nullptr) return; - auto OpCode = BinaryOp->getOpcode(); - const auto *LHS = BinaryOp->getLHS()->IgnoreParenImpCasts(); - const auto *RHS = BinaryOp->getRHS()->IgnoreParenImpCasts(); - if (LHS == nullptr || RHS == nullptr) ...
One of the great features of CMake/CTest/CDash is the ability to setup useful but rarely used tools to automatically run on a project and report the results to a web page. For example, valgrind is a great tool to run dynamic checks on C/C++ code catching