Flagsmith/flagsmith

Using django-lifecycle hooks results in `error: Untyped decorator makes function "x" untyped [misc]`

開放

#5,240 建立於 2025年3月24日

 (5 則留言) (0 個反應) (1 位負責人)Python (264 個分叉)batch import
good first issue

倉庫指標

星標
 (3,475 顆星)
PR 合併指標
 (平均合併 3天 7小時) (30 天內合併 157 個 PR)

描述

When using the @hook decorator from django-lifecycle on a model method, mypy throws the following error:

error: Untyped decorator makes function "x" untyped [misc]

This means that, currently, all methods decorated with @hook(...) are annotated with # type: ignore[misc]. The goal of this issue is to remove those type: ignore[misc] comments, while still having mypy pass its validation. Depending on the fix, it may be necessary to split the work up into multiple PRs as there are a lot of instances of this across the codebase.

Here is an example: https://github.com/Flagsmith/flagsmith/blob/main/api/features/models.py#L142

貢獻者指南