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:
airano
2026-02-17 18:19:39 +03:30
parent c9083d86b1
commit c73e39f6e4
135 changed files with 1185 additions and 317 deletions

View File

@@ -5,6 +5,7 @@ from typing import Any
from plugins.supabase.client import SupabaseClient
def get_tool_specifications() -> list[dict[str, Any]]:
"""Return tool specifications for ToolGenerator (18 tools)"""
return [
@@ -439,10 +440,12 @@ def get_tool_specifications() -> list[dict[str, Any]]:
},
]
# =====================
# PostgREST Operations (6)
# =====================
async def query_table(
client: SupabaseClient,
table: str,
@@ -478,6 +481,7 @@ async def query_table(
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
async def insert_rows(
client: SupabaseClient,
table: str,
@@ -509,6 +513,7 @@ async def insert_rows(
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
async def update_rows(
client: SupabaseClient,
table: str,
@@ -545,6 +550,7 @@ async def update_rows(
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
async def delete_rows(
client: SupabaseClient, table: str, filters: list[dict], use_service_role: bool = False
) -> str:
@@ -577,6 +583,7 @@ async def delete_rows(
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
async def execute_rpc(
client: SupabaseClient,
function_name: str,
@@ -597,6 +604,7 @@ async def execute_rpc(
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
async def count_rows(
client: SupabaseClient,
table: str,
@@ -622,10 +630,12 @@ async def count_rows(
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
# =====================
# Admin Operations via postgres-meta (12)
# =====================
async def list_tables(
client: SupabaseClient, schema: str = "public", limit: int = 50, offset: int = 0
) -> str:
@@ -660,6 +670,7 @@ async def list_tables(
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
async def get_table_schema(client: SupabaseClient, table: str, schema: str = "public") -> str:
"""Get table schema/columns"""
try:
@@ -678,6 +689,7 @@ async def get_table_schema(client: SupabaseClient, table: str, schema: str = "pu
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
async def list_schemas(client: SupabaseClient) -> str:
"""List all database schemas"""
try:
@@ -695,6 +707,7 @@ async def list_schemas(client: SupabaseClient) -> str:
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
async def list_extensions(client: SupabaseClient) -> str:
"""List installed extensions"""
try:
@@ -712,6 +725,7 @@ async def list_extensions(client: SupabaseClient) -> str:
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
async def list_policies(client: SupabaseClient, table: str | None = None) -> str:
"""List RLS policies"""
try:
@@ -730,6 +744,7 @@ async def list_policies(client: SupabaseClient, table: str | None = None) -> str
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
async def list_roles(client: SupabaseClient) -> str:
"""List database roles"""
try:
@@ -747,6 +762,7 @@ async def list_roles(client: SupabaseClient) -> str:
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
async def list_triggers(client: SupabaseClient, table: str | None = None) -> str:
"""List database triggers"""
try:
@@ -765,6 +781,7 @@ async def list_triggers(client: SupabaseClient, table: str | None = None) -> str
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
async def list_functions(
client: SupabaseClient, schema: str = "public", limit: int = 50, offset: int = 0
) -> str:
@@ -794,6 +811,7 @@ async def list_functions(
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
async def execute_sql(client: SupabaseClient, query: str) -> str:
"""Execute raw SQL query"""
try:
@@ -811,6 +829,7 @@ async def execute_sql(client: SupabaseClient, query: str) -> str:
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
async def get_table_indexes(client: SupabaseClient, table: str, schema: str = "public") -> str:
"""Get indexes for a table"""
try:
@@ -843,6 +862,7 @@ async def get_table_indexes(client: SupabaseClient, table: str, schema: str = "p
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
async def get_table_constraints(client: SupabaseClient, table: str, schema: str = "public") -> str:
"""Get constraints for a table"""
try:
@@ -877,6 +897,7 @@ async def get_table_constraints(client: SupabaseClient, table: str, schema: str
except Exception as e:
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
async def get_table_relationships(
client: SupabaseClient, table: str, schema: str = "public"
) -> str: