1

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?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.