Files
nifodea/infrastructure/cli/commands/export_xlsx.py
T
oqyude af01efc41a 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).
2026-10-25 05:17:27 +03:00

23 lines
704 B
Python

"""cf export-xlsx — экспорт модели в Excel."""
import typer
from infrastructure.cli.i18n import t
from infrastructure.cli.services import console, load_model
from infrastructure.repositories import ExcelRepository, ExcelRepositoryError
_repo = ExcelRepository()
def export_xlsx(
path: str = typer.Argument("exports/forecast.xlsx", help=t("cmd.export.arg.path")),
) -> None:
"""Экспорт модели в Excel"""
model = load_model()
try:
_repo.save(model, path)
console.print(t("cmd.export.ok", path=path))
except ExcelRepositoryError as e:
console.print(f"[red]{t('cmd.export.err', error=str(e))}[/red]")
raise typer.Exit(1)