Summary: Spent a couple hours customizing the clang-format rules to better match the desired code style. Reviewed By: IanChilds Differential Revision: D3714510 fbshipit-source-id: f6d0436346416aab023aacbedd70ea189e583e8d
31 lines
937 B
Bash
Executable File
31 lines
937 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
clang-format \
|
|
-style="{ \
|
|
AlignEscapedNewlinesLeft: true, \
|
|
AlignOperands: true, \
|
|
AllowAllParametersOfDeclarationOnNextLine: false, \
|
|
AllowShortBlocksOnASingleLine: false, \
|
|
AllowShortCaseLabelsOnASingleLine: true, \
|
|
AllowShortFunctionsOnASingleLine: false, \
|
|
AllowShortIfStatementsOnASingleLine: false, \
|
|
AllowShortLoopsOnASingleLine: false, \
|
|
BinPackArguments: false, \
|
|
BinPackParameters: false, \
|
|
BreakBeforeBraces: Attach, \
|
|
ColumnLimit: 100, \
|
|
ContinuationIndentWidth: 4, \
|
|
IndentCaseLabels: true, \
|
|
IndentWidth: 2, \
|
|
KeepEmptyLinesAtTheStartOfBlocks: false, \
|
|
Language: Cpp, \
|
|
PenaltyBreakBeforeFirstCallParameter: 100, \
|
|
PenaltyBreakString: 100, \
|
|
PenaltyExcessCharacter: 100, \
|
|
PointerAlignment: Right, \
|
|
SortIncludes: true, \
|
|
SpaceAfterCStyleCast: true, \
|
|
UseTab: Never, \
|
|
}" "$@" \
|
|
-i ./**/*.{h,c,cpp}
|