Last month I completed a personal coding challenge, where I dedicated thirty minutes a day for thirty days.
I decided to build a platformer game for my son, using GameMaker Studio 2, with the game logic being written in GameMaker Language (GML).
I documented the process in the following three articles:
Whilst using GameMaker Studio 2, I noticed that GitHub detects files with the “.yy” extension as Yacc language files, which stands for “Yet Another Compiler-Compiler”.
Although not a major issue, it is slightly annoying to see a GameMaker Studio 2 projects be reported by GitHub as 98% Yacc. I would prefer JSON or maybe even GML, as they are generated by GameMaker Studio 2.
As a result, I decided to research the linguist library which is used by GitHub to detect blob languages, ignore binary files, suppress generated files in diffs, and generate language breakdown graphs.
Thankfully, the library supports “overrides”, allowing for custom override strategies for language definitions and file paths.
As documented, I created a “.gitattributes” file with the following code:
# Re-classify .yy files *.yy linguist-language=GML
The “.gitattributes” must be stored in the root of the GameMaker Studio 2 project, similar to how you would use “.gitignore”.
Once pushed to GitHub, you should see the “languages” section update. This took several hours post push, I assume driven by a scheduled job executed by GitHub.
Depending on your preference, you may want to reclassify “.yy” files as JSON or maybe even ignore them completely. These are both viable options using linguist overrides.