Before: class X { int Y; public: int Z; }; After: class X { int Y; public: int Z; }; It would be nice if clang-format had an option to suppress this behavior.
Patches are welcome :-).
Created attachment 24308 [details] Patch which adds option to disable forced insertion of empty line before access modifiers. Attached patch adds new option called InsertEmptyLineBeforeAccessModifier. Empty line before access modifier is inserted if this option is set to true (which is the default value, because clang-format always inserts empty lines before access modifiers), otherwise empty lines are removed. I do not know if it is enough to have a boolean value, or a third value is needed to disable both behaviors (neither insert, nor remove empty lines before access modifiers).
Would you like to submit this patch? https://llvm.org/docs/Contributing.html If so feel free to add me as a reviewer