refactor(scripts): align LintingHelpers.psm1 with hve-core upstream#193
Merged
WilliamBerryiii merged 5 commits intomainfrom Feb 18, 2026
Merged
refactor(scripts): align LintingHelpers.psm1 with hve-core upstream#193WilliamBerryiii merged 5 commits intomainfrom
WilliamBerryiii merged 5 commits intomainfrom
Conversation
- add CIHelpers.psm1 import and remove 4 dead CI helper functions - add --diff-filter=ACMR and HEAD~1 fallback to Get-ChangedFilesFromGit - use pipeline filtering with inline Test-Path and platform-aware separators - make Get-FilesRecursive -Include mandatory, use single Get-ChildItem call - reduce Export-ModuleMember from 7 to 3 functions ♻️ - Generated by Copilot
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
Aligns scripts/linting/Modules/LintingHelpers.psm1 with the upstream hve-core implementation by slimming the module surface area and delegating CI-related helpers to CIHelpers.psm1.
Changes:
- Adds SPDX/copyright header and imports
CIHelpers.psm1; removes GitHub-specific CI helper functions and reduces exports. - Updates
Get-ChangedFilesFromGitfallback strategy and filtering (diff-filter, HEAD~1 fallback, pipeline filtering). - Refactors
Get-FilesRecursive/Get-GitIgnorePatternsfor simpler recursion and platform-aware path separators.
♻️ - Generated by Copilot
- add --diff-filter=ACMR to final git diff fallback with fail-fast on empty - wrap Get-ChildItem in @() for null-safe internal handling - add try/catch error handling on Get-Content in Get-GitIgnorePatterns - fix file-glob patterns to omit trailing separator for *.log/*.tmp - add 28 unit tests covering all 3 exported functions 🔧 - Generated by Copilot
…gHelpers - add explicit LASTEXITCODE check on HEAD~1 fallback for consistency - wrap pipeline return values in @() to guarantee array contracts - add tests verifying array-type returns from all three functions 🔧 - Generated by Copilot
agreaves-ms
approved these changes
Feb 18, 2026
bindsi
approved these changes
Feb 18, 2026
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.
Description
Align
scripts/linting/Modules/LintingHelpers.psm1with the upstream hve-core reference, reducing the module from 7 exports to 3 and delegating CI helper functions to the existingCIHelpers.psm1module. Address all PR review feedback and add comprehensive unit tests.Closes #68
Type of Change
Component(s) Affected
deploy/000-prerequisitesdeploy/001-iacdeploy/002-setupdeploy/004-workflowsrc/trainingdocs/Changes
CIHelpers.psm1import and remove 4 dead CI helper functions (Write-GitHubAnnotation,Set-GitHubOutput,Set-GitHubEnv,Write-GitHubStepSummary)--diff-filter=ACMRandHEAD~1fallback toGet-ChangedFilesFromGitTest-Pathand return@()on errorGet-FilesRecursive-Includeparameter mandatory, use singleGet-ChildItemcall[System.IO.Path]::DirectorySeparatorCharfor platform-aware separator inGet-GitIgnorePatternsExport-ModuleMemberfrom 7 to 3 functionsPR Review Fixes (Round 1)
--diff-filter=ACMRto final fallbackgit diffbranch and fail-fast withWrite-Warningwhen no changed files are foundGet-ChildItemresult in@()inGet-FilesRecursiveto guarantee array return instead of$nulltry/catcherror handling onGet-ContentinGet-GitIgnorePatterns, returning@()on failure*.log,*.tmp) to omit trailing directory separator that prevented matchingPR Review Fixes (Round 2)
$LASTEXITCODE -eq 0check onHEAD~1fallback for consistency with merge-base checkreturn $filteredFilesin@()inGet-ChangedFilesFromGitto guarantee array contract$files | Where-Objectreassignment in@()inGet-FilesRecursiveto preserve array guaranteereturn $patternsin@()inGet-GitIgnorePatternsto match early-exit return typesUnit Tests
scripts/tests/linting/LintingHelpers.Tests.ps1with 30 unit tests covering all 3 exported functionsInModuleScope,BeforeAll/AfterAllmodule import, and mock-based isolationTesting Performed
LintingHelpers.psm1and allscripts/linting/filesGet-ChangedFilesFromGit,Get-FilesRecursive,Get-GitIgnorePatterns)Documentation Impact
Checklist