Repository navigation
THRIFT-6219: ci(cpp): Check formatting of changed C++ lines only - #3976
Draft
slachiewicz wants to merge 1 commit into
Draft
slachiewicz wants to merge 1 commit into
slachiewicz wants to merge 1 commit into
Conversation
Client: cpp The added .clang-format options describe lib/cpp as it is written, so formatting a change no longer rewrites lines it did not touch. Do not drop them without reformatting lib/cpp in the same change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
@Jens-G, is this the direction you want for THRIFT-6219? It takes the ticket's second option, adjusting |
This branch has not been deployed
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.
Adds a CI job that runs clang-format 18 on the lines a pull request changes in
lib/cpp, so.clang-formatis enforced from now on without reformatting existing code.Six options are added to
.clang-formatso that it describeslib/cppas it is written:FixNamespaceComments,ReflowComments,SortIncludes,BinPackArguments,SortUsingDeclarationsandSpacesInLineCommentPrefix. The Base64 decode table is excluded with// clang-format off. With both, formatting all oflib/cpp/srcchanges 104 files and 1,583 lines, down from 149 files and 2,674. The remainder are files with a local style of their own (indented#if, nested namespaces on one line, aligned enum values) that no global option matches.The job does not cover
compiler/cpportest/cpp.Verified:
git-clang-format-18 --diff HEAD^ -- lib/cppexits 1 on a misformatted line in a.tccfile, and 0 on a correctly formatted change and on a change without C++ files.[skip ci]anywhere in the commit message to free up build resources.Generated-by: Claude Opus 5.5