- Add pyproject.toml: hatchling build, many-rsync entrypoint, ruff/mypy/pytest config with 60% coverage floor - Add uv.lock for reproducible dev installs - Add .pre-commit-config.yaml: ruff (with --fix) + mypy hooks - Add test_main.py: unit tests for _build_rsync_cmd, _load_raw, and load_config covering happy paths and FATAL exit cases - Add explanation.md: architecture overview with flowchart - main.py: refactor into typed, testable functions (_load_raw, _build_rsync_cmd extracted); add RsyncParameters/Config TypedDicts; add rsync_parameters config support (rsync_path, exclude_from); harden validation (n clamped, log_level validated) - README.md: update install instructions and document all config fields including rsync_parameters
649 B
649 B
explanation
this document shall serve as the explanation for the main.py script. here's the inputs (on the left) and outputs of the script:
flowchart LR
f["(optional) config file path"] -->|read from passed args| b
a[sync.toml / sync.json] -->|read input| b[main.py]
c[local_folders] -->|read input| b
b -->|rsync folders| d[remote_folder]
b -->|write logs| e[folder: ~/.rsync-logs/]
- If not given explicitly, read config (
_load_raw+load_config) and returncfg - Start logging
- Fire up the thread pool
- run
sync_folderfor eachfolderinlocal_foldersagainst targetremote_folder
- run
- Log results