langstats icon indicating copy to clipboard operation
langstats copied to clipboard

Exclude directories?

Open k4y4k opened this issue 3 years ago • 2 comments

Hey there :wave:

First off: this is pretty epic ngl. Works flawlessly, 9.99/10.

However, when I ran this inside my [Vue 3 and TypeScript] project folder, I was instead presented with: output

Removing node_modules (i.e. where the project's dependencies are installed) gives me something closer to what I'd expected (because why would I be writing AppleScript??! What the heck is an OCaml??!!!): output

Thus, I'm here to ask: is there an argument or some kind of config I can pass in to exclude certain directories? I didn't see anything in the README.

Edit: to be clear, I'm aware I can just slap a "NAH, BYE, IGNORE" on stuff like EJS and whatnot that I know I'm not writing, but I'm specifically looking to run this from the root of my project (and thus can't siphon off things like CSS, which are present in node_modules as well as the project's src/.

Cheers! kayak

k4y4k avatar Apr 05 '21 08:04 k4y4k

Hi, from the docs you can exclude language extensions but unfortunately not directories.

-e or --exclude: which file extensions to exclude when searching for files and creating the image. These files will be ignored and will not affect the total percentage or show up. You can specify multiple. Example: statistics -e .ipynb .css .HTML

I can see how this would be a useful feature, however. A few lines of code should be able to resolve the problem by filtering out directories in this function; free to open a pull request to address the issue. If not, I can set it up but am somewhat busy at the moment so may take several days.

Destaq avatar Apr 05 '21 11:04 Destaq

No wakkas. If I manage to get something together I'll open a PR :v:

k4y4k avatar Apr 06 '21 01:04 k4y4k

It's been a year but I finally got around to it!

Destaq avatar Sep 28 '22 19:09 Destaq

oh my god it has been a year 😆 thank you!!

k4y4k avatar Sep 29 '22 04:09 k4y4k