From 7356756868c6412bc0829b41782924b5ba3f4e74 Mon Sep 17 00:00:00 2001 From: Matt Krump <1036969+mkrump@users.noreply.github.com> Date: Sat, 25 Jul 2020 15:43:42 -0600 Subject: [PATCH] Turn on check_untyped_defs for aqt.taglimit * Add type hints taglimit * Turn on check_untyped_defs for aqt.taglimit --- qt/aqt/taglimit.py | 4 +++- qt/mypy.ini | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/qt/aqt/taglimit.py b/qt/aqt/taglimit.py index 0cb164683..971c41f49 100644 --- a/qt/aqt/taglimit.py +++ b/qt/aqt/taglimit.py @@ -1,5 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/copyleft/agpl.html +from typing import List, Optional import aqt from aqt.qt import * @@ -9,8 +10,9 @@ from aqt.utils import restoreGeom, saveGeom class TagLimit(QDialog): def __init__(self, mw, parent): QDialog.__init__(self, parent, Qt.Window) + self.tags: Union[str, List] = "" self.mw = mw - self.parent = parent + self.parent: Optional[QWidget] = parent self.deck = self.parent.deck self.dialog = aqt.forms.taglimit.Ui_Dialog() self.dialog.setupUi(self) diff --git a/qt/mypy.ini b/qt/mypy.ini index 69352e25e..132d4cfea 100644 --- a/qt/mypy.ini +++ b/qt/mypy.ini @@ -76,3 +76,5 @@ check_untyped_defs=true check_untyped_defs=true [mypy-aqt.deckconf] check_untyped_defs=true +[mypy-aqt.taglimit] +check_untyped_defs=true