-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
v0.14.3Targeted for v0.14.3 releaseTargeted for v0.14.3 release
Description
Problem
Controller uses self.__context.config.lftp fields (remote_address, remote_path, local_path, etc.) that are typed as Optional[str] because they start as None before the user configures them. Throughout the controller, these are passed with # type: ignore[arg-type] comments to suppress type errors — over a dozen instances scattered across _create_pair_context, __spawn_move_process, and the main loop.
This means:
- If a required field is missing at runtime, the failure happens deep in the call stack (e.g.,
os.path.join(None, ...)) with an unclear error - Static type checking is bypassed via
type: ignore, defeating the purpose of Pyright enforcement
Proposed Solution
Add a Controller._validate_config() method (or similar) called early in Controller.start() that:
- Asserts required LFTP fields are non-None (
remote_address,remote_username,remote_path,local_path,remote_port, etc.) - Raises a clear
ConfigErrororValueErrorwith a user-friendly message if any are missing - Once validated, the
type: ignore[arg-type]comments on those fields can be removed since the runtime contract is explicit
Context
Identified during PR #309 review. Deferred as it's a broader refactor beyond the scope of a patch release.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
v0.14.3Targeted for v0.14.3 releaseTargeted for v0.14.3 release