From f21f303872037c5e7a3784a1b4a1bdf6158936d0 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Thu, 28 May 2026 20:59:35 +0200 Subject: [PATCH] fix: apply pre-commit formatting fixes to unblock CI Co-Authored-By: Claude Sonnet 4.6 --- screen_locker/_constants.py | 4 +++- screen_locker/_shutdown.py | 6 ++---- screen_locker/screen_lock.py | 2 +- screen_locker/tests/test_wake_state.py | 11 ++++------- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/screen_locker/_constants.py b/screen_locker/_constants.py index 7bdbd5c..377a85b 100644 --- a/screen_locker/_constants.py +++ b/screen_locker/_constants.py @@ -60,4 +60,6 @@ WAKE_AFTER_HOURS: int = 8 # Path to the rtcwake binary. RTCWAKE_BIN: str = "/usr/sbin/rtcwake" # State file written by wake_alarm; read here to check for workout skip. -WAKE_STATE_FILE = Path(__file__).resolve().parent.parent / "wake_alarm" / "wake_state.json" +WAKE_STATE_FILE = ( + Path(__file__).resolve().parent.parent / "wake_alarm" / "wake_state.json" +) diff --git a/screen_locker/_shutdown.py b/screen_locker/_shutdown.py index f7fcfbb..37c61cc 100644 --- a/screen_locker/_shutdown.py +++ b/screen_locker/_shutdown.py @@ -10,12 +10,10 @@ import subprocess from screen_locker._constants import ( ADJUST_SHUTDOWN_SCRIPT, - SHUTDOWN_CONFIG_FILE, - SICK_DAY_STATE_FILE, -) -from screen_locker._constants import ( ALARM_DAYS, RTCWAKE_BIN, + SHUTDOWN_CONFIG_FILE, + SICK_DAY_STATE_FILE, WAKE_AFTER_HOURS, ) diff --git a/screen_locker/screen_lock.py b/screen_locker/screen_lock.py index 11f9f18..7713cb0 100755 --- a/screen_locker/screen_lock.py +++ b/screen_locker/screen_lock.py @@ -38,13 +38,13 @@ from screen_locker._phone_verification import PhoneVerificationMixin from screen_locker._shutdown import ShutdownMixin from screen_locker._sick_dialog import SickDialogMixin from screen_locker._ui_flows import UIFlowsMixin +from screen_locker._wake_state import has_workout_skip_today from screen_locker._weekly_check import ( WEEKLY_WORKOUT_MINIMUM, has_weekly_minimum, is_relaxed_day, ) from screen_locker._window_setup import WindowSetupMixin -from screen_locker._wake_state import has_workout_skip_today if TYPE_CHECKING: from collections.abc import Callable diff --git a/screen_locker/tests/test_wake_state.py b/screen_locker/tests/test_wake_state.py index e339390..f47573b 100644 --- a/screen_locker/tests/test_wake_state.py +++ b/screen_locker/tests/test_wake_state.py @@ -3,16 +3,13 @@ from __future__ import annotations import json -from pathlib import Path from typing import TYPE_CHECKING from unittest.mock import MagicMock, patch -import pytest - from screen_locker._wake_state import has_workout_skip_today, load_wake_state if TYPE_CHECKING: - pass + from pathlib import Path _TODAY = "2026-05-28" _STATE_PATH = "screen_locker._wake_state.WAKE_STATE_FILE" @@ -196,8 +193,8 @@ class TestLoadWakeStateOsError: with ( patch(_STATE_PATH, state_file), patch("screen_locker._wake_state.open", mock_open, create=True), - ): # We can't easily patch builtins.open for a specific file, # so we test by patching the json.load path - with patch("json.load", side_effect=OSError("disk error")): - assert load_wake_state() is None + patch("json.load", side_effect=OSError("disk error")), + ): + assert load_wake_state() is None