slachiewicz opened a new pull request, #3976: URL: https://github.com/apache/thrift/pull/3976
Adds a CI job that runs clang-format 18 on the lines a pull request changes in `lib/cpp`, so `.clang-format` is enforced from now on without reformatting existing code. Six options are added to `.clang-format` so that it describes `lib/cpp` as it is written: `FixNamespaceComments`, `ReflowComments`, `SortIncludes`, `BinPackArguments`, `SortUsingDeclarations` and `SpacesInLineCommentPrefix`. The Base64 decode table is excluded with `// clang-format off`. With both, formatting all of `lib/cpp/src` changes 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/cpp` or `test/cpp`. Verified: `git-clang-format-18 --diff HEAD^ -- lib/cpp` exits 1 on a misformatted line in a `.tcc` file, and 0 on a correctly formatted change and on a change without C++ files. - [x] Did you create an [Apache Jira](https://issues.apache.org/jira/projects/THRIFT/issues/) ticket? ([Request account here](https://selfserve.apache.org/jira-account.html), not required for trivial changes) - [x] If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"? - [x] Did you squash your changes to a single commit? (not required, but preferred) - [x] Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"? - [ ] If your change does not involve any code, include `[skip ci]` anywhere in the commit message to free up build resources. Generated-by: Claude Opus 5.5 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
