sloc
sloc copied to clipboard
Would be rad if you could pass a github repo url instead of a directory
As lovely as the Github language percentage statistics are, they don't actually tell you how many lines of code are written in each language.
This is an awesome idea! Do you know any libs that could help us to implement this feature?
Don't I'm afraid. To be honest, I actually found your tool because I was looking for something that would do this. Still haven't found one yet though.
@flosse I am not quite sure what would be stopping you. AFAIK implementing this would just mean
- cloning the repo to some temporary directory
- using the existing code to traverse the repo
- aggregate the results per language (taking the json-output or similar)
Am I missing something? Everyone has git installed, so you would not have to install nodegit
(which I found a bit buggy ...) . I created a little utility tool that has some relevant code you could just copy to achieve the first step.
@flosse I am not quite sure what would be stopping you.
the missing time ;-)
Everyone has git installed, so you would not have to install nodegit (which I found a bit buggy ...)
yes, I agree. I'd prefer to use native git and if git is not installed, sloc should just exit with an error
I created a little utility tool that has some relevant code you could just copy to achieve the first step.
that sounds good :)
...so I'm looking forward for the first PR :)
or make a feature request to github
Delivering a master thesis in a week, so I'll have a vacation before doing anything else, but a PR might arrive in August :-) Just wanted to be clear about the show stoppers before doing anything.
If you really are specific to github, there's the repository API. For instance https://api.github.com/repos/flosse/sloc/languages outputs:
{
"CoffeeScript": 35050,
"JavaScript": 7074
}
Otherwise, general git support would be appreciated (not just github).