Add numeric and others validations for options
还没有人认领这个 Issue。
评估
调研方向
首先阅读 mixlib-cli 的选项定义和处理路径,然后查看 issue 38 中描述的需求以及 --connection-port、--winrm-session-timeout 和 --max-wait 示例。在实现之前,确定数值验证和范围验证的范围。完成标准是命令行选项可以声明验证条件,并一致地拒绝无效值。
由索引模型根据 Issue 内容生成。
描述
Describe the Enhancement:
At present, there is no way to add validation criteria while defining the options params for example if the option only accepts integer we need to validate by providing some option params.
It will also cover https://github.com/chef/mixlib-cli/issues/38
Describe the Need:
In https://github.com/chef/chef/pull/8489 we realized we need to pass an integer to Train, but we realized we should probably ensure the users are giving us an integer when we require that.
I don't see an existing pattern in Chef right now. Maybe it's a simple single line or maybe it's a pattern we make a mixin. Let's add validation to each of the command line options that should be numeric though.
For example, --connection-port, --winrm-session-timeout, --max-wait.
Maybe a mixlib-cli option that would let you specify that it should be numeric, and maybe the acceptable range? I kind of thought we already had something like that.
- 主要语言
- Ruby
- 星标
- 118
- 派生
- 40
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
chef/mixlib-cli 的其他 Issue
-
Triage: Feature Request
难度 4/5 3-5 天 新手友好度 35/100
chef/mixlib-cli#69 ·
-
Type: Bug
难度 3/5 1-2 天 新手友好度 45/100
chef/mixlib-cli#48 · 1 条评论 ·
-
Triage: Feature Request
难度 4/5 3-5 天 新手友好度 25/100
chef/mixlib-cli#38 · 1 条评论 ·
-
Triage: Feature Request
难度 5/5 一周以上 新手友好度 20/100
chef/mixlib-cli#27 ·
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
enhancement help wanted
难度 2/5 1-3 小时 新手友好度 78/100
ecosyste-ms/repos#1215 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
WikiEducationFoundation/WikiEduDashboard#7157 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 4 天内回复