PowerShell / PowerShell/PSScriptAnalyzer
Add Get-ScriptAnalyzerSetting cmdlet to generalize a way of displaying collections of rules
还没有人认领这个 Issue。
- 主要语言
- C#
- 星标
- 2.2k
- 派生
- 414
- 平均合并
- 13 小时 1 分钟
- 30 天内合并 PR
- 2
描述
Summary of the new feature
As a user I want to be able to discover what rules are defined in a PSD1 file, especially those that are included with PSScriptAnalyzer. I would also like to point to any PSD1 file containing rules and get the same output.
Proposed technical implementation details (optional)
Example 1 - Get the settings in the CmdletDesign PSD1 file that is included with PSScriptAnalyer
Get-ScriptAnalyzerSetting -Settings CmdletDesign
The default output should be the same as running Get-ScriptAnalyzerRule on each rule in the PSD1.
Example 2 - Get the settings in the CmdletDesign PSD1 file and show the configuration
Get-ScriptAnalyzerSetting -Settings CmdletDesign -Configuration
Adding the configuration switch should display the rule name and any custom configuration settings for rules that allow configuration.
Example 3 - Get the settings in a user provided PSD1 file
Get-ScriptAnalyzerSetting -Path /path/to/myrules.psd1
The output should be the same and the Path parameter set should also allow the Configuration parameter.
Other considerations
If the PSD1 file can contain both inclusions and exclusions, then the out needs to indicate which rules are included and which are excluded. Consider grouping by include/exclude.
Current version = 1.20.0.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先检查现有的 Get-ScriptAnalyzerRule 行为以及 issue 中描述的 CmdletDesign PSD1 示例。定义 Get-ScriptAnalyzerSetting 应如何处理 Settings 和 Path 参数集、Configuration 输出,以及包含的规则与排除的规则;当内置和用户提供的 PSD1 文件都产生一致且有文档说明的输出时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- powershell
- 领域
- cli, tooling
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100