Обнаружено на шаге 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).
28 lines
1.1 KiB
Python
28 lines
1.1 KiB
Python
"""cf analyze — AI-анализ финансовой модели (заглушка)."""
|
|
|
|
import typer
|
|
|
|
from infrastructure.cli.i18n import t
|
|
from infrastructure.cli.services import build_services, console, load_model, resolve_currency
|
|
|
|
CURRENCY_OPTION = typer.Option(None, "--currency", "-c", help=t("cmd.forecast.opt.currency"))
|
|
|
|
|
|
def analyze(
|
|
months: int = typer.Option(12, "--months", "-m", help=t("cmd.analyze.opt.months")),
|
|
currency: str | None = CURRENCY_OPTION,
|
|
) -> None:
|
|
"""AI-анализ финансовой модели"""
|
|
model = load_model()
|
|
target_curr, _ = resolve_currency(model, currency)
|
|
_, _, assistant, _ = build_services(model)
|
|
assistant.display_currency = target_curr
|
|
result = assistant.analyze(months)
|
|
|
|
console.print(f"[bold]{t('cmd.analyze.title.prompt')}:[/bold]")
|
|
console.print(result["prompt"][:500] + "...\n")
|
|
|
|
console.print(f"[bold]{t('cmd.analyze.title.summary')}:[/bold]")
|
|
console.print(t("cmd.analyze.base_currency", currency=model.base_currency))
|
|
console.print(f"\n[yellow]{t('cmd.analyze.stub')}[/yellow]")
|