diff --git a/scripts/technical-debt-metrics.sh b/scripts/technical-debt-metrics.sh index e607f9569cd79..eb24ded1ce153 100755 --- a/scripts/technical-debt-metrics.sh +++ b/scripts/technical-debt-metrics.sh @@ -79,7 +79,6 @@ titlesPathsAndRegexes=( "skipAssignedInstances flags" "*" "set_option tactic.skipAssignedInstances" "adaptation notes" "*" "adaptation_note" "disabled simpNF lints" "*" "nolint simpNF" - "disabled deprecation lints" "*" "set_option linter.deprecated false" "erw" "*" "erw \[" "maxHeartBeats modifications" ":^MathlibTest" "^ *set_option .*maxHeartbeats" ) @@ -98,6 +97,17 @@ for i in ${!titlesPathsAndRegexes[@]}; do fi done +# count total number of `set_option linter.deprecated false` outside of `Mathlib/Deprecated` +deprecs="$(git grep -c -- "set_option linter.deprecated false" -- ":^Mathlib/Deprecated" | + awk -F: 'BEGIN{total=0} {total+=$2} END{print total}')" + +# count the `linter.deprecated` exceptions that are themselves followed by `deprecated ...(since` +# we subtract these from `deprecs` +doubleDeprecs="$(git grep -A1 -- "set_option linter.deprecated false" -- ":^Mathlib/Deprecated" | + grep -c "deprecated .*(since")" + +printf '%s|disabled deprecation lints\n' "$(( deprecs - doubleDeprecs ))" + printf '%s|%s\n' "$(grep -c 'docBlame' scripts/nolints.json)" "documentation nolint entries" # We count the number of large files, making sure to avoid counting the test file `MathlibTest/Lint.lean`. printf '%s|%s\n' "$(git grep '^set_option linter.style.longFile [0-9]*' Mathlib | wc -l)" "large files"