Merge pull request #2486 from nghttp2/bump-clang-format

Bump clang-format to 19
This commit is contained in:
Tatsuhiro Tsujikawa
2025-08-23 18:21:03 +09:00
committed by GitHub
8 changed files with 46 additions and 21 deletions

View File

@@ -35,7 +35,29 @@ AlignConsecutiveShortCaseStatements:
Enabled: false Enabled: false
AcrossEmptyLines: false AcrossEmptyLines: false
AcrossComments: false AcrossComments: false
AlignCaseArrows: false
AlignCaseColons: false AlignCaseColons: false
AlignConsecutiveTableGenBreakingDAGArgColons:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveTableGenCondOperatorColons:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveTableGenDefinitionColons:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignEscapedNewlines: Right AlignEscapedNewlines: Right
AlignOperands: Align AlignOperands: Align
AlignTrailingComments: AlignTrailingComments:
@@ -45,6 +67,7 @@ AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true
AllowBreakBeforeNoexceptSpecifier: Never AllowBreakBeforeNoexceptSpecifier: Never
AllowShortBlocksOnASingleLine: Never AllowShortBlocksOnASingleLine: Never
AllowShortCaseExpressionOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false
AllowShortCompoundRequirementOnASingleLine: true AllowShortCompoundRequirementOnASingleLine: true
AllowShortEnumsOnASingleLine: true AllowShortEnumsOnASingleLine: true
@@ -53,9 +76,7 @@ AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
AttributeMacros: AttributeMacros:
- __capability - __capability
BinPackArguments: true BinPackArguments: true
@@ -83,6 +104,7 @@ BraceWrapping:
BreakAdjacentStringLiterals: true BreakAdjacentStringLiterals: true
BreakAfterAttributes: Leave BreakAfterAttributes: Leave
BreakAfterJavaFieldAnnotations: false BreakAfterJavaFieldAnnotations: false
BreakAfterReturnType: None
BreakArrays: true BreakArrays: true
BreakBeforeBinaryOperators: None BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always BreakBeforeConceptDeclarations: Always
@@ -90,8 +112,10 @@ BreakBeforeBraces: Attach
BreakBeforeInlineASMColon: OnlyMultiline BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon BreakConstructorInitializers: BeforeColon
BreakFunctionDefinitionParameters: false
BreakInheritanceList: BeforeColon BreakInheritanceList: BeforeColon
BreakStringLiterals: true BreakStringLiterals: true
BreakTemplateDeclarations: MultiLine
ColumnLimit: 80 ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:' CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false CompactNamespaces: false
@@ -147,12 +171,15 @@ IntegerLiteralSeparator:
HexMinDigits: 0 HexMinDigits: 0
JavaScriptQuotes: Leave JavaScriptQuotes: Leave
JavaScriptWrapImports: true JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false KeepEmptyLines:
KeepEmptyLinesAtEOF: false AtEndOfFile: false
AtStartOfBlock: false
AtStartOfFile: true
LambdaBodyIndentation: Signature LambdaBodyIndentation: Signature
LineEnding: DeriveLF LineEnding: DeriveLF
MacroBlockBegin: '' MacroBlockBegin: ''
MacroBlockEnd: '' MacroBlockEnd: ''
MainIncludeChar: Quote
MaxEmptyLinesToKeep: 1 MaxEmptyLinesToKeep: 1
NamespaceIndentation: None NamespaceIndentation: None
ObjCBinPackProtocolList: Auto ObjCBinPackProtocolList: Auto
@@ -221,6 +248,7 @@ SpacesInLineCommentPrefix:
Maximum: -1 Maximum: -1
SpacesInParens: Never SpacesInParens: Never
SpacesInParensOptions: SpacesInParensOptions:
ExceptDoubleParentheses: false
InCStyleCasts: false InCStyleCasts: false
InConditionalStatements: false InConditionalStatements: false
InEmptyParentheses: false InEmptyParentheses: false
@@ -235,6 +263,7 @@ StatementMacros:
- munit_void_test_decl - munit_void_test_decl
- nghttp2_max_def - nghttp2_max_def
- nghttp2_min_def - nghttp2_min_def
TableGenBreakInsideDAGArg: DontBreak
TabWidth: 8 TabWidth: 8
UseTab: Never UseTab: Never
VerilogBreakBetweenInstancePorts: true VerilogBreakBetweenInstancePorts: true

View File

@@ -26,7 +26,7 @@ Coding style
We use clang-format to format source code consistently. The We use clang-format to format source code consistently. The
clang-format configuration file .clang-format is located at the root clang-format configuration file .clang-format is located at the root
directory. Since clang-format produces slightly different results directory. Since clang-format produces slightly different results
between versions, we currently use clang-format-18. between versions, we currently use clang-format-19.
To detect any violation to the coding style, we recommend to setup git To detect any violation to the coding style, we recommend to setup git
pre-commit hook to check coding style of the changes you introduced. pre-commit hook to check coding style of the changes you introduced.

View File

@@ -347,22 +347,18 @@ template <typename T, std::size_t N>
[[nodiscard]] std::span< [[nodiscard]] std::span<
const uint8_t, N == std::dynamic_extent ? std::dynamic_extent : N * sizeof(T)> const uint8_t, N == std::dynamic_extent ? std::dynamic_extent : N * sizeof(T)>
as_uint8_span(std::span<T, N> s) noexcept { as_uint8_span(std::span<T, N> s) noexcept {
return std::span < const uint8_t, return std::span<const uint8_t, N == std::dynamic_extent ? std::dynamic_extent
N == std::dynamic_extent : N * sizeof(T)>{
? std::dynamic_extent reinterpret_cast<const uint8_t *>(s.data()), s.size_bytes()};
: N * sizeof(T) >
{reinterpret_cast<const uint8_t *>(s.data()), s.size_bytes()};
} }
template <typename T, std::size_t N> template <typename T, std::size_t N>
[[nodiscard]] std::span<uint8_t, N == std::dynamic_extent ? std::dynamic_extent [[nodiscard]] std::span<uint8_t, N == std::dynamic_extent ? std::dynamic_extent
: N * sizeof(T)> : N * sizeof(T)>
as_writable_uint8_span(std::span<T, N> s) noexcept { as_writable_uint8_span(std::span<T, N> s) noexcept {
return std::span < uint8_t, return std::span<uint8_t, N == std::dynamic_extent ? std::dynamic_extent
N == std::dynamic_extent : N * sizeof(T)>{
? std::dynamic_extent reinterpret_cast<uint8_t *>(s.data()), s.size_bytes()};
: N * sizeof(T) >
{reinterpret_cast<uint8_t *>(s.data()), s.size_bytes()};
} }
template <typename R> template <typename R>