Skip to content

Instantly share code, notes, and snippets.

@austil
Created November 26, 2019 14:37
Show Gist options
  • Save austil/1fa5773700eaec0cb067c114e7320587 to your computer and use it in GitHub Desktop.
Save austil/1fa5773700eaec0cb067c114e7320587 to your computer and use it in GitHub Desktop.

First get stats for each folder in a file.

for D in `find ./public/app/plugins/datasource -maxdepth 1 -type d`
do
echo $D && cloc $D
done > stats_plugin

Then clean the output with some regex :

# Clean parsing stats
(?<=plugins/.*$)[\s\S\n]*?lines/s\)
# Keep code sum only
Language[\s\S\n]*?-{79}[\s\S\n]*?-{79}\nSUM:( )+\d+( )+\d+( )+\d+( )+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment