✨ 跟项目能跑起来就差这一步!这次狠狠修了一波: 🩺 修复40+损坏Python文件 - 补全所有缺少的class定义头(plugin-loader-pro、code-reviewer、 http-api/ws-api/http-tcp、webui/dashboard/log-terminal 等) - 修复中文括号、字符串未闭合、缩进错乱等语法问题 🔗 创建符号链接 plugin_bridge -> plugin-bridge - 解决Python模块路径不支持连字符的问题 - 关联修复 plugin-bridge 中错误的 import 路径 🧹 清理废弃代码 - 删除 oss/tui/ 目录(已废弃) - 清理所有 __pycache__ 和 .pyc 缓存文件 ✅ 全量语法检查通过,零错误! 📋 ai.md 新增代码审计报告和分阶段修复计划 🗺️ 所有插件 use() 调用现在走统一路径
50 lines
1.5 KiB
Python
50 lines
1.5 KiB
Python
class CodeReviewerPlugin:
|
|
def __init__(self):
|
|
self.reviewer = None
|
|
self.config = {}
|
|
|
|
def meta(self):
|
|
from oss.plugin.types import Metadata, PluginConfig, Manifest
|
|
return Manifest(
|
|
metadata=Metadata(
|
|
name="code-reviewer",
|
|
version="1.0.0",
|
|
author="NebulaShell",
|
|
description="代码审查器 - 自动扫描代码问题"
|
|
),
|
|
config=PluginConfig(
|
|
enabled=True,
|
|
args={
|
|
"scan_dirs": ["store", "oss"],
|
|
"exclude_patterns": ["__pycache__", "*.pyc"],
|
|
"max_file_size": 102400,
|
|
"report_format": "console"
|
|
}
|
|
),
|
|
dependencies=[]
|
|
)
|
|
|
|
def init(self, deps: dict = None):
|
|
config = {}
|
|
if deps:
|
|
config = deps.get("config", {})
|
|
|
|
self.config = {
|
|
"scan_dirs": config.get("scan_dirs", ["store", "oss"]),
|
|
"exclude_patterns": config.get("exclude_patterns", ["__pycache__"]),
|
|
"max_file_size": config.get("max_file_size", 102400),
|
|
"report_format": config.get("report_format", "console")
|
|
}
|
|
|
|
self.reviewer = CodeReviewer(self.config)
|
|
Log.info("code-reviewer", "初始化完成")
|
|
|
|
def start(self):
|
|
Log.info("code-reviewer", "插件已启动")
|
|
|
|
def stop(self):
|
|
Log.error("code-reviewer", "插件已停止")
|
|
|
|
def check(self, dirs: list = None) -> dict:
|
|
pass
|