Skip to content

Commit

Permalink
Update script to add total stats
Browse files Browse the repository at this point in the history
  • Loading branch information
JCWasmx86 committed Dec 28, 2022
1 parent 7cf756e commit 23da1d7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions stats.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
total_comments=0
total_lost_comments=0

check_it() {
cd ../$1 || exit
git stash >/dev/null 2>&1
Expand All @@ -15,7 +18,9 @@ check_it() {
git stash >/dev/null 2>&1
cd ../meson || exit
percentage=$(echo "print(str(round(($n_lost_comments/$n_comments) * 100, 3)) + '%')" | python /dev/stdin)
echo "$1 has $n_comments, lost $n_lost_comments during formatting ($percentage)"
echo "$1 has $n_comments comments, lost $n_lost_comments during formatting ($percentage)"
((total_comments+=n_comments))
((total_lost_comments+=n_lost_comments))
rounds=0
while :; do
python meson.py fmt_unstable ../$1 -R >/dev/null 2>&1 || exit
Expand Down Expand Up @@ -43,4 +48,5 @@ check_it gnome-builder
check_it gstreamer
check_it gtk
check_it glib

percentage=$(echo "print(str(round(($total_lost_comments/$total_comments) * 100, 3)) + '%')" | python /dev/stdin)
echo "Found $total_comments comments, but lost $total_lost_comments during formatting ($percentage)"

0 comments on commit 23da1d7

Please sign in to comment.