Skip to content

Adding txtpb extension to Protocol Buffer Text Format#6566

Merged
lildude merged 8 commits intogithub-linguist:mainfrom
milesflo:txtpb-support
Mar 16, 2026
Merged

Adding txtpb extension to Protocol Buffer Text Format#6566
lildude merged 8 commits intogithub-linguist:mainfrom
milesflo:txtpb-support

Conversation

@milesflo
Copy link
Contributor

@milesflo milesflo commented Oct 5, 2023

Description

The Text Format specification has consolidated its canonical file extension to txtpb, with textproto still supported in some legacy tooling...

From the Docs:

.txtpb is the canonical text format file extension and should be preferred to the alternatives. This suffix is preferred for its brevity and consistency with the official wire-format file extension .binpb. The legacy canonical extension .textproto still has widespread usage and tooling support. Some tooling also supports the legacy extensions .textpb and .pbtxt. All other extensions besides the above are strongly discouraged; in particular, extensions such as .protoascii wrongly imply that text format is ascii-only, and others like .pb.txt are not recognized by common tooling. METADATA files are special text format proto files that lack any extension.

To Protocol Buffer Text Format:

Add Extensions

  • txtpb canonical extension by the standard

Checklist:

@milesflo milesflo requested a review from a team as a code owner October 5, 2023 18:14
@milesflo milesflo changed the title txtpb: Adding canonical txtpb file extension to Protocol Buffer Text … Adding txtpb extension to Protocol Buffer Text Format Oct 5, 2023
lildude
lildude previously requested changes Oct 5, 2023
Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Along with the inline comment, we will also require samples of the new extensions files, and for the popularity requirements to be met.

@milesflo
Copy link
Contributor Author

milesflo commented Oct 5, 2023

@lildude Squashed change & comment updated 👍

Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need a sample for the new extension.

@milesflo
Copy link
Contributor Author

milesflo commented Oct 5, 2023

We still need a sample for the new extension.

Ahh I see. Done: 0fc3707

@lildude
Copy link
Member

lildude commented Oct 6, 2023

Thanks but as stated in the CONTRIBUTING.md file, the sample should be a real world sample. This appears to be a contrived "hello world" like sample. We also need to know the source of the sample and the license of the file. This was a point in the template you removed when opening this PR, which brings me to that port, please put back the template and fill it in… it's there for a reason 😉

@milesflo
Copy link
Contributor Author

milesflo commented Oct 9, 2023

@lildude Updated the sample, readded the template, and added links to everything

@dougthor42
Copy link

Would it be possible to have an exception for the "pending popularity" requirement?

At least within our org (https://github.com/qh-lab), the only reason we didn't use .txtpb is because linguist doesn't highlight it. I'm sure other orgs/repos had the same thought.

@lildude
Copy link
Member

lildude commented Jan 4, 2024

Would it be possible to have an exception for the "pending popularity" requirement?

Unfortunately we can't as it sets a precedent we don't want to fight each and every time someone develops "the next greatest thing, promise on my hamster's life".

As Linguist already knows about the language, you can use an override to set the language until this PR is merged and deployed.

@dougthor42
Copy link

I am disappointed, but completely understand and agree. But I had to try 😉.

Also, good to know about overrides! I'll let our team know. Thanks!

@lildude lildude dismissed their stale review March 13, 2024 10:43

Changes applied

Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

Important

The changes in this PR will not appear on GitHub until the next release has been made and deployed. See here for more details.

@lildude lildude enabled auto-merge March 16, 2026 16:06
@lildude lildude added this pull request to the merge queue Mar 16, 2026
Merged via the queue into github-linguist:main with commit 240bf92 Mar 16, 2026
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.

4 participants