PowerShell / PowerShell/PSScriptAnalyzer

Configurable ParameterDescription Placement and Section Requirements in PSProvideCommentHelp

Offen
#2,133 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

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 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)

  1. Configurable ParameterDescription Placement

    • Add a new configuration option for PSProvideCommentHelp called ParameterDescriptionPlacement with 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.
  2. 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 to true, 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 RequiredSectionsOrderMatters is false, presence of all required sections is enforced, but order is not.

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)

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die PSProvideCommentHelp-Regel und ihre bestehende Konfigurationsbehandlung zu finden. Verfolge, wie Parameterbeschreibungen und Hilfeabschnitte derzeit gefunden werden, und identifiziere dann die Tests der Regel, bevor du die Abdeckung für ParameterDescriptionPlacement, RequiredSections und RequiredSectionsOrderMatters definierst. Die Arbeit ist abgeschlossen, wenn beide Platzierungsmodi und die Validierung erforderlicher Abschnitte, einschließlich der optionalen Reihenfolge, konsistent durchgesetzt werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp, powershell
Bereich
tooling
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.