Skip to content

Conversation

@yan
Copy link
Owner

@yan yan commented Oct 17, 2025

Summary

  • Fixed all mypy --strict errors without using cast()
  • Uses runtime validation for better type safety

Changes

utils.py

  • Use explicit float variable to avoid int/float type conflict

github_client.py

  • Add type parameters to dict (dict[str, Any])
  • Use isinstance() for runtime type checking in pagination
  • Add explicit type annotation for JSON response

collector.py

  • Add _parse_datetime_required() for non-optional datetime fields
  • Returns datetime directly, raises ValueError if None
  • Better error messages with field names

main.py

  • Fix dict[str, any] to dict[str, Any]
  • Add Any import from typing

All fixes use runtime validation instead of cast() for type safety.

Testing

  • ✅ mypy --strict passes with no errors
  • ✅ All existing tests still pass

🤖 Generated with Claude Code

Fixed all mypy --strict errors without using cast():

- utils.py: Use explicit float variable to avoid int/float conflict
- github_client.py:
  - Add type parameters to dict (dict[str, Any])
  - Use isinstance() for runtime type checking in pagination
  - Add explicit type annotation for JSON response
- collector.py:
  - Add _parse_datetime_required() for non-optional datetime fields
  - Returns datetime directly, raises ValueError if None
  - Better error messages with field names
- main.py:
  - Fix dict[str, any] to dict[str, Any]
  - Add Any import from typing

All fixes use runtime validation instead of cast() for type safety.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@yan yan merged commit e2b1725 into main Oct 17, 2025
2 checks passed
@yan yan deleted the fix-mypy-errors branch October 17, 2025 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants