PowerShell / PowerShell/PSScriptAnalyzer

Rule severity vs diagnostic severity

Offen
#1,611 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

API Proposal Consider - 2.0 Issue - Discussion
Vorherrschende Sprache
C#
Sterne
2.2k
Forks
414
Ø Merge
13 Std. 1 Min.
Gemergte PRs (30 T.)
2

Beschreibung

From https://github.com/PowerShell/PSScriptAnalyzer/issues/1610.

One consideration that comes up when authoring rules is:

  • Rules can have a "severity"
  • The individual diagnostics can also have a "severity"

When we configure things, this creates the issue of:

  • Does a configured severity refer to a filter on rules or diagnostics?
  • If it's rules, how do rules perform broad analysis on a topic area and possibly output diagnostics of different severity?
    • Should rules designate their severity as the highest severity they may emit? If so, how do we enforce that statically?
  • If it's diagnostics, how do we ensure rules are run efficiently? If we can't statically determine ahead of time which rules will emit diagnostics of the right severity, are we forced to always run all the rules?

We could potentially offer both configurations, but I personally think this is an unhelpful level of granularity to offer to users, since we should work to make the concept of Severity a simple and monolithic one.

My current view on this is:

  • Configured severity refers to rules to run
  • Rules should be marked with the highest severity they can emit
  • We should run all such rules and then filter out any diagnostics of unwanted severities

But that's just while I'm thinking on it now, and I'd like to open this question up for discussion

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

Beginnen Sie mit dem Lesen des verlinkten PSScriptAnalyzer-Issues #1610 und der Diskussion über den Schweregrad hier. Ermitteln Sie, ob das Projekt bereits eine Regel oder eine Konfiguration für Diagnoseschweregrade besitzt, auf die die Entscheidung gestützt werden kann; für den Abschluss wären ein vereinbartes Schweregradmodell und ein Implementierungsumfang erforderlich, von denen dieses Issue keinen spezifiziert.

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
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

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