Skip to content

Add missing type annotations and fix typing inconsistencies#3152

Open
ChihweiLHBird wants to merge 2 commits into
mainfrom
zhiwei/types-1
Open

Add missing type annotations and fix typing inconsistencies#3152
ChihweiLHBird wants to merge 2 commits into
mainfrom
zhiwei/types-1

Conversation

@ChihweiLHBird

Copy link
Copy Markdown
Member
  • Add parameter type annotations to parse_forwarded, parse_xforwarded, _compare, AcceptList.match, and parse_credentials in sanic/headers.py
  • Use TYPE_CHECKING guard for Header and Config imports to avoid circular imports
  • Fix variable reuse in parse_forwarded where header was reassigned from list to str (renamed to header_values)
  • Change parse_credentials prefixes param from list | tuple | set | None to Collection[str] | None, and remove now-redundant isinstance runtime check that conflicted with the type annotation
  • Add element type to _run_shell_command(command: list[str]) in scripts/release.py
  • Fix import formatting in test files

Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
@ChihweiLHBird ChihweiLHBird requested review from a team as code owners April 8, 2026 05:56
@ChihweiLHBird ChihweiLHBird marked this pull request as draft April 8, 2026 05:56
@codecov

codecov Bot commented Apr 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.730%. Comparing base (785d77f) to head (e1109ff).

Additional details and impacted files
@@              Coverage Diff              @@
##              main     #3152       +/-   ##
=============================================
- Coverage   87.793%   87.730%   -0.063%     
=============================================
  Files          105       105               
  Lines         8143      8142        -1     
  Branches      1290      1290               
=============================================
- Hits          7149      7143        -6     
- Misses         687       692        +5     
  Partials       307       307               

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
@ChihweiLHBird ChihweiLHBird marked this pull request as ready for review April 8, 2026 17:22
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