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

Fix repository's incorrect language-classification on GitHub.com #223

Merged
merged 1 commit into from
Feb 13, 2019
Merged

Fix repository's incorrect language-classification on GitHub.com #223

merged 1 commit into from
Feb 13, 2019

Conversation

Alhadis
Copy link
Contributor

@Alhadis Alhadis commented Feb 13, 2019

Currently, GitHub classifies haskell-ci as a Roff repository:

Figure 1

This stems from the abundance of collections/cabal.project.* files with numeric suffixes, which GitHub mistakes as man pages. This PR is a small patch to correct that using an override.

NOTE: I'm assuming the files contained in collections/ are Haskell source. If they're not, please let me know and I'll mark them as ordinary Text, instead of being any particular language.

@phadej
Copy link
Collaborator

phadej commented Feb 13, 2019 via email

@Alhadis
Copy link
Contributor Author

Alhadis commented Feb 13, 2019

I guess linguist doesn't know about Cabal files?

Erm, it actually doesn't. That actually needs to be fixed upstream; I'll look into submitting a PR to have Cabal added as a language.

Since I'm (clearly) Haskell illiterate, would you be able to tell me what filenames and file extensions should be associated with Cabal?

Regarding this PR: I'll mark the files as Cabal in advance, but also linguist-vendored, which will instruct Linguist not to take them into account when calculating the language stats.

@Alhadis
Copy link
Contributor Author

Alhadis commented Feb 13, 2019

@phadej Alright, PR for Cabal support has been submitted upstream. 👍 Once it's merged and released in a new release of Linguist, the linguist-vendored attribute added by this PR can be dropped.

@phadej
Copy link
Collaborator

phadej commented Feb 13, 2019

@Alhadis extensions are a bit tricky

  • foo.cabal are package definition files
  • and additionally we have cabal.project, cabal.haskell-ci are files which share the same syntax
    • because the only <pkg>.cabal file in the directory is the definition of the package
    • .... so extension can be suffix or prefix

@phadej
Copy link
Collaborator

phadej commented Feb 13, 2019

Yet, handling only *.cabal files is fine for Cabal, I guess.

@phadej
Copy link
Collaborator

phadej commented Feb 13, 2019

I guess this is fine for now, we can discuss Cabal + linguist in your PR.

@phadej phadej merged commit b5917a6 into haskell-CI:master Feb 13, 2019
@Alhadis Alhadis deleted the language-fix branch February 13, 2019 16:28
@Alhadis
Copy link
Contributor Author

Alhadis commented Feb 13, 2019

Thanks! 👍

As mentioned at github/linguist#4419, we don't have a way of matching prefixes, only suffixes or entire filenames. 😢 Having said that, I'd recommend adding this to .gitattributes too:

cabal.haskell-ci linguist-language=Cabal

This will activate correct syntax highlighting for the file once the PR is live on GitHub.

@phadej
Copy link
Collaborator

phadej commented Feb 13, 2019

Fwiw, cabal.haskell-ci is (hopefully) become common-ish filename too, as people use this tool. (only 16 occurences atm)

@Alhadis
Copy link
Contributor Author

Alhadis commented Feb 13, 2019

I ran a search for that, but it only yielded 16 results. We require languages/filetypes to have considerable distribution in-the-wild before supporting them officially (at least 100 unique repos/users).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants