-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.clang-format: add clang-format file
Add a clang-format file to standardize all C formatting for future tests.
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
BasedOnStyle : google | ||
SpaceBeforeParens : Always | ||
IndentWidth : 4 | ||
BreakBeforeBraces : Custom | ||
BraceWrapping : | ||
BeforeElse : true | ||
AfterFunction : true | ||
UseTab: Never | ||
AllowShortIfStatementsOnASingleLine : false | ||
ConstructorInitializerAllOnOneLineOrOnePerLine : true | ||
AllowShortFunctionsOnASingleLine : false | ||
AllowShortLoopsOnASingleLine : false | ||
BinPackParameters : false | ||
BinPackArguments : false | ||
AllowAllParametersOfDeclarationOnNextLine : false | ||
AlignTrailingComments : true | ||
ColumnLimit : 88 | ||
|
||
# do not put all arguments on one line unless it's the same line as the call | ||
PenaltyBreakBeforeFirstCallParameter : 10000000 | ||
PenaltyReturnTypeOnItsOwnLine : 65000 | ||
PenaltyBreakString : 10 | ||
|
||
# treat foreach macros as for loops | ||
ForEachMacros : | ||
- json_array_foreach | ||
- json_object_foreach | ||
|
||
# These improve formatting results but require clang 3.6/7 or higher | ||
SortIncludes : false | ||
BreakBeforeBinaryOperators : NonAssignment | ||
AlignAfterOpenBracket: Align | ||
AlignOperands : true | ||
BreakBeforeTernaryOperators : true | ||
AllowAllParametersOfDeclarationOnNextLine : false | ||
SpaceBeforeSquareBrackets: false | ||
IndentPPDirectives: None |