-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcppfmt.sh
More file actions
executable file
·49 lines (36 loc) · 981 Bytes
/
cppfmt.sh
File metadata and controls
executable file
·49 lines (36 loc) · 981 Bytes
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
39
40
41
42
43
44
45
46
47
48
49
#/bin/sh
STYLE=$(cat << EOF
{
Language: Cpp,
BasedOnStyle: Google,
DerivePointerAlignment: false,
PointerAlignment: Left,
BreakBeforeBraces: Allman,
AlignOperands: true,
AlignAfterOpenBracket: Align,
AccessModifierOffset: -4,
Cpp11BracedListStyle: true,
NamespaceIndentation: None,
UseTab: Never,
TabWidth: 4,
Standard: Cpp11,
SpaceBeforeParens: ControlStatements,
AlwaysBreakTemplateDeclarations: true,
BinPackArguments: false,
BinPackParameters: false,
AlignAfterOpenBracket: true,
AlignConsecutiveAssignments: true,
IndentWidth: 4,
ColumnLimit: 120,
AllowShortFunctionsOnASingleLine: Inline,
AllowShortBlocksOnASingleLine: false,
BreakConstructorInitializersBeforeComma: true,
BreakBeforeBinaryOperators: NonAssignment,
BreakBeforeTernaryOperators: true,
BreakStringLiterals: false,
SortIncludes: true,
}
EOF
)
clang-format -style="$STYLE" "$@"
exit $?