linguist icon indicating copy to clipboard operation
linguist copied to clipboard

Add `.wlt` to Unity3D Assets

Open sbcrvl opened this issue 2 months ago • 6 comments

Description

As described in this response on an existing issue (#5862), the .wlt files present in Unity projects get misclassified as Mathematica. Of the 1.9k .wlt files found on GitHub, 1.2k (i.e. 63.15%) appear to be misclassified due to this file extension not being included in the Unity3D Asset language.

In this PR I'm adding the .wlt extension to the Unity3D Asset language, creating the (two) corresponding samples and including a second sample for the Mathematica language.

Checklist:

  • [ x ] I am adding a new extension to a language.

    • [ x ] 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*.wlt+%25YAML
    • [ x ] I have included a real-world usage sample for all extensions added in this PR:
      • Sample source(s):
        • Unity3D Asset
          • LayoutDefault.wlt
          • LayoutTall.wlt
        • Mathematica
      • Sample license(s):
        • Unity3D Asset (Generated for this repository, can use the MIT license)
        • Mathematica (MIT License)
    • [ ] I have included a change to the heuristics to distinguish my language from others using the same extension.

    Note

    A third usage for this file extension seems to be around, but it does not yet meet the 200-unique-user/repo requirement in order to be implemented, See usage.

sbcrvl avatar Sep 28 '25 08:09 sbcrvl

Oh, I just noticed I made a mistake in the last two commit messages, instead of .yml I should have written .wlt. Nevertheless, the files these commits create are properly assigned the .wlt file extension.

sbcrvl avatar Sep 28 '25 08:09 sbcrvl

Done! The samples have been simplified and are now visible in the diff. Regarding the popularity criteria, isn't it 200 repositories enough for a file extension to be included? There's at least 1.2k instances of this file extension on GitHub already.

sbcrvl avatar Sep 28 '25 12:09 sbcrvl

Regarding the popularity criteria, isn't it 200 repositories enough for a file extension to be included?

No. See https://github.com/github-linguist/linguist/issues/5756 which is referenced in the CONTRIBUTING.md file too.

lildude avatar Sep 28 '25 12:09 lildude

... unless the extension is expected to only occur once per repo, then 200 files.

Indeed, unlike other assets associated to that language, the nature of .wlt files is to have a single one per project which determines how the editor UI is shown, these do not represent assets that are going to be loaded by the game engine itself like the .mat or other 3D assets or texture-related files. That in addition to the fact that they represent the majority of this file extension and are being misclassified.

sbcrvl avatar Sep 28 '25 12:09 sbcrvl

Another desired implication would be that these files will be treated the equally as other Unity assets, meaning they will not be included on the statistics for each repo. Since these layout files are generated using the editor the user never really gets any inference over the contents on a text editor environment, resulting in this big file is undesirably indexed, and requiring a workarounds as mentioned here

sbcrvl avatar Sep 28 '25 13:09 sbcrvl

Indeed, unlike other assets associated to that language, the nature of .wlt files is to have a single one per project which determines how the editor UI is show

🤔 A quick search shows it's quite common for repos to have more than one of these files, hence my previous comment.

lildude avatar Sep 28 '25 14:09 lildude