PowerShell / PowerShell/PSScriptAnalyzer

Rule severity vs diagnostic severity

Aperta
#1,611 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

API Proposal Consider - 2.0 Issue - Discussion
Lingua principale
C#
Stelle
2.2k
Fork
414
Merge medio
13h 1m
PR unite (30g)
2

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia leggendo l’issue #1610 di PSScriptAnalyzer collegata e la discussione sulla severità qui. Determina se il progetto dispone già di una regola o di una configurazione della severità diagnostica su cui basare la decisione; per considerare il lavoro completato sarebbero necessari un modello di severità concordato e un ambito di implementazione, nessuno dei quali è specificato da questa issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp, powershell
Ambito
tooling
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.