How does Github calculate language percentage in a repo?

Posted by John Isaacks on Programmers See other posts from Programmers or by John Isaacks
Published on 2012-07-08T15:47:32Z Indexed on 2012/07/09 3:22 UTC
Read the original article Hit count: 275

Filed under:

I have a repo with Ruby and PHP code in it.

Github says my repo is 74.8% PHP and 25.2% Ruby

I do not understand how this can be. When I compare the 2 languages in my project:

# Count how many files:

# Ruby
ls | grep ".*\.rb" | wc -l
# returns 10

#PHP
ls | grep ".*\.php" | wc -l
# returns 1


# Count how many lines, words, chars:

# Ruby
cat *.rb | wc
# returns 229, 812, 5303

# PHP
cat *.php | wc
# returns 102, 473, 2760

Ruby always seems to have more.

Am I missing something?

© Programmers or respective owner

Related posts about github