From d0909e62002dea9fddb2cf80045e056e298e1cdc Mon Sep 17 00:00:00 2001 From: lekss361 Date: Sun, 26 Apr 2026 10:53:50 +0300 Subject: [PATCH] backend: ruff lint fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - main.py: AsyncIterator from collections.abc (typing.AsyncIterator deprecated, UP035) - geometry.py: TEAP first in import (isort: ALL_CAPS before MixedCase, I001) - pyproject.toml: ignore RUF001/002/003 — Russian-language project legitimately uses Cyrillic lookalikes in comments/docstrings (МСК-66 etc). Verified: ruff check . — All checks passed! Co-Authored-By: Claude Opus 4.7 (1M context) --- backend/app/main.py | 2 +- backend/app/services/generative/geometry.py | 2 +- backend/pyproject.toml | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/app/main.py b/backend/app/main.py index b8d23101..bfdfd360 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -1,5 +1,5 @@ +from collections.abc import AsyncIterator from contextlib import asynccontextmanager -from typing import AsyncIterator import sentry_sdk from fastapi import FastAPI diff --git a/backend/app/services/generative/geometry.py b/backend/app/services/generative/geometry.py index 06881dab..26fa92ad 100644 --- a/backend/app/services/generative/geometry.py +++ b/backend/app/services/generative/geometry.py @@ -5,7 +5,7 @@ Stage 1b: greedy filling of rectangular MKD with 3 strategies. STRtree for colli Performance target: <=10s per variant; fallback acceptance 15s. """ -from app.schemas.concept import ConceptInput, ConceptVariant, FinancialModel, TEAP +from app.schemas.concept import TEAP, ConceptInput, ConceptVariant, FinancialModel def generate_stub(payload: ConceptInput) -> list[ConceptVariant]: diff --git a/backend/pyproject.toml b/backend/pyproject.toml index fc6ba7b8..e299b6b2 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -45,6 +45,9 @@ line-length = 100 [tool.ruff.lint] select = ["E", "F", "I", "B", "UP", "N", "RUF", "ASYNC"] +# RUF001/002/003 — ambiguous Unicode (Cyrillic vs Latin lookalikes). +# Off because the project is Russian-language; comments/docstrings legitimately use Cyrillic. +ignore = ["RUF001", "RUF002", "RUF003"] [tool.mypy] python_version = "3.12"