chore: apply ruff auto-fixes and remove dead AST scripts

This commit is contained in:
2026-03-02 13:26:20 -05:00
parent 54635d8d1c
commit b9686392d7
114 changed files with 79 additions and 953 deletions

View File

@@ -9,7 +9,7 @@ import ast
import re
import sys
import os
from typing import Any, Callable
from typing import Any
BASE: str = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
stats: dict[str, Any] = {"auto_none": 0, "manual_sig": 0, "vars": 0, "errors": []}
@@ -332,7 +332,7 @@ if __name__ == "__main__":
print(f" {f}: {r}")
if "Error" in r:
all_ok = False
print(f"\n=== Summary ===")
print("\n=== Summary ===")
print(f" Auto -> None: {stats['auto_none']}")
print(f" Manual sigs: {stats['manual_sig']}")
print(f" Variables: {stats['vars']}")

View File

@@ -1,5 +1,3 @@
import re
import sys
files = ['ai_client.py', 'aggregate.py', 'mcp_client.py', 'shell_runner.py']
for file_path in files:

View File

@@ -1,5 +1,4 @@
import re
import sys
files = ['ai_client.py', 'aggregate.py', 'mcp_client.py', 'shell_runner.py']
for file_path in files:

View File

@@ -97,7 +97,7 @@ def main():
}))
return
if hook_context == "mma_headless":
logging.debug(f"GEMINI_CLI_HOOK_CONTEXT is 'mma_headless'. Allowing execution for sub-agent.")
logging.debug("GEMINI_CLI_HOOK_CONTEXT is 'mma_headless'. Allowing execution for sub-agent.")
print(json.dumps({
"decision": "allow",
"reason": "Sub-agent headless mode (MMA)."

View File

@@ -1,4 +1,3 @@
import os
import re
with open('mcp_client.py', 'r', encoding='utf-8') as f:

View File

@@ -211,19 +211,19 @@ def execute_agent(role: str, prompt: str, docs: list[str], debug: bool = False,
env = os.environ.copy()
env["GEMINI_CLI_HOOK_CONTEXT"] = "mma_headless"
if debug:
print(f"--- MMA DEBUG ---")
print("--- MMA DEBUG ---")
print(f"Executing Command: {cmd}")
print(f"Relevant Environment Variables:")
print("Relevant Environment Variables:")
for key, value in env.items():
if key.startswith("GEMINI_CLI_"):
print(f" {key}={value}")
process = subprocess.run(cmd, input=command_text, capture_output=True, text=True, encoding='utf-8', env=env)
if debug:
print(f"Subprocess Result:")
print("Subprocess Result:")
print(f" Return Code: {process.returncode}")
print(f" Stdout: {process.stdout[:1000]}...")
print(f" Stderr: {process.stderr}")
print(f"--- END DEBUG ---")
print("--- END DEBUG ---")
result = process.stdout
if not process.stdout and process.stderr:
result = f"Error: {process.stderr}"

View File

@@ -1,5 +1,6 @@
"""Scan all .py files for missing type hints. Writes scan_report.txt."""
import ast, os
import ast
import os
SKIP: set[str] = {'.git', '__pycache__', '.venv', 'venv', 'node_modules', '.claude', '.gemini'}
BASE: str = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))