gloc icon indicating copy to clipboard operation
gloc copied to clipboard

Add option to ignore lines from certain files

Open rluvaton opened this issue 4 years ago • 8 comments

Expected Behavior

I want to be able to ignore some files when calculating the repo lines (such as package-lock.json)

Actual Behavior

Count the lines from every file

rluvaton avatar Mar 29 '21 21:03 rluvaton

Github doesn't has such API

image

kas-elvirov avatar Mar 29 '21 23:03 kas-elvirov

Changing to the tokei api may help. They even have badges, and ignore code comments in a ton of languages.

Lazerbeak12345 avatar Apr 14 '21 18:04 Lazerbeak12345

Changing to the tokei api may help. They even have badges, and ignore code comments in a ton of languages.

Interesting idea. Thanks man

kas-elvirov avatar Apr 14 '21 22:04 kas-elvirov

Thanks for the assignment; I appreciate the gesture! I don't know that I'll be able to put much time into this, but I'll see what I can do.

Lazerbeak12345 avatar May 17 '21 19:05 Lazerbeak12345

@Lazerbeak12345 let's keep in touch regarding this task. I want to make it too. It would be great feature)

kas-elvirov avatar May 18 '21 10:05 kas-elvirov

I played around with their badges api and discovered that it usually works on smaller repos such as:

  • this one: . ([![](https://tokei.rs/b1/github/artem-solovev/gloc)](https://github.com/artem-solovev/gloc))
  • Their repo: . ([![](https://tokei.rs/b1/github/XAMPPRocky/tokei)](https://github.com/XAMPPRocky/tokei))

But it often either takes a long time to load, or just never resolves for larger repos, such as chromium:

. ([![](https://tokei.rs/b1/github/chromium/chromium)](https://github.com/chromium/chromium))

You may need to wait a bit for these images to load, if they load at all. (I've been getting 502 errors)

Lazerbeak12345 avatar Jun 08 '21 14:06 Lazerbeak12345

Ohh, that's great. I will keep in mind. I have to postpone this task because i'm working on my new project But i wanted release something similar you suggested anyway because it will be very useful Thanks again )

kas-elvirov avatar Jun 08 '21 16:06 kas-elvirov

Just thought i'd look at making this happen, and I've got bad news. Tokei provides an API, sure, but there's two ways of using it:

  • Crawl the actual code
  • Get badges. Only.

They have no api to get the actual number. This will work but it'll limit the ability to have status updates like "loading..." etc.

Lazerbeak12345 avatar Mar 25 '23 22:03 Lazerbeak12345