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>
40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING, override
|
|
|
|
from ....lib.log import NOTICE, log
|
|
from .Cmd import Cmd, Parent
|
|
|
|
if TYPE_CHECKING:
|
|
from argparse import ArgumentParser, Namespace
|
|
|
|
class CmdDep(Cmd): # export
|
|
|
|
def __init__(self, parent: Parent) -> None:
|
|
super().__init__(
|
|
parent,
|
|
'deps',
|
|
help = 'Check for circular dependencies between given modules',
|
|
)
|
|
|
|
@override
|
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
|
super().add_arguments(parser)
|
|
parser.add_argument('module', nargs = '*', help = 'Modules')
|
|
parser.add_argument('-f', '--flavour', nargs = '?', default = 'build')
|
|
|
|
@override
|
|
async def _run(self, args: Namespace) -> None:
|
|
cycle = self.app.find_circular_deps(args.module, args.flavour)
|
|
if cycle:
|
|
log(
|
|
NOTICE,
|
|
f'Found circular dependency in flavour {args.flavour}: '
|
|
' -> '.join(cycle)
|
|
)
|
|
exit(1)
|
|
log(
|
|
NOTICE,
|
|
f'No circular dependency found for flavour {args.flavour} in modules:',
|
|
' '.join(args.module),
|
|
)
|