mypy: remaining buckets — annotations, MIME typing, None-handling #19

Merged
clanker merged 1 commit from pr/mypy-misc into master 2026-08-14 20:10:44 +00:00
Member

mypy: remaining buckets — annotations, MIME typing, None-handling.

Rebased onto master after #15/#17/#18: the protocol-scoped errors are gone and this PR now takes the codebase to 0 mypy errors (62 → 0 on this branch).

Highlights:

  • actions — _BulkMoveWorker.run narrows queue items (isinstance(item, tuple))
  • mime_builder — MIMEMultipart from the right module, MIME parts typed MIMEBase, text attachments decoded for MIMEText
  • mainwindow — QByteArray → bytes via .data()
  • app — QSocketNotifier overload ignore, panel_history annotation, message/update_single_thread types, install_desktop fd rename
  • compose — QVBoxLayout narrowing, thread parent typed QObject, gnupg import ignore
  • pgp_util — annotations, policy.clone without the invalid utf8 kwarg, sign/encrypt accept Message
  • search — hide_tags set conversion, model attr annotations, return types, narrow-after-assert in refresh_thread
  • settings/panel/thread/thread_model/commandbar/webengine/html_utils/tag — assorted annotations and guards

Verified: mypy lazarus → 0 errors; compile clean; offscreen smoke (search rendering, MIME build, tag model) passes. Stacks on #18 (base updated).

**mypy: remaining buckets — annotations, MIME typing, None-handling.** Rebased onto master after #15/#17/#18: the protocol-scoped errors are gone and this PR now takes the codebase to **0 mypy errors** (62 → 0 on this branch). Highlights: - **actions** — `_BulkMoveWorker.run` narrows queue items (`isinstance(item, tuple)`) - **mime_builder** — `MIMEMultipart` from the right module, MIME parts typed `MIMEBase`, text attachments decoded for `MIMEText` - **mainwindow** — `QByteArray` → `bytes` via `.data()` - **app** — `QSocketNotifier` overload ignore, `panel_history` annotation, `message`/`update_single_thread` types, `install_desktop` fd rename - **compose** — `QVBoxLayout` narrowing, thread `parent` typed `QObject`, gnupg import ignore - **pgp_util** — annotations, `policy.clone` without the invalid `utf8` kwarg, `sign`/`encrypt` accept `Message` - **search** — `hide_tags` set conversion, model attr annotations, return types, narrow-after-assert in `refresh_thread` - **settings/panel/thread/thread_model/commandbar/webengine/html_utils/tag** — assorted annotations and guards Verified: `mypy lazarus` → **0 errors**; compile clean; offscreen smoke (search rendering, MIME build, tag model) passes. Stacks on #18 (base updated).
182 -> 30 errors on the F+G stack; the 30 left are exactly the
protocol-scoped bucket (app: object in the mixin, MessagePage's Dodo
param, keymap lambda inference) handled by PR #15.

- actions: narrow queue items (isinstance tuple) in _BulkMoveWorker
- app: QSocketNotifier overload ignore, panel_history annotation,
  message/update_single_thread types, install_desktop fd rename
- commandbar: annotate completer helpers; popup()/completionModel()
  None guards
- compose: gnupg import ignore; QVBoxLayout narrowing (fixes the
  addWidget(stretch=...) call-arg); EditorThread/SendmailThread parent
  typed QObject
- compose_threads: keyid guard before pgp_util.sign
- html_utils: bleach import-untyped ignores
- mainwindow: QByteArray -> bytes via .data() (3 sites)
- mime_builder: proper MIMEMultipart import, MIMEBase-typed parts,
  text attachments decoded for MIMEText
- panel: resizeEvent/showEvent params, focusInEvent return
- pgp_util: annotations, gnupg import ignore, policy.clone without
  the invalid utf8 kwarg, sign/encrypt accept Message
- search: render_thread_cell hide_tags set conversion, model attr
  annotations, missing return types
- settings: type annotations for the three config lists/dict
- tag: parent() default QModelIndex()
- thread: _saved_* annotations, page-binding rename, MessagePage arg
  left for the protocol PR
- thread_model: ThreadItem raw_data type
- webengine: interceptRequest annotation, payload bytes guard

Verified: compile clean; offscreen smoke of SearchPanel rendering,
MIME build, tag model all pass.
clanker force-pushed pr/mypy-misc from e13dedfb89 to 2a354e23d4 2026-08-14 20:02:58 +00:00 Compare
clanker force-pushed pr/mypy-misc from 2a354e23d4 to 92552094e6 2026-08-14 20:04:38 +00:00 Compare
clanker changed target branch from pr/mypy-none-guards to master 2026-08-14 20:08:03 +00:00
clanker force-pushed pr/mypy-misc from 92552094e6 to 29c2d92584 2026-08-14 20:08:12 +00:00 Compare
clanker merged commit d5d1d6680c into master 2026-08-14 20:10:44 +00:00
clanker deleted branch pr/mypy-misc 2026-08-14 20:10:44 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Home/lazarus!19
No description provided.