Count number of lines in a GitHub repository without cloning

[亡魂溺海] 提交于 2019-12-06 09:14:47

There is browser extension for Google Chrome named Gloc.

For GitHub specifically, you have a possibility to compute an approximation of that data (LOC: Lines of Code) through the GitHub Statistics API.

You can see an example in "Can you get the number of lines of code from a GitHub repository?", which does not involve cloning the repo.


More recently, you have the project jolav/codetabs (initally mentioned by Sclerosis), based on Curtis Gagliardi cgag/loc for counting lines of code.
It includes a service for counting lines for any public GitHub repository:
codetabs.com/count-loc/count-loc-online.html.

Example for my project: https://api.codetabs.com/v1/loc?github=vonc/seec


Problem (for both solutions): they do count the lines of all files inside a repo, so if you have vendored files like in a Go project, you will have a hard time distinguishing what you wrote from what you have vendored.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!