SUMMARY Pointer alignment type of default formatting style 'KDELibs' is set to '--align-pointer=type' except it should be '--align-pointer=name' as stated in https://community.kde.org/Policies/Frameworks_Coding_Style and https://invent.kde.org/sdk/kde-dev-scripts/-/blob/master/astyle-kdelibs STEPS TO REPRODUCE 1. Open code formattion settings 2. Check C++ and Artistic style 3. See that pointer * are aligned with the type and not with the name OBSERVED RESULT Aligned with the type EXPECTED RESULT Aligned with the name SOFTWARE/OS VERSIONS Kdevelop: Version 5.6.0 Operating System: Manjaro Linux KDE Plasma Version: 5.19.5 KDE Frameworks Version: 5.73.0 Qt Version: 5.15.0
Extremely easy to fix here: https://invent.kde.org/kdevelop/kdevelop/-/blob/6448782fbb6d1085e11357f84decfa90a63e8a34/plugins/astyle/astyle_formatter.cpp#L266 A test can be added here: https://invent.kde.org/kdevelop/kdevelop/-/blob/6448782fbb6d1085e11357f84decfa90a63e8a34/plugins/astyle/tests/test_astyle.cpp
Looks like this aspect of the KDELibs code style changed several years ago: Bug 265019.
Thank you Igor for pointing me to the right locations to work on the issue. I fixed the formatting style, tried to write a simple test and created a merge-request (170).
Git commit 1679afee428b35878f6466d0e30ba5c0a69c7228 by Igor Kushnir, on behalf of Derek Christ. Committed on 06/04/2021 at 12:24. Pushed by igorkushnir into branch 'master'. Rename KDELibs astyle formatting and fix its pointer alignment Rename the "KDELibs" Artistic Style code formatting preset to "KDE Frameworks" and fix pointer alignment for it which was set to PTR_ALIGN_TYPE instead of PTR_ALIGN_NAME. Also add a test in testPointerAlignment() for general pointer and reference alignments and add various tests in testKdeFrameworks() to verify that the KDE Frameworks formatting styles are matched by the automatic formatting. FIXED-IN: 5.7.0 M +2 -2 plugins/astyle/astyle_formatter.cpp M +1 -1 plugins/astyle/astyle_plugin.cpp M +59 -0 plugins/astyle/tests/test_astyle.cpp M +3 -0 plugins/astyle/tests/test_astyle.h https://invent.kde.org/kdevelop/kdevelop/commit/1679afee428b35878f6466d0e30ba5c0a69c7228