PowerShell / PowerShell/PSScriptAnalyzer

Add Get-ScriptAnalyzerSetting cmdlet to generalize a way of displaying collections of rules

Offen
#1,740 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Area - Configuration Issue - Enhancement Up-for-Grabs
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 to be able to discover what rules are defined in a PSD1 file, especially those that are included with PSScriptAnalyzer. I would also like to point to any PSD1 file containing rules and get the same output.

Proposed technical implementation details (optional)

Example 1 - Get the settings in the CmdletDesign PSD1 file that is included with PSScriptAnalyer
Get-ScriptAnalyzerSetting -Settings CmdletDesign

The default output should be the same as running Get-ScriptAnalyzerRule on each rule in the PSD1.

Example 2 - Get the settings in the CmdletDesign PSD1 file and show the configuration
Get-ScriptAnalyzerSetting -Settings CmdletDesign -Configuration

Adding the configuration switch should display the rule name and any custom configuration settings for rules that allow configuration.

Example 3 - Get the settings in a user provided PSD1 file
Get-ScriptAnalyzerSetting -Path /path/to/myrules.psd1

The output should be the same and the Path parameter set should also allow the Configuration parameter.

Other considerations

If the PSD1 file can contain both inclusions and exclusions, then the out needs to indicate which rules are included and which are excluded. Consider grouping by include/exclude.

Current version = 1.20.0.

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, das bestehende Verhalten von Get-ScriptAnalyzerRule und das im Issue beschriebene CmdletDesign-PSD1-Beispiel zu überprüfen. Lege fest, wie Get-ScriptAnalyzerSetting mit den Settings- und Path-Parametersätzen, der Configuration-Ausgabe sowie eingeschlossenen und ausgeschlossenen Regeln umgehen soll; abgeschlossen ist die Aufgabe, wenn sowohl integrierte als auch vom Benutzer bereitgestellte PSD1-Dateien eine konsistente, dokumentierte Ausgabe erzeugen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

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

Neue Issues direkt in Ihr Postfach

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