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-file
lets you pass in a file containing names of files you want excluded,--exclude-dir
lets you skip designated directories,--exclude-ext
skips files with the given file extension,--exclude-lang
ignores the given programming languages,--not-match-f
lets you specify a regex whose matches are skipped.