Use human-friendly names in mypy and Pylint ignore directives (#2946)
This commit is contained in:
parent
7bdef2f017
commit
a28fb27a7a
|
|
@ -42,7 +42,7 @@ class Fido2:
|
|||
error('fido2 support is most likely not installed')
|
||||
raise ValueError('HSM devices can not be detected, is libfido2 installed?')
|
||||
|
||||
fido_devices: str = clear_vt100_escape_codes(ret) # type: ignore
|
||||
fido_devices: str = clear_vt100_escape_codes(ret) # type: ignore[assignment]
|
||||
|
||||
manufacturer_pos = 0
|
||||
product_pos = 0
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ class SysCommandWorker:
|
|||
lines = filter(None, self._trace_log[self._trace_log_pos:last_line].splitlines())
|
||||
for line in lines:
|
||||
if self.remove_vt100_escape_codes_from_lines:
|
||||
line = clear_vt100_escape_codes(line) # type: ignore
|
||||
line = clear_vt100_escape_codes(line) # type: ignore[assignment]
|
||||
|
||||
yield line + b'\n'
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ class Journald:
|
|||
@staticmethod
|
||||
def log(message: str, level: int = logging.DEBUG) -> None:
|
||||
try:
|
||||
import systemd.journal # type: ignore
|
||||
import systemd.journal # type: ignore[import-not-found]
|
||||
except ModuleNotFoundError:
|
||||
return None
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class TranslationHandler:
|
|||
"""
|
||||
# this is a very naughty way of retrieving the data but
|
||||
# there's no alternative method exposed unfortunately
|
||||
catalog = translation._catalog # type: ignore
|
||||
catalog = translation._catalog # type: ignore[attr-defined]
|
||||
messages = {k: v for k, v in catalog.items() if k and v}
|
||||
return len(messages)
|
||||
|
||||
|
|
@ -205,7 +205,7 @@ class DeferredTranslation:
|
|||
@classmethod
|
||||
def install(cls) -> None:
|
||||
import builtins
|
||||
builtins._ = cls # type: ignore
|
||||
builtins._ = cls # type: ignore[attr-defined]
|
||||
|
||||
|
||||
translation_handler = TranslationHandler()
|
||||
|
|
|
|||
|
|
@ -394,7 +394,7 @@ class EditViewport(AbstractViewport):
|
|||
self._textbox = curses.textpad.Textbox(self._edit_win)
|
||||
self._main_win.refresh()
|
||||
|
||||
self._textbox.edit(self.process_key) # type: ignore
|
||||
self._textbox.edit(self.process_key) # type: ignore[arg-type]
|
||||
|
||||
|
||||
@dataclass
|
||||
|
|
@ -1481,8 +1481,8 @@ class Tui:
|
|||
return Tui.t()._main_loop(component)
|
||||
|
||||
def _sig_win_resize(self, signum: int, frame: FrameType | None) -> None:
|
||||
if hasattr(self, '_component') and self._component is not None: # pylint: disable=E1101
|
||||
self._component.resize_win() # pylint: disable=E1101
|
||||
if hasattr(self, '_component') and self._component is not None: # pylint: disable=no-member
|
||||
self._component.resize_win() # pylint: disable=no-member
|
||||
|
||||
def _main_loop(self, component: AbstractCurses) -> Result:
|
||||
self._screen.refresh()
|
||||
|
|
|
|||
Loading…
Reference in New Issue