Add comprehensive type hint coverage analysis tooling with mypy integration - #1271
Conversation
Co-authored-by: bact <128572+bact@users.noreply.github.com>
Co-authored-by: bact <128572+bact@users.noreply.github.com>
Co-authored-by: bact <128572+bact@users.noreply.github.com>
Co-authored-by: bact <128572+bact@users.noreply.github.com>
|
@copilot Cool.
|
Co-authored-by: bact <128572+bact@users.noreply.github.com>
Done! Both items addressed in commit f59b774:
The analyzer now runs mypy on each submodule during analysis. Errors range from 6-9 per module (most have 6, summarize has 9, word_vector has 8, tag has 7). |
|
@copilot I have moved the analyzer output files from docs/ to build_tools/analysis/output. Also update the script to be able to run on local machine (avoid using |
Co-authored-by: bact <128572+bact@users.noreply.github.com>
... Done in commit c3f1345:
Scripts now work seamlessly on local machines without requiring |
|



What do these changes do
Adds AST-based analysis tooling to audit type hint coverage across the codebase. Provides actionable data on 720 functions/methods categorized by completeness, scope, internal references, test suite mapping, priority, and mypy error counts.
Deliverables:
build_tools/analysis/type_hint_analyzer.py- Main analyzer using Python AST with mypy integration and command-line argumentsbuild_tools/analysis/generate_csv.py- CSV report generator with command-line argumentsbuild_tools/analysis/output/- Output directory containing JSON and CSV data files (submodule stats with mypy errors, functions without/incomplete hints)TYPE_HINT_COMPLETE_REPORT.md- Executive summaryTYPE_HINT_ANALYSIS.md- Detailed technical breakdownTYPE_HINT_QUICKSTART.md- Quick reference.markdownlintrc- Markdown linting configurationKey Metrics:
Priority Classification:
Mypy Integration:
Local Execution Support:
type_hint_analyzer.py --output-dir DIR(default: ./output)generate_csv.py --input FILE --output-dir DIR/tmpdirectorySubmodules needing attention: transliterate (48%), classify (20%), el (20%), chat (25%), wangchanberta (44%), coref (40%)
What was wrong
No visibility into type hint coverage across the codebase. Unable to systematically identify gaps, prioritize type safety improvements, or track mypy errors per submodule. Previous analysis tools were not suitable for local development (hardcoded paths,
/tmpdependency).How this fixes it
Implements comprehensive analysis that:
astmodulebuild_tools/analysis/output/directoryAnalysis is repeatable via
python3 build_tools/analysis/type_hint_analyzer.pyfrom any location in the repository.Your checklist for this pull request
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.