Split metric-bench's main into run_scores and measured, find the checkout from the history, drop an ambiguous shortened path, write places from the repository root, and give item 85 the history's reader

This commit is contained in:
2026-10-08 21:35:54 +02:00
parent 382472bd39
commit 8a2dbd70f1
7 changed files with 56 additions and 38 deletions
+6
View File
@@ -14,6 +14,12 @@ class Unit:
shared_state: int
def measured(path: str) -> bool:
"""A Python file outside the tests."""
folders, _, name = path.rpartition("/")
return name.endswith(".py") and not name.startswith("test_") and not name.endswith("_test.py") and "tests" not in folders.split("/")
def python_units(path: str, source: str) -> list[Unit]:
"""Each module-level function and each method in source, with its metrics; a source that does not parse has none."""
try: