Skip to content

chore: port tech debt metrics to Python#60

Open
Vierkantor wants to merge 2 commits into
masterfrom
port-tech-debt-script
Open

chore: port tech debt metrics to Python#60
Vierkantor wants to merge 2 commits into
masterfrom
port-tech-debt-script

Conversation

@Vierkantor

Copy link
Copy Markdown
Contributor

This PR ports the technical debt reporting script to Python, keeping its behaviour as close as possible to the original. I had a hard time working on the shell script, especially because it was written in a non-portable version of Bash. (In other words, MacOS users could not run it on their machines!) The ported script should run portably on computers with Python 3.6 or higher. The shell script is now a thin wrapper around the Python script, for backwards compatibility, and could be removed eventually.

I tested this script in PR report mode and weekly Zulip message mode, checking that GitHub and Zulip render the results identically (modulo some newlines and fixed bugs). This is what took most of my development time.

A few bugs were fixed in the process, see the FIXED: comments. There are still a few bugs left in the script that would need some more substantial refactors to fix, see the TODO: comments. Those will be work for future PRs.

This PR ports the technical debt reporting script to Python, keeping its behaviour as close as possible to the original. I had a hard time working on the shell script, especially because it was written in a non-portable version of Bash. (In other words, MacOS users could not run it on their machines!) The ported script should run portably on computers with Python 3.6 or higher. The shell script is now a thin wrapper around the Python script, for backwards compatibility, and could be removed eventually.

I tested this script in PR report mode and weekly Zulip message mode, checking that GitHub and Zulip render the results identically (modulo some newlines and fixed bugs). This is what took most of my development time.

A few bugs were fixed in the process, see the `FIXED:` comments. There are still a few bugs left in the script that would need some more substantial refactors to fix, see the `TODO:` comments. Those will be work for future PRs.

printf '%s|disabled deprecation lints|weak\n' "$(( deprecs - doubleDeprecs ))" # TODO: upgrade to strong after false positives are fixed, https://github.com/leanprover/lean4/pull/13595

printf '%s|%s|strong\n' "$({ git grep -c 'set_option warning.simp.varHead false' -- Mathlib Archive Counterexamples || true; } | awk -F: 'BEGIN{s=0}{s+=$2} END{print s}')" "disabled varHead simp warnings"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this check disappeared? Is it intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, it was not in the original sorted list of tech debt items so that must be the reason I missed it. I'll put it back in the list at a place where it seems to belong.

@adomani

adomani commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Other than the dropped check, everything else looks good! Note that I used substantial input from AI to help in the review, and, after extensive back and forth, the dropped stat above is the only flagged issue!

@Vierkantor

Copy link
Copy Markdown
Contributor Author

Thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants