fix(ci): fix black/ruff failures, add CoC and PR template
- Fix Python formatting (sync no longer strips blank lines from .py files) - Remove test_community_build.py (tests private sync module) - Fix ruff warnings in test files - Add CODE_OF_CONDUCT.md - Add .github/PULL_REQUEST_TEMPLATE.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ from typing import Any
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
|
||||
class Site(BaseModel):
|
||||
"""Gitea site configuration"""
|
||||
|
||||
@@ -20,6 +21,7 @@ class Site(BaseModel):
|
||||
alias: str | None = Field(None, description="Site alias")
|
||||
oauth_enabled: bool = Field(default=False, description="Whether OAuth is enabled")
|
||||
|
||||
|
||||
class PaginationParams(BaseModel):
|
||||
"""Pagination parameters for list endpoints"""
|
||||
|
||||
@@ -28,6 +30,7 @@ class PaginationParams(BaseModel):
|
||||
page: int = Field(default=1, ge=1, description="Page number (starts at 1)")
|
||||
limit: int = Field(default=30, ge=1, le=100, description="Number of items per page (1-100)")
|
||||
|
||||
|
||||
class ErrorResponse(BaseModel):
|
||||
"""Standard error response"""
|
||||
|
||||
@@ -36,6 +39,7 @@ class ErrorResponse(BaseModel):
|
||||
code: str | None = Field(None, description="Error code")
|
||||
details: dict[str, Any] | None = Field(None, description="Additional error details")
|
||||
|
||||
|
||||
class SuccessResponse(BaseModel):
|
||||
"""Standard success response"""
|
||||
|
||||
@@ -43,6 +47,7 @@ class SuccessResponse(BaseModel):
|
||||
message: str = Field(..., description="Success message")
|
||||
data: dict[str, Any] | None = Field(None, description="Response data")
|
||||
|
||||
|
||||
class GiteaUser(BaseModel):
|
||||
"""Gitea user information"""
|
||||
|
||||
@@ -55,6 +60,7 @@ class GiteaUser(BaseModel):
|
||||
avatar_url: str | None = None
|
||||
is_admin: bool = False
|
||||
|
||||
|
||||
class GiteaPermissions(BaseModel):
|
||||
"""Repository permissions"""
|
||||
|
||||
@@ -64,6 +70,7 @@ class GiteaPermissions(BaseModel):
|
||||
push: bool = False
|
||||
pull: bool = False
|
||||
|
||||
|
||||
class GiteaTimestamps(BaseModel):
|
||||
"""Common timestamp fields"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user