Bug 427109 - Wrong pointer alignment type of KDELibs formatting style
Summary: Wrong pointer alignment type of KDELibs formatting style
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Astyle (other bugs)
Version First Reported In: unspecified
Platform: Manjaro Linux
: NOR minor
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2020-09-29 10:05 UTC by Derek Christ
Modified: 2021-04-06 15:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.7.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Derek Christ 2020-09-29 10:05:42 UTC
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
Comment 2 Igor Kushnir 2020-09-29 11:54:46 UTC
Looks like this aspect of the KDELibs code style changed several years ago: Bug 265019.
Comment 3 Derek Christ 2020-09-29 21:49:45 UTC
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).
Comment 4 Igor Kushnir 2021-04-06 15:03:36 UTC
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