I was annoyed that GitHub would detect my repo as having Go code in it, so I did some quick doc reading and modified the .gitattributes file to hint it in the right direction.
About this I mean about the lack of highlighting with linguist-language=Protocol-Buffer, I think this is where it needs to be addressed GitHub · Where software is built
Ok, figured it out. Protocol-Buffer in linguist is for highlighting Protocol-Buffer files that conform to the language specification.
The files that Defold outputs are text encoded protocol buffer messages and can be translated using protoc --encode and protoc --decode accordingly.
I don’t know that there will ever be a syntax for the text format available, as it is not a language itself, but a data packet not too dissimilar from the binary format that Protocol Buffers would normally pass messages around with.
If I mark them as JSON5 I get syntax highlighting because of the unquoted key names, however, the comment in the format is # and does not highlight properly, as well as JSON5 expects a comma at the end of the line instead of a new-line, however this does not break the highlighter.
The trick here is that anything defined as “data” instead of a language, would not count against your stats, as data is not accumulated in github for a language score. So using JSON5 for now would get us halfway there, and unless someone creates a hiughlighter for text protobuf messages, nothing else really exists, and it would look like plain text.
Simply marking the types as ‘linguist-detectable=false’ is enough to remove them from the language stats, without attempting to pretty the output when viewed on github.
I found that one right before I published. The grammar file wasn’t as complete as the effort I put into mine so I decided to push still. Going to be using this implementation for the PR as it supports highlighting and tokenization of everything I could discover in the wild.
textproto-grammer just got an update with a big PR from the community.
Better matching / highlighting, using match terminology as defined by import / export implementations in go. Working on some tests against more files found in the wild. Let me know how it goes for you, and please leave some feedback / bugs on github.