From 1b924333fae1accc54cef68e544613a72d6d6b22 Mon Sep 17 00:00:00 2001 From: jinsongwang Date: Sat, 30 May 2026 13:38:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B8=85=E7=90=86=E6=89=80=E6=9C=89?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=9C=AA=E4=BD=BF=E7=94=A8=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=20=E2=80=94=20ruff=20F401=20=E6=B8=85=E9=9B=B6=20(Issue=20#31)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 10 files modified, 27 unused imports removed - ruff check --select F401: 76 errors → 0 errors - 每个文件仅保留实际使用的 stdlib/typing 导入 - 测试: 277 passed Co-Authored-By: Claude Opus 4.8 --- agent_go/api.py | 3 +-- agent_go/cli.py | 5 ++--- agent_go/config.py | 3 +-- agent_go/executor.py | 7 ++----- agent_go/git_utils.py | 4 +--- agent_go/pipeline.py | 3 +-- agent_go/subtask.py | 5 ++--- agent_go/ui.py | 4 +--- agent_go/utils.py | 4 +--- agent_go/workflow_gen.py | 2 +- 10 files changed, 13 insertions(+), 27 deletions(-) diff --git a/agent_go/api.py b/agent_go/api.py index 710d4d9..8d5735f 100644 --- a/agent_go/api.py +++ b/agent_go/api.py @@ -1,5 +1,4 @@ -import sys, os, subprocess, json, re, time, threading, shlex, signal, logging -from concurrent.futures import ThreadPoolExecutor, as_completed +import json, re, time, logging from pathlib import Path from datetime import datetime from typing import Any, Optional diff --git a/agent_go/cli.py b/agent_go/cli.py index 3d6337b..7d6f9a0 100644 --- a/agent_go/cli.py +++ b/agent_go/cli.py @@ -1,5 +1,4 @@ -import sys, os, subprocess, json, re, time, threading, shlex, signal, logging, argparse -from concurrent.futures import ThreadPoolExecutor, as_completed +import sys, os, subprocess, json, time, logging, argparse from pathlib import Path from datetime import datetime from typing import Any, Optional @@ -11,7 +10,7 @@ from .ui import confirm_plan, plan_to_md, plan_to_subtasks, confirm_subtasks from .utils import read_reference_docs, _detect_tool_versions from .pipeline import _run_pipeline -from .skills import load_skill, load_skills, discover_skills, render_skill_for_plan, render_skill_for_execution, list_skills +from .skills import load_skills, discover_skills, render_skill_for_plan, list_skills from .agents import load_agent_type, list_agent_types from .eval import cmd_eval from .tui import cmd_status_tui diff --git a/agent_go/config.py b/agent_go/config.py index f81a8ef..a7173ea 100644 --- a/agent_go/config.py +++ b/agent_go/config.py @@ -1,5 +1,4 @@ -import sys, os, subprocess, json, re, time, threading, shlex, signal, logging -from concurrent.futures import ThreadPoolExecutor, as_completed +import os, json, logging from pathlib import Path from datetime import datetime from typing import Any diff --git a/agent_go/executor.py b/agent_go/executor.py index 87b3d5b..9a5e87b 100644 --- a/agent_go/executor.py +++ b/agent_go/executor.py @@ -1,10 +1,7 @@ -import sys, os, subprocess, json, re, time, threading, shlex, signal, logging, shutil -from concurrent.futures import ThreadPoolExecutor, as_completed -from pathlib import Path -from datetime import datetime +import os, subprocess, re, time, shlex, shutil from .config import log_event -from .utils import _format_commit, _safe_append_to_file, _is_safe_verification_command, _log_rejected_command, _slugify +from .utils import _format_commit, _is_safe_verification_command, _log_rejected_command from .subtask import _git_merge_upstream, _run_headless from .agents import load_agent_type, get_claude_command, get_agent_env from .git_utils import _worktree_create diff --git a/agent_go/git_utils.py b/agent_go/git_utils.py index e4f9ce1..158a943 100644 --- a/agent_go/git_utils.py +++ b/agent_go/git_utils.py @@ -1,7 +1,5 @@ -import sys, os, subprocess, json, re, time, threading, shlex, signal, logging -from concurrent.futures import ThreadPoolExecutor, as_completed +import subprocess, logging from pathlib import Path -from datetime import datetime from typing import Any logger = logging.getLogger(__name__) diff --git a/agent_go/pipeline.py b/agent_go/pipeline.py index b631fb3..0cc5659 100644 --- a/agent_go/pipeline.py +++ b/agent_go/pipeline.py @@ -1,7 +1,6 @@ -import sys, os, subprocess, json, re, time, threading, shlex, signal, logging +import sys, os, subprocess, json, threading, signal, logging from concurrent.futures import ThreadPoolExecutor, as_completed from pathlib import Path -from datetime import datetime from typing import Any, Optional logger = logging.getLogger(__name__) diff --git a/agent_go/subtask.py b/agent_go/subtask.py index 9358b7a..59b734b 100644 --- a/agent_go/subtask.py +++ b/agent_go/subtask.py @@ -1,8 +1,7 @@ -import sys, os, subprocess, json, re, time, threading, shlex, signal, logging -from concurrent.futures import ThreadPoolExecutor, as_completed +import subprocess, json, re, time, threading, logging from pathlib import Path from datetime import datetime -from typing import Any, Optional +from typing import Optional from .config import log_event diff --git a/agent_go/ui.py b/agent_go/ui.py index 9337889..9ce189c 100644 --- a/agent_go/ui.py +++ b/agent_go/ui.py @@ -1,7 +1,5 @@ -import sys, os, subprocess, json, re, time, threading, shlex, signal, logging -from concurrent.futures import ThreadPoolExecutor, as_completed +import sys, os, logging from pathlib import Path -from datetime import datetime from typing import Any, Optional from .config import safe_input, log_event diff --git a/agent_go/utils.py b/agent_go/utils.py index 9f6b1e2..e4b477b 100644 --- a/agent_go/utils.py +++ b/agent_go/utils.py @@ -1,8 +1,6 @@ -import sys, os, subprocess, json, re, time, threading, shlex, signal, logging -from concurrent.futures import ThreadPoolExecutor, as_completed +import subprocess, json, re, time, shlex, logging from pathlib import Path from datetime import datetime -from typing import Any __all__ = ["read_reference_docs", "SAFE_VERIFICATION_PREFIXES"] diff --git a/agent_go/workflow_gen.py b/agent_go/workflow_gen.py index a60f168..23371a6 100644 --- a/agent_go/workflow_gen.py +++ b/agent_go/workflow_gen.py @@ -1,7 +1,7 @@ """GitHub Actions workflow auto-generation.""" from pathlib import Path -from typing import Any, Optional +from typing import Optional __all__ = ["cmd_ci"]