Conversation
4a898ce to
40c0945
Compare
|
Afaik current code-style is not represented in clang-format, would it be possible to format other things, while ignoring brackets |
|
@Try I'll look into it. |
|
Linking to prior art: #304 |
|
Regarding brackets. The current style is called "Ratliff" and is quite unconventional (i find i a little confusing, because the closing bracket stays indented). Usually either K&R or Allman brackets are used. But if you really want to keep this bracket style, clang-format does have BS_Custom style, where you can manually define the brackets the way you want. Edit: So i tried to get it to work, but sadly it is not possible, because BreakBeforeBraces: Custom
BraceWrapping:
AfterFunction: false
AfterClass: false
AfterStruct: false
AfterEnum: false
AfterUnion: false
BeforeElse: false
BeforeCatch: false
IndentBraces: trueSo the only way to indent braces at the moment is to use Whitesmiths brace style, which in turn disables customization for the opening bracket. |
Hey @Try ,
it would be wise to offload the code style to a formatter/linter. Here is a WIP implementation with mainwindow.cpp as a test case for automatic formatting.