PowerShell / PowerShell/PSScriptAnalyzer

PSAvoidTrailingWhitespace should ignore empty lines indented to match the current block

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

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

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

説明

Currently, PSAvoidTrailingWhitespace checks all lines for trailing whitespace, even when that line is effectively empty and the "trailing" whitespace is actually leading whitespace for the current indentation level. If the recommended action is taken (remove the whitespace), then adding new code in those spots requires re-indenting that spot to the current code indentation level.

I propose that it should respect the current indentation level for an empty line and not generate a note for those lines, as long as they match the indentation of the current block of code.

What is the latest version of PSScriptAnalyzer at the point of writing
1.17.1, shipping with the vscode-powershell extension version 1.8.1

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

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

はじめの一歩

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

調査の方向性

まず、PSAvoidTrailingWhitespace ルールの実装と既存のテストを見つけます。現在のブロックレベルまでインデントされた空行のケースを再現し、一致するインデントは無視される一方で、実際の行末の空白は引き続き報告されることを確認します。テストでこの動作がカバーされ、ルールがこれらのケースを区別できれば完了です。

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

評価

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

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

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