From cd838888c7d3625bb47e0d1a9de68cf5fb0fb21c Mon Sep 17 00:00:00 2001 From: damiano Date: Thu, 15 Aug 2024 19:17:43 +0000 Subject: [PATCH] CI: add deprecated files to tech debts counters (#15853) Adds information about the `Deprecated` folder to the technical debt report. [Asked on Zulip](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Technical.20Debt.20Counters/near/462615354) --- scripts/technical-debt-metrics.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/technical-debt-metrics.sh b/scripts/technical-debt-metrics.sh index 4e5f937b7aad9..cd49fd69bfaa1 100755 --- a/scripts/technical-debt-metrics.sh +++ b/scripts/technical-debt-metrics.sh @@ -59,6 +59,11 @@ printf '%s|%s\n' "$(git grep "^open .*Classical" | grep -v " in$" -c)" "bare ope # We print the number of files, not the number of matches --- hence, the nested grep. printf '%s|%s\n' "$(git grep -c 'autoImplicit true' | grep -c -v 'test')" "non-test files with autoImplicit true" +deprecatedFiles="$(git ls-files '**/Deprecated/*.lean' | xargs wc -l | sed 's=^ *==')" + +printf '%s|%s\n' "$(printf '%s' "${deprecatedFiles}" | wc -l)" "\`Deprecated\` files" +printf '%s|%s\n' "$(printf '%s\n' "${deprecatedFiles}" | grep total | sed 's= total==')" 'total LoC in `Deprecated` files' + initFiles="$(git ls-files '**/Init/*.lean' | xargs wc -l | sed 's=^ *==')" printf '%s|%s\n' "$(printf '%s' "${initFiles}" | wc -l)" "\`Init\` files"