Add .clang-format file

This tries to capture the "OpenVPN" format as
good as possible.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
pull/720/head
Frank Lichtenheld 2025-01-15 17:44:33 +01:00
parent 57f9cad58a
commit 844c060acc
1 changed files with 44 additions and 0 deletions

44
.clang-format Normal file
View File

@ -0,0 +1,44 @@
---
BasedOnStyle: Mozilla
AccessModifierOffset: '-4'
AlignAfterOpenBracket: Align
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments:
Kind: Always
OverEmptyLines: 1
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
BreakStringLiterals: false
ColumnLimit: '100'
ContinuationIndentWidth: '4'
DerivePointerAlignment: false
IndentCaseLabels: true
IndentGotoLabels: false
IndentWidth: '4'
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
Language: Cpp
MaxEmptyLinesToKeep: '2'
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpacesBeforeTrailingComments: '2'
SpacesInParens: Never
TabWidth: '4'
UseTab: Never