sloc icon indicating copy to clipboard operation
sloc copied to clipboard

Would be rad if you could pass a github repo url instead of a directory

Open metasoarous opened this issue 9 years ago • 7 comments

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.

metasoarous avatar Jan 17 '15 03:01 metasoarous

This is an awesome idea! Do you know any libs that could help us to implement this feature?

flosse avatar Jan 17 '15 13:01 flosse

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.

metasoarous avatar Jan 17 '15 23:01 metasoarous

@flosse I am not quite sure what would be stopping you. AFAIK implementing this would just mean

  1. cloning the repo to some temporary directory
  2. using the existing code to traverse the repo
  3. 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.

fatso83 avatar Jul 15 '15 13:07 fatso83

@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 :)

flosse avatar Jul 15 '15 13:07 flosse

or make a feature request to github

stevenvachon avatar Jul 15 '15 13:07 stevenvachon

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.

fatso83 avatar Jul 15 '15 14:07 fatso83

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).

millette avatar Sep 30 '15 18:09 millette