Add comprehensive type annotations across the codebase#114
Open
lucasfeliciano wants to merge 5 commits intoPauperformance:masterfrom
Open
Add comprehensive type annotations across the codebase#114lucasfeliciano wants to merge 5 commits intoPauperformance:masterfrom
lucasfeliciano wants to merge 5 commits intoPauperformance:masterfrom
Conversation
Annotate all function signatures, __init__ params, and return types. Modernize typing: replace Optional[X] with X | None, List with list, etc. Remove redundant self.x: type = x where param type suffices.
Annotate all function signatures across service/mtg, service/academy, service/arena, service/nexus, and service/pauperformance. Modernize typing: replace Optional/List/Dict/Tuple/DefaultDict with modern equivalents (X | None, list, dict, tuple, defaultdict).
Annotate all function signatures in cli/builder, cli/group, cli/main, and task modules. Use modern typing syntax throughout.
Annotate all test functions, fixtures, and helpers with parameter and return types. Use modern typing syntax throughout.
- Fix type annotations to satisfy mypy strict mode (148 → 0 errors) - Widen credential param types to str | None to match defaults - Add type: ignore comments for unfixable issues (untyped libs, etc.) - Fix unused type: ignore comments flagged by warn_unused_ignores - Add ignore_missing_imports and warn_unused_ignores to mypy config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.pyfiles across the entire codebase (foundation, services, CLI, tasks, and tests)ignore_missing_imports = Trueintox.ini— passes clean with 0 errors across 123 source filesBeautifulSoup.findAll→find_all, variable type shadowing inutil/path.py)Details
Annotations were added in a bottom-up layered approach:
ignore_missing_importsfor untyped third-party libraries (36 files)Key patterns used:
list[str],dict[str, int],X | NoneTypeVarfor class decorator typing (auto_repr,auto_str)# type: ignore[error-code]for genuinely unfixable issues (untyped libraries, method assignment in decorators)Test plan
Success: no issues found in 123 source files