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:
@@ -5,6 +5,7 @@ from typing import Any
|
||||
|
||||
from plugins.gitea.client import GiteaClient
|
||||
|
||||
|
||||
def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
"""Return tool specifications for ToolGenerator"""
|
||||
return [
|
||||
@@ -160,12 +161,14 @@ def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
async def list_webhooks(client: GiteaClient, owner: str, repo: str) -> str:
|
||||
"""List repository webhooks"""
|
||||
webhooks = await client.list_webhooks(owner, repo)
|
||||
result = {"success": True, "count": len(webhooks), "webhooks": webhooks}
|
||||
return json.dumps(result, indent=2)
|
||||
|
||||
|
||||
async def create_webhook(
|
||||
client: GiteaClient,
|
||||
owner: str,
|
||||
@@ -193,12 +196,14 @@ async def create_webhook(
|
||||
}
|
||||
return json.dumps(result, indent=2)
|
||||
|
||||
|
||||
async def delete_webhook(client: GiteaClient, owner: str, repo: str, webhook_id: int) -> str:
|
||||
"""Delete a webhook"""
|
||||
await client.delete_webhook(owner, repo, webhook_id)
|
||||
result = {"success": True, "message": f"Webhook {webhook_id} deleted successfully"}
|
||||
return json.dumps(result, indent=2)
|
||||
|
||||
|
||||
async def test_webhook(client: GiteaClient, owner: str, repo: str, webhook_id: int) -> str:
|
||||
"""Test a webhook"""
|
||||
test_result = await client.test_webhook(owner, repo, webhook_id)
|
||||
@@ -209,6 +214,7 @@ async def test_webhook(client: GiteaClient, owner: str, repo: str, webhook_id: i
|
||||
}
|
||||
return json.dumps(result, indent=2)
|
||||
|
||||
|
||||
async def get_webhook(client: GiteaClient, owner: str, repo: str, webhook_id: int) -> str:
|
||||
"""Get webhook details"""
|
||||
webhook = await client.get_webhook(owner, repo, webhook_id)
|
||||
|
||||
Reference in New Issue
Block a user