How does Github calculate language percentage in a repo?
- by John Isaacks
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?