style: format all PS1 source files with Invoke-Formatter#182
Merged
Conversation
Run PSScriptAnalyzer's Invoke-Formatter across all 62 source PS1 files (excludes Output\ which is auto-generated). No logic changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes formatting across PSDepend’s PowerShell source and test scripts by running Invoke-Formatter (PSScriptAnalyzer), aiming to make style consistent and reduce diff noise going forward.
Changes:
- Reformat
.ps1files (whitespace, indentation, brace style, alignment). - Normalize attribute/parameter formatting in public/private functions and scripts.
- Apply the same formatting pass to Pester test files for consistency.
Reviewed changes
Copilot reviewed 48 out of 62 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/PSResourceGet.Type.Tests.ps1 | Formatting-only changes in PSResourceGet tests. |
| Tests/PSModuleGallery.Type.Tests.ps1 | Formatting-only changes in integration tests (including multi-line if expressions). |
| Tests/PSGalleryNuget.Type.Tests.ps1 | Formatting-only changes to mocks/stubs. |
| Tests/PSGalleryModule.Type.Tests.ps1 | Formatting-only changes to mocks/stubs. |
| Tests/PSDepend.Tests.ps1 | Formatting-only changes (spacing/alignment in test setup). |
| Tests/Package.Type.Tests.ps1 | Formatting-only changes to stub function declarations and mocks. |
| Tests/Npm.Type.Tests.ps1 | Formatting-only changes to mocks. |
| Tests/Help.tests.ps1 | Formatting-only changes to hashtable alignment. |
| Tests/GitHub.Type.Tests.ps1 | Formatting-only changes to mocks. |
| Tests/Git.Type.Tests.ps1 | Formatting-only changes to mocks. |
| Tests/DotnetSdk.Type.Tests.ps1 | Formatting-only changes to mocks. |
| PSDepend/Public/Test-Dependency.ps1 | Formatting-only changes to parameter attributes/ValidateScript spacing. |
| PSDepend/Public/Invoke-PSDepend.ps1 | Formatting-only changes to cmdlet binding/flow control layout. |
| PSDepend/Public/Invoke-DependencyScript.ps1 | Formatting-only changes to loops/conditionals and splat construction layout. |
| PSDepend/Public/Install-Dependency.ps1 | Formatting-only changes (cmdletbinding/Process block style). |
| PSDepend/Public/Import-Dependency.ps1 | Formatting-only changes (parameter attributes/Process block style). |
| PSDepend/Public/Get-PSDependType.ps1 | Formatting-only changes (loop/conditional layout and object formatting). |
| PSDepend/Public/Get-PSDependScript.ps1 | Formatting-only changes (loop/conditional layout). |
| PSDepend/Public/Get-Dependency.ps1 | Formatting-only changes (parameter set attributes, branching layout, object formatting). |
| PSDepend/PSDependScripts/Task.ps1 | Formatting-only changes (loop/conditional layout). |
| PSDepend/PSDependScripts/PSResourceGet.ps1 | Formatting-only changes (brace/elseif layout). |
| PSDepend/PSDependScripts/PSGalleryNuget.ps1 | Formatting-only changes (indentation and branching layout). |
| PSDepend/PSDependScripts/PSGalleryModule.ps1 | Formatting-only changes (branching layout, splat formatting). |
| PSDepend/PSDependScripts/Package.ps1 | Formatting-only changes (branching layout, splat formatting). |
| PSDepend/PSDependScripts/Nuget.ps1 | Formatting-only changes (indentation and branching layout). |
| PSDepend/PSDependScripts/Npm.ps1 | Formatting-only changes (region layout, branching layout). |
| PSDepend/PSDependScripts/Noop.ps1 | Formatting-only changes (hashtable alignment). |
| PSDepend/PSDependScripts/GitHub.ps1 | Formatting-only changes (branching/loop layout). |
| PSDepend/PSDependScripts/Git.ps1 | Formatting-only changes (branching/loop layout). |
| PSDepend/PSDependScripts/FileSystem.ps1 | Formatting-only changes (including removal of BOM and loop/branch layout). |
| PSDepend/PSDependScripts/FileDownload.ps1 | Formatting-only changes (function/branch layout). |
| PSDepend/PSDependScripts/DotnetSdk.ps1 | Formatting-only changes (branch layout). |
| PSDepend/PSDependScripts/Command.ps1 | Formatting-only changes (loop/try-catch layout). |
| PSDepend/PSDependScripts/Chocolatey.ps1 | Formatting-only changes (splat alignment, try/catch/elseif layout). |
| PSDepend/Private/Validate-DependencyParameters.ps1 | Formatting-only changes (including removal of BOM and loop/branch layout). |
| PSDepend/Private/Test-PlatformSupport.ps1 | Formatting-only changes (including removal of BOM and branch layout). |
| PSDepend/Private/Test-Dotnet.ps1 | Formatting-only changes (attribute spacing and branch layout). |
| PSDepend/Private/Sort-WithCustomList.ps1 | Formatting-only changes (parameter attributes and Begin/Process/End layout). |
| PSDepend/Private/Sort-PSDependency.ps1 | Formatting-only changes (loop/branch layout). |
| PSDepend/Private/Save-NugetPackage.ps1 | Formatting-only changes (including removal of BOM and attribute spacing). |
| PSDepend/Private/Resolve-DependScripts.ps1 | Formatting-only changes (including removal of BOM and loop/branch layout). |
| PSDepend/Private/Invoke-ExternalCommand.ps1 | Formatting-only changes (including removal of BOM and branch layout). |
| PSDepend/Private/Install-NodeModule.ps1 | Formatting-only changes to inline npm install invocation formatting. |
| PSDepend/Private/Install-Dotnet.ps1 | Formatting-only changes (attribute spacing and branch layout). |
| PSDepend/Private/Import-PSDependModule.ps1 | Formatting-only changes (including removal of BOM and loop/branch layout). |
| PSDepend/Private/Get-WebFile.ps1 | Formatting-only changes (including removal of BOM and indentation). |
| PSDepend/Private/Get-TopologicalSort.ps1 | Formatting-only changes (indentation and loop/branch layout). |
| PSDepend/Private/Get-TaggedDependency.ps1 | Formatting-only changes (including removal of BOM and loop/branch layout). |
| PSDepend/Private/Get-PropertyOrder.ps1 | Formatting-only changes (including removal of BOM and block layout). |
| PSDepend/Private/Get-ProjectDetail.ps1 | Formatting-only changes (including removal of BOM and loop/branch layout). |
| PSDepend/Private/Get-ParameterName.ps1 | Formatting-only changes (indentation and parameter list layout). |
| PSDepend/Private/Get-Parameter.ps1 | Large formatting-only refactor of indentation and block structure. |
| PSDepend/Private/Get-NodeModule.ps1 | Formatting-only changes (branch layout). |
| PSDepend/Private/Get-Hash.ps1 | Formatting-only changes (parameter attribute layout and branching). |
| PSDepend/Private/Get-ClonedObject.ps1 | Formatting-only changes (elseif/else brace layout). |
| PSDepend/Private/Find-NugetPackage.ps1 | Formatting changes surfaced functional issues in bound-parameter checking and auth header/token construction (needs fixes). |
| PSDepend/Private/Bootstrap-Nuget.ps1 | Formatting-only changes (indentation, -Uri casing). |
| PSDepend/Private/Add-ToItemCollection.ps1 | Formatting-only changes (including removal of BOM and branch layout). |
| PSDepend/Private/Add-ObjectDetail.ps1 | Formatting-only changes (including removal of BOM and block layout). |
| psakeFile.ps1 | Formatting-only changes (preference assignments and variable alignment). |
| Examples/Install-PSDepend.ps1 | Formatting-only changes (including removal of BOM and -Uri casing). |
| build.ps1 | Formatting-only changes (try/catch/else brace layout). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
35
to
41
| $headers = @{} | ||
| if ($null -ne $Credential) | ||
| { | ||
| if ($null -ne $Credential) { | ||
| $basicAuthToken = [Convert]::ToBase64String(":$($Credential.GetNetworkCredential().Password)") | ||
|
|
||
| $headers["X-NuGet-ApiKey"] = $Credential.UserName | ||
| $headers["Authentication"] = "Basic $basicAuthToken" | ||
| } |
Test Results 4 files 76 suites 2m 10s ⏱️ Results for commit 3895a35. ♻️ This comment has been updated with latest results. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Gilbert Sanchez <me@gilbertsanchez.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Invoke-Formatter(PSScriptAnalyzer) across all 62 source.ps1filesOutput\directory excluded — it is auto-generated byStageFilesTest plan
.\build.ps1 StageFilesto verify staging still works🤖 Generated with Claude Code