make rclomatic pythantic #10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
rclomatic is at the moment pure functional programming. Make it more pythantic by wrapping zfs, btrf, ... in classes.
Done (merged to
dev, commits7e25722..cbc395d):resolve_snapshot_backend()returning(\"zfs\"|\"btrfs\"|None, cfg)with every caller branching on the string) with aSnapshotBackendinterface (backend.py) andZfsBackend/BtrfsBackendclasses implementing it.config.resolve_snapshot_backend()is now a factory returning an instantiated backend (orNone) instead of a tuple.sync.pyandactions/list_cmd.pynow callbackend.resolve_source_dir(...)/backend.list_snapshots(...)polymorphically — everyif backend == \"zfs\": ... elif ...branch is gone.actions/check.pyneeded zero changes.resolve_dataset,replace_snapshot,create_snapshot,resolve_location_dir) stayed as plain functions rather than being forced onto a class.checkstill never mutates acreate: truetarget's snapshot. Full test suite green (193 tests, up from 190).deploy/config/rclomatic.d/example.yaml.examplereferencing the oldresolve_zfs_source()name.Design/plan docs:
docs/superpowers/specs/2026-08-05-rclomatic-oop-snapshot-backends-design.md,docs/superpowers/plans/2026-08-05-rclomatic-oop-snapshot-backends.md.Open / explicitly out of scope:
hooks.py,ntfy.py,stats.py, and the other non-backend modules were not converted to classes. This work was scoped to the one place in the codebase with real multi-implementation type-tag dispatch to replace (ZFS vs. BTRFS snapshot backends) — the other modules don't have an equivalent pattern, so wrapping them in classes would be decorative rather than fixing anything. If the "..." in the issue title meant other modules should also become class-based, that's a separate follow-up, not covered here.originyet — only merged locally intodev.