Consider configuring ECM clang-format hook setup for KDevelop
The following discussion from !533 (merged) should be addressed:
-
@igorkushnir started a discussion: (+6 comments) Run
git clang-format @~
, then amend to conform to KDevelop's preferred formatting style.
Igor Kushnir:
Does the hook format all project sources or use git clang-format to format only the recent diff? KDevelop sources are not yet clang-formatted. Also can the hook be overridden manually? Sometimes a tiny bug fix in poorly formatted code triggers reformatting of a lot of unrelated code.
Arjen Hiemstra:
It only checks formatting of the staged changes. It also respects the customised .clang-format that's already in the sources.
I think this is the relevant documentation: https://api.kde.org/ecm/kde-module/KDEGitCommitHooks.html
We need to check how it works in practice for KDevelop sources that are not consistently formatted yet.