Skip to content

fix(cli): 修复数字开头用户名导致 init 模板插件类名非法#43

Merged
GEYUANwuqi merged 1 commit into
ncatbot:mainfrom
GlowLED:fix/init-numeric-username-classname
Jun 9, 2026
Merged

fix(cli): 修复数字开头用户名导致 init 模板插件类名非法#43
GEYUANwuqi merged 1 commit into
ncatbot:mainfrom
GlowLED:fix/init-numeric-username-classname

Conversation

@GlowLED

@GlowLED GlowLED commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

数字开头的系统用户名经 _generate_template_plugin 派生出以数字开头的
入口类名(如 0UserPluginPlugin),生成的 plugin.py 含非法标识符,
加载时抛 SyntaxError。新增 _to_class_name() 保证类名始终为合法标识符
并消除重复的 Plugin 后缀。新增回归测试 CX-21/CX-22。

数字开头的系统用户名经 _generate_template_plugin 派生出以数字开头的
入口类名(如 35921PluginPlugin),生成的 plugin.py 含非法标识符,
加载时抛 SyntaxError。新增 _to_class_name() 保证类名始终为合法标识符
并消除重复的 Plugin 后缀。新增回归测试 CX-21/CX-22。
@GEYUANwuqi GEYUANwuqi merged commit 772a55e into ncatbot:main Jun 9, 2026
3 checks passed
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