Skip to content

Feat: add typing overloads to help mypy correctly infer types in more use-cases - #110

Merged
volfpeter merged 1 commit into
mainfrom
feat/typing-infererence-improvement
Oct 22, 2026
Merged

volfpeter merged 1 commit into
mainfrom
feat/typing-infererence-improvement

Conversation

@volfpeter

@volfpeter volfpeter commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Bug Fixes
    • Improved type checking for synchronous and asynchronous page and HTMX rendering callbacks, helping surface mismatched handler types during development.
  • Developer Experience
    • Removed unnecessary type-checking suppressions from example and test route definitions.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: acbccae5-d37a-43a0-9147-2746f2bbeedc
📥 Commits

Reviewing files that changed from the base of the PR and between a27f8a9 and 19c2bb6.

📒 Files selected for processing: 3
  • examples/custom-rendering/custom_rendering_app.py
  • fasthx/core_decorators.py
  • tests/test_core_decorators.py

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

The non-streaming hx and page overloads now use separate types for synchronous and asynchronous renderers. Type-ignore comments were removed from related example and test route decorators.

Changes

Renderer overload typing

Layer / File(s) Summary
Separate renderer overloads
fasthx/core_decorators.py
The non-streaming hx and page overloads distinguish synchronous and asynchronous renderers.
Remove route type-ignore comments
examples/custom-rendering/custom_rendering_app.py, tests/test_core_decorators.py
Removed type-ignore comments from route decorators. The decorator arguments and route implementations remain unchanged.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: mohdsameerkalam

Merge Risk: ⚪ Minimal · up to 19c2b

The typing changes are mergeable with no identified functional or availability risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately describes the main change: adding typing overloads to improve mypy type inference. It is concise and specific.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@volfpeter
volfpeter merged commit c63b891 into main Oct 22, 2026
6 checks passed
@volfpeter
volfpeter deleted the feat/typing-infererence-improvement branch October 22, 2026 13:40
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.

1 participant