fix: add meta/manifest tests, fix tab indentation, and correct changelog version#188
Merged
Merged
Conversation
…log version - Add Manifest.tests.ps1, Meta.Tests.ps1, and MetaFixers.psm1 to validate manifest/changelog version parity and enforce space indentation - Convert tabs to spaces in PSGalleryModule.ps1, Get-Dependency.ps1, and five credential test depend files to satisfy the new meta test - Rename [0.4.0-alpha] to [0.4.0] in CHANGELOG.md so the version regex matches the manifest version and the manifest test passes - Update Help.tests.ps1 (collateral from the credential work) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Test Results 3 files 66 suites 1m 29s ⏱️ Results for commit b7bc142. ♻️ This comment has been updated with latest results. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds new “meta” and manifest validation tests to the PSDepend test suite, updates the changelog version header to align with the manifest version check, and normalizes indentation (tabs → spaces) in several scripts and test depend files.
Changes:
- Add new Pester tests and helper module to validate manifest/changelog version parity and enforce text-file formatting rules.
- Update
CHANGELOG.mdversion header from0.4.0-alphato0.4.0. - Replace tab indentation with spaces in selected scripts and credential-related depend files.
Reviewed changes
Copilot reviewed 5 out of 12 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/MetaFixers.psm1 | Adds helper functions for listing text files and applying encoding/indentation fixers. |
| Tests/Meta.Tests.ps1 | Introduces repo-wide checks for UTF-16/NUL bytes and tab indentation. |
| Tests/Manifest.tests.ps1 | Adds a manifest validation suite and changelog-version parity test. |
| Tests/Help.tests.ps1 | Updates test bootstrap/build behavior and refactors help-parameter validation. |
| Tests/DependFiles/savemodule.withcredentials.depend.psd1 | Converts tabs to spaces in test depend data. |
| Tests/DependFiles/psgallerynuget.withcredentials.psd1 | Converts tabs to spaces in test depend data. |
| Tests/DependFiles/psgallerynuget.latestversionwithcredential.depend.psd1 | Converts tabs to spaces in test depend data. |
| Tests/DependFiles/psgallerymodule.withcredentials.depend.psd1 | Converts tabs to spaces in test depend data. |
| Tests/DependFiles/psgallerymodule.multiplecredentials.depend.psd1 | Converts tabs to spaces in test depend data. |
| PSDepend/Public/Get-Dependency.ps1 | Adjusts comment-based help indentation and examples. |
| PSDepend/PSDependScripts/PSGalleryModule.ps1 | Fixes tab indentation in comment header. |
| CHANGELOG.md | Updates release header formatting/version label. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
112
to
114
| It "finds help parameter in code: <_>" { | ||
| $_ -in $script:commandParameterNames | Should -Be $true | ||
| $_ -in $parameterNames | Should -Be $true | ||
| } |
| $helpLinks = @($commandHelp.relatedLinks.navigationLink.uri | Where-Object { $_ }) | ||
| $helpParameters = global:FilterOutCommonParams -Params $commandHelp.Parameters.Parameter | ||
| $helpParameterNames = $helpParameters.Name | ||
| # $helpLinks = $commandHelp.relatedLinks.navigationLink.uri |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Gilbert Sanchez <me@gilbertsanchez.com>
…ngelog path line - Use $commandParameterNames (not undefined $parameterNames) in the help-parameter-in-code assertion - Populate $helpParameterNames in BeforeDiscovery so Context -ForEach actually iterates during discovery (was silently empty with BeforeAll) - Remove duplicate $changelogPath assignment that used the wrong -Child alias Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fixes PSAvoidTrailingWhitespace violations on lines 28 and 83 (blank lines inside comment-based help). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PSAvoidTrailingWhitespace (73): Strip trailing whitespace from all .ps1/.psm1 files under PSDepend/ and Tests/ PSPossibleIncorrectComparisonWithNull (4): Move $null to left-hand side in GitHub.ps1, Npm.ps1, Sort-WithCustomList.ps1 PSAvoidUsingCmdletAliases (1): Replace `select` with Select-Object in Invoke-PSDepend.ps1 PSUseOutputTypeCorrectly (27): Add [OutputType(...)] to Get-PSDependScript, Invoke-PSDepend, Sort-PSDependency, Test-Dotnet, Test-PlatformSupport, Validate-DependencyParameters, New-TestCredential, and Test-PSDependTypeSupportedHere Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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
Manifest.tests.ps1,Meta.Tests.ps1, andMetaFixers.psm1— new test infrastructure that validates manifest/changelog version parity and enforces space indentation across all text files[0.4.0-alpha]→[0.4.0]inCHANGELOG.mdso the manifest test's version regex matches the manifest versionPSGalleryModule.ps1,Get-Dependency.ps1, and five credential test depend files to satisfy the meta indentation testTest plan
.\build.ps1 StageFilescompletes cleanlyManifest.tests.ps1passes (changelog version matches manifest)Meta.Tests.ps1passes (0 files with tab indentation)🤖 Generated with Claude Code