Было: `ruff check .` → 10 ошибок, CI-гейт на ruff был бы красным сразу. - 9× I001 (порядок импортов) — application/forecast.py:1, application/scenarios.py:1, domain/currency.py:1, infrastructure/ai/assistant.py:1, infrastructure/cli/app.py:11, infrastructure/cli/commands/init.py:2, infrastructure/cli/services.py:2, tests/test_model.py:1, tests/test_repositories.py:1 - 1× E501 — infrastructure/cli/services.py:30, сигнатура build_services перенесена на три строки Поведение не меняется: переупорядочены только импорты, убраны пустые строки, перенесена длинная сигнатура. Порядок импорта в app.py не влияет на момент вызова setup_i18n() — он по-прежнему после импорта команд. Проверка: 75/75 тестов зелёные, ruff check . — All checks passed.
18 lines
493 B
Python
18 lines
493 B
Python
"""cf init — создать пустую модель."""
|
|
import typer
|
|
|
|
from domain import FinancialModel
|
|
from infrastructure.cli.i18n import t
|
|
from infrastructure.cli.paths import MODEL_PATH
|
|
from infrastructure.cli.services import console, save_model
|
|
|
|
app = typer.Typer()
|
|
|
|
|
|
@app.command()
|
|
def init() -> None:
|
|
"""Создать пустую финансовую модель"""
|
|
model = FinancialModel()
|
|
save_model(model)
|
|
console.print(t("cmd.init.ok", path=str(MODEL_PATH)))
|