Introduce astyle for C++ code formatting, and reformat codebase
Creates an .astylerc file defining the formatting rules; with astyle installed, you can do this from the repository root:
astyle --options=.astylerc --recursive --suffix=none '.cpp' '.h'
Removes the Eclipse formatting rules since they're IDE dependent and not used by the current maintainer team
Applying the formatting rules to the entire C++ codebase with astyle 3.6.13
The style rules were designed to align as closely as possible with the de-facto code style of the core piscsi modules, which have been touched most recently. In those modules only minimal inconsistencies are addressed. On some older modules and the unit test where code style is looser, we get major reformatting.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Note that there's a new bug in the latest astyle which causes it to ignore the reference operator alignment in function arguments. It always center align the operator. Let's give them a few weeks and see if they fix the bug.
https://gitlab.com/saalen/astyle/-/issues/103
This is neat. Let's give it a go. The commit hash is likely to change after a rebase merge, so it's something that we create after the fact I think.
abandoning this for now; astyle is not getting a bugfix anytime soon it seems, and when going back to an earlier version that didn't have this bug, there were other unwanted style bugs instead
I'm going to revisit clang-format instead, which @akuker originally introduced