Clang-tidy——静态代码分析框架
clang-tidy具体可以检测以下几个部分: (1)boost 检测boost库API使用问题 (2)cert 检测CERT的代码规范 (3)cpp-core-guidelines 检测是否违反cpp-core-guidelines (4)google 检测是否违反google code style (5)llvm 检测是否违反llvm code style (6)readability 检测代码上相关问题,但又不明确属于任何代码规范的 (7)misc 其它一些零碎的check (8)mpi 检测MPI API问题 (9)modernize 把C++03代码转换成C++11代码,使用C++11新特性 (10)performance 检测performance相关问题
官网:https://clang.llvm.org/extra/clang-tidy/
实例:https://github.com/google/orbit/blob/main/.clang-tidy
参考: https://hokein.github.io/clang-tools-tutorial/clang-tidy.htmlhttps://www.cxyzjd.com/article/ypshowm/100040729https://blog.csdn.net/u013187057/article/details/103052275https://www.cxyzjd.com/article/wads23456/108009617https://codeyarns.com/2019/01/28/how-to-use-clang-tidy/https://segmentfault.com/a/1190000007015981https://www.kdab.com/clang-tidy-part-1-modernize-source-code-using-c11c14/https://www.kdab.com/clang-tidy-part-2-integrate-qmake-and-other-build-systems-using-bear/