style: привести код к ruff format (line-length 120)

Обнаружено на шаге 0: `ruff format --check .` НЕ был чистым в baseline
(24 файла расходились с форматом ruff). `ruff check .` был чистым.

Изменение только косметическое (переносы, пустая строка после docstring
модуля, склейка вызовов в пределах line-length=120 из [tool.ruff]);
поведение не меняется — pytest 81/81 зелёные, `ruff check .` — без ошибок.

Нужно, чтобы `ruff format --check .` стал рабочим гейтом (D13 CI).
This commit is contained in:
oqyude committed 2026-10-25 05:17:27 +03:00
1 parent 9b53b25a91
commit af01efc41a
24 files changed
+219 -160

No files matched your search

+17 -16
View File
@@ -26,20 +26,19 @@ class ForecastService:
for account in self.model.accounts:
monthly = self._project_account(account, months)
for m in range(months):
results.append({
"account": account.name,
"month": m + 1,
"balance": monthly[m]["balance"],
"income": monthly[m]["income"],
"expenses": monthly[m]["expenses"],
})
results.append(
{
"account": account.name,
"month": m + 1,
"balance": monthly[m]["balance"],
"income": monthly[m]["income"],
"expenses": monthly[m]["expenses"],
}
)
# Asset growth — once per month, distributed across accounts proportionally
for m in range(months):
total_growth = sum(
a.value * a.growth_rate / _HUNDRED / _TWELVE
for a in self.model.assets
)
total_growth = sum(a.value * a.growth_rate / _HUNDRED / _TWELVE for a in self.model.assets)
month_rows = [r for r in results if r["month"] == m + 1]
total_bal = sum(r["balance"] for r in month_rows) or _ONE
for r in month_rows:
@@ -77,11 +76,13 @@ class ForecastService:
balance = balance + income - expenses
monthly.append({
"balance": _q(balance),
"income": _q(income),
"expenses": _q(expenses),
})
monthly.append(
{
"balance": _q(balance),
"income": _q(income),
"expenses": _q(expenses),
}
)
return monthly
def _liability_cost(self, account: Account) -> Decimal:
@@ -3,6 +3,7 @@
Определяет контракт: load(path) -> FinancialModel, save(model, path) -> None.
Реализации: JsonFileRepository, ExcelRepository.
"""
from __future__ import annotations
from pathlib import Path
+1 -4
View File
@@ -83,9 +83,6 @@ class ScenarioService:
income_multiplier=to_d(income_mult),
expense_multiplier=to_d(expense_mult),
growth_multiplier=to_d(growth_mult),
description=(
f"What-if: income x{income_mult}, "
f"expense x{expense_mult}, growth x{growth_mult}"
),
description=(f"What-if: income x{income_mult}, expense x{expense_mult}, growth x{growth_mult}"),
)
return self.apply(scenario, months)