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 [
|
||||
@@ -190,12 +191,14 @@ def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
async def get_user(client: GiteaClient, username: str) -> str:
|
||||
"""Get user information"""
|
||||
user = await client.get_user(username)
|
||||
result = {"success": True, "user": user}
|
||||
return json.dumps(result, indent=2)
|
||||
|
||||
|
||||
async def list_user_repos(
|
||||
client: GiteaClient, username: str, page: int = 1, limit: int = 30
|
||||
) -> str:
|
||||
@@ -204,12 +207,14 @@ async def list_user_repos(
|
||||
result = {"success": True, "count": len(repos), "repositories": repos}
|
||||
return json.dumps(result, indent=2)
|
||||
|
||||
|
||||
async def search_users(client: GiteaClient, q: str | None = None, uid: int | None = None) -> str:
|
||||
"""Search users"""
|
||||
users = await client.search_users(query=q, uid=uid)
|
||||
result = {"success": True, "count": len(users), "users": users}
|
||||
return json.dumps(result, indent=2)
|
||||
|
||||
|
||||
# Organization operations
|
||||
async def list_organizations(client: GiteaClient, page: int = 1, limit: int = 30) -> str:
|
||||
"""List organizations"""
|
||||
@@ -217,18 +222,21 @@ async def list_organizations(client: GiteaClient, page: int = 1, limit: int = 30
|
||||
result = {"success": True, "count": len(orgs), "organizations": orgs}
|
||||
return json.dumps(result, indent=2)
|
||||
|
||||
|
||||
async def get_organization(client: GiteaClient, org: str) -> str:
|
||||
"""Get organization information"""
|
||||
organization = await client.get_organization(org)
|
||||
result = {"success": True, "organization": organization}
|
||||
return json.dumps(result, indent=2)
|
||||
|
||||
|
||||
async def list_org_repos(client: GiteaClient, org: str, page: int = 1, limit: int = 30) -> str:
|
||||
"""List organization repositories"""
|
||||
repos = await client.list_org_repos(org, page=page, limit=limit)
|
||||
result = {"success": True, "count": len(repos), "repositories": repos}
|
||||
return json.dumps(result, indent=2)
|
||||
|
||||
|
||||
# Team operations
|
||||
async def list_org_teams(client: GiteaClient, org: str, page: int = 1, limit: int = 30) -> str:
|
||||
"""List organization teams"""
|
||||
@@ -236,6 +244,7 @@ async def list_org_teams(client: GiteaClient, org: str, page: int = 1, limit: in
|
||||
result = {"success": True, "count": len(teams), "teams": teams}
|
||||
return json.dumps(result, indent=2)
|
||||
|
||||
|
||||
async def list_team_members(
|
||||
client: GiteaClient, team_id: int, page: int = 1, limit: int = 30
|
||||
) -> str:
|
||||
|
||||
Reference in New Issue
Block a user