Skip to content

Review clang-format configuration (was ACTS-351)

Original author Moritz Kiehn @msmk

He current clang-format configuration forces aligned variable assignment, newlines both for template definition, return type, and body of functions, and indentation based on namespace depth.

The first part introduces visual clutter since single line changes can required additional purely formatting changes. e.g.

double x = 0;
float    y = 0;
int       z = 1;

would change to

float x = 0;
float y = 0;
int    z = 0;

even though only one line had a real change.

The second part requires a lot of vertical space that limits readability especially in header files. Compare the current format

template <typename T>
T
doThings(const T& x)
{
    return x;
}

with one example for a more compressed format

template <typename T>
T doThings(const T& x) { return x; }

Changes can be tested first in the framework, see ACTSFW-48.

Edited by Moritz Kiehn
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information