summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-01 07:32:00 -0600
committerJeff Carr <[email protected]>2025-02-01 07:32:00 -0600
commit9a0e4a6d62d58d51d3257b588242f442bddc40da (patch)
tree43dfc96f604cf2427e4dd6d67ad64c180d0328cb /example
parentcfedee740ce59638de70382652a3d637398bcab2 (diff)
auto formatting is working well enough
Diffstat (limited to 'example')
-rw-r--r--example/fruit.proto78
-rw-r--r--example/fruit.proto.new14
2 files changed, 48 insertions, 44 deletions
diff --git a/example/fruit.proto b/example/fruit.proto
index 6df0b89..c546fd4 100644
--- a/example/fruit.proto
+++ b/example/fruit.proto
@@ -16,61 +16,63 @@ package main;
import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp
message Apple {
- string name = 1; // `autogenpb:unique` // generates SortByxxx() and AppendUnique() functions
- string genus = 2; // `autogenpb:unique` // generates same thing here but SortByGenus()
- google.protobuf.Timestamp ctime = 3; // when the apple was born
+ string name = 1; // `autogenpb:unique` // generates SortByxxx() and AppendUnique() functions
+ string genus = 2; // `autogenpb:unique` // generates same thing here but SortByGenus()
+ google.protobuf.Timestamp ctime = 3; // when the apple was born
}
message Apples {
- string name = 1; // `autogenpb:unique` // generates SortByxxx() and AppendUnique() functions
- string genus = 2; // `autogenpb:unique` // generates same thing here but SortByGenus()
- repeated Apple apples = 3;
+ string name = 1; // `autogenpb:unique` // generates SortByxxx() and AppendUnique() functions
+ string genus = 2; // `autogenpb:unique` // generates same thing here but SortByGenus()
+ repeated Apple apples = 3;
}
-message Pear { // `autogenpb:nomutex`
- string name = 1; // `autogenpb:sort`
- string favorite = 2; // `autogenpb:sort` `autogenpb:unique`
+message Pear { // `autogenpb:nomutex`
+ string name = 1; // `autogenpb:sort`
+ string favorite = 2; // `autogenpb:sort` `autogenpb:unique`
}
-message Pears { // `autogenpb:nomutex`
- string name = 1; // `autogenpb:sort`
- string favorite = 2; // `autogenpb:sort` `autogenpb:unique`
- repeated Pear pears = 3;
+message Pears { // `autogenpb:nomutex`
+ string name = 1; // `autogenpb:sort`
+ string favorite = 2; // `autogenpb:sort` `autogenpb:unique`
+ repeated Pear pears = 3;
}
-message Banana { // `autogenpb:nomutex`
- repeated string name = 1; // `autogenpb:sort`
- string favorite = 2; // `autogenpb:sort` `autogenpb:unique`
- string country = 3; // `autogenpb:sort`
+message Banana { // `autogenpb:nomutex`
+ repeated string name = 1; // `autogenpb:sort`
+ string favorite = 2; // `autogenpb:sort` `autogenpb:unique`
+ string country = 3; // `autogenpb:sort`
}
-message Basket { // `autogenpb:nomutex`
- repeated string name = 1; // `autogenpb:sort` `autogenpb:unique`
- string favorite = 2; // `autogenpb:sort` `autogenpb:unique`
- int64 price = 3; // `autogenpb:sort`
- repeated Banana banna = 4;
- repeated Pear pears = 5;
- repeated Apple stacks = 6;
+message Basket { // `autogenpb:nomutex`
+ repeated string name = 1; // `autogenpb:sort` `autogenpb:unique`
+ string favorite = 2; // `autogenpb:sort` `autogenpb:unique`
+ int64 price = 3; // `autogenpb:sort`
+ // here for testing padding
+
+ repeated Banana banna = 4;
+ repeated Pear pears = 5;
+ repeated Apple stacks = 6;
}
// "Fruit" must exist. you can put anything in it
message Fruit {
- string brand = 1; // `autogenpb:unique` `autogenpb:sort`
- Apple apples = 2;
- repeated Pear pears = 3;
- string UPC = 4; // `autogenpb:sort` `autogenpb:unique`
- string city = 5; // `autogenpb:sort`
- Pears notpears = 6;
- Pears fakepears = 7;
- repeated Basket gifts = 8;
+ string brand = 1; // `autogenpb:unique` `autogenpb:sort`
+ Apple apples = 2;
+ repeated Pear pears = 3;
+ string UPC = 4; // `autogenpb:sort` `autogenpb:unique`
+ string city = 5; // `autogenpb:sort`
+ Pears notpears = 6;
+ Pears fakepears = 7;
+ repeated Basket gifts = 8;
}
// "Fruits" MUST EXIST and start exactly this way
// It must be "Fruit" + 's' and must match the name of this file: "fruit.proto"
-message Fruits { // `autogenpb:marshal` `autogenpb:mutex`
- string uuid = 1; // `autogenpb:uuid:be926ad9-f07f-484c-adf2-d96eeabf3079`
- string version = 2; // `autogenpb:version:v0.0.1`
- repeated Fruit Fruits = 3; // THIS MUST BE "Fruit" and then "Fruit" + "s"
- int64 cost = 4; // you can add additional things here but the three lines above must conform to the standard above
- map<string, string> junk = 5;
+message Fruits { // `autogenpb:marshal` `autogenpb:mutex`
+ string uuid = 1; // `autogenpb:uuid:be926ad9-f07f-484c-adf2-d96eeabf3079`
+ string version = 2; // `autogenpb:version:v0.0.1`
+ repeated Fruit Fruits = 3; // THIS MUST BE "Fruit" and then "Fruit" + "s"
+ int64 cost = 4; // you can add additional things here but the three lines above must conform to the standard above
+ map<string, string> junk = 5;
}
diff --git a/example/fruit.proto.new b/example/fruit.proto.new
index f9f39a0..78f9c22 100644
--- a/example/fruit.proto.new
+++ b/example/fruit.proto.new
@@ -45,12 +45,14 @@ message Banana { // `autogenpb:nomutex`
}
message Basket { // `autogenpb:nomutex`
- repeated string name = 1; // `autogenpb:sort` `autogenpb:unique`
- string favorite = 2; // `autogenpb:sort` `autogenpb:unique`
- int64 price = 3; // `autogenpb:sort`
- repeated Banana banna = 4;
- repeated Pear pears = 5;
- repeated Apple stacks = 6;
+ repeated string name = 1; // `autogenpb:sort` `autogenpb:unique`
+ string favorite = 2; // `autogenpb:sort` `autogenpb:unique`
+ int64 price = 3; // `autogenpb:sort`
+ //
+
+ repeated Banana banna = 4;
+ repeated Pear pears = 5;
+ repeated Apple stacks = 6;
}
// "Fruit" must exist. you can put anything in it