Skip to content
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

✨ 支持插件加载优先级 #75

Merged
merged 1 commit into from
Aug 1, 2024
Merged

✨ 支持插件加载优先级 #75

merged 1 commit into from
Aug 1, 2024

Conversation

A-kirami
Copy link
Owner

@A-kirami A-kirami commented Aug 1, 2024

这个 PR 带来了什么样的更改?

  • 错误修复
  • 新功能
  • 文档/注释
  • 代码格式
  • 代码重构
  • 测试用例
  • 性能优化
  • 外观样式
  • 项目构建
  • 依赖环境
  • 持续集成/部署
  • 其他,请描述:

这个 PR 是否存在破坏性变更?

  • 是的,并已在 issue #___ 号中获得批准
  • 没有

描述

支持在配置文件中指定插件的加载优先级,按优先级从小到大的顺序加载

通过在插件名后添加 :priority 即可指定优先级

[plugin]
plugins = ["plugins.service_manager:1", "kirami_plugin_helloworld:-99"]
plugin_dirs=["basic_plugins:0", "extensive_plugin:99"]

默认情况下,未指定优先级的插件加载优先级为无穷大,用户可以在配置中指定 plugin_priority 来调整插件默认优先级

动机和背景

部分情况下,用户需要手动控制插件加载的顺序

其他信息

检查工作

  • 我对我的代码进行了注释,特别是在难以理解的部分
  • 我的更改需要更新文档,并且已对文档进行了相应的更改
  • 我添加了测试并且已经在本地通过,以证明我的修复补丁或新功能有效
  • 我已检查并确保更改没有与其他打开的 Pull Requests 重复

@A-kirami A-kirami added the enhancement New feature or request label Aug 1, 2024
@A-kirami A-kirami merged commit ad916a7 into main Aug 1, 2024
3 checks passed
@A-kirami A-kirami deleted the feat/plugin-priority branch August 1, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant