Skip to content

Use language: python for pre-commit hook portability - #61

Merged
shoucandanghehe merged 3 commits into
feat/refactor-handlefrom
copilot/sub-pr-59
Feb 12, 2026
Merged

shoucandanghehe merged 3 commits into
feat/refactor-handlefrom
copilot/sub-pr-59

Conversation

Copilot AI commented Feb 12, 2026 •

Copy link
Copy Markdown
Contributor

The generate-client-pyi hook used language: system with entry: python ..., requiring Python on PATH in every environment. Switch to language: python for pre-commit-managed interpreter.

Changes

  • Changed language: system → language: python
  • Changed entry: python3 scripts/generate_client_pyi.py → entry: scripts/generate_client_pyi.py
  • Made scripts/generate_client_pyi.py executable (required for language: python)

Pre-commit now manages the Python environment automatically, eliminating dependency on system Python configuration.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • pre-commit.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@codecov

codecov Bot commented Feb 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.21%. Comparing base (06687ce) to head (0626341).
⚠️ Report is 1 commits behind head on feat/refactor-handle.

Additional details and impacted files
@@                  Coverage Diff                  @@
##           feat/refactor-handle      #61   +/-   ##
=====================================================
  Coverage                 73.21%   73.21%           
=====================================================
  Files                        26       26           
  Lines                      6492     6492           
  Branches                    332      332           
=====================================================
  Hits                       4753     4753           
  Misses                     1683     1683           
  Partials                     56       56           
Flag Coverage Δ
unittests 73.21% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: shoucandanghehe <51957264+shoucandanghehe@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP Address feedback on handle refactor from PR #59 discussion Use python3 explicitly in pre-commit hook for portability Feb 12, 2026
@shoucandanghehe
shoucandanghehe marked this pull request as ready for review February 12, 2026 16:56
Co-authored-by: shoucandanghehe <51957264+shoucandanghehe@users.noreply.github.com>
Copilot AI changed the title Use python3 explicitly in pre-commit hook for portability Use language: python for pre-commit hook portability Feb 12, 2026
@shoucandanghehe
shoucandanghehe merged commit cae9c1b into feat/refactor-handle Feb 12, 2026
20 checks passed
shoucandanghehe added a commit that referenced this pull request Feb 13, 2026
* 💥 将 UNSET 改为使用 metaclass 实现
希望不要炸掉什么东西)

* 🔧 为 client.pyi 添加一些 ignore

* ✨ 添加 omit_unset 方法

* ♻️ 重构 handle

* 🚨 auto fix by pre-commit hooks

* 🐛 修复可空字段显式 null 传递

* 🐛 修复 bool 查询参数编码

* 🐛 对齐可空语义与位置更新

* 🐛 对齐 API 行为与文档约束

* 🐛 修正响应体解析与返回类型

* 🐛 完善附件与论坛标签参数

* 🐛 修复默认值与必填参数约束

* 🐛 补全参数范围与互斥校验

* 🐛 修复鉴权与路由参数不一致

* 🐛 修复线程参数与归档时间处理

* ✨ 新增 client.pyi 生成脚本

* 🔧 配置 client.pyi 自动生成并对齐格式

* 🚨 auto fix by pre-commit hooks

* 🐛 修复 generate-client-pyi hook 的 uv 依赖

* ♻️ 引入 Range 注解参数校验

* 🐛 修复 Ruff 警告

* ✨ 为参数约束补充 overload 软提示

* ♻️ 抽离参数校验模块并补充规则测试

* 🐛 修复 client.pyi 生成器对 Annotated 与 overload 的处理

* ♻️ 为已移除 guild 端点增加软弃用告警

* ✅ 为已移除 guild 端点补充弃用告警测试

* 🐛 修复 modify_DM 图标字节编码

* 🔥 移除一些 TODO

* ♻️ 移除 _request 的 bot 参数并同步调用

* ♻️ _call_api 支持无 bot 形参处理器

