Skip to content

fix(logging): resolve basedpyright errors in log channels - #225

Merged
tmgbedu merged 2 commits into
mainfrom
fix/basedpyright-batch-1
Sep 22, 2026
Merged

tmgbedu merged 2 commits into
mainfrom
fix/basedpyright-batch-1

Conversation

@tmgbedu

@tmgbedu tmgbedu commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all basedpyright errors in fastapi_startkit/logging/channels/ (8 files).

  • BaseChannel: declares driver: LogDriver (new structural Protocol) and max_level: str | None; adds driver_class() which resolves via DriverFactory.make and raises ValueError for an unknown driver instead of calling None.
  • BaseChannel.channel(): same None-guard around ChannelFactory.make.
  • MultiBaseChannel / StackChannel: declare channels: list[BaseChannel]; stack channel default uses Config.get(...) or [] (matches the str | None default in the Config facade stub).
  • Removed now-unused/duplicate DriverFactory imports in the concrete channels.

Rules fixed: reportAttributeAccessIssue (34), reportOptionalCall (6), reportArgumentType (1).

DriverFactory.make / ChannelFactory.make are unchanged (they still return None for unknown names). The only runtime difference: an unknown driver/channel name now raises a clear ValueError where it used to raise TypeError: 'NoneType' object is not callable.

Verification

  • uv run basedpyright: 628 → 587 errors (−41), warnings unchanged (113), no new errors
  • uv run pytest --ignore=tests/masoniteorm/postgres: 2355 passed, 7 skipped

🤖 Generated with Claude Code

Declare the `driver`/`max_level` attributes on BaseChannel via a LogDriver
protocol and `channels` on MultiBaseChannel, and resolve driver/channel
classes through explicit None-checks instead of calling an Optional.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@codecov

codecov Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tmgbedu
tmgbedu merged commit 3200a4a into main Sep 22, 2026
4 of 6 checks passed
@tmgbedu
tmgbedu deleted the fix/basedpyright-batch-1 branch September 22, 2026 21:19
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