aboutsummaryrefslogtreecommitdiff
path: root/.clang-format
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-03-25 23:37:38 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2019-03-25 23:39:02 +0100
commit4b8a7c35e20baa6e1e38f2c3ed201bd58050e672 (patch)
tree3feaeae82b1b5472b665112fc804ca712e66eb3d /.clang-format
parent49b04bc2e092611ed87f3e2122a67c67a9a109ba (diff)
downloadslirp-4b8a7c35e20baa6e1e38f2c3ed201bd58050e672.zip
slirp-4b8a7c35e20baa6e1e38f2c3ed201bd58050e672.tar.gz
slirp-4b8a7c35e20baa6e1e38f2c3ed201bd58050e672.tar.bz2
Add .clang-format
Add the .clang-format used for formatting the slirp code during the import from qemu. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format64
1 files changed, 64 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..9ae8088
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,64 @@
+# https://clang.llvm.org/docs/ClangFormat.html
+# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
+---
+Language: Cpp
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: false # although we like it, it creates churn
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlinesLeft: true
+AlignOperands: true
+AlignTrailingComments: false # churn
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account
+AlwaysBreakBeforeMultilineStrings: false
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+ AfterControlStatement: false
+ AfterEnum: false
+ AfterFunction: true
+ AfterStruct: false
+ AfterUnion: false
+ BeforeElse: false
+ IndentBraces: false
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Custom
+BreakBeforeTernaryOperators: false
+BreakStringLiterals: true
+ColumnLimit: 80
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: false
+DerivePointerAlignment: false
+DisableFormat: false
+ForEachMacros: [
+ 'QTAILQ_FOREACH',
+ 'QTAILQ_FOREACH_REVERSE',
+ 'QTAILQ_FOREACH_SAFE',
+ 'QTAILQ_RAW_FOREACH',
+]
+IndentCaseLabels: false
+IndentWidth: 4
+IndentWrappedFunctionNames: false
+KeepEmptyLinesAtTheStartOfBlocks: false
+MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
+MacroBlockEnd: '.*_END$'
+MaxEmptyLinesToKeep: 2
+PointerAlignment: Right
+ReflowComments: true
+SortIncludes: false
+SpaceAfterCStyleCast: false
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInContainerLiterals: true
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+Standard: Auto
+UseTab: Never
+...