PowerShell / PowerShell/PSScriptAnalyzer
PSProvideCommentHelp should also warn on script param blocks
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 2.2k
- Forks
- 414
- Ø Merge
- 13 Std. 1 Min.
- Gemergte PRs (30 T.)
- 2
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der Regel PSProvideCommentHelp und verwende Invoke-ScriptAnalyzer mit der Skriptdefinition param($foo) auf oberster Ebene als Reproduktion. Vergleiche sie mit dem vorhandenen Beispiel für function param; abgeschlossen ist die Aufgabe, wenn der Skript-Parameterblock dieselbe Help-Comment-Diagnose erzeugt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- powershell
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100