fix: Resolve all CI failures - linting, typing, and test issues

Co-authored-by: elisiariocouto <818914+elisiariocouto@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-09-13 22:34:21 +00:00
committed by Elisiário Couto
parent 5987a759b8
commit c8f0a103c6
8 changed files with 65 additions and 84 deletions

View File

@@ -3,7 +3,6 @@
import click
from pathlib import Path
from leggen.utils.paths import path_manager
@click.command()

View File

@@ -581,7 +581,7 @@ def get_historical_balances(account_id=None, days=365):
# Calculate historical balances by working backwards from current balance
historical_balances = []
account_running_balances = {}
account_running_balances: dict[str, dict[str, float]] = {}
# Initialize running balances with current balances
for (acc_id, balance_type), balance_info in current_balances.items():

View File

@@ -1,5 +1,6 @@
"""Centralized path management for Leggen."""
import contextlib
import os
from pathlib import Path
from typing import Optional
@@ -47,12 +48,8 @@ class PathManager:
db_path = self.get_config_dir() / "leggen.db"
# Try to ensure the directory exists, but handle permission errors gracefully
try:
with contextlib.suppress(PermissionError, OSError):
db_path.parent.mkdir(parents=True, exist_ok=True)
except (PermissionError, OSError):
# If we can't create the directory, continue anyway
# This allows tests and error cases to work as expected
pass
return db_path