Skip to content

Conversation

@copybara-service
Copy link

txtpbfmt: Add support for formatting repeated primitive fields as lists.

When this option is used, repeated primitive fields are printed using a more conscice list syntax:

repeated_field: 1
repeated_field: 2
repeated_field: 3

vs

repeated_field: [1, 2, 3]

This syntax is part of the go/textformat-spec (screen/4cDavcUGvdjyWwN), thus it's supported by all parsers. Furthermore, some proto implementations (like C++ and Java) allow using it when printing text-proto.

This CL is a no-op if the config option isn't used.

@copybara-service copybara-service bot force-pushed the test_834277184 branch 2 times, most recently from 4e44ace to b914c80 Compare November 24, 2025 09:36
…ists.

When this option is used, repeated primitive fields are printed using a more conscice list syntax:

```textproto
repeated_field: 1
repeated_field: 2
repeated_field: 3
```

vs

```textproto
repeated_field: [1, 2, 3]
```

This syntax is part of the go/textformat-spec (screen/4cDavcUGvdjyWwN), thus it's supported by all parsers. Furthermore, some proto implementations (like [C++](http://google3/third_party/protobuf/text_format.h;l=407;rcl=828248838) and [Java](http://google3/third_party/java_src/protobuf/current/java/com/google/protobuf/TextFormat.java;l=385;rcl=815831657)) allow using it when printing text-proto.

This CL is a no-op if the config option isn't used.

PiperOrigin-RevId: 836120469
@copybara-service copybara-service bot merged commit fcb97cc into master Nov 24, 2025
@copybara-service copybara-service bot deleted the test_834277184 branch November 24, 2025 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants