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.

Bewertung

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

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.

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)

Vorherrschende Sprache
C#
Sterne
2.2k
Forks
415
Ø Merge
13 Std. 1 Min.
Gemergte PRs (30 T.)
2

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus PowerShell/PSScriptAnalyzer

Alle Issues in PowerShell/PSScriptAnalyzer

Ähnliche Issues

Weitere Issues zu C#

Neue Issues direkt in Ihr Postfach

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