github.com/psrajat/prototool@v1.3.0/internal/cmd/testdata/format/proto3/foo/foo.proto.golden (about) 1 // foo 2 3 // bar 4 5 syntax = "proto3"; // inline comment1 6 7 package foo; // inline comment3 8 9 // comment16 10 option (bar.file_dep_option) = { 11 hello: 1 12 bar: 2 13 }; // inline comment16 14 // comment6 15 option (bar.file_option) = true; // inline comment6 16 // comment4 17 option go_package = "foopb"; // inline comment4 18 // comment11 19 option java_multiple_files = true; //inline comment11 20 // comment5 21 option java_outer_classname = "FooProto"; // inline comment5 22 // comment12 23 option java_package = "com.foo"; // inline comment23 24 25 //comment10 26 import "foo/bar/bar.proto"; //inline comment10 27 // comment9 28 import "google/protobuf/timestamp.proto"; // inline comment9 29 30 // baz 31 32 // bat 33 // ban 34 35 // Baz is a baz. 36 message Baz { 37 // comment14 38 // still comment14 39 option (bar.message_option) = true; // inline comment14 40 // comment15 41 option (bar.message_dep_option) = { 42 hello: 1 43 }; // inline comment15 44 int64 hello = 1; 45 // unassociated comment 46 47 // another unassociated comment 48 49 // dep comment 50 bar.Dep dep = 2; 51 google.protobuf.Timestamp timestamp = 3; // inline c-style comment 52 int64 woot = 5 [(bar.field_option) = true]; 53 // comment17 54 int64 woot2 = 6 [ 55 (bar.field_dep_option) = { 56 hello: 1 57 }, 58 (bar.field_option) = true 59 ]; // inline comment17 60 map<string, int64> m = 11; 61 map<string, int64> m2 = 12 [ 62 (bar.field_dep_option) = { 63 hello: 1 64 }, 65 (bar.field_option) = true 66 ]; 67 oneof test_oneof { 68 // TODO: readd when oneof options handled 69 option (bar.oneof_option) = true; // inline comment18 70 option (bar.oneof_dep_option) = { 71 hello: 1 72 }; // inline comment19 73 int64 foo1 = 8; 74 string foo2 = 9; 75 // comment18 76 int64 woot3 = 10 [ 77 (bar.field_dep_option) = { 78 hello: 1 79 }, 80 (bar.field_option) = true 81 ]; // inline comment18 82 // comment21 83 bar.Dep dep2 = 14; // inline comment21 84 } 85 int64 test_repeated_field_option = 15 [ 86 (bar.repeated_field_option) = 1, 87 (bar.repeated_field_option) = 2 88 ]; 89 int64 test_repeated_dep_option = 16 [ 90 (bar.field_dep_option) = { 91 hello: 1 92 repeated_bar: [ 93 1, 94 2 95 ] 96 }, 97 (bar.repeated_field_dep_option) = { 98 hello: 1 99 recursive: { 100 hello: 2 101 repeated_bar: [ 102 3, 103 4 104 ] 105 } 106 }, 107 (bar.repeated_field_dep_option) = { 108 hello: 5 109 recursive: { 110 hello: 6 111 repeated_bar: [ 112 7, 113 8 114 ] 115 } 116 }, 117 (bar.repeated_field_dep_option) = { 118 hello: 1 119 repeated_dep: [ 120 { 121 hello: 1 122 repeated_bar: [ 123 1, 124 2 125 ] 126 }, 127 { 128 hello: 3 129 repeated_bar: [ 130 3, 131 4 132 ] 133 } 134 ] 135 } 136 ]; 137 } 138 139 // Bat is a bat. 140 message Bat { 141 reserved 2 to 10, 1000 to 1100; 142 reserved "foo"; 143 reserved "bar", "baz"; 144 // NestedBat is a nested bat. 145 message NestedBat { 146 int64 hello = 1; 147 } 148 } 149 150 enum SomeAlias { 151 option allow_alias = true; 152 SOME_ALIAS_INVALID = 0; 153 SOME_ALIAS_UNSET = 1; 154 SOME_ALIAS_TREE = 2; 155 SOME_ALIAS_BALLOON = 3; 156 SOME_ALIAS_LAMP_POST = 3; 157 } 158 159 // Empty is an empty message. 160 message Empty {} 161 162 // Something is something. 163 enum Something { 164 option (bar.enum_option) = true; 165 // comment25 166 SOMETHING_INVALID = 0 [(bar.enum_value_option) = true]; // inline comment25 167 // comment27 168 SOMETHING_UNSET = 1; // inline comment27 169 // comment28 170 SOMETHING_FOO = 2; // inline comment28 171 } 172 173 // Daylight is the daylight service. 174 service Daylight { 175 option (bar.service_option) = true; // inline comment29 176 option (bar.service_dep_option) = { 177 hello: 1 178 }; // inline comment30 179 rpc Hello(Bat) returns (Empty) { 180 option (bar.method_dep_option) = { 181 hello: 1 182 bar: 2 183 recursive: { 184 hello: 3 185 recursive: { 186 bar: 2 187 } 188 } 189 }; // inline comment22 190 } // inline comment23 191 rpc Foo(Empty) returns (Bat); // inline comment24 192 }