Compare commits

...

1 Commits

Author SHA1 Message Date
CI Bot 6cbd08f666 fix(code-quality): 第一批代码质量修复 - 零风险项
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Successful in 2m30s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 2m44s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 3m5s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m28s
- 修复 ruff 配置:移除已废弃规则 W503/E704(ruff 0.14+ 不兼容)
- 修复 F541 (13处):f-string 无占位符改为普通字符串
- 修复 B017 (1处):pytest.raises(Exception) 改为 ValidationError
- 修复 vulture 死代码:trim_engine 中 if False 的三元表达式
- 修复 mypy var-annotated:SUNSET_VERSIONS 加类型标注
2026-07-15 00:51:36 +08:00
8 changed files with 20 additions and 19 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ class APIVersionMiddleware(BaseHTTPMiddleware):
class VersionNotFoundMiddleware(BaseHTTPMiddleware):
"""处理已下线的 API 版本"""
SUNSET_VERSIONS = [] # 已下线的版本列表
SUNSET_VERSIONS: list[str] = [] # 已下线的版本列表
async def dispatch(self, request: Request, call_next):
version = self._extract_version(request.url.path)
+2 -2
View File
@@ -186,8 +186,8 @@ class TrimEngine:
FFmpeg filter 字符串,如 "[0:v]trim=start=10:duration=5,setpts=PTS-STARTPTS[v0_trimmed]"
"""
if trim.is_noop:
# 不裁剪,直接直通
return f"{input_label}copy{output_label}" if False else f"{input_label}setpts=PTS-STARTPTS{output_label}"
# 不裁剪,直接直通(仅重置时间戳)
return f"{input_label}setpts=PTS-STARTPTS{output_label}"
parts: list[str] = []
+1 -2
View File
@@ -80,7 +80,6 @@ select = [
# 与原 setup.cfg flake8 配置对齐,确保不新增阻断
ignore = [
"E203",
"W503",
"E501", # line-too-longblack管)
"E302",
"E402", # module-import-not-at-top(循环导入多)
@@ -97,6 +96,6 @@ ignore = [
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403", "F405"]
"tests/*" = ["E402", "F401", "F841"]
"packages/ports/*" = ["E301", "E704"]
"packages/ports/*" = ["E301"]
"apps/*/migrations/*" = ["ALL"]
"alembic/*" = ["ALL"]
+1 -1
View File
@@ -123,7 +123,7 @@ def get_new_migrations_via_diff(diff_target: str) -> List[Path]:
return [REPO_ROOT / f for f in files]
except subprocess.CalledProcessError as e:
print(f"⚠️ git diff 失败({diff_target}):{e.stderr.strip()}")
print(f" 降级为检查所有迁移文件")
print(" 降级为检查所有迁移文件")
return sorted(ALEMBIC_VERSIONS_DIR.glob("*.py"))
+1 -1
View File
@@ -125,7 +125,7 @@ def main() -> int:
if mode != "start":
fields.append({"is_short": True, "text": {"tag": "lark_md", "content": f"**耗时**\n{duration}"}})
else:
fields.append({"is_short": True, "text": {"tag": "lark_md", "content": f"**状态**\n进行中"}})
fields.append({"is_short": True, "text": {"tag": "lark_md", "content": "**状态**\n进行中"}})
if runner_name:
fields.append({"is_short": True, "text": {"tag": "lark_md", "content": f"**Runner**\n{runner_name}"}})
+9 -9
View File
@@ -378,17 +378,17 @@ def init_phase6_tasks():
conn.commit()
conn.close()
print(f"\n[SUCCESS] Phase 6 任务初始化完成!")
print("\n[SUCCESS] Phase 6 任务初始化完成!")
print(f"📊 总计 {len(PHASE6_TASKS)} 个任务")
print(f"✅ 成功创建 {created_count} 个任务")
print(f"\n任务分布:")
print(f" Week 1-2: 基础搭建 - 7 个任务")
print(f" Week 3: 认证页面 - 5 个任务")
print(f" Week 4: 工作空间管理 - 6 个任务")
print(f" Week 5: 订阅管理 - 5 个任务")
print(f" Week 6: Admin 后台 - 5 个任务")
print(f" Week 7: 个人中心 - 4 个任务")
print(f" Week 8: 测试和优化 - 8 个任务")
print("\n任务分布:")
print(" Week 1-2: 基础搭建 - 7 个任务")
print(" Week 3: 认证页面 - 5 个任务")
print(" Week 4: 工作空间管理 - 6 个任务")
print(" Week 5: 订阅管理 - 5 个任务")
print(" Week 6: Admin 后台 - 5 个任务")
print(" Week 7: 个人中心 - 4 个任务")
print(" Week 8: 测试和优化 - 8 个任务")
print(f"\n预计总工时:{sum(t['estimated_hours'] for t in PHASE6_TASKS)} 小时")
+2 -2
View File
@@ -294,8 +294,8 @@ def main():
print("\n" + "=" * 60)
print("[OK] 数据初始化完成!")
print("=" * 60)
print(f"\n访问推进器: http://47.98.113.167:8088/projects")
print(f"访问 API 文档: http://47.98.113.167:8089/docs\n")
print("\n访问推进器: http://47.98.113.167:8088/projects")
print("访问 API 文档: http://47.98.113.167:8089/docs\n")
if __name__ == "__main__":
@@ -173,7 +173,9 @@ class TestConfigSchemas:
cfg = BGMConfig(volume=0.5)
assert cfg.volume == 0.5
with pytest.raises(Exception):
from pydantic import ValidationError
with pytest.raises(ValidationError):
BGMConfig(volume=1.5) # > 1.0 应该校验失败
def test_edit_plan_config_schema_full(self):