GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Add file-path support to Invoke-Formatter by Copilot · Pull Request #2230 · PowerShell/PSScriptAnalyzer Conversation
|
There was an error while loading. Please reload this page.
| File | Description |
|---|---|
| Tests/Engine/ModuleHelp.Tests.ps1 | Updates checks for pipeline-binding help metadata. |
| Tests/Engine/InvokeFormatter.tests.ps1 | Tests file formatting, encoding, indentation, and -WhatIf. |
| Engine/Commands/InvokeFormatterCommand.cs | Implements path-based formatting and file-property handling. |
| docs/Cmdlets/Invoke-Formatter.md | Documents the new parameter set and usage. |
Review effort: Balanced
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: bergmeister <[email protected]>
Refactor encoding handling and indentation logic. Co-authored-by: Copilot Autofix powered by AI <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
BOM-less legacy-encoded scripts fail to format, leaving the encoding-preservation requirement unmet.
In code that hasn't changed since last review
docs/Cmdlets/Invoke-Formatter.md:21
The help source does not represent the new mutually exclusive parameter sets correctly: both invocations share one unnamed syntax block, and -ScriptDefinition still declares Parameter Sets: (All) at line 145. This file feeds New-ExternalHelp in build.psm1:65, so these declarations also affect generated help. Give ScriptDefinition (Default) and Path separate ### headings and syntax blocks, following docs/Cmdlets/Invoke-ScriptAnalyzer.md:16–53, and change the ScriptDefinition parameter metadata to Parameter Sets: ScriptDefinition.
Review effort: Balanced
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: bergmeister <[email protected]>
Co-authored-by: bergmeister <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
CR-only files encounter a formatting failure, and the legacy-encoding regression is not portable across supported Windows PowerShell environments.
Review effort: Balanced
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| int spaceIndentedLines = 0; | ||
| string firstIndentationKind = "space"; | ||
| bool foundIndentation = false; | ||
| string[] lines = scriptDefinition.Split('\n'); |
| [System.IO.File]::ReadAllBytes($path)[0..1] | Should -Be @(255, 254) | ||
| } | ||
|
|
||
| It 'Best-effort formats BOM-less files using a legacy encoding' { |
| $scriptDefinition = '$name=''café''' | ||
| $expected = '$name = ''café''' |
* Initial plan * Handle CR-only formatter line endings Co-authored-by: bergmeister <[email protected]> * Make legacy encoding fixture source-independent Co-authored-by: bergmeister <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: bergmeister <[email protected]>
At least 1 approving review is required to merge this pull request.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Add-Path parameter to Invoke-Formatter
There was an error while loading. Please reload this page.