hhatto / gocloc

A little fast cloc(Count Lines Of Code)
MIT License
789 stars 79 forks source link

Skip files explicitly using .gitignore #8

Open joseluisq opened 6 years ago

joseluisq commented 6 years ago

It would be great if gocloc could skip files explicitly excluded by a versioning tool like git via .gitignore file.

fenollp commented 6 years ago

Maybe use https://github.com/monochromegane/go-gitignore

erinok commented 6 years ago

This would be awesome. I'd also lobby for having the ability to not obey .gitignore, and the ability to obey a special .clocignore file. (Basically, what fd does: https://github.com/sharkdp/fd)

thijssmudde commented 6 years ago

I'd need this badly to find out exactly how productive I am as a software developer. Its a kind of gamification for me, so I can set targets of writing 100 LOC each day

noahgreenbaum commented 5 years ago

We came across gocloc and had the same need - it turns out git ls-files -z | xargs -0 gocloc works very well, and handles filenames with spaces just fine.

Credit to: Stack Overflow and cloc Issue #49.