hhatto / gocloc

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

[BUG] fix: semantic error in skip duplicated #68

Open Lincyaw opened 1 year ago

Lincyaw commented 1 year ago

The default operations in gocloc will consider the same files as only one file, which will leads to confusion.

And I find the flag is wrong.

hhatto commented 1 year ago

Thank you for your pull-request.

First off, by default, gocloc prevents the same content files (checked by md5 checksum) from being counted multiple times. The original purpose of providing the --skip-duplicated option is to skip this duplication check and count even the duplicated ones.

Considering the above, I think the option name --skip-duplicated does not reflect the intended behavior.

Instead of merging this change, I think it would be better to change the option name. For instance, how about changing it to --include-duplicates?

deasa commented 5 months ago

Hi there! I just came across this as well and was confused because I expected skip-duplicated to not include duplicated files in the output. Which direction is this going to go? Renaming the flag, or changing the code behavior?