PowerShell / PowerShell/PSScriptAnalyzer

The rule PSUseShouldProcessForStateChangingFunctions is far too simple

オープン
#283 コメント 9 件 リアクション 10 件 担当者 0 名 GitHub で見る

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

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

説明

You can't determine if a command is "State Changing" based purely on the verb. This is the sort of stuff that makes me SO upset at this module that I just want to throw it out -- it takes too much time to go through and review stuff when most of the warnings/errors are wrong.

For one example, I'm getting that warning on a bunch of XML document commands like "New-XElement" and "New-XAttribute" which obviously don't modify system state, they just create xml nodes and attributes which can at least hypothetically be added to a document in memory.

For another example, almost every single command in the ShowUI module uses the "New" verb to generate UI elements on windows, not to modify the system state.

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

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

はじめの一歩

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

調査の方向性

まず、PSUseShouldProcessForStateChangingFunctions ルールと、コマンド New-XElement、New-XAttribute、ShowUI で報告されているケースを確認します。メモリ内に XML または UI 要素を作成するコマンドと、システム状態を変更するコマンドをルールがどのように区別すべきかを判断し、その後、誤検知の警告がなくなったことを示すカバレッジを追加します。

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

評価

技術スタック
csharp, powershell
領域
devtools
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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