PowerShell / PowerShell/PSScriptAnalyzer

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

オープン
#1,744 コメント 2 件 リアクション 0 件 担当者 1 名 GitHub で見る

@JamesWTruher がすでに取り組んでいます。

2022年9月27日 から。

Up-for-Grabs
主要言語
C#
スター
2.2k
フォーク
414
平均マージ
13時間 1分
マージ済み PR(30日)
2

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。