reformat all c++ files with clang-format#48328
Merged
Conversation
d9425f2 to
f623bd4
Compare
This was referenced Apr 24, 2026
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.
We should autoformat the C++ code similar to how we use rustfmt for the Rust code. This PR uses
clang-formatto reformat all of the C++ code to a consistent, modern style. I did not attempt to preserve the existing style which was doing some things I think we should phase out, such as braces on new lines. This change only contains the reformatting and nothing else. Later, we can add a.clang-formatfile, update CI to enforce style, etc.To review, I suggest performing the same mass reformatting locally and confirming the resulting diff is the same as this one. To do that:
Install
clang-formatAdd the following
.clang-formatfile to the root of the project:find src -name "*.cpp" -o -name "*.h" | xargs clang-format -ifrom the project root. As far as I can tell, clang-format can't crawl a project tree on its own so we have to use something likefindto hit every file.