Skip to content

Conversation

@anupsdf
Copy link
Contributor

@anupsdf anupsdf commented Dec 11, 2025

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:

class A {
  int
  f() {
    return 0;
  };
};
int f();
int
f() {
  return 1;
}
int
LongName::AnotherLongName();

why

Keeping .clang-format config file up to date by removing deprecated options.

NOTE: Counter proposal in #5034

Copilot AI review requested due to automatic review settings December 11, 2025 22:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 Cpp11 to c++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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant