Skip to content

clang-format: Set AlignConsecutiveDeclarations in .clang-format

Ben Mather requested to merge bwhmather/gtk:align-consecutive-declarations into main

This makes automated alignment of function declaration arguments match much more closely with the current manual style.

Manual:

gdk_texture_loadable_icon_load (GLoadableIcon  *icon,
                                int             size,
                                char          **type,
                                GCancellable   *cancellable,
                                GError        **error)

clang-format before this change:

gdk_texture_loadable_icon_load (GLoadableIcon *icon,
                                int size,
                                char **type,
                                GCancellable *cancellable,
                                GError **error)

clang-format after this change:

gdk_texture_loadable_icon_load (GLoadableIcon *icon,
                                int            size,
                                char         **type,
                                GCancellable  *cancellable,
                                GError       **error)

Note that clang-format tries to be cute and will indent pointer *s less than the longest identifier name if it can get away with it.

AlignConsecutiveDeclarations was introduced in clang-format 3.8, which was presumably released after this file was added.

Merge request reports