PowerShell / PowerShell/PSScriptAnalyzer
Add a rule to alert `catch [RuntimeException] { ... }`
@JamesWTruher ci sta già lavorando.
Dal 27/9/2022.
- Lingua principale
- C#
- Stelle
- 2.2k
- Fork
- 414
- Merge medio
- 13h 1m
- PR unite (30g)
- 2
Descrizione
Summary of the new feature
In practice, catch [System.Management.Automation.RuntimeException] { ... } behaves the same as an unqualified catch block. That is, it catches any exception. See details in https://github.com/PowerShell/PowerShell/issues/16392.
Reason for that is explained in https://github.com/PowerShell/PowerShell/issues/16392#issuecomment-966712592.
Proposed technical implementation details (optional)
It would be nice to have a rule to caution against using RuntimeException as the type for a catch clause.
What is the latest version of PSScriptAnalyzer at the point of writing
1.20.0
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.