PowerShell / PowerShell/PSScriptAnalyzer

Enforce presence of '$ErrorActionPreference = "Stop"'

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

まだ誰も着手していません。

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

説明

Summary of the new feature

Defensive Programming is essential to software engineering. To enable fail-fast methodology in PowerShell, you must add $ErrorActionPreference = "Stop" to the top of every PowerShell file. One can easily forget to add this line; I would like a PSScriptAnalyzer rule that enforces the presence of $ErrorActionPreference = "Stop", or at a minimum enforces explicitly setting $ErororActionPreference.

What is the latest version of PSScriptAnalyzer at the point of writing
N/A (whatever comes in the latest version of VS Code PowerShell extension)

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

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

はじめの一歩

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

調査の方向性

この issue では実装ファイルやテストが指定されていません。まず、PSScriptAnalyzer のルールがどこで登録およびテストされているかを特定し、次に、PowerShell ファイルで $ErrorActionPreference が明示的に設定されているかをどのように検査しているかを確認してください。合意したルールの範囲に従って、未設定または Stop 以外の設定をアナライザーが一貫して報告できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp, powershell
領域
tooling
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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