[clang-format] Add flag to suppress empty line insertion before access modifier.
| Bugzilla Link | 16518 |
| Version | trunk |
| OS | All |
| CC | @mydeveloperday |
Extended Description
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.
mentioned in issue llvm/llvm-bugzilla-archive#41870
Would you like to submit this patch?
https://llvm.org/docs/Contributing.html
If so feel free to add me as a reviewer
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).
Patches are welcome :-).
Is this issue fixed? I'd like to work on it. I'm a beginner and novice so help and guidance would be appreciated
I think this issue is fixed in https://github.com/llvm/llvm-project/commit/60bf5826cfd3629b5200a8ab743d701c90f66af0. It can be enabled with - "EmptyLineBeforeAccessModifier": "Never"