ucentral-tools: add clang-format configuration

Add clang-format configuration file used for code formatting.

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2025-10-19 00:00:00 +02:00
parent 1ac05ccc68
commit 01f809d5c4

View File

@@ -0,0 +1,60 @@
---
# clang-format configuration for ucentral-tools
BasedOnStyle: LLVM
# Indentation
IndentWidth: 8
TabWidth: 8
UseTab: ForIndentation
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
# Line length
ColumnLimit: 100
# Braces
BreakBeforeBraces: Linux
Cpp11BracedListStyle: false
# Spacing
SpaceAfterCStyleCast: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
# Alignment
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignOperands: true
AlignTrailingComments: true
# Breaking
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakStringLiterals: true
# Pointers and references
PointerAlignment: Right
DerivePointerAlignment: false
# Comments
ReflowComments: true
# Sorting
SortIncludes: true
IncludeBlocks: Preserve
# Function calls
BinPackArguments: true
BinPackParameters: true
# Other
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 2