PowerShell / PowerShell/PSScriptAnalyzer
Format Document with Hash Table entry on first line stopping all formatting in file
まだ誰も着手していません。
- 主要言語
- C#
- スター
- 2.2k
- フォーク
- 414
- 平均マージ
- 13時間 1分
- マージ済み PR(30日)
- 2
説明
Steps to reproduce
following data in VS Code editor will prevent any formatting of PowerShell code in the file. If I move the PivotRows = 'Date' to the next line proper formatting occurs throughout rest of file.
{
$pt.SprintEffortCharts=@{ PivotRows = 'Date'
NoTotalsInPivot = $true
PivotDataToColumn = $true
}
}
Output of Invoke-Formatter
Invoke-Formatter -ScriptDefinition "$(Get-Content $scriptPath)" -Verbose 2> .\invoke-formatter.log
VERBOSE: Using settings file at C:\Program Files\WindowsPowerShell\Modules\PSScriptAnalyzer\1.17.1\Settings\CodeFormatting.psd1.
VERBOSE: Analyzing Script Definition.
VERBOSE: Running PSPlaceCloseBrace rule.
VERBOSE: Found 0 violations.
VERBOSE: Fixed 0 violations.
VERBOSE: Analyzing Script Definition.
VERBOSE: Running PSPlaceOpenBrace rule.
VERBOSE: Found 0 violations.
VERBOSE: Fixed 0 violations.
VERBOSE: Analyzing Script Definition.
VERBOSE: Running PSUseConsistentWhitespace rule.
VERBOSE: Found 2 violations.
VERBOSE: Fixed 1 violations.
VERBOSE: Analyzing Script Definition.
VERBOSE: Running PSUseConsistentWhitespace rule.
VERBOSE: Found 1 violations.
VERBOSE: Fixed 1 violations.
VERBOSE: Analyzing Script Definition.
VERBOSE: Running PSUseConsistentIndentation rule.
VERBOSE: Found 0 violations.
VERBOSE: Fixed 0 violations.
VERBOSE: Analyzing Script Definition.
VERBOSE: Running PSAlignAssignmentStatement rule.
VERBOSE: Found 0 violations.
VERBOSE: Fixed 0 violations.
{ $pt.SprintEffortCharts = @{ PivotRows = 'Date' NoTotalsInPivot = $true PivotDataToColumn = $true } }
invoke-formatter.log
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.16299.820
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.820
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
1.17.1
1.17.1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、PSScriptAnalyzer 1.17.1 上で Invoke-Formatter を使用して、提供されたハッシュテーブルの例を再現し、次に PivotRows を次の行に移動したバージョンと比較します。1 行目のハッシュテーブルエントリに対するフォーマッターの動作を追跡します。ハッシュテーブルの内容を折りたたむことなく、ファイル全体が正しくフォーマットされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- powershell
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 45/100