[gmx-developers] Updated clang-format rules: `#include` sorting

Eric Irrgang ericirrgang at gmail.com
Thu Mar 17 13:58:17 CET 2022


Hi Devs.

!2590 was merged today, provisionally resolving #3659 ("Update header inclusion order policy and enforcement").

This change restores enforcement of header sorting, but with clang-format instead of a custom script.

The exact sorting mechanism is simpler (relying exclusively on regular expression matching order) and so the previous sorting rules (https://manual.gromacs.org/current/dev-manual/includestyle.html) cannot be reproduced exactly.

Additionally, the paths used for `#include` directives will be updated, in some cases, with resolution of #3288 (coming soon).

To reduce merge conflicts on outstanding branches/MRs, you can merge or cherry-pick the updated .clang-format file and apply clang-format to your branch before rebasing onto master.

Apologies for the inconvenience.

Best,
Eric


More information about the gromacs.org_gmx-developers mailing list