Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prog8 language detected as Lua #5102

Open
akubiczek opened this issue Dec 3, 2020 · 4 comments
Open

Prog8 language detected as Lua #5102

akubiczek opened this issue Dec 3, 2020 · 4 comments
Labels
Add Language Good First Issue This is a great opportunity to start contributing to Linguist

Comments

@akubiczek
Copy link

Problem Description

The Prog8 source code is detected as Lua language.

URL of the affected repository:

https://github.com/akubiczek/p8checkers

Last modified on:

2020-12-02

Expected language:

Prog8

https://prog8.readthedocs.io/en/latest/
https://github.com/irmen/prog8

Detected language:

Lua

@lildude
Copy link
Member

lildude commented Dec 3, 2020

This is happening because Linguist doesn't know anything about the "Prog8" language and currently only associates the .p8 extension with Lau:

https://github.com/github/linguist/blob/633d196c170e002bcccb4143d6906787f360e08b/lib/linguist/languages.yml#L3031-L3051

Unfortunately, as Linguist doesn't know about the language, you can't implement a workaround, however if Prog8 meets the requirements detailed in CONTRIBUTING.md, we'd be happy to accept a PR.

@lildude lildude added Add Language Good First Issue This is a great opportunity to start contributing to Linguist labels Dec 3, 2020
@Nixinova
Copy link
Contributor

Nixinova commented Feb 6, 2021

Quite difficult to search for usage using GitHub search, but using keyword ubyte gives <100 files and 26 repos, so I don't think this meets the requirements.

@Alhadis
Copy link
Collaborator

Alhadis commented Feb 6, 2021

Yep, that's correct.

@akubiczek Until Prog8 satisfies the distribution criteria, you can "fix" the Lua misclassification by adding a .gitattributes file containing the following override:

*.p8 linguist-language=Text

Or if you want to repurpose another language's highlighting because it's syntactically similar (but obviously don't want it affecting classification), you can try:

*.p8 linguist-language=C linguist-detectable=false

(Note that I actually haven't tested this. YMMV…)

Because Text is recognised by Linguist as a prose-type language, it doesn't influence a repository's classification or language statistics. This hack tends to make a decent halfway-point between misrepresentation and support/recognition on GitHub.com.

@irmen
Copy link

irmen commented Mar 10, 2021

author of Prog8 here: thanks for raising this issue. I noticed it as well for my own repositories. Realistically I think it will be quite a long time before we have "hundreds of repositories" that will be using Prog8. While it would be fantastic if it "takes off" (relatively speaking) it's still a very niche and experimental language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Add Language Good First Issue This is a great opportunity to start contributing to Linguist
Projects
None yet
Development

No branches or pull requests

5 participants