-
Notifications
You must be signed in to change notification settings - Fork 125
Closed
Labels
good first issueGood for newcomersGood for newcomersmaintenanceMaintenance work, no version bumpMaintenance work, no version bump
Milestone
Description
Issue Description
Invoke-YamlLint.ps1 and Invoke-PSScriptAnalyzer.ps1 share nearly identical boilerplate for parameter handling, changes-only filtering, and result reporting. This common structure could be extracted into a shared pattern or helper function to reduce maintenance overhead.
Additional Context
Shared patterns between the scripts:
- Same parameter sets (
-ChangesOnly,-BaseBranch,-OutputFormat) - Identical imports of
LintingHelpers.psm1 - Same pattern for collecting changed files and filtering
- Similar result aggregation and output format handling
Recommended approach:
- Create a
New-LintingContextfunction inLintingHelpers.psm1that handles common setup (file discovery, changes-only filtering) - Update both scripts to use the shared context builder
- Keep tool-specific logic (PSScriptAnalyzer vs actionlint invocation) in each script
Testing:
- Run both
npm run psscriptanalyzerandnpm run lint:yaml - Verify
-ChangesOnlybehavior still works for both - Run existing Pester tests
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomersmaintenanceMaintenance work, no version bumpMaintenance work, no version bump