diff --git a/apps/api/app/middleware/versioning.py b/apps/api/app/middleware/versioning.py index 48078fd7f..2563713a5 100644 --- a/apps/api/app/middleware/versioning.py +++ b/apps/api/app/middleware/versioning.py @@ -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) diff --git a/apps/worker/video_processing/trim_engine.py b/apps/worker/video_processing/trim_engine.py index ada3f373a..62bf6f88a 100755 --- a/apps/worker/video_processing/trim_engine.py +++ b/apps/worker/video_processing/trim_engine.py @@ -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] = [] diff --git a/pyproject.toml b/pyproject.toml index bba37e42e..cf71b34ae 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,7 +80,6 @@ select = [ # 与原 setup.cfg flake8 配置对齐,确保不新增阻断 ignore = [ "E203", - "W503", "E501", # line-too-long(black管) "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"] diff --git a/scripts/check_migration_safety.py b/scripts/check_migration_safety.py index 747181e8f..b01fb0387 100644 --- a/scripts/check_migration_safety.py +++ b/scripts/check_migration_safety.py @@ -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")) diff --git a/scripts/ci_notify.py b/scripts/ci_notify.py index 40f78e35b..f15e84802 100644 --- a/scripts/ci_notify.py +++ b/scripts/ci_notify.py @@ -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}"}}) diff --git a/scripts/init_phase6_tasks.py b/scripts/init_phase6_tasks.py index cf445f99a..73c822bc5 100644 --- a/scripts/init_phase6_tasks.py +++ b/scripts/init_phase6_tasks.py @@ -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)} 小时") diff --git a/scripts/init_tracker_data.py b/scripts/init_tracker_data.py index 180eb8cc3..78bdb5433 100644 --- a/scripts/init_tracker_data.py +++ b/scripts/init_tracker_data.py @@ -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__": diff --git a/tests/unit/test_config_schemas_and_ai_endpoints.py b/tests/unit/test_config_schemas_and_ai_endpoints.py index b2f2ee2dd..b79e2b75a 100644 --- a/tests/unit/test_config_schemas_and_ai_endpoints.py +++ b/tests/unit/test_config_schemas_and_ai_endpoints.py @@ -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):