Allow modules to provide rules

Offen
#2,103 3 Kommentare 2 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
25/100
Issue-Typ
Feature
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
powershell
Bereich
tooling

Rechercherichtung

Beginne mit der Überprüfung des dokumentierten Verhaltens von CustomRulePath und MEF und untersuche anschließend ValidModPaths und GetValidCustomRulePaths(), um die aktuelle Erkennung benutzerdefinierter Regeln zu verstehen. Kläre den vorgesehenen Ansatz zur Modulermittlung oder -konfiguration und definiere, wie verfügbare Modulregeln als Implementierungen von DiagnosticRecord erkannt werden sollen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Up for Grabs

Summary of the new feature

as a user/developer I would like to have rules be defined as a part of a module.

As it stands now, the only possibility i can see right now to import "custom" rules is via CustomRulePath, however documentation and testing leads me to believe this only supports a known static or relative path.

Proposed technical implementation details (optional)

As a part of your documentation you talk about MEF, but this is possibly only for CustomRulePath? I can see as part of instance that you have ValidModPaths, but it seemes to only have data appended by methods in reference to GetValidCustomRulePaths()?

  • checking all commands in psmodulepath that outputs Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord?
    • Alternativly you could have the module require to have psdata.ExternalModuleDependencies defined to scriptanalyzer?
  • alternativly you can add usingModules to settings so you dont need to re-check all modules in current runspace, but just the ones defined by the user

I want Scriptanalyzer to also check available rules from modules.

What is the latest version of PSScriptAnalyzer at the point of writing
1.24.0

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.