PowerShell / PowerShell/PSScriptAnalyzer

Add Get-ScriptAnalyzerSetting cmdlet to generalize a way of displaying collections of rules

未關閉
#1,740 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

Area - Configuration Issue - Enhancement Up-for-Grabs
主要語言
C#
星號
2.2k
分支
415
平均合併
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.

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先檢視現有的 Get-ScriptAnalyzerRule 行為,以及 issue 中描述的 CmdletDesign PSD1 範例。定義 Get-ScriptAnalyzerSetting 應如何處理 Settings 和 Path 參數集、Configuration 輸出,以及包含和排除的規則;當內建和使用者提供的 PSD1 檔案都產生一致且有文件說明的輸出時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
powershell
領域
cli, tooling
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。