Guidelines for GitHub Fortran repos

Just a little tip for the GitHub users. I just faced a strange situation where my repos where flagged as mainly Javascript or Pascal repos.

Because some of my repos contain:

  • the documentation site (lots of .js and .html files)
  • or include files (I use .inc which is recognized as Pascal)

the ‘Languages’ statistics on GitHub are often wrong.
If you end up in the same situation you can add a .gitattributes file to the root of your Github repository with the following:

*.inc linguist-language=Fortran
docs/** linguist-documentation

The first line maps .inc to Fortran code, and the second excludes the folder docs from linguist search.

6 Likes