Skip to content

Commit 32e25a7

Browse files
committed
fix: resolve all ruff lint errors (F401, F841, E741, I001)
Remove unused imports, fix unsorted import blocks, rename ambiguous variable, and remove unused local variable assignment.
1 parent 8fbc82e commit 32e25a7

File tree

9 files changed

+18
-27
lines changed

9 files changed

+18
-27
lines changed

pkg/hanzo-mcp/hanzo_mcp/zap_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import logging
1818
import struct
1919
import time
20-
from typing import Any, Callable, Awaitable
20+
from typing import Any, Awaitable, Callable
2121

2222
logger = logging.getLogger(__name__)
2323

pkg/hanzo-tools-code/hanzo_tools/code/code_tool.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@
1818
"""
1919

2020
import difflib
21-
import json
2221
import os
2322
from dataclasses import dataclass, field
2423
from pathlib import Path
2524
from typing import Any, ClassVar, Literal
2625

27-
from mcp.server import FastMCP
2826
from mcp.server.fastmcp import Context as MCPContext
2927

3028
from hanzo_tools.core import (
@@ -720,7 +718,7 @@ async def exports(ctx: MCPContext, path: str) -> dict:
720718
if not full_path.exists():
721719
raise NotFoundError(f"File not found: {path}")
722720
text = full_path.read_text()
723-
export_lines = [l.strip() for l in text.splitlines() if l.strip().startswith(("export ", "pub ", "__all__"))]
721+
export_lines = [line.strip() for line in text.splitlines() if line.strip().startswith(("export ", "pub ", "__all__"))]
724722
return {"uri": str(full_path), "exports": export_lines, "count": len(export_lines)}
725723

726724
@self.action("types", "Find type definitions in file")

pkg/hanzo-tools-memory/hanzo_tools/memory/memory_tool.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ async def _clear(self, scope: str) -> str:
573573
async def _export(self, scope: str, limit: int) -> str:
574574
"""Export memories as JSON."""
575575
import json as json_mod
576+
576577
from hanzo_tools.memory.markdown_memory import get_markdown_backend
577578
backend = get_markdown_backend()
578579
backend._ensure_loaded()

pkg/hanzo-tools-net/hanzo_tools/net/fetch_tool.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@
1111
"""
1212

1313
import asyncio
14-
import json
1514
import os
1615
import re
1716
from pathlib import Path
18-
from typing import Any, ClassVar
17+
from typing import ClassVar
1918
from urllib.parse import urljoin, urlparse
2019

21-
from mcp.server import FastMCP
2220
from mcp.server.fastmcp import Context as MCPContext
2321

2422
from hanzo_tools.core import (
@@ -523,7 +521,6 @@ async def open_url(
523521
Effect: NONDETERMINISTIC_EFFECT
524522
"""
525523
import platform
526-
import subprocess
527524

528525
system = platform.system().lower()
529526
if system == "darwin":

pkg/hanzo-tools-plan/hanzo_tools/plan/plan_tool.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
- execute: NONDETERMINISTIC (audit-friendly)
1515
"""
1616

17-
import json
1817
import re
1918
from dataclasses import dataclass, field
2019
from datetime import datetime, timezone
2120
from enum import Enum
2221
from typing import Any, ClassVar
2322

24-
from mcp.server import FastMCP
2523
from mcp.server.fastmcp import Context as MCPContext
2624

2725
from hanzo_tools.core import (

pkg/hanzo-tools-vcs/hanzo_tools/vcs/git_tool.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
"""
1515

1616
import asyncio
17-
import json
1817
import os
19-
from typing import Any, ClassVar
18+
from typing import ClassVar
2019

21-
from mcp.server import FastMCP
2220
from mcp.server.fastmcp import Context as MCPContext
2321

2422
from hanzo_tools.core import (
@@ -570,7 +568,6 @@ async def clean(ctx: MCPContext, force: bool = False, directories: bool = False,
570568

571569
@self.action("init", "Initialize repository")
572570
async def init(ctx: MCPContext, path: str | None = None, bare: bool = False, cwd: str | None = None) -> dict:
573-
work_dir = path or cwd or self.cwd
574571
args = ["init"]
575572
if bare:
576573
args.append("--bare")

pkg/hanzo-tools/hanzo_tools/core/unified.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ def register(self, mcp_server: FastMCP) -> None:
396396
from pydantic import ConfigDict
397397
from mcp.server.fastmcp.tools.base import Tool as FastMCPTool
398398
from mcp.server.fastmcp.utilities.func_metadata import (
399-
FuncMetadata,
400399
ArgModelBase,
400+
FuncMetadata,
401401
)
402402

403403
tool_name = self.name

tests/conformance/benchmark_parallel.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212

1313
from __future__ import annotations
1414

15-
import asyncio
16-
import json
1715
import os
18-
import statistics
1916
import sys
20-
import tempfile
17+
import json
2118
import time
22-
from dataclasses import dataclass, field
23-
from pathlib import Path
19+
import asyncio
20+
import tempfile
21+
import statistics
2422
from typing import Any
23+
from pathlib import Path
24+
from dataclasses import field, dataclass
2525

2626
HANZO_ROOT = Path(os.environ.get("HANZO_ROOT", Path.home() / "work" / "hanzo"))
2727
TIMEOUT = 30

tests/conformance/run_conformance.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525

2626
from __future__ import annotations
2727

28-
import asyncio
29-
import json
3028
import os
3129
import re
32-
import shutil
3330
import sys
34-
import tempfile
31+
import json
3532
import time
36-
from dataclasses import dataclass, field
37-
from pathlib import Path
33+
import shutil
34+
import asyncio
35+
import tempfile
3836
from typing import Any
37+
from pathlib import Path
38+
from dataclasses import field, dataclass
3939

4040
# ── Configuration ─────────────────────────────────────────────────────────────
4141

0 commit comments

Comments
 (0)