1- # Tested with Ubuntu clang-format version 14.0.0-1ubuntu1.1
2-
3- BreakBeforeBinaryOperators : All
4-
5- ColumnLimit : 120
6-
1+ # Language conformance: C11
2+ # Using Cpp as a language is ok here, since there is no separate C formatter.
3+ # It is common to use Cpp for C code formatting in clang-format.
4+ Language : Cpp
5+ Standard : Cpp11
76BasedOnStyle : Google
87
8+ # --- BRACE STYLE ---
9+ # "Functions... opening brace on new line"
10+ # "if, for, while... opening brace on the same line"
911BreakBeforeBraces : Stroustrup
1012
13+ # --- INDENTATION & WIDTH ---
14+ ColumnLimit : 120
15+
16+ # "You shall indent the code with 4 spaces"
1117IndentWidth : 4
18+ TabWidth : 4
19+ UseTab : Never
20+ ContinuationIndentWidth : 4
1221
22+ # --- POINTERS ---
23+ # Google defaults to Left, but guidelines show Right (void *p)
1324PointerAlignment : Right
25+ DerivePointerAlignment : false
26+
27+ # --- SPECIFIC TROPIC SQUARE RULES ---
28+ # "You shall place braces around the single statement"
29+ # Valid since Clang-Format 15
30+ InsertBraces : true
31+
32+ # "You shall put spaces after... if, switch..."
33+ SpaceBeforeParens : ControlStatements
34+ # "You shall not add spaces around (inside) parenthesized expressions"
35+ SpacesInParentheses : false
36+
37+ # "Space on each side of most binary and ternary operators"
38+ # Note: "SpacesInBinaryOperators" is implicit in Google style, no key needed.
39+ SpaceBeforeAssignmentOperators : true
1440
15- # # Insert New line at EOF if missing
16- # InsertNewlineAtEOF : true
17- # # Set EOL to LF unconditionally
18- # LineEnding: LF
41+ # Misc Cleanup
42+ SortIncludes : true
43+ IndentCaseLabels : true
44+ BreakBeforeBinaryOperators : All
0 commit comments