From 672adeb84f672ba1062dc8cada4effdd1e6e2c22 Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Thu, 6 Oct 2022 16:16:07 -0400 Subject: [PATCH] [ObjC] Fix up clang-format directives in generate files. - If the source name is long enough, clang-format can want to reflow that comment line, so move up the directive. - Fix typo at the end of the file. --- objectivec/GPBAny.pbobjc.h | 3 +-- objectivec/GPBAny.pbobjc.m | 5 ++--- objectivec/GPBApi.pbobjc.h | 3 +-- objectivec/GPBApi.pbobjc.m | 5 ++--- objectivec/GPBDuration.pbobjc.h | 3 +-- objectivec/GPBDuration.pbobjc.m | 5 ++--- objectivec/GPBEmpty.pbobjc.h | 3 +-- objectivec/GPBEmpty.pbobjc.m | 5 ++--- objectivec/GPBFieldMask.pbobjc.h | 3 +-- objectivec/GPBFieldMask.pbobjc.m | 5 ++--- objectivec/GPBSourceContext.pbobjc.h | 3 +-- objectivec/GPBSourceContext.pbobjc.m | 5 ++--- objectivec/GPBStruct.pbobjc.h | 3 +-- objectivec/GPBStruct.pbobjc.m | 5 ++--- objectivec/GPBTimestamp.pbobjc.h | 3 +-- objectivec/GPBTimestamp.pbobjc.m | 5 ++--- objectivec/GPBType.pbobjc.h | 3 +-- objectivec/GPBType.pbobjc.m | 5 ++--- objectivec/GPBWrappers.pbobjc.h | 3 +-- objectivec/GPBWrappers.pbobjc.m | 5 ++--- src/google/protobuf/compiler/objectivec/file.cc | 5 ++--- 21 files changed, 32 insertions(+), 53 deletions(-) diff --git a/objectivec/GPBAny.pbobjc.h b/objectivec/GPBAny.pbobjc.h index e30acc0aec..3f40181ae6 100644 --- a/objectivec/GPBAny.pbobjc.h +++ b/objectivec/GPBAny.pbobjc.h @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/any.proto - // clang-format off +// source: google/protobuf/any.proto #import "GPBDescriptor.h" #import "GPBMessage.h" diff --git a/objectivec/GPBAny.pbobjc.m b/objectivec/GPBAny.pbobjc.m index e838675145..7f62f119e2 100644 --- a/objectivec/GPBAny.pbobjc.m +++ b/objectivec/GPBAny.pbobjc.m @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/any.proto - // clang-format off +// source: google/protobuf/any.proto #import "GPBProtocolBuffers_RuntimeSupport.h" #import "GPBAny.pbobjc.h" @@ -101,4 +100,4 @@ typedef struct GPBAny__storage_ { // @@protoc_insertion_point(global_scope) -// clange-format on +// clang-format on diff --git a/objectivec/GPBApi.pbobjc.h b/objectivec/GPBApi.pbobjc.h index 3cd0821bac..11b5400ea6 100644 --- a/objectivec/GPBApi.pbobjc.h +++ b/objectivec/GPBApi.pbobjc.h @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/api.proto - // clang-format off +// source: google/protobuf/api.proto #import "GPBDescriptor.h" #import "GPBMessage.h" diff --git a/objectivec/GPBApi.pbobjc.m b/objectivec/GPBApi.pbobjc.m index 88a215eb15..18c4c644e9 100644 --- a/objectivec/GPBApi.pbobjc.m +++ b/objectivec/GPBApi.pbobjc.m @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/api.proto - // clang-format off +// source: google/protobuf/api.proto #import "GPBProtocolBuffers_RuntimeSupport.h" #import "GPBApi.pbobjc.h" @@ -355,4 +354,4 @@ typedef struct GPBMixin__storage_ { // @@protoc_insertion_point(global_scope) -// clange-format on +// clang-format on diff --git a/objectivec/GPBDuration.pbobjc.h b/objectivec/GPBDuration.pbobjc.h index fda9b4733f..7fb2658d5f 100644 --- a/objectivec/GPBDuration.pbobjc.h +++ b/objectivec/GPBDuration.pbobjc.h @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/duration.proto - // clang-format off +// source: google/protobuf/duration.proto #import "GPBDescriptor.h" #import "GPBMessage.h" diff --git a/objectivec/GPBDuration.pbobjc.m b/objectivec/GPBDuration.pbobjc.m index bc610923f4..06f5bc31d5 100644 --- a/objectivec/GPBDuration.pbobjc.m +++ b/objectivec/GPBDuration.pbobjc.m @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/duration.proto - // clang-format off +// source: google/protobuf/duration.proto #import "GPBProtocolBuffers_RuntimeSupport.h" #import "GPBDuration.pbobjc.h" @@ -96,4 +95,4 @@ typedef struct GPBDuration__storage_ { // @@protoc_insertion_point(global_scope) -// clange-format on +// clang-format on diff --git a/objectivec/GPBEmpty.pbobjc.h b/objectivec/GPBEmpty.pbobjc.h index 26ef9a6907..1c840eb6fd 100644 --- a/objectivec/GPBEmpty.pbobjc.h +++ b/objectivec/GPBEmpty.pbobjc.h @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/empty.proto - // clang-format off +// source: google/protobuf/empty.proto #import "GPBDescriptor.h" #import "GPBMessage.h" diff --git a/objectivec/GPBEmpty.pbobjc.m b/objectivec/GPBEmpty.pbobjc.m index 49f703099a..2360c369f3 100644 --- a/objectivec/GPBEmpty.pbobjc.m +++ b/objectivec/GPBEmpty.pbobjc.m @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/empty.proto - // clang-format off +// source: google/protobuf/empty.proto #import "GPBProtocolBuffers_RuntimeSupport.h" #import "GPBEmpty.pbobjc.h" @@ -72,4 +71,4 @@ typedef struct GPBEmpty__storage_ { // @@protoc_insertion_point(global_scope) -// clange-format on +// clang-format on diff --git a/objectivec/GPBFieldMask.pbobjc.h b/objectivec/GPBFieldMask.pbobjc.h index 87898ad254..5d4f59c45a 100644 --- a/objectivec/GPBFieldMask.pbobjc.h +++ b/objectivec/GPBFieldMask.pbobjc.h @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/field_mask.proto - // clang-format off +// source: google/protobuf/field_mask.proto #import "GPBDescriptor.h" #import "GPBMessage.h" diff --git a/objectivec/GPBFieldMask.pbobjc.m b/objectivec/GPBFieldMask.pbobjc.m index f820fd826d..acb202d35c 100644 --- a/objectivec/GPBFieldMask.pbobjc.m +++ b/objectivec/GPBFieldMask.pbobjc.m @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/field_mask.proto - // clang-format off +// source: google/protobuf/field_mask.proto #import "GPBProtocolBuffers_RuntimeSupport.h" #import "GPBFieldMask.pbobjc.h" @@ -85,4 +84,4 @@ typedef struct GPBFieldMask__storage_ { // @@protoc_insertion_point(global_scope) -// clange-format on +// clang-format on diff --git a/objectivec/GPBSourceContext.pbobjc.h b/objectivec/GPBSourceContext.pbobjc.h index e747dc0b9f..84338824d8 100644 --- a/objectivec/GPBSourceContext.pbobjc.h +++ b/objectivec/GPBSourceContext.pbobjc.h @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/source_context.proto - // clang-format off +// source: google/protobuf/source_context.proto #import "GPBDescriptor.h" #import "GPBMessage.h" diff --git a/objectivec/GPBSourceContext.pbobjc.m b/objectivec/GPBSourceContext.pbobjc.m index 094f32380a..7f035e71e3 100644 --- a/objectivec/GPBSourceContext.pbobjc.m +++ b/objectivec/GPBSourceContext.pbobjc.m @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/source_context.proto - // clang-format off +// source: google/protobuf/source_context.proto #import "GPBProtocolBuffers_RuntimeSupport.h" #import "GPBSourceContext.pbobjc.h" @@ -85,4 +84,4 @@ typedef struct GPBSourceContext__storage_ { // @@protoc_insertion_point(global_scope) -// clange-format on +// clang-format on diff --git a/objectivec/GPBStruct.pbobjc.h b/objectivec/GPBStruct.pbobjc.h index eaa531ed9a..4035f5166e 100644 --- a/objectivec/GPBStruct.pbobjc.h +++ b/objectivec/GPBStruct.pbobjc.h @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/struct.proto - // clang-format off +// source: google/protobuf/struct.proto #import "GPBDescriptor.h" #import "GPBMessage.h" diff --git a/objectivec/GPBStruct.pbobjc.m b/objectivec/GPBStruct.pbobjc.m index 3707178eb8..b6ee9c1e4b 100644 --- a/objectivec/GPBStruct.pbobjc.m +++ b/objectivec/GPBStruct.pbobjc.m @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/struct.proto - // clang-format off +// source: google/protobuf/struct.proto #import "GPBProtocolBuffers_RuntimeSupport.h" #import "GPBStruct.pbobjc.h" @@ -298,4 +297,4 @@ typedef struct GPBListValue__storage_ { // @@protoc_insertion_point(global_scope) -// clange-format on +// clang-format on diff --git a/objectivec/GPBTimestamp.pbobjc.h b/objectivec/GPBTimestamp.pbobjc.h index 6d6a93028f..0f1acdd8c2 100644 --- a/objectivec/GPBTimestamp.pbobjc.h +++ b/objectivec/GPBTimestamp.pbobjc.h @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/timestamp.proto - // clang-format off +// source: google/protobuf/timestamp.proto #import "GPBDescriptor.h" #import "GPBMessage.h" diff --git a/objectivec/GPBTimestamp.pbobjc.m b/objectivec/GPBTimestamp.pbobjc.m index 1792ecb3ab..7d2276c586 100644 --- a/objectivec/GPBTimestamp.pbobjc.m +++ b/objectivec/GPBTimestamp.pbobjc.m @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/timestamp.proto - // clang-format off +// source: google/protobuf/timestamp.proto #import "GPBProtocolBuffers_RuntimeSupport.h" #import "GPBTimestamp.pbobjc.h" @@ -96,4 +95,4 @@ typedef struct GPBTimestamp__storage_ { // @@protoc_insertion_point(global_scope) -// clange-format on +// clang-format on diff --git a/objectivec/GPBType.pbobjc.h b/objectivec/GPBType.pbobjc.h index ef9b74bf5f..b102ab48c2 100644 --- a/objectivec/GPBType.pbobjc.h +++ b/objectivec/GPBType.pbobjc.h @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/type.proto - // clang-format off +// source: google/protobuf/type.proto #import "GPBDescriptor.h" #import "GPBMessage.h" diff --git a/objectivec/GPBType.pbobjc.m b/objectivec/GPBType.pbobjc.m index 5c8c73e169..60f7c08944 100644 --- a/objectivec/GPBType.pbobjc.m +++ b/objectivec/GPBType.pbobjc.m @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/type.proto - // clang-format off +// source: google/protobuf/type.proto #import "GPBProtocolBuffers_RuntimeSupport.h" #import "GPBType.pbobjc.h" @@ -710,4 +709,4 @@ typedef struct GPBOption__storage_ { // @@protoc_insertion_point(global_scope) -// clange-format on +// clang-format on diff --git a/objectivec/GPBWrappers.pbobjc.h b/objectivec/GPBWrappers.pbobjc.h index 11b052a6ba..94e69ad417 100644 --- a/objectivec/GPBWrappers.pbobjc.h +++ b/objectivec/GPBWrappers.pbobjc.h @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/wrappers.proto - // clang-format off +// source: google/protobuf/wrappers.proto #import "GPBDescriptor.h" #import "GPBMessage.h" diff --git a/objectivec/GPBWrappers.pbobjc.m b/objectivec/GPBWrappers.pbobjc.m index 45ee1a3b94..879579cf05 100644 --- a/objectivec/GPBWrappers.pbobjc.m +++ b/objectivec/GPBWrappers.pbobjc.m @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/wrappers.proto - // clang-format off +// source: google/protobuf/wrappers.proto #import "GPBProtocolBuffers_RuntimeSupport.h" #import "GPBWrappers.pbobjc.h" @@ -444,4 +443,4 @@ typedef struct GPBBytesValue__storage_ { // @@protoc_insertion_point(global_scope) -// clange-format on +// clang-format on diff --git a/src/google/protobuf/compiler/objectivec/file.cc b/src/google/protobuf/compiler/objectivec/file.cc index ff74517963..bf175f9a93 100644 --- a/src/google/protobuf/compiler/objectivec/file.cc +++ b/src/google/protobuf/compiler/objectivec/file.cc @@ -644,7 +644,7 @@ void FileGenerator::GenerateSource(io::Printer* printer) { "\n" "// @@protoc_insertion_point(global_scope)\n" "\n" - "// clange-format on\n"); + "// clang-format on\n"); } // Helper to print the import of the runtime support at the top of generated @@ -655,9 +655,8 @@ void FileGenerator::PrintFileRuntimePreamble( const std::vector& headers_to_import) const { printer->Print( "// Generated by the protocol buffer compiler. DO NOT EDIT!\n" - "// source: $filename$\n" - "\n" "// clang-format off\n" + "// source: $filename$\n" "\n", "filename", file_->name());