linguist
linguist copied to clipboard
Adding `txtpb` extension to Protocol Buffer Text Format
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:
- [x] I am adding a new extension to a language.
- [ ] The new extension is used in hundreds of repositories on GitHub.com
- Search results for each extension:
- https://github.com/search?type=code&q=NOT+is%3Afork+path%3A*.txtpb
- Search results for each extension:
- [x] I have included a real-world usage sample for all extensions added in this PR:
- Sample source(s):
- Sample license(s):
- [ ] I have included a change to the heuristics to distinguish my language from others using the same extension.
- [ ] The new extension is used in hundreds of repositories on GitHub.com
@lildude Squashed change & comment updated π
We still need a sample for the new extension.
Ahh I see. Done: https://github.com/github-linguist/linguist/pull/6566/commits/0fc370705d76fccd898e74384635b821d352042b
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 π
@lildude Updated the sample, readded the template, and added links to everything
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.
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.
I am disappointed, but completely understand and agree. But I had to try :wink:.
Also, good to know about overrides! I'll let our team know. Thanks!