How do I leave a "Default" language on Github?

Asked

Viewed 2,292 times

10

3 answers

6

Github tries to infer the language of the repository through libraries Linguist. 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 is written:

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

Then it might be worth sending a pull request to the library staff explaining that this is a Ruby application made with Twitter Bootstrap. Maybe it’s a matter of adding a few more lines to the vendor.yml from this library to remove Javascript-containing directories specific to this framework.

An important point is that vendor.yml already contains a regex to delete 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 standard see @utluiz comment. Maybe an alternative is to move scripts to the folder bootstrap for example.

Another alternative would be to click the "Contact A Human" button from the help screen on repositories marked with the wrong language and see how Github’s people respond.

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

  • 1

    If someone sends a specific pull request about a project, I believe they will ask you to tailor their structure to the standards set by them.

  • Anyway, +1 for citing Bitbucket. I use and recommend it. On Github we cannot have private projects.

  • 1

    utluiz, I don’t know the maintainers, but I will update the answer with this fact :).

3

You can’t 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 cited page indicates, you can delete third party files from this scan by placing the dependencies in certain locations that Linguist does not look at.

This is set in the aruqivo vendor.yml linguist, containing several exclusion patterns for many of the most common cases:

  • jQuery e outros biblitecas javascript
  • Folders as cache and dependencies
  • Archives README and leave
  • And much more...

Anyway, you just need to look at the file and put its dependencies in the right places if they are not.

  • 3

    The vendor.yml is actually part of Linguist and not part of your repository. Changes to it should be made as pull requests to the library and affect all github repositories. Or I got it wrong?

  • @That’s right, that’s right. I’ll adjust the answer.

0

Solution vide : https://github.com/github/linguist

Consider your project’s ". gitattribute" file to insert the syntax somewhere in the file:

For all files in the folder or directory SeuProjeto/NomeDoDiretorio/* linguist-vendored

or Your project/Nomedodiretorio/*. js Linguist-vendored

ex: projectosite/Script/* " or /*. js" Linguist-vendored

For one or more files specific to the folder or directory Your project/Nomedodiretorio/nomerquivo.js Linguist-vendored

This will seal the Github stack contact from considering in the project count.

Obs: in a particular Folder or directory if you want to put a file type or some file of your choice in the count just enter at the end of the command "file.type Linguist-vendored=false" for example: Scripts/* Linguist-vendored counter.Vb Linguist-vendored=false

to one or more files you want.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.