fix: Add mypy easy fixes to repository.#192
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #192 +/- ##
==========================================
- Coverage 98.01% 97.60% -0.42%
==========================================
Files 21 21
Lines 3131 3212 +81
==========================================
+ Hits 3069 3135 +66
- Misses 62 77 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
This PR adds initial mypy type checking support and fixes the easy/straightforward type errors across the codebase. It reduces the total mypy error count from 511 errors across 14 files down to 232 errors across 3 files.
Error reduction: 279 errors fixed (54.6% reduction)
Supports #190
Mypy report comparison
Per-file error count
mainactual/rules.pyactual/queries.pyactual/__init__.pyactual/database.pyactual/cli/main.pyactual/budgets.pyactual/schedules.pyactual/api/models.pyactual/protobuf_models.pyactual/utils/changeset.pyactual/api/__init__.pyactual/cli/config.pyactual/api/bank_sync.pyactual/exceptions.pyError categories
main[operator][arg-type][union-attr][str][assignment][bool][call-overload][attr-defined][return-value][index][import-untyped][call-arg][var-annotated][misc][return]Remaining errors (232)
The remaining 232 errors are concentrated in 3 files:
actual/rules.py(214) — Mostly[operator]and[str]errors from enum/literal type comparisons in the rules engine. These require deeper refactoring of the rules type system.actual/queries.py(15) — Primarily[call-overload]errors from SQLModel'sSession.exec()overload resolution, which is a known upstream issue.actual/__init__.py(3) — Minor type narrowing issues.Changes made
mypyconfiguration topyproject.tomlwithtypes-python-dateutilstub dependencyOptionaltypes, type narrowing (assert,ifguards), and return type annotationsNone-safety issues (union-attr), argument type mismatches (arg-type), and assignment incompatibilities🤖 This report has been generated with Claude Code