llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.1k stars 11.6k forks source link

[clang-format]: Feature Request: AlignConsecutiveDeclarations option to ignore function prototypes #74320

Open bradh352 opened 9 months ago

bradh352 commented 9 months ago

We recently started using clang-format in the c-ares project: https://github.com/c-ares/c-ares/blob/main/.clang-format

We have "AlignConsecutiveDeclarations" enabled, which yields nicely formatted variable declarations. However, since we have a coding style requirement of 80 columns, function prototype alignment actually appears to cause more harm than good from a readability standpoint. Due to the line limit restrictions, the formatting is inconsistent at best, aligning some parameter members and not others.

Our feature request would be a flag to disable function prototypes from this alignment option.

huiskes commented 7 months ago

I would like to second this request. Based on the documentation you would also not expect the alignment of function parameter declarations in the first place.

bradh352 commented 1 week ago

just checking in on this request :)