GarethD
GarethD

Reputation: 122

Configuring clang-format in source

Whilst it is possible to disable clang-format entirely in source comments with // clang-format off // clang-format on

Specifically what I'm trying to achieve right now is to allow AlignConsecutiveAssignments for enums that have assigned values, and to turn it off for all other places. It would be great to be able to switch this parameter (or give it flags as opposed to it being binary).

Does anybody know if this is possible or should I make a feature request?

Upvotes: 1

Views: 200

Answers (1)

GarethD
GarethD

Reputation: 122

Perhaps I can use 2 separate .clang-format files and use one with AlignConsecutiveAssignments = false for my .c files and the other with AlignConsecutiveAssignments = true for my .h files.

This is far from perfect but would work for most cases.

EDIT - this is what I did to solve this for now.

Upvotes: 1

Related Questions