Contrary to what is stated in https://frinring.wordpress.com/2018/08/30/improve-your-cpp-code-in-kdevelop-with-clang-tidy/, the clang-tidy plugin doesn't build with kdevelop 5.2 First of all there is an error /build/kdevelop-clang.tidy/src/kdev-clang-tidy-0.3.0/src/problemmodel.cpp:78:67: error: variable ‘KDevelop::DocumentRange pathLocation’ has initializer but incomplete type KDevelop::DocumentRange pathLocation(KDevelop::DocumentRange::invalid()); ^~~~~~~ which can be fixed by adding #include <language/editor/documentrange.h> After this one gets another error /build/kdevelop-clang.tidy/src/kdev-clang-tidy-0.3.0/src/problemmodel.cpp: In member function ‘void ClangTidy::ProblemModel::setMessage(const QString&)’: /build/kdevelop-clang.tidy/src/kdev-clang-tidy-0.3.0/src/problemmodel.cpp:81:5: error: ‘setPlaceholderText’ was not declared in this scope setPlaceholderText(message, pathLocation, i18n("Clang-Tidy")); ^~~~~~~~~~~~~~~~~~
Git commit ed4992ec6dfd530608a8140b35d23f5375e6ad9d by Kevin Funk. Committed on 30/08/2018 at 11:16. Pushed by kfunk into branch 'master'. Add missing include M +1 -0 src/problemmodel.cpp https://commits.kde.org/kdev-clang-tidy/ed4992ec6dfd530608a8140b35d23f5375e6ad9d
Indeed, my bad, I managed to screw up my test builds and were using 5.3 where I assumed 5.2 to be building. Working on fixing that, 9.3.1 should be out later today.
There's also an '#include <QUrl>' missing in src/problemmodel.h which is needed with Qt 5.11
Yes, that as well. And then some work to ifversion for some kdevplatform API only in 5.3... oh dear, I must have been running the wrong branch for some time :/ Fixing while I comment here :)
Git commit 7e56a85ae63bc73cc7470d2db894ec27be57b110 by Friedrich W. H. Kossebau. Committed on 30/08/2018 at 11:45. Pushed by kossebau into branch 'master'. Fix build with KDevPlatform 5.2 M +6 -0 src/CMakeLists.txt A +8 -0 src/config.h.in M +6 -0 src/problemmodel.cpp M +6 -0 src/problemmodel.h https://commits.kde.org/kdev-clang-tidy/7e56a85ae63bc73cc7470d2db894ec27be57b110