#352·scc

.gitattributes linguist-language (language detection override) isn't taken into account

Author: ell1eCreated Oct 7, 2022Updated Oct 1, 2024
Labelsenhancement

Describe the bug A .gitattributes file's linguist-language entries seem to be ignored. These are language detection overrides based on specified files or file patterns, for use e.g. when a language in the repository is often detected wrong or is unlikely to be known by any tools looking at it. This might for example be the case if it's a small, domain-specific language made just for that specific project.

To Reproduce

  1. Clone or create a repo that uses .gitattributes to override something, here is an example line you can put into .gitattributes in your repo root for testing:
    *.mylang linguist-language=MyLang
    Then make sure any non-empty stuff.mylang file is present.
  2. Run scc on the repository.

Expected behavior With above steps to reproduce MyLang should show up in the listing, or whatever override is specified. At least when I tried it, this wasn't the case.

Desktop (please complete the following information):

  • OS: Fedora Linux
  • OS Version 26
  • SCC Version: 3.1.0