mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-07 18:48:54 +08:00
Merge pull request #2486 from nghttp2/bump-clang-format
Bump clang-format to 19
This commit is contained in:
@@ -35,7 +35,29 @@ AlignConsecutiveShortCaseStatements:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCaseArrows: 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
|
||||
AlignOperands: Align
|
||||
AlignTrailingComments:
|
||||
@@ -45,6 +67,7 @@ AllowAllArgumentsOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowBreakBeforeNoexceptSpecifier: Never
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortCaseExpressionOnASingleLine: true
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortCompoundRequirementOnASingleLine: true
|
||||
AllowShortEnumsOnASingleLine: true
|
||||
@@ -53,9 +76,7 @@ AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: MultiLine
|
||||
AttributeMacros:
|
||||
- __capability
|
||||
BinPackArguments: true
|
||||
@@ -83,6 +104,7 @@ BraceWrapping:
|
||||
BreakAdjacentStringLiterals: true
|
||||
BreakAfterAttributes: Leave
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakAfterReturnType: None
|
||||
BreakArrays: true
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeConceptDeclarations: Always
|
||||
@@ -90,8 +112,10 @@ BreakBeforeBraces: Attach
|
||||
BreakBeforeInlineASMColon: OnlyMultiline
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakFunctionDefinitionParameters: false
|
||||
BreakInheritanceList: BeforeColon
|
||||
BreakStringLiterals: true
|
||||
BreakTemplateDeclarations: MultiLine
|
||||
ColumnLimit: 80
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
CompactNamespaces: false
|
||||
@@ -147,12 +171,15 @@ IntegerLiteralSeparator:
|
||||
HexMinDigits: 0
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
KeepEmptyLinesAtEOF: false
|
||||
KeepEmptyLines:
|
||||
AtEndOfFile: false
|
||||
AtStartOfBlock: false
|
||||
AtStartOfFile: true
|
||||
LambdaBodyIndentation: Signature
|
||||
LineEnding: DeriveLF
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MainIncludeChar: Quote
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: None
|
||||
ObjCBinPackProtocolList: Auto
|
||||
@@ -221,6 +248,7 @@ SpacesInLineCommentPrefix:
|
||||
Maximum: -1
|
||||
SpacesInParens: Never
|
||||
SpacesInParensOptions:
|
||||
ExceptDoubleParentheses: false
|
||||
InCStyleCasts: false
|
||||
InConditionalStatements: false
|
||||
InEmptyParentheses: false
|
||||
@@ -235,6 +263,7 @@ StatementMacros:
|
||||
- munit_void_test_decl
|
||||
- nghttp2_max_def
|
||||
- nghttp2_min_def
|
||||
TableGenBreakInsideDAGArg: DontBreak
|
||||
TabWidth: 8
|
||||
UseTab: Never
|
||||
VerilogBreakBetweenInstancePorts: true
|
||||
|
||||
@@ -26,7 +26,7 @@ Coding style
|
||||
We use clang-format to format source code consistently. The
|
||||
clang-format configuration file .clang-format is located at the root
|
||||
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
|
||||
pre-commit hook to check coding style of the changes you introduced.
|
||||
|
||||
@@ -2948,7 +2948,7 @@ int main(int argc, char **argv) {
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
struct sigaction act {};
|
||||
struct sigaction act{};
|
||||
act.sa_handler = SIG_IGN;
|
||||
sigaction(SIGPIPE, &act, nullptr);
|
||||
|
||||
|
||||
@@ -2427,7 +2427,7 @@ int run(char **uris, int n) {
|
||||
int failures = 0;
|
||||
int data_fd = -1;
|
||||
nghttp2_data_provider2 data_prd;
|
||||
struct stat data_stat {};
|
||||
struct stat data_stat{};
|
||||
|
||||
if (!config.datafile.empty()) {
|
||||
if (config.datafile == "-") {
|
||||
@@ -3051,7 +3051,7 @@ int main(int argc, char **argv) {
|
||||
static_cast<size_t>(config.encoder_header_table_size));
|
||||
}
|
||||
|
||||
struct sigaction act {};
|
||||
struct sigaction act{};
|
||||
act.sa_handler = SIG_IGN;
|
||||
sigaction(SIGPIPE, &act, nullptr);
|
||||
reset_timer();
|
||||
|
||||
@@ -479,7 +479,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
set_color_output(color || isatty(fileno(stdout)));
|
||||
|
||||
struct sigaction act {};
|
||||
struct sigaction act{};
|
||||
act.sa_handler = SIG_IGN;
|
||||
sigaction(SIGPIPE, &act, nullptr);
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ read_tls_ticket_key_file(const std::vector<std::string_view> &files,
|
||||
|
||||
size_t i = 0;
|
||||
for (auto &file : files) {
|
||||
struct stat fst {};
|
||||
struct stat fst{};
|
||||
|
||||
if (stat(file.data(), &fst) == -1) {
|
||||
auto error = errno;
|
||||
|
||||
@@ -95,7 +95,7 @@ int shrpx_signal_set(sigset_t *set) {
|
||||
namespace {
|
||||
template <typename Signals>
|
||||
int signal_set_handler(void (*handler)(int), Signals &&sigs) {
|
||||
struct sigaction act {};
|
||||
struct sigaction act{};
|
||||
act.sa_handler = handler;
|
||||
sigemptyset(&act.sa_mask);
|
||||
int rv;
|
||||
|
||||
@@ -347,22 +347,18 @@ template <typename T, std::size_t N>
|
||||
[[nodiscard]] std::span<
|
||||
const uint8_t, N == std::dynamic_extent ? std::dynamic_extent : N * sizeof(T)>
|
||||
as_uint8_span(std::span<T, N> s) noexcept {
|
||||
return std::span < const uint8_t,
|
||||
N == std::dynamic_extent
|
||||
? std::dynamic_extent
|
||||
: N * sizeof(T) >
|
||||
{reinterpret_cast<const uint8_t *>(s.data()), s.size_bytes()};
|
||||
return std::span<const uint8_t, N == std::dynamic_extent ? std::dynamic_extent
|
||||
: N * sizeof(T)>{
|
||||
reinterpret_cast<const uint8_t *>(s.data()), s.size_bytes()};
|
||||
}
|
||||
|
||||
template <typename T, std::size_t N>
|
||||
[[nodiscard]] std::span<uint8_t, N == std::dynamic_extent ? std::dynamic_extent
|
||||
: N * sizeof(T)>
|
||||
as_writable_uint8_span(std::span<T, N> s) noexcept {
|
||||
return std::span < uint8_t,
|
||||
N == std::dynamic_extent
|
||||
? std::dynamic_extent
|
||||
: N * sizeof(T) >
|
||||
{reinterpret_cast<uint8_t *>(s.data()), s.size_bytes()};
|
||||
return std::span<uint8_t, N == std::dynamic_extent ? std::dynamic_extent
|
||||
: N * sizeof(T)>{
|
||||
reinterpret_cast<uint8_t *>(s.data()), s.size_bytes()};
|
||||
}
|
||||
|
||||
template <typename R>
|
||||
|
||||
Reference in New Issue
Block a user