* ♻️ 移除未使用的 bot 形参

* 🐛 修复消息回复检查对 UNSET 的判定

* ♻️ 统一发送模型的可选字段为 Missing

* ♻️ 统一序列化链路使用 omit_unset

* ✅ 补充 UNSET 序列化回归测试

* ♻️ 合并序列化入口到 model_dump

* ♻️ 统一 API 序列化参数为 omit_unset_values

* ♻️ 同步命令存储序列化参数与类型

* ✨ 为 client.pyi 生成增加哈希校验与元信息

* ♻️ 将测试动态导入改为静态导入

* 🐛 修正 ApplicationCommandCreate 模型定义

* 🐛 修正 ExecuteWebhookParams 模型定义

* 📝 standardize docstrings for Application Commands section

* 📝 standardize docstrings for Interactions section

* 📝 standardize docstrings for Application section

* 📝 standardize docstrings for Audit Log and Auto Moderation sections

* 📝 standardize docstrings for Channel section

* 📝 standardize docstrings for Message section

* 📝 standardize docstrings for Channel Operations section

* 📝 standardize docstrings for Emoji section

* 📝 standardize docstrings for Entitlement section

* 📝 standardize docstrings for Guild Core section

* 📝 standardize docstrings for Guild Members section

* 📝 standardize docstrings for Guild Bans, Roles, Prune section

* 📝 standardize docstrings for Guild Integrations/Widget/Welcome section

* 📝 standardize docstrings for Voice section

* 📝 standardize docstrings for Guild Scheduled Event section

* 📝 standardize docstrings for Guild Template section

* 📝 standardize docstrings for Invite, Poll, SKU sections

* 📝 standardize docstrings for Stage Instance and Sticker sections

* 📝 standardize docstrings for Subscription and User sections

* 📝 standardize docstrings for Webhook, Gateway, OAuth2 sections

* 📝 standardize section comments format

* 📝 fix docstring format for deprecated method

* 📝 fix Discord docs links for moved or removed endpoints

* 🚨 auto fix by pre-commit hooks

* 🐛 fix multipart payload dropping empty attachments list

* 🔥 移除无用赋值

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* ♻️ preserve UNSET falsy behavior in metaclass implementation

* ⚡ cache inspect.signature results for API handlers

* 🚨 auto fix by pre-commit hooks

* ♻️ 移除一些不正确的继承关系

* ✨ 显式导出 UNSET

* ♻️ 重构 UNSET 类及相关类型别名

* 🐛 修复类型守卫不会正确收窄类型

* 🐛 修复 _sub_command_rule 中 Missing 类型的类型检查问题

使用 is_unset() 类型守卫正确收窄 Missing[list[...]] 类型

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* 🐛 修复 on_*_command 函数参数的 Missing 类型问题

将 options, default_permission, nsfw 参数类型从 Optional 改为 Missing,默认值从 None 改为 UNSET

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* 🔧 Use `language: python` for pre-commit hook portability (#61)

* Initial plan

* 🔧 Use python3 explicitly in pre-commit hook for portability

Co-authored-by: shoucandanghehe <51957264+shoucandanghehe@users.noreply.github.com>

* 🔧 Use language: python for pre-commit managed interpreter

Co-authored-by: shoucandanghehe <51957264+shoucandanghehe@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: shoucandanghehe <51957264+shoucandanghehe@users.noreply.github.com>

* 🐛 修复 InteractionCreateEvent 中用户上下文检查逻辑

* 🐛 修复命令参数解析中的 Missing 类型收窄

* 🐛 修复 message 中 Missing 字段类型问题

* ♻️ 移除 _call_api 对 legacy 参数兼容

统一 API 调用参数形态,避免在适配层静默改写 params/data 导致行为不透明。

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
@shoucandanghehe
shoucandanghehe deleted the copilot/sub-pr-59 branch February 13, 2026 19:50
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.

2 participants