mirror of https://github.com/eclipse/paho.mqtt.c
Added a .clang-format file and bash script to run it over the directory tree.
This commit is contained in:
parent
6e5366b9af
commit
88f6011583
|
|
@ -0,0 +1,79 @@
|
||||||
|
---
|
||||||
|
Language: C
|
||||||
|
|
||||||
|
# Indentation: tabs, one tab per indent level
|
||||||
|
# The Emacs footer in source files specifies indent-tabs-mode: t
|
||||||
|
UseTab: ForIndentation
|
||||||
|
TabWidth: 4
|
||||||
|
IndentWidth: 4
|
||||||
|
ContinuationIndentWidth: 8
|
||||||
|
IndentCaseLabels: true
|
||||||
|
IndentCaseBlocks: false
|
||||||
|
IndentGotoLabels: false
|
||||||
|
IndentPPDirectives: None
|
||||||
|
IndentWrappedFunctionNames: false
|
||||||
|
|
||||||
|
# Braces: Allman style - opening brace on its own line for everything
|
||||||
|
BreakBeforeBraces: Allman
|
||||||
|
|
||||||
|
# Alignment
|
||||||
|
AlignAfterOpenBracket: DontAlign
|
||||||
|
AlignConsecutiveAssignments: false
|
||||||
|
AlignConsecutiveDeclarations: false
|
||||||
|
AlignConsecutiveMacros: false
|
||||||
|
AlignEscapedNewlines: Left
|
||||||
|
AlignOperands: true
|
||||||
|
AlignTrailingComments: true
|
||||||
|
|
||||||
|
# Pointer style: mixed in codebase (char* ptr and char *ptr both appear),
|
||||||
|
# derive per file with Left as default
|
||||||
|
PointerAlignment: Left
|
||||||
|
DerivePointerAlignment: true
|
||||||
|
|
||||||
|
# Spaces
|
||||||
|
SpaceAfterCStyleCast: false
|
||||||
|
SpaceAfterLogicalNot: false
|
||||||
|
SpaceBeforeAssignmentOperators: true
|
||||||
|
SpaceBeforeParens: ControlStatements
|
||||||
|
SpaceInEmptyBlock: false
|
||||||
|
SpaceInEmptyParentheses: false
|
||||||
|
SpacesInCStyleCastParentheses: false
|
||||||
|
SpacesInParentheses: false
|
||||||
|
SpacesInSquareBrackets: false
|
||||||
|
SpacesBeforeTrailingComments: 1
|
||||||
|
|
||||||
|
# Line breaking
|
||||||
|
ColumnLimit: 120
|
||||||
|
AllowAllArgumentsOnNextLine: true
|
||||||
|
AllowAllParametersOfDeclarationOnNextLine: true
|
||||||
|
AllowShortBlocksOnASingleLine: Never
|
||||||
|
AllowShortCaseLabelsOnASingleLine: false
|
||||||
|
AllowShortEnumsOnASingleLine: false
|
||||||
|
AllowShortFunctionsOnASingleLine: None
|
||||||
|
AllowShortIfStatementsOnASingleLine: Never
|
||||||
|
AllowShortLoopsOnASingleLine: false
|
||||||
|
AlwaysBreakAfterReturnType: None
|
||||||
|
AlwaysBreakBeforeMultilineStrings: false
|
||||||
|
BinPackArguments: true
|
||||||
|
BinPackParameters: true
|
||||||
|
BreakBeforeBinaryOperators: None
|
||||||
|
BreakBeforeTernaryOperators: true
|
||||||
|
BreakStringLiterals: true
|
||||||
|
|
||||||
|
# Includes: preserve existing order, do not sort
|
||||||
|
SortIncludes: Never
|
||||||
|
IncludeBlocks: Preserve
|
||||||
|
|
||||||
|
# Blank lines
|
||||||
|
MaxEmptyLinesToKeep: 2
|
||||||
|
|
||||||
|
# Comments: do not reflow to preserve manual formatting
|
||||||
|
ReflowComments: false
|
||||||
|
|
||||||
|
# Penalties for line breaking decisions
|
||||||
|
PenaltyBreakBeforeFirstCallParameter: 19
|
||||||
|
PenaltyBreakComment: 300
|
||||||
|
PenaltyBreakFirstLessLess: 120
|
||||||
|
PenaltyBreakString: 1000
|
||||||
|
PenaltyExcessCharacter: 1000000
|
||||||
|
PenaltyReturnTypeOnItsOwnLine: 60
|
||||||
Loading…
Reference in New Issue