forked from facebook/yoga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
format.sh
executable file
·38 lines (36 loc) · 1.29 KB
/
format.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
BASEDIR="$(dirname "$0")"
FILES=$(find "$BASEDIR" \( -path "$BASEDIR/buck-out" -o -path "$BASEDIR/lib" \) -prune -o \
\( -name \*.h ! -name YGEnums.h -o -name \*.c -o -name \*.cpp \) -print)
for f in $FILES "$@"; do
clang-format \
-style="{ \
AlignAfterOpenBracket: Align, \
AlignEscapedNewlinesLeft: true, \
AlignOperands: true, \
AllowAllParametersOfDeclarationOnNextLine: false, \
AllowShortBlocksOnASingleLine: false, \
AllowShortCaseLabelsOnASingleLine: false, \
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: 1000, \
PenaltyExcessCharacter: 100, \
PenaltyReturnTypeOnItsOwnLine: 100, \
PointerAlignment: Right, \
SortIncludes: true, \
SpaceAfterCStyleCast: true, \
UseTab: Never, \
ObjCSpaceAfterProperty: true, \
}" -i "$f"
done