summaryrefslogtreecommitdiffstats
path: root/.clang-format
diff options
context:
space:
mode:
authorSimon Rettberg2021-03-05 10:33:18 +0100
committerSimon Rettberg2021-03-05 10:37:45 +0100
commit2fd6ceb81754c48168f4a5b344f1baec9d23775e (patch)
treefa575ab1bcb53fae5face2db2fcc516bc8eba921 /.clang-format
parent[BUILD] Make lint/format optional (diff)
downloaddnbd3-2fd6ceb81754c48168f4a5b344f1baec9d23775e.tar.gz
dnbd3-2fd6ceb81754c48168f4a5b344f1baec9d23775e.tar.xz
dnbd3-2fd6ceb81754c48168f4a5b344f1baec9d23775e.zip
[BUILD] Disable lint/formatting for non-kernel for now
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format54
1 files changed, 31 insertions, 23 deletions
diff --git a/.clang-format b/.clang-format
index 2abc64d..6adc436 100644
--- a/.clang-format
+++ b/.clang-format
@@ -9,16 +9,17 @@
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
---
-AccessModifierOffset: -4
-AlignAfterOpenBracket: Align
+AccessModifierOffset: -3
+AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
-#AlignEscapedNewlines: Left # Unknown to clang-format-4.0
-AlignOperands: true
-AlignTrailingComments: false
-AllowAllParametersOfDeclarationOnNextLine: false
-AllowShortBlocksOnASingleLine: false
-AllowShortCaseLabelsOnASingleLine: false
+AlignEscapedNewlines: Left
+AlignOperands: false
+AlignTrailingComments: true
+AllowAllArgumentsOnNextLine: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: Empty
+AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
@@ -29,14 +30,14 @@ AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
- AfterClass: false
+ AfterClass: true
AfterControlStatement: false
- AfterEnum: false
+ AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
- AfterStruct: false
- AfterUnion: false
+ AfterStruct: true
+ AfterUnion: true
#AfterExternBlock: false # Unknown to clang-format-5.0
BeforeCatch: false
BeforeElse: false
@@ -44,10 +45,10 @@ BraceWrapping:
#SplitEmptyFunction: true # Unknown to clang-format-4.0
#SplitEmptyRecord: true # Unknown to clang-format-4.0
#SplitEmptyNamespace: true # Unknown to clang-format-4.0
-BreakBeforeBinaryOperators: None
+BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
#BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0
-BreakBeforeTernaryOperators: false
+BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
#BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0
BreakAfterJavaFieldAnnotations: false
@@ -56,11 +57,11 @@ ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
#CompactNamespaces: false # Unknown to clang-format-4.0
ConstructorInitializerAllOnOneLineOrOnePerLine: false
-ConstructorInitializerIndentWidth: 8
-ContinuationIndentWidth: 8
+ConstructorInitializerIndentWidth: 6
+ContinuationIndentWidth: 6
Cpp11BracedListStyle: false
DerivePointerAlignment: false
-DisableFormat: false
+DisableFormat: true
ExperimentalAutoDetectBinPacking: false
#FixNamespaceComments: false # Unknown to clang-format-4.0
@@ -69,16 +70,19 @@ IncludeCategories:
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
+#IndentCaseBlocks: false
IndentCaseLabels: false
+IndentGotoLabels: false
#IndentPPDirectives: None # Unknown to clang-format-5.0
-IndentWidth: 8
+IndentWidth: 3
IndentWrappedFunctionNames: false
+#InsertTrailingCommas: Wrapped
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
-MaxEmptyLinesToKeep: 1
+MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
#ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0
ObjCBlockIndentWidth: 8
@@ -87,11 +91,12 @@ ObjCSpaceBeforeProtocolList: true
# Taken from git's rules
#PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0
-PenaltyBreakBeforeFirstCallParameter: 30
+PenaltyBreakBeforeFirstCallParameter: 60
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 10
PenaltyExcessCharacter: 100
+#PenaltyIndentedWhitespace: 20
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
@@ -100,6 +105,7 @@ SortIncludes: false
#SortUsingDeclarations: false # Unknown to clang-format-4.0
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
+#SpaceAroundPointerQualifiers: Both
SpaceBeforeAssignmentOperators: true
#SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0
#SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0
@@ -110,9 +116,11 @@ SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
-SpacesInParentheses: false
+SpacesInConditionalStatement: true
+SpacesInParentheses: true
SpacesInSquareBrackets: false
Standard: Cpp03
-TabWidth: 8
-UseTab: Always
+TabWidth: 3
+#UseTab: AlignWithSpaces
+UseTab: ForContinuationAndIndentation
...