1

GitHub appears to auto-detect the project language type. However, it has failed on a couple of mine.

Is there a way to set that manually, or is there some keyword/phrase I should set to trigger it?

I'd presumed it goes by file extension as it properly detects my Modula-2, Propeller Spin, and Java repos. However, it only identifies about half my Assembly repos properly (and they all have .asm files).

3

You can use a .gitattributes file to add or override filename and extension patterns (or vi/emacs lines).

*.ASM linguist-language=Assembly

Github's code library responsible for file type statistics and syntax highlighting selection is called Linguist. You can open a pull request for a change to languages.yml if you believe that you are not the only one affected by this case sensitivity problem.

Assembly: type: programming color: "#6E4C13" aliases: - nasm extensions: - ".asm" - ".a51" - ".inc" - ".nasm" tm_scope: source.assembly ace_mode: assembly_x86 language_id: 24

1

Appears that it only detects the type properly if the filename extensions are in lower case characters. Several of my old projects go way back from when caps was the standard for full filenames. Creating an empty token file in the GitHub web UI with a lowercase extension of the appropriate type will trick it into displaying the proper language type in the repository screen.

  • This was true before March 2015. It changed with pull request #2087 to the Linguist project (used to detect languages on github.com). – pchaigno Aug 15 '17 at 9:00
  • That's odd as it still wasn't working even in late 2016. I haven't been working on those projects yet in 2017, so can't say about now though... – Brian Knoblauch Aug 15 '17 at 11:57
  • 1
    Could be that it didn't update. Language statistics are only updated if you push to the repository. – pchaigno Aug 15 '17 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.