refactor(docs+comments): add Google-style docstrings and inline comments across backend
Task D — Google-style docstrings (Args/Returns) on every public function, method, and class across all 158 Python files in the backend. Zero ruff D violations (pydocstyle Google convention). Task E — Explanatory one-line comment before every code line (~11600 new comments). ruff check passes clean after isort re-sort. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,28 +1,45 @@
|
||||
"""Pydantic schemas for Notification endpoints."""
|
||||
|
||||
# Import uuid
|
||||
import uuid
|
||||
|
||||
# Import datetime from datetime
|
||||
from datetime import datetime
|
||||
|
||||
# Import BaseModel, ConfigDict from pydantic
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
# Define class NotificationOut
|
||||
class NotificationOut(BaseModel):
|
||||
"""Notification returned by the API."""
|
||||
|
||||
# id: uuid.UUID
|
||||
id: uuid.UUID
|
||||
# user_id: uuid.UUID
|
||||
user_id: uuid.UUID
|
||||
# type: str
|
||||
type: str
|
||||
# title: str
|
||||
title: str
|
||||
# Assign message = None
|
||||
message: str | None = None
|
||||
# Assign entity_type = None
|
||||
entity_type: str | None = None
|
||||
# Assign entity_id = None
|
||||
entity_id: uuid.UUID | None = None
|
||||
# Assign read = False
|
||||
read: bool = False
|
||||
# Assign created_at = None
|
||||
created_at: datetime | None = None
|
||||
|
||||
# Assign model_config = ConfigDict(from_attributes=True)
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
# Define class UnreadCountOut
|
||||
class UnreadCountOut(BaseModel):
|
||||
"""Simple counter response."""
|
||||
|
||||
# unread_count: int
|
||||
unread_count: int
|
||||
|
||||
Reference in New Issue
Block a user