Rule Request: UnknownLabel
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先复现 Invoke-ScriptAnalyzer 示例,并检查现有规则如何报告控制流问题。确定未知标签和位于相关循环之外的标签在哪里进行分析,然后验证已完成的规则是否针对该示例以 Error 严重性和预期消息报告 PSUnknownLabel。
由索引模型根据 Issue 内容生成。
描述
Not sure whether this is a PowerShell a bug or feature but fixing it in PowerShell would probably be a break change.
In any case, I think unknown labels should be notified and even deserve an error severity if the label doesn't exist or is outside the concerned loop.
Invoke-ScriptAnalyzer -ScriptDefinition {
:foo foreach ($a in 1,2,3) {
$a
if ($a -ge $b) { break bar }
}
}.ToString()
Expected
Something like:
RuleName Severity ScriptName Line Message
-------- -------- ---------- ---- -------
PSUnknownLabel Error 4 The label 'bar' is not known in this context
- 主要语言
- C#
- 星标
- 2.2k
- 派生
- 422
- 平均合并
- 2 小时 23 分钟
- 30 天内合并 PR
- 25
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PowerShell/PSScriptAnalyzer 的其他 Issue
-
Up-for-Grabs
难度 1/5 1-3 小时 新手友好度 78/100
PowerShell/PSScriptAnalyzer#2213 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 1-2 天 新手友好度 18/100
PowerShell/PSScriptAnalyzer#2302 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
PowerShell/PSScriptAnalyzer#2300 ·
维护者通常 1 天内回复
-
Invoke-ScriptAnalyzer fails intermittently with NullReferenceException in CommandInfo.ResolveParameter (ProvideCommentHelp / AvoidReservedCharInCmdlet race on Export-ModuleMember)可能已有人在做 @jessehouwing 于 89 天前认领。 未关闭Issue - Bug
难度 4/5 3-5 天 新手友好度 52/100
PowerShell/PSScriptAnalyzer#2229 · 6 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 32/100
PowerShell/PSScriptAnalyzer#2222 · 2 条评论 ·
维护者通常 1 天内回复
查看 PowerShell/PSScriptAnalyzer 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
GamaEdtech/gamatrain-back#977 ·
维护者通常 1 天内回复
-
area-templates triage:bot-seen triage:needs-human
难度 2/5 1-3 小时 新手友好度 75/100
microsoft/aspire#22356 · 1 条评论 ·
维护者通常 1 天内回复
-
Needs-Triage
难度 2/5 1-3 小时 新手友好度 84/100
PowerShell/PowerShell#28432 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/aspire.dev#2184 ·
维护者通常 2 天内回复
-
area-controls-refreshview platform/ios s/triaged
难度 2/5 1-3 小时 新手友好度 74/100
dotnet/maui#40314 · 1 个 reaction ·
维护者通常 1 天内回复