-
Notifications
You must be signed in to change notification settings - Fork 0
Rename translation keys to sakuraflow namespace and add CI/tests
#3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d01ba2a
Rename translation keys to `sakuraflow` namespace and add CI/tests
Sakura-Ex 83d41e9
Initial plan
Copilot df03675
Fix test_smoke.py to use absolute path for metadata file check
Copilot 959d487
Merge pull request #4 from Sakura-Ex/copilot/sub-pr-3
Sakura-Ex b561f89
Refactor translation key scanning and clean up imports
Sakura-Ex 9572a9f
Merge remote-tracking branch 'origin/feat/test-workflow' into feat/te…
Sakura-Ex 7794420
Refactor translation key scanning and clean up imports
Sakura-Ex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - dev | ||
| paths-ignore: | ||
| - '**.md' | ||
| - '.gitignore' | ||
| - '.idea/**' | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - dev | ||
| paths-ignore: | ||
| - '**.md' | ||
| - '.gitignore' | ||
| - '.idea/**' | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.11"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/pip | ||
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pip- | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install flake8 pytest | ||
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
|
|
||
| - name: Lint with flake8 | ||
| run: | | ||
| # 1. 检查严重错误和不安全的导入习惯 | ||
| # E9: 语法错误 | ||
| # F63: 总是为真的测试 | ||
| # F7: 编译错误 | ||
| # F82: 未定义的变量 | ||
| # F401: 导入但未使用的模块 | ||
| # F403: 使用了 'from module import *' | ||
| flake8 . --count --select=E9,F63,F7,F82,F401,F403 --show-source --statistics | ||
|
|
||
| # 2. 其他风格检查 (作为警告,不中断构建) | ||
| flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
|
|
||
| - name: Run tests | ||
| run: | | ||
| # 确保当前目录在 PYTHONPATH 中,以便测试脚本可以导入插件包 | ||
| export PYTHONPATH=$PYTHONPATH:. | ||
| # 运行所有测试并显示详细输出 | ||
| pytest -v | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,120 +1,120 @@ | ||
| { | ||
| "todo.common.task": "任务", | ||
| "todo.common.creator": "创建者", | ||
| "todo.common.tier": "等级", | ||
| "todo.common.priority": "优先级", | ||
| "todo.common.collaborators": "负责人", | ||
| "todo.common.dependencies": "前置依赖", | ||
| "todo.common.status": "状态", | ||
| "todo.common.description": "描述", | ||
| "todo.common.unknown": "未知", | ||
| "todo.common.unassigned": "未分配", | ||
| "todo.common.none": "无", | ||
| "todo.common.usage": "用法", | ||
| "todo.common.alias": "缩写", | ||
| "todo.common.labels": "任务标签", | ||
| "todo.common.title": "标题", | ||
| "sakuraflow.common.task": "任务", | ||
| "sakuraflow.common.creator": "创建者", | ||
| "sakuraflow.common.tier": "等级", | ||
| "sakuraflow.common.priority": "优先级", | ||
| "sakuraflow.common.collaborators": "负责人", | ||
| "sakuraflow.common.dependencies": "前置依赖", | ||
| "sakuraflow.common.status": "状态", | ||
| "sakuraflow.common.description": "描述", | ||
| "sakuraflow.common.unknown": "未知", | ||
| "sakuraflow.common.unassigned": "未分配", | ||
| "sakuraflow.common.none": "无", | ||
| "sakuraflow.common.usage": "用法", | ||
| "sakuraflow.common.alias": "缩写", | ||
| "sakuraflow.common.labels": "任务标签", | ||
| "sakuraflow.common.title": "标题", | ||
|
|
||
| "todo.prop.title": "任务标题", | ||
| "todo.prop.description": "任务描述", | ||
| "todo.prop.status": "任务状态", | ||
| "todo.prop.tier": "电压等级", | ||
| "todo.prop.priority": "优先级", | ||
| "todo.prop.collaborators": "协作人员", | ||
| "todo.prop.dependencies": "前置依赖", | ||
| "todo.prop.labels": "任务标签", | ||
| "sakuraflow.prop.title": "任务标题", | ||
| "sakuraflow.prop.description": "任务描述", | ||
| "sakuraflow.prop.status": "任务状态", | ||
| "sakuraflow.prop.tier": "电压等级", | ||
| "sakuraflow.prop.priority": "优先级", | ||
| "sakuraflow.prop.collaborators": "协作人员", | ||
| "sakuraflow.prop.dependencies": "前置依赖", | ||
| "sakuraflow.prop.labels": "任务标签", | ||
|
|
||
| "todo.action.restore": "恢复任务", | ||
| "todo.action.resume": "恢复", | ||
| "todo.action.pause": "暂停", | ||
| "todo.action.complete": "完工", | ||
| "todo.action.note": "笔记", | ||
| "todo.action.claim": "认领", | ||
| "todo.action.append": "追加", | ||
| "todo.action.modify": "修改", | ||
| "todo.action.remove": "移除", | ||
| "todo.action.prev_page": "上一页", | ||
| "todo.action.next_page": "下一页", | ||
| "sakuraflow.action.restore": "恢复任务", | ||
| "sakuraflow.action.resume": "恢复", | ||
| "sakuraflow.action.pause": "暂停", | ||
| "sakuraflow.action.complete": "完工", | ||
| "sakuraflow.action.note": "笔记", | ||
| "sakuraflow.action.claim": "认领", | ||
| "sakuraflow.action.append": "追加", | ||
| "sakuraflow.action.modify": "修改", | ||
| "sakuraflow.action.remove": "移除", | ||
| "sakuraflow.action.prev_page": "上一页", | ||
| "sakuraflow.action.next_page": "下一页", | ||
|
|
||
| "todo.status.done": "已完成", | ||
| "todo.status.in_progress": "进行中", | ||
| "todo.status.on_hold": "挂起", | ||
| "sakuraflow.status.done": "已完成", | ||
| "sakuraflow.status.in_progress": "进行中", | ||
| "sakuraflow.status.on_hold": "挂起", | ||
|
|
||
| "todo.priority.very_high": "非常高", | ||
| "todo.priority.high": "高", | ||
| "todo.priority.medium": "中", | ||
| "todo.priority.low": "低", | ||
| "todo.priority.very_low": "非常低", | ||
| "sakuraflow.priority.very_high": "非常高", | ||
| "sakuraflow.priority.high": "高", | ||
| "sakuraflow.priority.medium": "中", | ||
| "sakuraflow.priority.low": "低", | ||
| "sakuraflow.priority.very_low": "非常低", | ||
|
|
||
| "todo.ui.hover.latest_progress": "最新进展", | ||
| "todo.ui.hover.waiting_record": "等待记录", | ||
| "todo.ui.hover.click_to_action": "点击{0}{1}", | ||
| "todo.ui.hover.remove_hint": "使用 {0} remove 移除项", | ||
| "sakuraflow.ui.hover.latest_progress": "最新进展", | ||
| "sakuraflow.ui.hover.waiting_record": "等待记录", | ||
| "sakuraflow.ui.hover.click_to_action": "点击{0}{1}", | ||
| "sakuraflow.ui.hover.remove_hint": "使用 {0} remove 移除项", | ||
|
|
||
| "todo.ui.info.header": "任务详情 #{0}", | ||
| "todo.ui.info.no_desc": "暂无描述", | ||
| "todo.ui.info.progress_header": "任务进度记录", | ||
| "todo.ui.info.no_records": "暂无记录", | ||
| "todo.ui.info.invalid_dep": "已失效", | ||
| "sakuraflow.ui.info.header": "任务详情 #{0}", | ||
| "sakuraflow.ui.info.no_desc": "暂无描述", | ||
| "sakuraflow.ui.info.progress_header": "任务进度记录", | ||
| "sakuraflow.ui.info.no_records": "暂无记录", | ||
| "sakuraflow.ui.info.invalid_dep": "已失效", | ||
|
|
||
| "todo.help.header": "TodoList 指令帮助", | ||
| "todo.help.hint": "提示:点击可填充指令至聊天栏;鼠标移至指令上方查看详情", | ||
| "todo.help.list": "查看进行中任务清单", | ||
| "todo.help.archive": "查看已完成归档记录", | ||
| "todo.help.search": "搜索任务 (支持多条件: t=标题 s=!Done)", | ||
| "todo.help.add": "立项一个新的任务", | ||
| "todo.help.info": "查询特定任务的详细信息", | ||
| "todo.help.note": "追加一条任务进度记录", | ||
| "todo.help.set": "修改任务的核心属性", | ||
| "todo.help.append": "向任务追加协作人或依赖", | ||
| "todo.help.remove": "从任务中移除协作人或依赖", | ||
| "todo.help.pause": "挂起当前任务", | ||
| "todo.help.resume": "恢复挂起任务", | ||
| "todo.help.complete": "标记任务完工并归档", | ||
| "todo.help.restore": "将已完成任务重新激活", | ||
| "sakuraflow.help.header": "TodoList 指令帮助", | ||
| "sakuraflow.help.hint": "提示:点击可填充指令至聊天栏;鼠标移至指令上方查看详情", | ||
| "sakuraflow.help.list": "查看进行中任务清单", | ||
| "sakuraflow.help.archive": "查看已完成归档记录", | ||
| "sakuraflow.help.search": "搜索任务 (支持多条件: t=标题 s=!Done)", | ||
| "sakuraflow.help.add": "立项一个新的任务", | ||
| "sakuraflow.help.info": "查询特定任务的详细信息", | ||
| "sakuraflow.help.note": "追加一条任务进度记录", | ||
| "sakuraflow.help.set": "修改任务的核心属性", | ||
| "sakuraflow.help.append": "向任务追加协作人或依赖", | ||
| "sakuraflow.help.remove": "从任务中移除协作人或依赖", | ||
| "sakuraflow.help.pause": "挂起当前任务", | ||
| "sakuraflow.help.resume": "恢复挂起任务", | ||
| "sakuraflow.help.complete": "标记任务完工并归档", | ||
| "sakuraflow.help.restore": "将已完成任务重新激活", | ||
|
|
||
| "todo.help.desc.set.main": "修改任务属性。电压(t): 0-14对应(ULV-MAX);优先级(p): 0=Very High, 4=Very Low", | ||
| "todo.help.available_props": "可用属性:", | ||
| "todo.help.desc.list.main": "向任务的列表字段中追加或移除项。依赖项需为有效的任务ID。", | ||
| "todo.help.available_lists": "可用列表:", | ||
| "sakuraflow.help.desc.set.main": "修改任务属性。电压(t): 0-14对应(ULV-MAX);优先级(p): 0=Very High, 4=Very Low", | ||
| "sakuraflow.help.available_props": "可用属性:", | ||
| "sakuraflow.help.desc.list.main": "向任务的列表字段中追加或移除项。依赖项需为有效的任务ID。", | ||
| "sakuraflow.help.available_lists": "可用列表:", | ||
|
|
||
| "todo.welcome.header": "TodoList", | ||
| "todo.welcome.line1": "欢迎使用待办事项管理插件。", | ||
| "todo.welcome.line2": "本插件能够协助管理复杂的流程,支持任务追踪、等级标记及协作管理。", | ||
| "todo.welcome.btn_line": "可用快捷操作", | ||
| "todo.welcome.btn.help": "查看帮助", | ||
| "todo.welcome.hover.help": "点击查看帮助", | ||
| "todo.welcome.btn.list": "任务列表", | ||
| "todo.welcome.hover.list": "点击查看未完成任务", | ||
| "todo.welcome.btn.add": "新建任务", | ||
| "todo.welcome.hover.add": "点击填充新建指令", | ||
| "sakuraflow.welcome.header": "TodoList", | ||
| "sakuraflow.welcome.line1": "欢迎使用待办事项管理插件。", | ||
| "sakuraflow.welcome.line2": "本插件能够协助管理复杂的流程,支持任务追踪、等级标记及协作管理。", | ||
| "sakuraflow.welcome.btn_line": "可用快捷操作", | ||
| "sakuraflow.welcome.btn.help": "查看帮助", | ||
| "sakuraflow.welcome.hover.help": "点击查看帮助", | ||
| "sakuraflow.welcome.btn.list": "任务列表", | ||
| "sakuraflow.welcome.hover.list": "点击查看未完成任务", | ||
| "sakuraflow.welcome.btn.add": "新建任务", | ||
| "sakuraflow.welcome.hover.add": "点击填充新建指令", | ||
|
|
||
| "todo.list.header": "任务列表", | ||
| "todo.list.empty": "当前没有进行中的任务", | ||
| "todo.archive.header": "已归档任务", | ||
| "todo.archive.empty": "归档记录为空", | ||
| "todo.search.header": "搜索结果", | ||
| "todo.search.empty": "未找到匹配的任务", | ||
| "todo.search.more_results": "... 还有 {0} 条结果", | ||
| "todo.search.cache_expired": "搜索缓存已过期,请重新输入查询条件", | ||
| "sakuraflow.list.header": "任务列表", | ||
| "sakuraflow.list.empty": "当前没有进行中的任务", | ||
| "sakuraflow.archive.header": "已归档任务", | ||
| "sakuraflow.archive.empty": "归档记录为空", | ||
| "sakuraflow.search.header": "搜索结果", | ||
| "sakuraflow.search.empty": "未找到匹配的任务", | ||
| "sakuraflow.search.more_results": "... 还有 {0} 条结果", | ||
| "sakuraflow.search.cache_expired": "搜索缓存已过期,请重新输入查询条件", | ||
|
|
||
| "todo.msg.add_success": "任务 {0} 已成功立项!", | ||
| "todo.msg.not_found": "未找到任务 ID", | ||
| "todo.msg.invalid_list_alias": "无效列表别称: {0}", | ||
| "todo.msg.dep_not_found": "引用错误:任务 #{0} 不存在,无法添加为前置依赖", | ||
| "todo.msg.append_success": "已向任务 #{0} 列表 {1} 追加: {2}", | ||
| "todo.msg.remove_success": "已从任务 #{0} 的 {1} 中移除: {2}", | ||
| "todo.msg.remove_failed": "移除失败:项 {0} 不在列表内或任务 ID 错误", | ||
| "todo.msg.invalid_prop_alias": "无效属性别称: {0}", | ||
| "todo.msg.invalid_tier": "无效的电压等级!请输入 0-{0} 或名称: {1}", | ||
| "todo.msg.invalid_priority": "无效优先级!请输入 0-4 或名称: {0}", | ||
| "todo.msg.invalid_status": "无效状态!请输入: {0}", | ||
| "todo.msg.set_success": "任务 #{0} 属性 {1} 已更新为 {2}", | ||
| "todo.msg.note_success": "进度已记录至任务 #{0}", | ||
| "todo.msg.restore_success": "任务 #{0} 已从归档中恢复至进行中状态 ▶", | ||
| "todo.msg.complete_success": "任务 #{0} 已完工并移入归档 ✔", | ||
| "todo.msg.pause_success": "任务 #{0} 已标记为暂停 ⏸", | ||
| "todo.msg.resume_success": "任务 #{0} 已恢复运行 ▶", | ||
| "todo.msg.default_tier_success": "默认电压等级已设置为: {0}", | ||
| "todo.msg.unknown_error": "未知错误: {0}" | ||
| "sakuraflow.msg.add_success": "任务 {0} 已成功立项!", | ||
| "sakuraflow.msg.not_found": "未找到任务 ID", | ||
| "sakuraflow.msg.invalid_list_alias": "无效列表别称: {0}", | ||
| "sakuraflow.msg.dep_not_found": "引用错误:任务 #{0} 不存在,无法添加为前置依赖", | ||
| "sakuraflow.msg.append_success": "已向任务 #{0} 列表 {1} 追加: {2}", | ||
| "sakuraflow.msg.remove_success": "已从任务 #{0} 的 {1} 中移除: {2}", | ||
| "sakuraflow.msg.remove_failed": "移除失败:项 {0} 不在列表内或任务 ID 错误", | ||
| "sakuraflow.msg.invalid_prop_alias": "无效属性别称: {0}", | ||
| "sakuraflow.msg.invalid_tier": "无效的电压等级!请输入 0-{0} 或名称: {1}", | ||
| "sakuraflow.msg.invalid_priority": "无效优先级!请输入 0-4 或名称: {0}", | ||
| "sakuraflow.msg.invalid_status": "无效状态!请输入: {0}", | ||
| "sakuraflow.msg.set_success": "任务 #{0} 属性 {1} 已更新为 {2}", | ||
| "sakuraflow.msg.note_success": "进度已记录至任务 #{0}", | ||
| "sakuraflow.msg.restore_success": "任务 #{0} 已从归档中恢复至进行中状态 ▶", | ||
| "sakuraflow.msg.complete_success": "任务 #{0} 已完工并移入归档 ✔", | ||
| "sakuraflow.msg.pause_success": "任务 #{0} 已标记为暂停 ⏸", | ||
| "sakuraflow.msg.resume_success": "任务 #{0} 已恢复运行 ▶", | ||
| "sakuraflow.msg.default_tier_success": "默认电压等级已设置为: {0}", | ||
| "sakuraflow.msg.unknown_error": "未知错误: {0}" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI 这里启用了 flake8 的
F403(禁止import *),但当前代码仍存在from .constants import *(例如sakura_flow/interface.py、sakura_flow/utils.py),会导致该步骤直接失败。要么把这些通配符导入改成显式导入,要么从该严格检查集合中移除F403(如果项目暂时允许import *)。