Myvideo

Guest

Login

200 - Reformat with clang-format

Uploaded By: Myvideo
1 view
0
0 votes
0

It’s time to automate formatting code. The only formatter I know of that will do the vertical alignment I prefer is clang-format, so I’m using that. Start with an llvm format: clang-format -style=llvm -dump-config > .clang-format Then modify .clang-format to more closely match the style I’m using. There’s a couple of features in newer versions of clang-format that would make the output a bit better, but this is close enough. ColumnLimit: 200 BreakBeforeBraces: Allman AlignAfterOpenBracket: Align AlignArrayOfStructures: Right AlignConsecutiveMacros: AcrossEmptyLines AlignConsecutiveAssignments: AcrossEmptyLines AlignConsecutiveBitFields: AcrossEmptyLines AlignConsecutiveDeclarations: AcrossEmptyLines AlignEscapedNewlines: Right AlignOperands: Align AlwaysBreakAfterReturnType: AllDefinitions AllowShortFunctionsOnASingleLine: None PointerAlignment: Left

Share with your friends

Link:

Embed:

Video Size:

Custom size:

x

Add to Playlist:

Favorites
My Playlist
Watch Later