From d0cd6353d7be09da2b6aa394fb794f8bfaf88a42 Mon Sep 17 00:00:00 2001 From: furtest Date: Wed, 28 Jan 2026 16:14:25 +0100 Subject: [PATCH 1/9] pyproject.toml : Add pylint as dev dependency --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 5b96ec5..82346d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,3 +20,8 @@ packages = [{include = "unisync", from = "src"}] [build-system] requires = ["poetry-core>=2.0.0,<3.0.0"] build-backend = "poetry.core.masonry.api" + +[dependency-groups] +dev = [ + "pylint (>=4.0.4,<5.0.0)" +] From 68c03c18d56047a199080ea7456ca0348551b2d8 Mon Sep 17 00:00:00 2001 From: furtest Date: Wed, 28 Jan 2026 16:19:06 +0100 Subject: [PATCH 2/9] config : remove unused import --- src/unisync/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unisync/config.py b/src/unisync/config.py index d504df1..06061d5 100644 --- a/src/unisync/config.py +++ b/src/unisync/config.py @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later from configparser import UNNAMED_SECTION -from dataclasses import dataclass, field +from dataclasses import dataclass from pathlib import Path import ipaddress import configparser From 405e9787962eab19b49eae44a621059a6df982c7 Mon Sep 17 00:00:00 2001 From: furtest Date: Wed, 28 Jan 2026 16:19:30 +0100 Subject: [PATCH 3/9] config : reraise exception instead of raising a new one --- src/unisync/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/unisync/config.py b/src/unisync/config.py index 06061d5..cd11d03 100644 --- a/src/unisync/config.py +++ b/src/unisync/config.py @@ -30,8 +30,8 @@ class ServerConfig: if self.ip != "": try: ipaddress.ip_address(self.ip) - except ValueError: - raise ValueError("The provided ip address is invalid") + except ValueError as e: + raise ValueError("The provided ip address is invalid") from e @dataclass class RootsConfig: From 033de7e7ca87ef847f50858acabaf684d9f168d2 Mon Sep 17 00:00:00 2001 From: furtest Date: Wed, 28 Jan 2026 16:20:40 +0100 Subject: [PATCH 4/9] config : cleanup linter warnings --- src/unisync/config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/unisync/config.py b/src/unisync/config.py index cd11d03..6b21078 100644 --- a/src/unisync/config.py +++ b/src/unisync/config.py @@ -120,13 +120,13 @@ def load_config(config_path:str) -> Config: Path(config.get(other_section, "cache_dir_path", fallback=DEFAULT_MISC_CACHE_DIR_PATH)).expanduser() ) - args_bool = list() - args_val = dict() + args_bool = [] + args_val = {} if "Unison" in config.sections(): for key, val in config.items("Unison"): if key in config["DEFAULT"].keys(): continue - elif val == "" or val == None: + if val in ("", None): args_bool.append(key) else: args_val[key] = val From a281fab8db482569b8686e8a90a160134b4c82c1 Mon Sep 17 00:00:00 2001 From: furtest Date: Wed, 28 Jan 2026 16:21:30 +0100 Subject: [PATCH 5/9] defaults : remove trailing whitespace --- src/unisync/defaults.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unisync/defaults.py b/src/unisync/defaults.py index 55f0062..cd12b49 100644 --- a/src/unisync/defaults.py +++ b/src/unisync/defaults.py @@ -6,7 +6,7 @@ from pathlib import Path # Commented out values are part of the config but are required so there is no defaults. # This allows this file to be a list of all the config options. -# DEFAULT_SERVER_USER: str = "" +# DEFAULT_SERVER_USER: str = "" DEFAULT_SERVER_SSHARGS: str = "" DEFAULT_SERVER_HOSTNAME: str = "" DEFAULT_SERVER_IP: str = "" From 942b6c3cefa1fe31c614f68521de4d97c253e2da Mon Sep 17 00:00:00 2001 From: furtest Date: Wed, 28 Jan 2026 18:21:13 +0100 Subject: [PATCH 6/9] main : import PathsManager instead of * --- src/unisync/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unisync/main.py b/src/unisync/main.py index b448cda..7096498 100644 --- a/src/unisync/main.py +++ b/src/unisync/main.py @@ -7,7 +7,7 @@ from unisync.argparser import create_argparser from unisync.runners import unisync_sync, unisync_add, unisync_mount from unisync.config import load_config from unisync.synchroniser import Synchroniser -from unisync.paths import * +from unisync.paths import PathsManager def main(): parser = create_argparser(unisync_sync, unisync_add, unisync_mount) From cbfbb32b869db226c1bbc657807936cd71d94cae Mon Sep 17 00:00:00 2001 From: furtest Date: Wed, 28 Jan 2026 18:21:38 +0100 Subject: [PATCH 7/9] main : linter reports cleanup use is not None instead of != None and remove a useless pass --- src/unisync/main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/unisync/main.py b/src/unisync/main.py index 7096498..d8b77b3 100644 --- a/src/unisync/main.py +++ b/src/unisync/main.py @@ -15,14 +15,13 @@ def main(): config_path: Path = Path("~/.config/unisync/config.ini").expanduser() # Check if --config is set - if cli_args.config != None and Path(cli_args.config).is_file(): + if cli_args.config is not None and Path(cli_args.config).is_file(): config = load_config(cli_args.config) elif config_path.is_file(): config = load_config(str(config_path)) else: # TODO replace the next line with something to do if no config file is found config = load_config(str(config_path)) - pass # TODO make the command line arguments work and override the config options From 2dafcc8c6b9c756d3c3a0a265e9d8dfcb681c830 Mon Sep 17 00:00:00 2001 From: furtest Date: Wed, 28 Jan 2026 18:22:37 +0100 Subject: [PATCH 8/9] paths : linter reports cleanup use [] instead of list() --- src/unisync/paths.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unisync/paths.py b/src/unisync/paths.py index a13bc50..127560e 100644 --- a/src/unisync/paths.py +++ b/src/unisync/paths.py @@ -92,7 +92,7 @@ class PathsManager: Writes a list of new paths to the file """ current_paths = self.get_paths_to_sync() - paths_to_add = list() + paths_to_add = [] # Check if one of the parent is already being synchronised # If so there is no need to add the child path for new_path in paths: From 7dd01260b363fc915f1b4b517eb7f4ccfd61a580 Mon Sep 17 00:00:00 2001 From: furtest Date: Fri, 30 Jan 2026 15:19:46 +0100 Subject: [PATCH 9/9] runners : linter reports cleanup del an unused parameter and remove a whitespace --- src/unisync/runners.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/unisync/runners.py b/src/unisync/runners.py index c2391ac..0e65dc9 100644 --- a/src/unisync/runners.py +++ b/src/unisync/runners.py @@ -6,6 +6,7 @@ from unisync.paths import PathsManager from unisync.config import Config def unisync_sync(synchroniser:Synchroniser, paths_manager:PathsManager, config: Config): + del config # The function signature must be the same for all runners if synchroniser.create_ssh_master_connection() != 0: print("Connection failed quitting") return 1 @@ -13,7 +14,7 @@ def unisync_sync(synchroniser:Synchroniser, paths_manager:PathsManager, config: synchroniser.sync_files(paths_manager.get_paths_to_sync()) synchroniser.sync_links(paths_manager.get_paths_to_sync()) - + # TODO check the config options and do or don't do the following synchroniser.update_links() #synchroniser.mount_remote_dir()