diff --git a/.clang-format b/.clang-format
index cd564fb109c..3bd0b0b3387 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,16 +1,38 @@
---
-Language: Cpp
+Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
-AlignConsecutiveMacros: false
-AlignConsecutiveAssignments: true
-AlignConsecutiveDeclarations: false
+AlignArrayOfStructures: Left
+AlignConsecutiveAssignments:
+ Enabled: true
+ AcrossEmptyLines: false
+ AcrossComments: false
+ AlignCompound: true
+ PadOperators: true
+AlignConsecutiveBitFields:
+ Enabled: true
+ AcrossEmptyLines: false
+ AcrossComments: false
+ AlignCompound: false
+ PadOperators: false
+AlignConsecutiveDeclarations:
+ Enabled: false
+ AcrossEmptyLines: false
+ AcrossComments: false
+ AlignCompound: false
+ PadOperators: true
+AlignConsecutiveMacros:
+ Enabled: true
+ AcrossEmptyLines: false
+ AcrossComments: false
+ AlignCompound: false
+ PadOperators: true
AlignEscapedNewlines: Left
-AlignOperands: true
+AlignOperands: Align
AlignTrailingComments: true
-AllowAllArgumentsOnNextLine: true
-AllowAllConstructorInitializersOnNextLine: true
+AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
+AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
@@ -21,26 +43,31 @@ AlwaysBreakAfterDefinitionReturnType: All
AlwaysBreakAfterReturnType: AllDefinitions
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
+AttributeMacros:
+ - __capability
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
- AfterCaseLabel: false
- AfterClass: true
- AfterControlStatement: false
- AfterEnum: false
- AfterFunction: true
- AfterNamespace: true
+ AfterCaseLabel: false
+ AfterClass: true
+ AfterControlStatement: Never
+ AfterEnum: false
+ AfterFunction: true
+ AfterNamespace: true
AfterObjCDeclaration: false
- AfterStruct: false
- AfterUnion: false
+ AfterStruct: false
+ AfterUnion: false
AfterExternBlock: false
- BeforeCatch: false
- BeforeElse: false
- IndentBraces: false
+ BeforeCatch: false
+ BeforeElse: false
+ BeforeLambdaBody: false
+ BeforeWhile: false
+ IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
+BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Linux
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
@@ -49,17 +76,23 @@ BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
-ColumnLimit: 132
-CommentPragmas: '^ IWYU pragma:'
+ColumnLimit: 132
+CommentPragmas: "^ IWYU pragma:"
+QualifierAlignment: Leave
CompactNamespaces: false
-ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
-DisableFormat: false
+DisableFormat: false
+EmptyLineAfterAccessModifier: Never
+EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
+PackConstructorInitializers: NextLine
+BasedOnStyle: ""
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+AllowAllConstructorInitializersOnNextLine: true
FixNamespaceComments: true
ForEachMacros:
- forv_Vec
@@ -68,72 +101,117 @@ ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
-IncludeBlocks: Preserve
+IfMacros:
+ - KJ_IF_MAYBE
+IncludeBlocks: Preserve
IncludeCategories:
- - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
- Priority: 2
- SortPriority: 0
- - Regex: '^(<|"(gtest|isl|json)/)'
- Priority: 3
- SortPriority: 0
- - Regex: '.*'
- Priority: 1
- SortPriority: 0
-IncludeIsMainRegex: '$'
-IncludeIsMainSourceRegex: ''
+ - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
+ Priority: 2
+ SortPriority: 0
+ CaseSensitive: false
+ - Regex: '^(<|"(gtest|isl|json)/)'
+ Priority: 3
+ SortPriority: 0
+ CaseSensitive: false
+ - Regex: ".*"
+ Priority: 1
+ SortPriority: 0
+ CaseSensitive: false
+IncludeIsMainRegex: "$"
+IncludeIsMainSourceRegex: ""
+IndentAccessModifiers: false
IndentCaseLabels: false
+IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
-IndentWidth: 2
+IndentExternBlock: AfterExternBlock
+IndentRequiresClause: true
+IndentWidth: 2
IndentWrappedFunctionNames: false
+InsertBraces: false
+InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
-MacroBlockBegin: ''
-MacroBlockEnd: ''
+LambdaBodyIndentation: Signature
+MacroBlockBegin: ""
+MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: Inner
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
+ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: false
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 30000
PenaltyBreakFirstLessLess: 120
+PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
+PenaltyIndentedWhitespace: 0
PointerAlignment: Right
-ReflowComments: true
-SortIncludes: false
+PPIndentWidth: -1
+ReferenceAlignment: Pointer
+ReflowComments: true
+RemoveBracesLLVM: false
+RequiresClausePosition: OwnLine
+SeparateDefinitionBlocks: Leave
+ShortNamespaceLines: 1
+SortIncludes: Never
+SortJavaStaticImport: Before
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
+SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
+SpaceBeforeParensOptions:
+ AfterControlStatements: true
+ AfterForeachMacros: true
+ AfterFunctionDefinitionName: false
+ AfterFunctionDeclarationName: false
+ AfterIfMacros: true
+ AfterOverloadedOperator: false
+ AfterRequiresInClause: false
+ AfterRequiresInExpression: false
+ BeforeNonEmptyParentheses: false
+SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
-SpacesInAngles: false
+SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
+SpacesInLineCommentPrefix:
+ Minimum: 1
+ Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
-Standard: Latest
+BitFieldColonSpacing: Both
+Standard: Latest
+StatementAttributeLikeMacros:
+ - Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
-TabWidth: 8
-UseCRLF: false
-UseTab: Never
-...
-
+TabWidth: 8
+UseCRLF: false
+UseTab: Never
+WhitespaceSensitiveMacros:
+ - STRINGIZE
+ - PP_STRINGIZE
+ - BOOST_PP_STRINGIZE
+ - NS_SWIFT_NAME
+ - CF_SWIFT_NAME
+---
diff --git a/example/plugins/c-api/basic_auth/basic_auth.c b/example/plugins/c-api/basic_auth/basic_auth.c
index 95a87edc1a4..d798ee6ab15 100644
--- a/example/plugins/c-api/basic_auth/basic_auth.c
+++ b/example/plugins/c-api/basic_auth/basic_auth.c
@@ -52,8 +52,8 @@ base64_decode(const char *input)
*output++ = decode(0) << 2 | decode(1) >> 4;
*output++ = decode(1) << 4 | decode(2) >> 2;
*output++ = decode(2) << 6 | decode(3);
- len -= 4;
- input += 4;
+ len -= 4;
+ input += 4;
}
/*
@@ -139,7 +139,7 @@ handle_dns(TSHttpTxn txnp, TSCont contp)
goto done;
}
*password = '\0';
- password += 1;
+ password += 1;
if (!authorized(user, password)) {
TSError("[%s] %s:%s not authorized", PLUGIN_NAME, user, password);
diff --git a/example/plugins/c-api/bnull_transform/bnull_transform.c b/example/plugins/c-api/bnull_transform/bnull_transform.c
index 8cb2c44dc1a..db41fdbb93b 100644
--- a/example/plugins/c-api/bnull_transform/bnull_transform.c
+++ b/example/plugins/c-api/bnull_transform/bnull_transform.c
@@ -41,7 +41,7 @@
#define PLUGIN_NAME "bnull_transform"
-#define TS_NULL_MUTEX NULL
+#define TS_NULL_MUTEX NULL
#define STATE_BUFFER_DATA 0
#define STATE_OUTPUT_DATA 1
diff --git a/example/plugins/c-api/cache_scan/cache_scan.cc b/example/plugins/c-api/cache_scan/cache_scan.cc
index 4e0d9a952e3..e0546be0be0 100644
--- a/example/plugins/c-api/cache_scan/cache_scan.cc
+++ b/example/plugins/c-api/cache_scan/cache_scan.cc
@@ -68,10 +68,10 @@ handle_scan(TSCont contp, TSEvent event, void *edata)
cache_scan_state *cstate = static_cast
%d total objects in cache
\n" - "