feat(tools): label technical debt entries by what would close them, missing tests and removed links #15470
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15470"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-11-03T13:55:06Z.
What
tools/debt_report.pylabels every technical debt entry indocs/dev/TechnicalDebt.mdanddocs/dev/debt/*.md, so the entries someone can close can be found without rereading 345 files. The proposal, counts and accuracy measurements are in #15469.console,firmware,gpu,titleorcode. Read from theCloses when:text if there is one, otherwise from the entry:firmware;console;gpu;code.no-test: none of the functions the entry names (its link text, and lowercase identifiers in backticks) appears in a test source. Calls through_nid_postfixand_nid_no_patchcount. A name of only lowercase letters (start,size,writes) counts only when a library exports it (APS5_VABI name(orname_nid_postfix), so plain words don't mark an entry as tested.windows,macosandlinuxfor each platform the entry names, unless it names all three.stale?: a linkedcore/file no longer exists. Onmainthis finds one entry, inlibScePlayerInvitationDialog.md, which links theExport.cppthat19044c17b5removed.It prints one line per entry and the counts per label, or JSON with
--json. Debt file names and--label(repeatable) filter the output, and it always exits 0. For example,python3 tools/debt_report.py --label code --label no-testlists the 265 entries that need only code and have no test.An entry may end with a
Labels:trailer, as withCloses when:. A label given there replaces the inferred labels of its family, andtestedremoves an inferredno-test.check_conventions.pygets adebt-labelswarning for an unknown label in a trailer on an entry line, its indented lines included. The trailer ends the entry and stays on its line.TechnicalDebt.mdgets one sentence on the trailer, next to theCloses when:one. The rootCMakeLists.txtregisters the two new test scripts (conventions_debt_labels,debt_report). No debt entry changes.Conflicts:
check_conventions.py(the end ofRULES, the constants afterDEBT_ENTRY_LIMIT, andCheck.debt_entries). The additions are independent; whichever merges second rebases.TechnicalDebt.mdandcheck_conventions.py. The blank lines it adds between entries don't affect the parser, which reads entries throughdebt_entries.Tested
Windows 11, Python 3.13.
python3 -m unittest tools/tests/test_debt_report.py tools/tests/test_check_conventions_debt_labels.py tools/tests/test_check_conventions_debt_length.py: 17 tests pass. They cover sections and entries, names, every closer rule, platforms, test words with the_nid_suffixes, missing links, the trailer override, the command line, and the warning, which applies only to entry lines and their indented lines.python3 -m unittest discover -s tools/tests -p "test_check_conventions*.py": 202 tests pass.python3 tools/check_conventions.py --base origin/main: all checks pass.A full run on
mainb11c7bf84ftakes about 6 s:5615 entries: 2499 no-test, 2444 firmware, 1952 code, 1201 console, 311 windows, 130 linux, 51 macos, 16 gpu, 2 title, 1 stale?.Accuracy against hand labels, on 100 random entries used to tune the rules, then 60 that were not:
no-test, labelled entries that have no testIn the second sample
no-testcounts only the first 30 entries: the verdicts for the other 30 were recorded out of order.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)