Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Find what you need - explore our website and developer resources
5 January 2022
It is not entirely trivial to run clazy and clang-tidy from the command line, but it is rather useful to do so to either run it from CI or to make the same fixit for lots of projects. In the video, I promise a script to run over all files. It looks somewhat like this but, of course, needs to be adapted to your directory layout:
for file in ` find ../sources -name \*.cpp | grep -v 3rdparty`; do \
echo "-------------$file-------------"; \
clazy-standalone --checks=old-style-connect -p ../build/compile_commands.json --ignore-dirs='5.15' \
-export-fixes=`basename $file`.yaml $file; done
clang-apply-replacements .
List of all clazy checks: https://github.com/KDE/clazy#list-of-checks
clang-tidy binary: https://clang.llvm.org/extra/clang-tidy/
clang-tidy checks: https://clang.llvm.org/extra/clang-tidy/checks/list.html
The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/scripts
All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Learn Modern C++
Our hands-on Modern C++ training courses are designed to quickly familiarize newcomers with the language. They also update professional C++ developers on the latest changes in the language and standard library introduced in recent C++ editions.
Learn more
Need help with performance issues?
Let the KDAB experts solve concrete performance problems, improve your software architecture or teach your team how to apply debugging and profiling tools to your developement process in the best way.
Get in touch