docs: add AI code generation requirements and comprehensive Google-style docstrings
- Add AI code generation requirements to AGENTS.md - Add module-level docstrings to all 46 Python modules - Add detailed Google-style docstrings to all classes and functions - Remove all inline comments following self-documenting code principle - Include Args, Returns, Raises sections in function docstrings - Add Attributes and Examples sections to class docstrings
This commit is contained in:
@@ -1,17 +1,38 @@
|
||||
"""Transaction Manager interface for managing database transactions."""
|
||||
"""Transaction Manager interface for managing database transactions.
|
||||
|
||||
This module defines the abstract interface for transaction management.
|
||||
Implementations control transaction boundaries for use cases.
|
||||
"""
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class TransactionManager(ABC):
|
||||
"""Abstract Transaction Manager for controlling transaction boundaries."""
|
||||
"""Abstract Transaction Manager for controlling transaction boundaries.
|
||||
|
||||
Provides interface for committing or rolling back database transactions.
|
||||
Used by use cases to manage atomic operations.
|
||||
|
||||
Example:
|
||||
>>> async with transaction_manager:
|
||||
... await repository.add(entity)
|
||||
... await transaction_manager.commit()
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
async def commit(self) -> None:
|
||||
"""Commit the current transaction."""
|
||||
"""Commit the current transaction.
|
||||
|
||||
Persists all pending changes to the database.
|
||||
Should be called after all operations succeed.
|
||||
"""
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
async def rollback(self) -> None:
|
||||
"""Rollback the current transaction."""
|
||||
"""Rollback the current transaction.
|
||||
|
||||
Discards all pending changes.
|
||||
Should be called when an error occurs.
|
||||
"""
|
||||
...
|
||||
|
||||
Reference in New Issue
Block a user