I tested it against various merge requests and the more I go, the more I
wonder if it will ever be *really* useful. It detects so many false
positive of totally acceptable code. I tweak the style rules, improve
some things but then make other things worse.
Actually the logic of having one "best" case with the penalty system is
flawed IMO. We should really have rules of what is acceptable and should
not trigger changes vs. what is not acceptable styling.
For instance what such a system cannot detect is when we organize some
things on purpose, for instance for semantic reasons. If it's just "best
rule" based, it cannot work, but with an "acceptable style" logic, the
on-purpose organization of code will just pass as long as it doesn't
break the coding style.
Anyway let's see…
- Align macro values.
- Align backslashes to escape newlines.
- Added explicit PointerAlignment though this one seems unneeded.
- Increase the column limit (even though 80 is really the official one)
and add some penalty on breaking on very unexpected places, such as
around assignments or on first parameters in calls/declaration. We
want short lines but this is more of a soft rule which should not
override sensible line breaking rules.
- Group some rules and reorder rule names alphabetically within groups.
Fixes#950
`.gitlab/search-common-ancestor.sh`'s original authors are
Philip Withnall and Frederic Martinsons.
(Jehan/reviewer's note: script further improved by Asalle)