Github is marking my repository that doesn't contain a single line of HTML as containing 75% HTML. I ran linguist on the repo locally and according to the output, it is considering all files with the .j2 extension as HTML files:
This is obviously not the case as all of the .j2 files in my repo are templates yaml, json and other configuration files.
Expected behaviour
Jinja templates should be classified as "Jinja templates" or something more descriptive that isn't HTML. Alternatively, linguist could drill down further in the file name and classify .html.j2 files as HTML, .yaml.j2 files as YAML, .json.j2 files as JSON etc.
Related discussion
@lildude pointed out in https://github.com/github/linguist/issues/5047 that jinja2 templates "are part of the "HTML+Django" language which is part of the HTML group of languages". This is obviously a bug, there's nothing about files ending in .j2 that makes them "HTML+Django" specific. In my case, Ansible roles in my repo make significant use of jinja2 that has nothing to do with HTML or Django.
Describe the bug
Github is marking my repository that doesn't contain a single line of HTML as containing 75% HTML. I ran linguist on the repo locally and according to the output, it is considering all files with the
.j2
extension as HTML files:This is obviously not the case as all of the
.j2
files in my repo are templates yaml, json and other configuration files.Expected behaviour
Jinja templates should be classified as "Jinja templates" or something more descriptive that isn't HTML. Alternatively, linguist could drill down further in the file name and classify
.html.j2
files as HTML,.yaml.j2
files as YAML,.json.j2
files as JSON etc.Related discussion
@lildude pointed out in https://github.com/github/linguist/issues/5047 that jinja2 templates "are part of the "HTML+Django" language which is part of the HTML group of languages". This is obviously a bug, there's nothing about files ending in
.j2
that makes them "HTML+Django" specific. In my case, Ansible roles in my repo make significant use of jinja2 that has nothing to do with HTML or Django.