boyter / scc

Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go
MIT License
6.28k stars 250 forks source link

Let badge exclude/include some folders #422

Open fzyzcjy opened 6 months ago

fzyzcjy commented 6 months ago

Hi thanks for the project! I want to use it in https://github.com/fzyzcjy/flutter_rust_bridge, but the badge: https://sloc.xyz/github/fzyzcjy/flutter_rust_bridge/?category=lines does not reflect the real case - because I commit the generated code into the git repository as well (because this repo itself is a code generator).

Therefore, it would be great if there can be an option to exclude/include some folders when querying.

boyter commented 6 months ago

Probably the easiest way would be to commit a .ignore file which ignores the generated code. At least that's the easiest way that would work right now, and should help with a lot of other tools that support it.

Let me know if that works for you and solves your use case.

fzyzcjy commented 6 months ago

@boyter Thank you! It would be great if there could be a file named .scc_ignore or allow customize which ignore file path to use. Because I only want to exclude from line counting, but not from other tools.

boyter commented 6 months ago

Yep adding a .scc_ignore sounds like the best approach here then.

Although maybe .sccignore would be a better name... ill think on that.

fzyzcjy commented 6 months ago

Totally agree! Since .gitignore has no _ as well