PowerShell / PowerShell/PSScriptAnalyzer

PipelineIndentation: when not set to NoIndentation: does not cater for case where line continuation token is used instead of pipeline (->missing indentation)

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

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

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

説明

foo `
-bar |
baz
foo `
# comment
-bar |
baz

Expected behavior

Calling Invoke-Formatter on it (PipelineIndentation is not NoIndentation, which is not the default), then baz should be indented twice (once because of the previous backtick and once because of the rule itself. It only gets indented once

foo `
    # comment
    -bar |
        baz

Actual behavior

foo `
    # comment
    -bar |
    baz

If an unexpected error was thrown then please report the full error details using e.g. $error[0] | Select-Object *

Environment data

PSSA 1.18,1 or latest version of master

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

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

はじめの一歩

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

調査の方向性

NoIndentationではなくPipelineIndentationを使用して、バックティックによる継続とコメントを含む例をInvoke-Formatterで再現します。PipelineIndentationのフォーマット経路を追跡し、期待される出力と一致するようにbazが両方のインデントレベルを受け取ることを確認します。

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

評価

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

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

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