fix: auto-fix code issues (cron)

- 修复重复导入/字段
- 修复异常处理
- 修复PEP8格式问题
- 添加类型注解
This commit is contained in:
OpenClaw Bot
2026-02-28 09:11:38 +08:00
parent 210cae132f
commit 74c2daa5ef
37 changed files with 1135 additions and 1145 deletions

View File

@@ -20,7 +20,6 @@ from search_manager import (
# 添加 backend 到路径
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
def test_fulltext_search():
"""测试全文搜索"""
print("\n" + "=" * 60)
@@ -63,7 +62,6 @@ def test_fulltext_search():
print("\n✓ 全文搜索测试完成")
return True
def test_semantic_search():
"""测试语义搜索"""
print("\n" + "=" * 60)
@@ -99,7 +97,6 @@ def test_semantic_search():
print("\n✓ 语义搜索测试完成")
return True
def test_entity_path_discovery():
"""测试实体路径发现"""
print("\n" + "=" * 60)
@@ -118,7 +115,6 @@ def test_entity_path_discovery():
print("\n✓ 实体路径发现测试完成")
return True
def test_knowledge_gap_detection():
"""测试知识缺口识别"""
print("\n" + "=" * 60)
@@ -137,7 +133,6 @@ def test_knowledge_gap_detection():
print("\n✓ 知识缺口识别测试完成")
return True
def test_cache_manager():
"""测试缓存管理器"""
print("\n" + "=" * 60)
@@ -185,7 +180,6 @@ def test_cache_manager():
print("\n✓ 缓存管理器测试完成")
return True
def test_task_queue():
"""测试任务队列"""
print("\n" + "=" * 60)
@@ -226,7 +220,6 @@ def test_task_queue():
print("\n✓ 任务队列测试完成")
return True
def test_performance_monitor():
"""测试性能监控"""
print("\n" + "=" * 60)
@@ -273,7 +266,6 @@ def test_performance_monitor():
print("\n✓ 性能监控测试完成")
return True
def test_search_manager():
"""测试搜索管理器"""
print("\n" + "=" * 60)
@@ -294,7 +286,6 @@ def test_search_manager():
print("\n✓ 搜索管理器测试完成")
return True
def test_performance_manager():
"""测试性能管理器"""
print("\n" + "=" * 60)
@@ -319,7 +310,6 @@ def test_performance_manager():
print("\n✓ 性能管理器测试完成")
return True
def run_all_tests():
"""运行所有测试"""
print("\n" + "=" * 60)
@@ -406,7 +396,6 @@ def run_all_tests():
return passed == total
if __name__ == "__main__":
success = run_all_tests()
sys.exit(0 if success else 1)