The same files excluded by `--exclude-list-file` not counted later
Brought to you by:
alnd
Hello,
Here it seems to be some bug. I expect the file to be counted in the first case or is it a feature?
Case 1
& .\cloc-1.62.exe ` --windows ` --list-file=v3_cloc_include.txt ` --exclude-list-file=v3_cloc_exclude.txt
(Run from Powershell)
Result:
In ignored:
{PATH1}/Scripts/operator-screen.js: listed in exclusion file v3_cloc_exclude.txt
This present only in found and not counted!:
{PATH2}/Scripts/operatorScreenPrototype.js
Case 2
& .\cloc-1.62.exe ` --windows ` --skip-uniqueness ` --list-file=v3_cloc_include.txt ` --exclude-list-file=v3_cloc_exclude.txt `
Result:
In ignored:
{PATH1}/Scripts/operator-screen.js: listed in exclusion file v3_cloc_exclude.txt
Now it is counted:
{PATH2}/Scripts/operatorScreenPrototype.js
Anonymous
Could you attach a zip file containing sample inputs for me to work with? If I can reproduce your problem I'll be able to fix it.
Here I've tried to reproduce this with directory and files structure similar to my project. But the bug is not reproduced. I'm attaching the archive with a try. Probably I'll check it again later. In my project strangely enough it does not include some files without
--skip-uniqueness
. I can't attach it as of NDA. Thank you!Here's what's probably happening: you have copies of a file in two locations, one of which is in the list of excluded files or directories. The logic becomes tricky in this case--should the file be counted or not? cloc will only count one instance. I believe the current implementation of cloc will exclude both copies of the file if one instance is in the excluded list.
no feedback, change to closed