How to leave a "Default" language in GitHub?

10

This is a project made in Ruby , however, as I used the Twitter BootStrap , it presents JavaScript as the predominant language, since it is the language that predominates in the repository. Can you force the default language to be RUBY ?

Links to the repository link

    
asked by anonymous 15.01.2014 / 13:27

2 answers

5

GitHub attempts to infer the language of the repository through the linguist libraries. Unfortunately as far as I know, there is no automated flow to change the language of a repository.

At the top of the Linguist repository it is written:

  

Language Savant. If your repository's language is being reported   incorrectly, send us a pull request!

So maybe it's worth a pull request for library staff explaining that this is a Ruby application made with Twitter BootStrap. It may be a matter of adding a few extra lines from the vendor.yml library to remove specific JavaScript-containing directories from this framework.

One important point is that vendor.yml already contains a regex to exclude the bootstrap:

# Bootstrap minified css and js
- (^|/)bootstrap([^.]*)(\.min)?\.(js|css)$

Before sending a pull request it is important to check if the regex is incomplete / with some problem or if you are using a directory structure that escapes from the default see comment from @utluiz. Perhaps an alternative is to move the scripts to the bootstrap folder, for example.

Another alternative would be to click the "Contact A Human" button from the repositories marked with the wrong language and see how the GitHub staff responds.

If none of this works, you can still migrate your repository to another service. I have in particular migrated all my repositories to the Bitbucket . This is an Atlassian service with Git and Mercurial repositories; including, in addition to Open Source repositories, for teams with up to five members, private repositories are also free. You can easily import your GitHub repositories and edit the project language in the administrative menu. The main cons for me are the absence of something similar to the Gists and the fact that it is a lesser-known service (although GitHub users can log in usually with your accounts), I am still fully satisfied with the change and today I only use GitHub for eventual contributions to third party Open Source projects.

    
15.01.2014 / 13:55
3

You can not do this manually.

According to the GitHub help page , they use a library called Linguist, which determines the predominant language in the files.

However, as the same page quoted indicates, you can exclude third-party files from this check by placing the dependencies in certain places that Linguist does not look at.

This is defined in Linguist's vendor.yml file containing several exclusion patterns for many of the most common cases:

  • jQuery and other javascript libraries
  • Folders as cache and dependencies
  • README and license files
  • And much more ...

Anyway, you just have to look at the file and place your dependencies in the appropriate places, if they are not.

    
15.01.2014 / 13:46