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:
@@ -11,6 +11,7 @@ from typing import Any
|
||||
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
|
||||
|
||||
class BulkUpdatePostsParams(BaseModel):
|
||||
"""Parameters for bulk updating posts"""
|
||||
|
||||
@@ -55,6 +56,7 @@ class BulkUpdatePostsParams(BaseModel):
|
||||
|
||||
return v
|
||||
|
||||
|
||||
class BulkDeletePostsParams(BaseModel):
|
||||
"""Parameters for bulk deleting posts"""
|
||||
|
||||
@@ -71,6 +73,7 @@ class BulkDeletePostsParams(BaseModel):
|
||||
raise ValueError("All post IDs must be positive integers")
|
||||
return v
|
||||
|
||||
|
||||
class BulkUpdateProductsParams(BaseModel):
|
||||
"""Parameters for bulk updating WooCommerce products"""
|
||||
|
||||
@@ -120,6 +123,7 @@ class BulkUpdateProductsParams(BaseModel):
|
||||
|
||||
return v
|
||||
|
||||
|
||||
class BulkDeleteProductsParams(BaseModel):
|
||||
"""Parameters for bulk deleting products"""
|
||||
|
||||
@@ -136,6 +140,7 @@ class BulkDeleteProductsParams(BaseModel):
|
||||
raise ValueError("All product IDs must be positive integers")
|
||||
return v
|
||||
|
||||
|
||||
class BulkAssignCategoriesParams(BaseModel):
|
||||
"""Parameters for bulk assigning categories"""
|
||||
|
||||
@@ -164,6 +169,7 @@ class BulkAssignCategoriesParams(BaseModel):
|
||||
raise ValueError("item_type must be 'post' or 'product'")
|
||||
return v
|
||||
|
||||
|
||||
class BulkAssignTagsParams(BaseModel):
|
||||
"""Parameters for bulk assigning tags"""
|
||||
|
||||
@@ -192,6 +198,7 @@ class BulkAssignTagsParams(BaseModel):
|
||||
raise ValueError("item_type must be 'post' or 'product'")
|
||||
return v
|
||||
|
||||
|
||||
class BulkUpdateMediaParams(BaseModel):
|
||||
"""Parameters for bulk updating media items"""
|
||||
|
||||
@@ -222,6 +229,7 @@ class BulkUpdateMediaParams(BaseModel):
|
||||
|
||||
return v
|
||||
|
||||
|
||||
class BulkDeleteMediaParams(BaseModel):
|
||||
"""Parameters for bulk deleting media items"""
|
||||
|
||||
@@ -240,6 +248,7 @@ class BulkDeleteMediaParams(BaseModel):
|
||||
raise ValueError("All media IDs must be positive integers")
|
||||
return v
|
||||
|
||||
|
||||
class BulkOperationResult(BaseModel):
|
||||
"""Result of a bulk operation"""
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ from typing import Any
|
||||
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
|
||||
|
||||
class DatabaseExportParams(BaseModel):
|
||||
"""Parameters for database export"""
|
||||
|
||||
@@ -33,6 +34,7 @@ class DatabaseExportParams(BaseModel):
|
||||
raise ValueError(f"Invalid table name: {table}")
|
||||
return v
|
||||
|
||||
|
||||
class DatabaseImportParams(BaseModel):
|
||||
"""Parameters for database import"""
|
||||
|
||||
@@ -50,6 +52,7 @@ class DatabaseImportParams(BaseModel):
|
||||
raise ValueError("URL must start with http:// or https://")
|
||||
return v
|
||||
|
||||
|
||||
class DatabaseBackupParams(BaseModel):
|
||||
"""Parameters for creating database backup"""
|
||||
|
||||
@@ -61,6 +64,7 @@ class DatabaseBackupParams(BaseModel):
|
||||
default=False, description="Also backup wp-content/uploads directory"
|
||||
)
|
||||
|
||||
|
||||
class DatabaseRestoreParams(BaseModel):
|
||||
"""Parameters for restoring database"""
|
||||
|
||||
@@ -78,6 +82,7 @@ class DatabaseRestoreParams(BaseModel):
|
||||
raise ValueError("Confirmation required: set confirm=true")
|
||||
return v
|
||||
|
||||
|
||||
class DatabaseSearchParams(BaseModel):
|
||||
"""Parameters for searching database"""
|
||||
|
||||
@@ -91,6 +96,7 @@ class DatabaseSearchParams(BaseModel):
|
||||
case_sensitive: bool = Field(default=False, description="Case-sensitive search")
|
||||
max_results: int = Field(default=100, ge=1, le=1000, description="Maximum results to return")
|
||||
|
||||
|
||||
class DatabaseQueryParams(BaseModel):
|
||||
"""Parameters for executing SQL query"""
|
||||
|
||||
@@ -136,6 +142,7 @@ class DatabaseQueryParams(BaseModel):
|
||||
|
||||
return v
|
||||
|
||||
|
||||
class DatabaseSizeResponse(BaseModel):
|
||||
"""Response model for database size information"""
|
||||
|
||||
@@ -143,6 +150,7 @@ class DatabaseSizeResponse(BaseModel):
|
||||
tables: list[dict[str, Any]] = Field(description="List of tables with size information")
|
||||
row_count: int = Field(description="Total row count across all tables")
|
||||
|
||||
|
||||
class DatabaseTableInfo(BaseModel):
|
||||
"""Information about a database table"""
|
||||
|
||||
@@ -154,6 +162,7 @@ class DatabaseTableInfo(BaseModel):
|
||||
total_size_mb: float
|
||||
collation: str
|
||||
|
||||
|
||||
class DatabaseRepairResult(BaseModel):
|
||||
"""Result of database repair operation"""
|
||||
|
||||
@@ -161,6 +170,7 @@ class DatabaseRepairResult(BaseModel):
|
||||
status: str # 'OK', 'Repaired', 'Failed'
|
||||
message: str | None = None
|
||||
|
||||
|
||||
class DatabaseBackupInfo(BaseModel):
|
||||
"""Information about a database backup"""
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ from typing import Any
|
||||
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
|
||||
|
||||
class SystemInfoResponse(BaseModel):
|
||||
"""Comprehensive system information"""
|
||||
|
||||
@@ -32,6 +33,7 @@ class SystemInfoResponse(BaseModel):
|
||||
active_plugins: int = Field(description="Number of active plugins")
|
||||
active_theme: str = Field(description="Active theme name")
|
||||
|
||||
|
||||
class PHPInfoResponse(BaseModel):
|
||||
"""PHP configuration details"""
|
||||
|
||||
@@ -41,6 +43,7 @@ class PHPInfoResponse(BaseModel):
|
||||
ini_settings: dict[str, str] = Field(description="Important php.ini settings")
|
||||
disabled_functions: list[str] = Field(default=[], description="Disabled PHP functions")
|
||||
|
||||
|
||||
class DiskUsageResponse(BaseModel):
|
||||
"""Disk usage statistics"""
|
||||
|
||||
@@ -55,6 +58,7 @@ class DiskUsageResponse(BaseModel):
|
||||
)
|
||||
breakdown: dict[str, float] = Field(default={}, description="Detailed breakdown by directory")
|
||||
|
||||
|
||||
class CronEvent(BaseModel):
|
||||
"""WordPress cron event information"""
|
||||
|
||||
@@ -66,6 +70,7 @@ class CronEvent(BaseModel):
|
||||
)
|
||||
args: list[Any] = Field(default=[], description="Arguments passed to the hook")
|
||||
|
||||
|
||||
class CronListResponse(BaseModel):
|
||||
"""List of all cron events"""
|
||||
|
||||
@@ -73,6 +78,7 @@ class CronListResponse(BaseModel):
|
||||
total: int = Field(description="Total number of events")
|
||||
schedules: dict[str, dict[str, Any]] = Field(default={}, description="Available cron schedules")
|
||||
|
||||
|
||||
class CronRunParams(BaseModel):
|
||||
"""Parameters for manually running a cron job"""
|
||||
|
||||
@@ -90,6 +96,7 @@ class CronRunParams(BaseModel):
|
||||
)
|
||||
return v
|
||||
|
||||
|
||||
class ErrorLogParams(BaseModel):
|
||||
"""Parameters for retrieving error log"""
|
||||
|
||||
@@ -111,6 +118,7 @@ class ErrorLogParams(BaseModel):
|
||||
raise ValueError("level must be: error, warning, notice, or fatal")
|
||||
return v.lower() if v else v
|
||||
|
||||
|
||||
class ErrorLogEntry(BaseModel):
|
||||
"""Single error log entry"""
|
||||
|
||||
@@ -120,6 +128,7 @@ class ErrorLogEntry(BaseModel):
|
||||
file: str | None = Field(default=None, description="File where error occurred")
|
||||
line: int | None = Field(default=None, description="Line number")
|
||||
|
||||
|
||||
class ErrorLogResponse(BaseModel):
|
||||
"""Error log retrieval response"""
|
||||
|
||||
@@ -128,6 +137,7 @@ class ErrorLogResponse(BaseModel):
|
||||
filtered_lines: int = Field(description="Number of entries returned")
|
||||
log_size_mb: float = Field(description="Log file size in MB")
|
||||
|
||||
|
||||
class CacheStats(BaseModel):
|
||||
"""Cache statistics"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user