PowerShell / PowerShell/PSScriptAnalyzer

Add a rule to alert `catch [RuntimeException] { ... }`

Aberta
#1,744 2 comentários 0 reações 1 responsável Ver no GitHub

@JamesWTruher já está trabalhando nisso.

Desde 27/9/2022.

Up-for-Grabs
Linguagem predominante
C#
Estrelas
2.2k
Forks
415
Merge médio
13h 1min
PRs com merge (30d)
2

Descrição

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

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.