From 635ccf48f86350852f7ab0c9e9b3c4b990fc2b55 Mon Sep 17 00:00:00 2001 From: pranavisrikanth Date: Fri, 8 May 2026 16:19:21 +1000 Subject: [PATCH 1/2] Add markdown report documentation scoring tool --- tools/score_report_doc_quality.py | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tools/score_report_doc_quality.py diff --git a/tools/score_report_doc_quality.py b/tools/score_report_doc_quality.py new file mode 100644 index 000000000..5cbb9fe6c --- /dev/null +++ b/tools/score_report_doc_quality.py @@ -0,0 +1,44 @@ +from pathlib import Path +import sys + +SCORING_SECTIONS = { + "## Purpose": 25, + "## Starter Mapping": 25, + "## Future Opportunities": 25, + "## Conclusion": 25, +} + + +def calculate_score(file_path: Path) -> int: + if not file_path.exists(): + print(f"Fail. File not found: {file_path}") + return 0 + + content = file_path.read_text(encoding="utf-8") + lines = {line.strip() for line in content.splitlines()} + + score = 0 + + for section, points in SCORING_SECTIONS.items(): + if section in lines: + score += points + print(f"Pass. Found {section} (+{points})") + else: + print(f"Miss. Missing {section} (+0)") + + print(f"\nDocumentation Score: {score}/100") + return score + + +def main() -> int: + if len(sys.argv) != 2: + print("Usage: python tools/score_report_doc_quality.py ") + return 1 + + score = calculate_score(Path(sys.argv[1])) + + return 0 if score == 100 else 1 + + +if __name__ == "__main__": + raise SystemExit(main()) \ No newline at end of file From a7c4afd71d3ffb05ccc0231d34b0e20ea6555fc8 Mon Sep 17 00:00:00 2001 From: pranavisrikanth Date: Fri, 8 May 2026 16:29:33 +1000 Subject: [PATCH 2/2] Improve markdown heading parsing for report scoring --- tools/score_report_doc_quality.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/score_report_doc_quality.py b/tools/score_report_doc_quality.py index 5cbb9fe6c..4bdedad8f 100644 --- a/tools/score_report_doc_quality.py +++ b/tools/score_report_doc_quality.py @@ -15,8 +15,10 @@ def calculate_score(file_path: Path) -> int: return 0 content = file_path.read_text(encoding="utf-8") - lines = {line.strip() for line in content.splitlines()} - + lines = [ + line.strip().rstrip("#").strip() + for line in content.splitlines() + ] score = 0 for section, points in SCORING_SECTIONS.items():