Use the Google Style for clang-format without exceptions (#8706)

This reduces the friction when merging from github and google repos by
using the exact same clang style guide.

MARKDOWN=true
This commit is contained in:
Derek Bailey
2025-09-23 21:19:33 -07:00
committed by GitHub
parent 881eaab706
commit 0e047869da
84 changed files with 8178 additions and 6653 deletions

View File

@@ -8,7 +8,7 @@
namespace flatbuffers {
namespace tests {
void EvolutionTest(const std::string &tests_data_path) {
void EvolutionTest(const std::string& tests_data_path) {
// VS10 does not support typed enums, exclude from tests
#if !defined(_MSC_VER) || _MSC_VER >= 1700
const int NUM_VERSIONS = 2;
@@ -83,8 +83,8 @@ void EvolutionTest(const std::string &tests_data_path) {
void ConformTest() {
const char ref[] = "table T { A:int; } enum E:byte { A }";
auto test_conform = [](const char *ref, const char *test,
const char *expected_err) {
auto test_conform = [](const char* ref, const char* test,
const char* expected_err) {
flatbuffers::Parser parser1;
TEST_EQ(parser1.Parse(ref), true);
flatbuffers::Parser parser2;
@@ -112,11 +112,13 @@ void ConformTest() {
"field renamed to different type: T2.df (renamed from T2.f)");
// Check enum underlying type changes.
test_conform("enum E:int32 {A}", "enum E: byte {A}", "underlying type differ for enum: E");
test_conform("enum E:int32 {A}", "enum E: byte {A}",
"underlying type differ for enum: E");
// Check union underlying type changes.
const char ref3[] = "table A {} table B {} union C {A, B}";
test_conform(ref3, "table A {} table B {} union C:int32 {A, B}", "underlying type differ for union: C");
test_conform(ref3, "table A {} table B {} union C:int32 {A, B}",
"underlying type differ for union: C");
// Check conformity for Offset64-related changes.
{
@@ -151,7 +153,7 @@ void ConformTest() {
}
}
void UnionDeprecationTest(const std::string &tests_data_path) {
void UnionDeprecationTest(const std::string& tests_data_path) {
const int NUM_VERSIONS = 2;
std::string schemas[NUM_VERSIONS];
std::string jsonfiles[NUM_VERSIONS];