Remove deprecated Clang-Format style options and improve readability#5061
Draft
anupsdf wants to merge 1 commit intostellar:masterfrom
Draft
Remove deprecated Clang-Format style options and improve readability#5061anupsdf wants to merge 1 commit intostellar:masterfrom
anupsdf wants to merge 1 commit intostellar:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes deprecated clang-format style options that are no longer supported in clang-format 20 and updates the configuration file with their modern equivalents. The changes improve code formatting consistency by removing blank lines at the start of blocks, files, and functions throughout the codebase.
Key changes:
- Removed deprecated options:
AlwaysBreakAfterReturnType,AlwaysBreakTemplateDeclarations,BreakBeforeInheritanceComma,BreakConstructorInitializersBeforeComma,BreakAfterJavaFieldAnnotations,ConstructorInitializerAllOnOneLineOrOnePerLine,KeepEmptyLinesAtTheStartOfBlocks,SpaceInEmptyParentheses,SpacesInCStyleCastParentheses,SpacesInParentheses - Added modern equivalents:
BreakAfterReturnType,BreakInheritanceList,BreakTemplateDeclarations,KeepEmptyLines,PackConstructorInitializers,SpacesInParens - Updated C++ standard from
Cpp11toc++17 - Applied automatic formatting that removed empty lines at the start of blocks and files
Reviewed changes
Copilot reviewed 64 out of 64 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .clang-format | Updated with clang-format 20 compatible options, replacing deprecated settings with modern equivalents |
| Multiple .cpp/.h files | Removed blank lines at the start of functions, blocks, and files as per new formatting rules |
| src/util/NonCopyable.h | Reformatted struct inheritance to multi-line format |
| src/rust/soroban/p25 | Updated subproject commit reference |
| src/protocol-curr/xdr | Updated subproject commit reference |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what
Remove deprecated clang-format20 style options and improve readability.
Note: BreakAfterReturnType: AllDefinitions is similar to the deprecated option we used to have before with AlwaysBreakAfterReturnType: AllDefinitions.
Example:why
Keeping .clang-format config file up to date by removing deprecated options.
NOTE: Counter proposal in #5034