App, lib, cmds: Fix mypy.explicit-override fallout
This commit adds @override decorators to approximately 300 methods across 76 files that inherit from base classes such as AbstractCmd, FileContext, ExecContext, Distro, SSHClient, and others. The decorator ensures the type checker can verify that overridden methods have compatible signatures and prevents accidental shadowing of inherited methods without intent. Files modified include command classes, library modules, distro implementations, and SSH client implementations. Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
30a00df5c7
commit
5fa008be5a
78 changed files with 263 additions and 81 deletions
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from contextlib import asynccontextmanager
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import override, TYPE_CHECKING
|
||||
|
||||
from ....CmdBase import CmdBase as Base
|
||||
from ....lib.FileContext import FileContext
|
||||
|
|
@ -27,6 +27,7 @@ class Cmd(Base): # export
|
|||
)
|
||||
yield ret
|
||||
|
||||
@override
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
super().add_arguments(parser)
|
||||
parser.add_argument(
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
|||
|
||||
from ....lib.log import DEBUG, log
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, override
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
|
@ -12,10 +12,12 @@ class CmdExtract(Cmd): # export
|
|||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(parent, 'x', help = 'Extract a tar archive')
|
||||
|
||||
@override
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
super().add_arguments(parser)
|
||||
parser.add_argument('dst', help = 'Destination root URI')
|
||||
|
||||
@override
|
||||
async def _run(self, args: Namespace) -> None:
|
||||
async with self.ctx(dst = args.dst) as ctx:
|
||||
paths = await ctx.extract(ctx.dst.root)
|
||||
|
|
|
|||
Loading…
Reference in a new issue