refactor: replace Any types with specific types and update bad_code.md

- Replace Any with object or specific types across codebase
- Add ReviewRequest dataclass for PR review payloads
- Update bad_code.md: mark 5.1 (Any Type Overuse) as resolved
- Fix summary table with accurate counts and unresolved issues list
This commit is contained in:
meeks
2026-07-19 15:35:17 +02:00
parent aa9e8222a3
commit ae4e2d46ac
13 changed files with 326 additions and 169 deletions
+4 -4
View File
@@ -1,7 +1,7 @@
import asyncio
import logging
import lmstudio as lms
from typing import Any, Callable
from typing import Callable
from .prompt import CAVEMAN_PROMPT
logger: logging.Logger = logging.getLogger("agent-base")
@@ -13,7 +13,7 @@ class _ActResponseCapture:
def __init__(self) -> None:
self.responses: list[str] = []
def __call__(self, message: Any) -> None:
def __call__(self, message: object) -> None:
content: str = ""
if hasattr(message, 'content'):
content = message.content
@@ -58,7 +58,7 @@ class BaseAgent:
def __init__(self, model_name: str) -> None:
self.model_name: str = model_name
self.model: Any | None = None
self.model: object | None = None
self.system_prompt: str = ""
async def initialize(self) -> None:
@@ -87,7 +87,7 @@ class BaseAgent:
logger.error(f"Agent execution error: {e}")
return f"Error in agent execution: {str(e)}"
async def run_with_tools(self, user_input: str, tools: list[Any]) -> str:
async def run_with_tools(self, user_input: str, tools: list[object]) -> str:
"""Run the agent with tool calling capability."""
if self.model is None:
await self.initialize()