PowerShell / PowerShell/PSScriptAnalyzer
PSProvideCommentHelp should also warn on script param blocks
まだ誰も着手していません。
- 主要言語
- C#
- スター
- 2.2k
- フォーク
- 414
- 平均マージ
- 13時間 1分
- マージ済み PR(30日)
- 2
説明
Summary of the new feature
As a user, I want the ## comment generation feature in the PowerShell extension for VSCode to also generate comment based help for param blocks at the top of scripts. The PowerShell extension leverages the PSProvideCommentHelp rule to do this.
Proposed technical implementation details (optional)
Invoke-ScriptAnalyzer -ScriptDefinition 'param($foo)' -Settings @{
Rules = @{
PSProvideCommentHelp = @{
Enable = $true
ExportedOnly = $false
BlockComment = $true
VSCodeSnippetCorrection = $false
Placement = "before"
}
}
}
This should yield a diagnostic record just like this does:
Invoke-ScriptAnalyzer -ScriptDefinition 'function asdf { param($foo) }' -Settings @{
Rules = @{
PSProvideCommentHelp = @{
Enable = $true
ExportedOnly = $false
BlockComment = $true
VSCodeSnippetCorrection = $false
Placement = "before"
}
}
}
RuleName Severity ScriptName Line Message
-------- -------- ---------- ---- -------
PSProvideCommentHelp Information 1 The cmdlet 'asdf' does not have a help comment.
What is the latest version of PSScriptAnalyzer at the point of writing
1.18.3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
PSProvideCommentHelp ルールから始め、再現用としてトップレベルの param($foo) スクリプト定義に対して Invoke-ScriptAnalyzer を使用します。既存の function param の例と比較し、スクリプトの param ブロックが同じヘルプコメント診断を生成すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- powershell
- 領域
- tooling
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100