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
|
|
@ -9,7 +9,7 @@ from tarfile import TarFile, TarInfo
|
|||
from .CopyContext import CopyContext
|
||||
from .ExecContext import ExecContext
|
||||
from .log import DEBUG, ERR, log
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, override
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .base import StatResult
|
||||
|
|
@ -89,6 +89,7 @@ class TarIo(CopyContext):
|
|||
|
||||
class TarIoTarFile(TarIo):
|
||||
|
||||
@override
|
||||
async def _extract(self, blob: bytes, root: str | None = None) -> None:
|
||||
tf = TarFile(fileobj = io.BytesIO(blob))
|
||||
for info in tf.getmembers():
|
||||
|
|
@ -111,7 +112,16 @@ class TarIoTarFile(TarIo):
|
|||
|
||||
class TarIoTarExec(TarIo):
|
||||
|
||||
@override
|
||||
async def _extract(self, blob: bytes, root: str | None = None) -> None:
|
||||
cmd = ['tar']
|
||||
if root is not None:
|
||||
cmd += ['-C', root]
|
||||
cmd += ['-x', '-f', '-']
|
||||
await self.dst.run(cmd, cmd_input = blob)
|
||||
|
||||
@property
|
||||
@override
|
||||
def dst(self) -> ExecContext:
|
||||
ret = super().dst
|
||||
if not isinstance(ret, ExecContext):
|
||||
|
|
@ -120,10 +130,3 @@ class TarIoTarExec(TarIo):
|
|||
'context, which only has a file context'
|
||||
)
|
||||
return ret
|
||||
|
||||
async def _extract(self, blob: bytes, root: str | None = None) -> None:
|
||||
cmd = ['tar']
|
||||
if root is not None:
|
||||
cmd += ['-C', root]
|
||||
cmd += ['-x', '-f', '-']
|
||||
await self.dst.run(cmd, cmd_input = blob)
|
||||
|
|
|
|||
Loading…
Reference in a new issue