style: apply ruff formatting to source and test files
All checks were successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/type Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful

This commit is contained in:
2026-05-02 12:05:14 +03:00
parent 1dbedf0f52
commit 14adcaa3e6
16 changed files with 50 additions and 95 deletions

View File

@@ -47,9 +47,7 @@ class SQLAlchemyPostRepository(PostRepository):
async def get_by_id(self, entity_id: UUID) -> Post | None:
"""Get post by ID."""
result = await self._session.execute(
select(PostORM).where(PostORM.id == str(entity_id))
)
result = await self._session.execute(select(PostORM).where(PostORM.id == str(entity_id)))
orm = result.scalar_one_or_none()
return self._to_domain(orm) if orm else None
@@ -67,9 +65,7 @@ class SQLAlchemyPostRepository(PostRepository):
async def update(self, entity: Post) -> None:
"""Update existing post."""
result = await self._session.execute(
select(PostORM).where(PostORM.id == str(entity.id))
)
result = await self._session.execute(select(PostORM).where(PostORM.id == str(entity.id)))
orm = result.scalar_one()
orm.title = entity.title.value
@@ -83,25 +79,19 @@ class SQLAlchemyPostRepository(PostRepository):
async def delete(self, entity_id: UUID) -> None:
"""Delete post by ID."""
result = await self._session.execute(
select(PostORM).where(PostORM.id == str(entity_id))
)
result = await self._session.execute(select(PostORM).where(PostORM.id == str(entity_id)))
orm = result.scalar_one_or_none()
if orm:
await self._session.delete(orm)
async def exists(self, entity_id: UUID) -> bool:
"""Check if post exists."""
result = await self._session.execute(
select(PostORM).where(PostORM.id == str(entity_id))
)
result = await self._session.execute(select(PostORM).where(PostORM.id == str(entity_id)))
return result.scalar_one_or_none() is not None
async def get_by_slug(self, slug: str) -> Post | None:
"""Get post by slug."""
result = await self._session.execute(
select(PostORM).where(PostORM.slug == slug)
)
result = await self._session.execute(select(PostORM).where(PostORM.slug == slug))
orm = result.scalar_one_or_none()
return self._to_domain(orm) if orm else None
@@ -154,9 +144,7 @@ class SQLAlchemyPostRepository(PostRepository):
async def slug_exists(self, slug: str) -> bool:
"""Check if slug exists."""
result = await self._session.execute(
select(PostORM).where(PostORM.slug == slug)
)
result = await self._session.execute(select(PostORM).where(PostORM.slug == slug))
return result.scalar_one_or_none() is not None
async def search(