Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: upgrade clang-format to v18 #53957

Merged
merged 2 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
Copy link
Member Author

@RedYetiDev RedYetiDev Aug 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review note: This was changed, as AllowShortBlocksOnASingleLine is a Never/Empty/Always value.

https://clang.llvm.org/docs/ClangFormatStyleOptions.html#allowshortblocksonasingleline

AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
Copy link
Member Author

@RedYetiDev RedYetiDev Aug 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review note: This was changed, as the behavior of AllowShortLoopsOnASingleLine was changed since this was true. In order for formatting to remain the same as it currently is, AllowShortLoopsOnASingleLine should be false.

https://clang.llvm.org/docs/ClangFormatStyleOptions.html#allowshortloopsonasingleline

AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
Expand Down
317 changes: 12 additions & 305 deletions tools/clang-format/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions tools/clang-format/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"name": "node-core-clang-format",
"version": "1.0.0",
"description": "Formatting C++ files for Node.js core",
"license": "MIT",
RedYetiDev marked this conversation as resolved.
Show resolved Hide resolved
"dependencies": {
"clang-format": "^1.8.0"
"@wasm-fmt/clang-format": "^18.1.8"
}
}
Loading