Formatted by the uncrustify-kf5 script
Details
Diff Detail
- Lint
Lint Skipped - Unit
Unit Tests Skipped
I wanted to make some minor changes like removing the QT foreach from KCalc, but then it seemed prudent to first reformat the source according to KDE style. The vast majority of this diff consists of moved opening braces, and tabs replaced by spaces.
What I usually do is to copy the style I find, but I wouldn't object reformatting for consistency.
The status quo is 'uncrustify-kf5' from https://cgit.kde.org/kde-dev-scripts.git/tree/ but I don't know if it will give a different result. Could you try this?
Yeah, I also started by copying the style, but realized a reformat might be acceptable before I do more.
The uncrustify script should perhaps be mentioned in the docs somewhere. I used astyle because I found a reference here: https://community.kde.org/Policies/Kdelibs_Coding_Style. Uncrustify produces a slightly different result, mostly regarding long lines it seems. Updating the diff to uncrustify version.
I feared that it would result in many more changes, because KCalc code is 20+ years old, and maintainers didn't have guidelines for coding style back then.
We usually do not fix the coding style on old code because it makes it harder to see who contributed which changes ("git blame"). Style conventions make more sense for new code, or when the git history is rewritten anyway (e.g. for the KF5 split).
I don't know if Evan still has time to review changes; adding more reviewers to check if anyone objects.
kcalc_core.cpp | ||
---|---|---|
175–189 | You might want to revert this part manually. The new table is much harder to read. |
On the git blame point, I've found git hyper-blame to be very useful for exactly this case: https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/git-hyper-blame.html
Unless there's going to be a git hook, a CI job or something similar making sure we follow this style i don't see the point
There seems to be no consensus that that such reformats of old code are needed. Closing.