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

【代码优化?】来自@coderabbitai #158

Closed
buiawpkgew1 opened this issue Oct 30, 2023 · 2 comments
Closed

【代码优化?】来自@coderabbitai #158

buiawpkgew1 opened this issue Oct 30, 2023 · 2 comments

Comments

@buiawpkgew1
Copy link

buiawpkgew1e#14 (review)

@hect0x7
Copy link
Owner

hect0x7 commented Oct 30, 2023

好腻害的ai,不过仔细读了一下,感觉ai的全局联系能力还不太行,有些问题明显是只根据上下文提出来的,略显草率。

但有几点是可以改进下:
插件的入参校验问题,要不要抛异常?
zip插件在删除文件和文件夹时,增加一次判空校验。

@hect0x7 hect0x7 changed the title 来自@coderabbitai 【代码优化?】来自@coderabbitai Oct 30, 2023
@hect0x7
Copy link
Owner

hect0x7 commented Oct 30, 2023

插件的入参校验,不抛异常主要是为了兼容一种情况:用户配置了插件,但是没有配置核心参数。
就比如,用户配置了插件,插件里用到了一个环境变量,可能过了一段时间这个环境变量不在了。
那么这时插件是选择【空参不执行】好,还是【空参就报错】好?

我打算增加一个异常和配置项,当这个配置项开启时,【空参就报错】,否则使用【空参不执行】。
具体实现思路:由插件专门抛出这个异常,由option catch并根据配置项进行处理或丢弃。

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

No branches or pull requests

2 participants