Skip to content

Commit 6ec921e

Browse files
committed
fix: Resolve ruff linting violations in CI/CD code
- Remove unused variables (run_id, defaults, result) - Remove unused imports - Fix f-string without placeholders All CI/CD integration files now pass ruff checks.
1 parent 5f0f241 commit 6ec921e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+102
-161
lines changed

ai/src/fuzzforge_ai/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ def create_a2a_app():
7878
print("\033[0m") # Reset color
7979

8080
# Create A2A app
81-
print(f"🚀 Starting FuzzForge A2A Server")
81+
print("🚀 Starting FuzzForge A2A Server")
8282
print(f" Model: {fuzzforge.model}")
8383
if fuzzforge.cognee_url:
8484
print(f" Memory: Cognee at {fuzzforge.cognee_url}")
8585
print(f" Port: {port}")
8686

8787
app = create_custom_a2a_app(fuzzforge.adk_agent, port=port, executor=fuzzforge.executor)
8888

89-
print(f"\n✅ FuzzForge A2A Server ready!")
89+
print("\n✅ FuzzForge A2A Server ready!")
9090
print(f" Agent card: http://localhost:{port}/.well-known/agent-card.json")
9191
print(f" A2A endpoint: http://localhost:{port}/")
9292
print(f"\n📡 Other agents can register FuzzForge at: http://localhost:{port}")
@@ -101,7 +101,7 @@ def main():
101101
app = create_a2a_app()
102102
port = int(os.getenv('FUZZFORGE_PORT', 10100))
103103

104-
print(f"\n🎯 Starting server with uvicorn...")
104+
print("\n🎯 Starting server with uvicorn...")
105105
uvicorn.run(app, host="127.0.0.1", port=port)
106106

107107

ai/src/fuzzforge_ai/a2a_server.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
from starlette.applications import Starlette
2020
from starlette.responses import Response, FileResponse
21-
from starlette.routing import Route
2221

2322
from google.adk.a2a.executor.a2a_agent_executor import A2aAgentExecutor
2423
from google.adk.a2a.utils.agent_card_builder import AgentCardBuilder

ai/src/fuzzforge_ai/agent_card.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
from dataclasses import dataclass
18-
from typing import List, Optional, Dict, Any
18+
from typing import List, Dict, Any
1919

2020
@dataclass
2121
class AgentSkill:

ai/src/fuzzforge_ai/agent_executor.py

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

1313

1414
import asyncio
15-
import base64
1615
import time
1716
import uuid
1817
import json
@@ -392,7 +391,7 @@ async def search_project_knowledge(query: str, dataset: str, search_type: str) -
392391
user_email = f"project_{config.get_project_context()['project_id']}@fuzzforge.example"
393392
user = await get_user(user_email)
394393
cognee.set_user(user)
395-
except Exception as e:
394+
except Exception:
396395
pass # User context not critical
397396

398397
# Use cognee search directly for maximum flexibility
@@ -583,7 +582,6 @@ async def list_project_files(path: str, pattern: str) -> str:
583582
pattern: Glob pattern (e.g. '*.py', '**/*.js', '')
584583
"""
585584
try:
586-
from pathlib import Path
587585

588586
# Get project root from config
589587
config = ProjectConfigManager()
@@ -648,7 +646,6 @@ async def read_project_file(file_path: str, max_lines: int) -> str:
648646
max_lines: Maximum lines to read (0 for all, default 200 for large files)
649647
"""
650648
try:
651-
from pathlib import Path
652649

653650
# Get project root from config
654651
config = ProjectConfigManager()
@@ -711,7 +708,6 @@ async def search_project_files(search_pattern: str, file_pattern: str, path: str
711708
"""
712709
try:
713710
import re
714-
from pathlib import Path
715711

716712
# Get project root from config
717713
config = ProjectConfigManager()
@@ -757,7 +753,7 @@ async def search_project_files(search_pattern: str, file_pattern: str, path: str
757753
result = f"Found '{search_pattern}' in {len(matches)} locations (searched {files_searched} files):\n"
758754
result += "\n".join(matches[:50])
759755
if len(matches) >= 50:
760-
result += f"\n... (showing first 50 matches)"
756+
result += "\n... (showing first 50 matches)"
761757
return result
762758
else:
763759
return f"No matches found for '{search_pattern}' in {files_searched} files matching '{file_pattern}'"
@@ -1088,7 +1084,7 @@ async def get_task_list(task_list_id: str) -> str:
10881084

10891085
def _build_instruction(self) -> str:
10901086
"""Build the agent's instruction prompt"""
1091-
instruction = f"""You are FuzzForge, an intelligent A2A orchestrator with dual memory systems.
1087+
instruction = """You are FuzzForge, an intelligent A2A orchestrator with dual memory systems.
10921088
10931089
## Your Core Responsibilities:
10941090

ai/src/fuzzforge_ai/cli.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from datetime import datetime
2727
from contextlib import contextmanager
2828
from pathlib import Path
29-
from typing import Any
3029

3130
from dotenv import load_dotenv
3231

@@ -90,18 +89,12 @@
9089
from rich.console import Console
9190
from rich.table import Table
9291
from rich.panel import Panel
93-
from rich.prompt import Prompt
9492
from rich import box
9593

96-
from google.adk.events.event import Event
97-
from google.adk.events.event_actions import EventActions
98-
from google.genai import types as gen_types
9994

10095
from .agent import FuzzForgeAgent
101-
from .agent_card import get_fuzzforge_agent_card
10296
from .config_manager import ConfigManager
10397
from .config_bridge import ProjectConfigManager
104-
from .remote_agent import RemoteAgentConnection
10598

10699
console = Console()
107100

@@ -243,7 +236,7 @@ def print_banner(self):
243236
)
244237
)
245238
if self.agent.executor.agentops_trace:
246-
console.print(f"Tracking: [medium_purple1]AgentOps active[/medium_purple1]")
239+
console.print("Tracking: [medium_purple1]AgentOps active[/medium_purple1]")
247240

248241
# Show skills
249242
console.print("\nSkills:")
@@ -320,7 +313,7 @@ async def cmd_register(self, args: str) -> None:
320313
url=args.strip(),
321314
description=description
322315
)
323-
console.print(f" [dim]Saved to config for auto-registration[/dim]")
316+
console.print(" [dim]Saved to config for auto-registration[/dim]")
324317
else:
325318
console.print(f"[red]Failed: {result['error']}[/red]")
326319

@@ -346,9 +339,9 @@ async def cmd_unregister(self, args: str) -> None:
346339
# Remove from config
347340
if self.config_manager.remove_registered_agent(name=agent_to_remove['name'], url=agent_to_remove['url']):
348341
console.print(f"✅ Unregistered: [bold]{agent_to_remove['name']}[/bold]")
349-
console.print(f" [dim]Removed from config (won't auto-register next time)[/dim]")
342+
console.print(" [dim]Removed from config (won't auto-register next time)[/dim]")
350343
else:
351-
console.print(f"[yellow]Agent unregistered from session but not found in config[/yellow]")
344+
console.print("[yellow]Agent unregistered from session but not found in config[/yellow]")
352345

353346
async def cmd_list(self, args: str = "") -> None:
354347
"""List registered agents"""
@@ -699,7 +692,7 @@ async def cmd_artifacts(self, args: str = "") -> None:
699692
)
700693

701694
console.print(table)
702-
console.print(f"\n[dim]Use /artifacts <id> to view artifact content[/dim]")
695+
console.print("\n[dim]Use /artifacts <id> to view artifact content[/dim]")
703696

704697
async def cmd_tasks(self, args: str = "") -> None:
705698
"""List tasks or show details for a specific task."""

ai/src/fuzzforge_ai/cognee_integration.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616

1717

1818
import os
19-
import asyncio
20-
import json
21-
from typing import Dict, List, Any, Optional, Union
19+
from typing import Dict, Any, Optional
2220
from pathlib import Path
2321

2422

ai/src/fuzzforge_ai/cognee_service.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@
1515

1616

1717
import os
18-
import asyncio
1918
import logging
2019
from pathlib import Path
21-
from typing import Dict, List, Any, Optional
22-
from datetime import datetime
20+
from typing import Dict, List, Any
2321

2422
logger = logging.getLogger(__name__)
2523

ai/src/fuzzforge_ai/config_bridge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
try:
1515
from fuzzforge_cli.config import ProjectConfigManager as _ProjectConfigManager
16-
except ImportError as exc: # pragma: no cover - used when CLI not available
16+
except ImportError: # pragma: no cover - used when CLI not available
1717
class _ProjectConfigManager: # type: ignore[no-redef]
1818
"""Fallback implementation that raises a helpful error."""
1919

ai/src/fuzzforge_ai/memory_service.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,12 @@
1616

1717

1818
import os
19-
import json
20-
from typing import Dict, List, Any, Optional
21-
from datetime import datetime
19+
from typing import Dict, Any
2220
import logging
2321

2422
# ADK Memory imports
2523
from google.adk.memory import InMemoryMemoryService, BaseMemoryService
2624
from google.adk.memory.base_memory_service import SearchMemoryResponse
27-
from google.adk.memory.memory_entry import MemoryEntry
2825

2926
# Optional VertexAI Memory Bank
3027
try:

backend/toolbox/workflows/ossfuzz_campaign/workflow.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ async def run(
5757
Dictionary containing crashes, stats, and SARIF report
5858
"""
5959
workflow_id = workflow.info().workflow_id
60-
run_id = workflow.info().run_id
6160

6261
workflow.logger.info(
6362
f"Starting OSS-Fuzz Campaign for project '{project_name}' "

0 commit comments

Comments
 (0)