mqtt_cpp
mqtt_cpp copied to clipboard
Add more static analysis to CI
E.g this blog post has great info on how to use cmake to do some great static anlysis.
https://blog.kitware.com/static-checks-with-cmake-cdash-iwyu-clang-tidy-lwyu-cpplint-and-cppcheck/
I've set up the following on some of my projects:
"link what you use"
cmake -DCMAKE_LINK_WHAT_YOU_USE=TRUE .
cmake --build . --target all
include what you use:
cmake -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=/usr/lib/llvm/8/bin/include-what-you-use .
cmake --build . --target all
clang tidy
cmake -DCMAKE_CXX_CLANG_TIDY=/usr/lib/llvm/8/bin/clang-tidy .
cmake --build . --target all
clang static analyzer (different than clang tidy)
export PATH="/usr/lib/llvm/8/bin:$PATH"
scan-build -o scanlogs cmake -DCMAKE_BUILD_TYPE=Debug .
scan-build -o scanlogs make -j `nproc`
@jonesmz , it seems good. Could you write a PR to support the feature?
Sure.
Will try.