githubwildcardglobgithub-linguist

Does GitHub Linguist's languages.yml allow wildcards in extensions?


Let's say we have a programming language that uses files with various extensions, all of which share some characters that indicate the language, but continues with additional characters that indicates the type of content. Take for example from the current languages.yml:

Xojo:
  type: programming
  extensions:
  - ".xojo_code"
  - ".xojo_menu"
  - ".xojo_report"
  - ".xojo_script"
  - ".xojo_toolbar"
  - ".xojo_window"
  tm_scope: source.vbnet
  ace_mode: text
  language_id: 405

For generalisation and to avoid having to update languages.yml whenever a new content type is added, it would be natural to use wildcards:

Xojo:
  type: programming
  extensions:
  - ".xojo_*"
  tm_scope: source.vbnet
  ace_mode: text
  language_id: 405

Here is another example:

VHDL:
  type: programming
  color: "#adb2cb"
  extensions:
  - ".vhdl"
  - ".vhd"
  - ".vhf"
  - ".vhi"
  - ".vho"
  - ".vhs"
  - ".vht"
  - ".vhw"
  ace_mode: vhdl
  codemirror_mode: vhdl
  codemirror_mime_type: text/x-vhdl
  language_id: 385

This could be:

VHDL:
  type: programming
  color: "#adb2cb"
  extensions:
  - ".vhdl"
  - ".vh?"
  ace_mode: vhdl
  codemirror_mode: vhdl
  codemirror_mime_type: text/x-vhdl
  language_id: 385

Does Linguist allow using such wildcards?


Solution

  • No, it doesn't.

    We (I'm a co-maintainer of github-linguist) don't receive that many requests to add new extensions that we have felt a need to add this for now.