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:
Jan Lindemann 2026-07-22 15:51:14 +02:00
commit 5fa008be5a
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61
78 changed files with 263 additions and 81 deletions

View file

@ -1,7 +1,7 @@
from __future__ import annotations
from functools import cached_property
from typing import TYPE_CHECKING
from typing import override, TYPE_CHECKING
from ...CmdBase import CmdBase as Base
from ..CmdSecrets import CmdSecrets as Parent
@ -46,6 +46,7 @@ class Cmd(Base): # export
def __init__(self, parent: Parent, name: str, help: str) -> None:
super().__init__(parent, name, help)
@override
def add_arguments(self, parser: ArgumentParser) -> None:
super().add_arguments(parser)
parser.add_argument('packages', nargs = '*', help = 'Package names')

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, override
from .Cmd import Cmd, Parent
from .lib.base import Attrs
@ -15,10 +15,12 @@ class CmdCompileTemplates(Cmd): # export
parent, 'compile-templates', help = 'Compile package template files'
)
@override
async def _run(self, args: Namespace) -> None:
attrs = Attrs(args.mode, args.owner, args.group, None)
await self._compile_template_files(args.packages, attrs)
@override
def add_arguments(self, parser: ArgumentParser) -> None:
super().add_arguments(parser)
parser.add_argument(

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, override
from .Cmd import Cmd, Parent
@ -18,6 +18,7 @@ class CmdInstall(Cmd): # export
),
)
@override
def add_arguments(self, parser: ArgumentParser) -> None:
parser.add_argument('src', help = 'URI of secret source')
parser.add_argument(
@ -28,6 +29,7 @@ class CmdInstall(Cmd): # export
)
super().add_arguments(parser)
@override
async def _run(self, args: Namespace) -> None:
packages = [] if args.packages == ['all'] else args.packages
await self.ctx.install(args.src, packages, args.only_missing)

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, override
from .Cmd import Cmd, Parent
@ -16,6 +16,7 @@ class CmdListCompilationOutput(Cmd): # export
help = 'List package compilation output files',
)
@override
def add_arguments(self, parser: ArgumentParser) -> None:
super().add_arguments(parser)
parser.add_argument(
@ -25,6 +26,7 @@ class CmdListCompilationOutput(Cmd): # export
help = 'Show all output targets, including non-existent files',
)
@override
async def _run(self, args: Namespace) -> None:
print(
'\n'.join(

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, override
from .Cmd import Cmd, Parent
@ -12,6 +12,7 @@ class CmdListSecrets(Cmd): # export
def __init__(self, parent: Parent) -> None:
super().__init__(parent, 'list-secrets', help = 'List package secret files')
@override
def add_arguments(self, parser: ArgumentParser) -> None:
super().add_arguments(parser)
parser.add_argument(
@ -21,6 +22,7 @@ class CmdListSecrets(Cmd): # export
help = 'Show all secret paths, including non-existent files',
)
@override
async def _run(self, args: Namespace) -> None:
print(
'\n'.join(

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, override
from .Cmd import Cmd, Parent
@ -12,5 +12,6 @@ class CmdListTemplates(Cmd): # export
def __init__(self, parent: Parent) -> None:
super().__init__(parent, 'list-templates', help = 'List package template files')
@override
async def _run(self, args: Namespace) -> None:
print('\n'.join(await self._list_template_files(args.packages)))

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, override
from .Cmd import Cmd, Parent
@ -16,5 +16,6 @@ class CmdRmCompilationOutput(Cmd): # export
help = 'Remove package compilation output files',
)
@override
async def _run(self, args: Namespace) -> None:
await self._remove_compilation_targets(args.packages)