mirror of
https://github.com/elisiariocouto/leggen.git
synced 2025-12-24 15:59:24 +00:00
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:
committed by
Elisiário Couto
parent
5987a759b8
commit
c8f0a103c6
@@ -3,7 +3,6 @@
|
||||
import click
|
||||
from pathlib import Path
|
||||
|
||||
from leggen.utils.paths import path_manager
|
||||
|
||||
|
||||
@click.command()
|
||||
|
||||
@@ -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():
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user