Skip to content

✨ 迁移到新模板 #536

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 13 commits into from
Apr 23, 2025
Merged

✨ 迁移到新模板 #536

merged 13 commits into from
Apr 23, 2025

Conversation

shoucandanghehe
Copy link
Member

No description provided.

@shoucandanghehe shoucandanghehe requested a review from Copilot April 21, 2025 05:25
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates several game modules to a new template by replacing legacy parameters with updated ones and integrating new language support. Key changes include replacing "status" with "type", "command" with "prompt", and adding a _lang parameter via get_lang() across multiple modules, as well as updating schema imports to newer versions.

Reviewed Changes

Copilot reviewed 49 out of 52 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
nonebot_plugin_tetris_stats/games/tos/unbind.py Updated binding info keys and added language support.
nonebot_plugin_tetris_stats/games/tos/query.py Introduced historical data retrieval with language support and renamed a field in GameData.
nonebot_plugin_tetris_stats/games/tos/bind.py Replaced command with prompt and added _lang parameter.
nonebot_plugin_tetris_stats/games/top/unbind.py Updated binding payloads with new field names and language support.
nonebot_plugin_tetris_stats/games/top/query.py Revised query payloads with trending and language support.
nonebot_plugin_tetris_stats/games/top/bind.py Consistent update to prompt fields and language integration.
nonebot_plugin_tetris_stats/games/tetrio/unbind.py Adjusted binding payload parameters to match the new template.
nonebot_plugin_tetris_stats/games/tetrio/record/sprint.py Fixed render route and added _lang parameter.
nonebot_plugin_tetris_stats/games/tetrio/record/blitz.py Added language support to the blitz image rendering.
nonebot_plugin_tetris_stats/games/tetrio/rank/detail.py, all.py Integrated _lang parameter into rank rendering payloads.
nonebot_plugin_tetris_stats/games/tetrio/query (v1 & v2) Migrated query image generation to use updated schema and language support.
nonebot_plugin_tetris_stats/games/tetrio/list.py Updated list display schema and added language support.
nonebot_plugin_tetris_stats/games/tetrio/bind.py Changed binding parameters and integrated language support.
nonebot_plugin_tetris_stats/games/tetrio/api/schemas/summaries/zenith.py Updated type hint for revolution in schema.
Files not reviewed (3)
  • nonebot_plugin_tetris_stats/i18n/.lang.schema.json: Language not supported
  • nonebot_plugin_tetris_stats/i18n/.template.json: Language not supported
  • nonebot_plugin_tetris_stats/i18n/en-US.json: Language not supported
Comments suppressed due to low confidence (1)

nonebot_plugin_tetris_stats/games/tetrio/query/v1.py:95

  • Hardcoding '_lang' as 'zh-CN' breaks consistency with other modules that invoke get_lang(); consider using get_lang() for consistent language determination.
_lang='zh-CN',

Copy link

codecov bot commented Apr 21, 2025

Codecov Report

Attention: Patch coverage is 82.68734% with 67 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
nonebot_plugin_tetris_stats/utils/chart.py 24.28% 53 Missing ⚠️
nonebot_plugin_tetris_stats/games/tos/query.py 56.52% 10 Missing ⚠️
...nebot_plugin_tetris_stats/games/tetrio/query/v1.py 80.00% 2 Missing ⚠️
nonebot_plugin_tetris_stats/utils/lang.py 80.00% 1 Missing ⚠️
nonebot_plugin_tetris_stats/utils/screenshot.py 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
...stats/games/tetrio/api/schemas/summaries/zenith.py 100.00% <100.00%> (ø)
nonebot_plugin_tetris_stats/games/tetrio/bind.py 75.00% <100.00%> (+0.80%) ⬆️
nonebot_plugin_tetris_stats/games/tetrio/list.py 77.77% <100.00%> (+0.85%) ⬆️
...ot_plugin_tetris_stats/games/tetrio/query/tools.py 54.83% <100.00%> (ø)
...nebot_plugin_tetris_stats/games/tetrio/query/v2.py 45.71% <100.00%> (+1.59%) ⬆️
...nebot_plugin_tetris_stats/games/tetrio/rank/all.py 69.04% <100.00%> (+0.75%) ⬆️
...ot_plugin_tetris_stats/games/tetrio/rank/detail.py 63.63% <100.00%> (+0.84%) ⬆️
...t_plugin_tetris_stats/games/tetrio/record/blitz.py 63.63% <100.00%> (+0.67%) ⬆️
..._plugin_tetris_stats/games/tetrio/record/sprint.py 62.50% <100.00%> (+0.68%) ⬆️
nonebot_plugin_tetris_stats/games/tetrio/unbind.py 66.66% <100.00%> (+0.95%) ⬆️
... and 30 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shoucandanghehe shoucandanghehe requested a review from Copilot April 23, 2025 11:07
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates to the new template by updating field names, function calls, and schema imports across the various game modules.

  • Renames binding status fields from “status” to “type” and command fields to “prompt”.
  • Introduces the _lang parameter from get_lang() consistently in rendering calls.
  • Updates import paths and schema references to align with the new project structure.

Reviewed Changes

Copilot reviewed 49 out of 52 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
nonebot_plugin_tetris_stats/games/tos/unbind.py Changed binding field and added _lang parameter.
nonebot_plugin_tetris_stats/games/tos/query.py Renamed variables and added historical data fetching with proper language injection.
nonebot_plugin_tetris_stats/games/tos/bind.py Updated binding parameters and language injection.
nonebot_plugin_tetris_stats/games/top/* Similar rename updates and added language support.
nonebot_plugin_tetris_stats/games/tetrio/* Updated schema imports, binding, query, and record rendering to the new template.
Files not reviewed (3)
  • nonebot_plugin_tetris_stats/i18n/.lang.schema.json: Language not supported
  • nonebot_plugin_tetris_stats/i18n/.template.json: Language not supported
  • nonebot_plugin_tetris_stats/i18n/en-US.json: Language not supported
Comments suppressed due to low confidence (1)

nonebot_plugin_tetris_stats/games/tetrio/query/v1.py:44

  • [nitpick] The variable name 'dsps' is not very descriptive; consider renaming it to a more meaningful name such as 'delta_per_second' if that better represents its purpose.
dsps: float

value_max, value_min = get_value_bounds([i.tr for i in histories])
split_value, offset = get_split(value_max, value_min)
values = get_value_bounds([i.score for i in histories])
split_value, offset = get_split(values, TR_MAX, TR_MIN)
Copy link
Preview

Copilot AI Apr 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the updated get_split function accepts three arguments as used here and that TR_MAX and TR_MIN are correctly defined for its intended usage.

Copilot uses AI. Check for mistakes.

@shoucandanghehe shoucandanghehe merged commit ff3eb79 into main Apr 23, 2025
15 checks passed
@shoucandanghehe shoucandanghehe deleted the feat/use-new-templates branch April 23, 2025 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant