From d809beeca70425e652a451c5758cfa0d76096e0d Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sun, 30 Nov 2025 23:57:49 +0100 Subject: [PATCH] fix(lint): fix G004 and PTH123 violations across codebase - Convert f-string logging to % style (G004) - Convert open() to Path.open() (PTH123) - Remove G004 and PTH123 from global ignores in pyproject.toml --- screen_locker/screen_lock.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/screen_locker/screen_lock.py b/screen_locker/screen_lock.py index 235b718..74b8137 100755 --- a/screen_locker/screen_lock.py +++ b/screen_locker/screen_lock.py @@ -632,7 +632,7 @@ class ScreenLocker: return False try: - with open(self.log_file) as f: + with self.log_file.open() as f: logs = json.load(f) except (OSError, json.JSONDecodeError): return False @@ -646,7 +646,7 @@ class ScreenLocker: logs = {} if self.log_file.exists(): try: - with open(self.log_file) as f: + with self.log_file.open() as f: logs = json.load(f) except (OSError, json.JSONDecodeError): logs = {} @@ -660,10 +660,10 @@ class ScreenLocker: # Save updated logs try: - with open(self.log_file, "w") as f: + with self.log_file.open("w") as f: json.dump(logs, f, indent=2) except OSError as e: - _logger.warning(f"Could not save workout log: {e}") + _logger.warning("Could not save workout log: %s", e) def close(self) -> None: """Close the application and exit."""