Skip to content

style: format all PS1 source files with Invoke-Formatter#182

Merged
HeyItsGilbert merged 2 commits into
mainfrom
style/format-ps1-files
May 21, 2026
Merged

style: format all PS1 source files with Invoke-Formatter#182
HeyItsGilbert merged 2 commits into
mainfrom
style/format-ps1-files

Conversation

@HeyItsGilbert
Copy link
Copy Markdown
Member

@HeyItsGilbert HeyItsGilbert commented May 21, 2026

Summary

  • Ran Invoke-Formatter (PSScriptAnalyzer) across all 62 source .ps1 files
  • Output\ directory excluded — it is auto-generated by StageFiles
  • No logic changes; whitespace and style only

Test plan

  • Run .\build.ps1 StageFiles to verify staging still works
  • Run Pester tests to confirm no regressions

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings May 21, 2026 03:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .ps1 files (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 thread PSDepend/Private/Find-NugetPackage.ps1 Outdated
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"
}
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

Test Results

    4 files     76 suites   2m 10s ⏱️
1 320 tests 1 232 ✅ 88 💤 0 ❌
1 616 runs  1 526 ✅ 90 💤 0 ❌

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>
@HeyItsGilbert HeyItsGilbert merged commit 0a918c2 into main May 21, 2026
6 checks passed
@HeyItsGilbert HeyItsGilbert deleted the style/format-ps1-files branch May 21, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants