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:
@@ -7,12 +7,14 @@ from typing import Any
|
||||
|
||||
from plugins.wordpress.client import WordPressClient
|
||||
|
||||
|
||||
def _count_words(html_content: str) -> int:
|
||||
"""Strip HTML tags and count words."""
|
||||
text = re.sub(r"<[^>]+>", " ", html_content)
|
||||
text = re.sub(r"\s+", " ", text).strip()
|
||||
return len(text.split()) if text else 0
|
||||
|
||||
|
||||
def _strip_html(html_content: str, max_chars: int = 500) -> str:
|
||||
"""Strip HTML tags and return first max_chars characters."""
|
||||
text = re.sub(r"<[^>]+>", " ", html_content)
|
||||
@@ -21,6 +23,7 @@ def _strip_html(html_content: str, max_chars: int = 500) -> str:
|
||||
return text[:max_chars] + "..."
|
||||
return text
|
||||
|
||||
|
||||
def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
"""Return tool specifications for ToolGenerator"""
|
||||
return [
|
||||
@@ -454,6 +457,7 @@ def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
class PostsHandler:
|
||||
"""Handle post-related operations for WordPress"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user