I have a user case where I need to calculate Lines of Code per BUC-ID. I have achieved the same using
git log --shortstat --grep=BUC3565-EPIC16 |grep -E "fil(e|es) changed" | awk -v BUC=$i '{ inserted+=$4; deleted+=$6; delta+=$4-$6i } END {printf "%s, %s, %s, %s \n",BUC, inserted, deleted, delta }'
Now I have BUC-ID with multiple files. Is there any way I can just skip few files/folders and still able to calculate Lines off Code for that BUC-ID?
Basically, I need to exclude some files/folders while calculating Lines of Code. I am not able to do so because each commit has multiple files. Some should be included and some excluded...Any idea how to achieve that?
Does CLOC provide any feature to exclude files?
cloc has several mechanisms to exclude files; search on "exclude" at https://github.com/AlDanial/cloc for details.
Briefly,
--exclude-list-filelets you pass in a file containing names of files you want excluded,--exclude-dirlets you skip designated directories,--exclude-extskips files with the given file extension,--exclude-langignores the given programming languages,--not-match-flets you specify a regex whose matches are skipped.