PowerShell / PowerShell/PSScriptAnalyzer
Configurable ParameterDescription Placement and Section Requirements in PSProvideCommentHelp
還沒有人認領這個 Issue。
- 主要語言
- C#
- 星號
- 2.2k
- 分支
- 415
- 平均合併
- 13 小時 1 分鐘
- 30 天內合併 PR
- 2
描述
Summary of the new feature
As a user of PSScriptAnalyzer, I want to be able to configure where ParameterDescription comments appear and enforce required help sections (with optional order enforcement) in the PSProvideCommentHelp rule, so that I can align documentation with my project's standards and ensure consistency.
Proposed technical implementation details (optional)
-
Configurable ParameterDescription Placement
- Add a new configuration option for PSProvideCommentHelp called
ParameterDescriptionPlacementwith two possible values:WithCommentHelp(default): Parameter descriptions are included in the comment help block as today.InParamBlock: Parameter descriptions are placed as inline comments in the param block itself.
- The setting would control where parameter docs are generated and where the rule expects to find them.
- Add a new configuration option for PSProvideCommentHelp called
-
Required Sections and Order Enforcement
- Add a configuration option called
RequiredSections, accepting an array of section names (e.g.,["Synopsis", "Description", "Parameters"]). - Add a boolean configuration option
RequiredSectionsOrderMatters(default:false). If set totrue, the order of the sections in the array is enforced in the help comment, and the rule will fail if the order is incorrect. - If
RequiredSectionsOrderMattersis false, presence of all required sections is enforced, but order is not.
- Add a configuration option called
These options would give users more flexibility in how comment-based help is structured and validated.
What is the latest version of PSScriptAnalyzer at the point of writing
2024.6.0 (or latest at time of filing)
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
先定位 PSProvideCommentHelp 規則及其現有的設定處理。追蹤目前如何尋找參數描述和說明區段,然後在為 ParameterDescriptionPlacement、RequiredSections 和 RequiredSectionsOrderMatters 定義涵蓋範圍之前,找出該規則的測試。完成的標準是:兩種放置模式和必要區段的驗證(包括可選的順序)都能一致地強制執行。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- csharp, powershell
- 領域
- tooling
- Issue 類型
- 功能
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100