style: add ValidateNotNullOrEmpty to build.ps1 -Task parameter#20
Conversation
Matches the canonical template (PowerShellModuleTemplate#23). Without the validator, `./build.ps1 -Task ''` and `./build.ps1 -Task $null` slip past parameter binding and produce confusing downstream errors from psake. The validator surfaces the misuse immediately.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesBuild Script Parameter Validation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR improves build.ps1 argument validation by adding [ValidateNotNullOrEmpty()] to the -Task parameter, so invalid invocations fail immediately during parameter binding rather than producing confusing downstream psake errors.
Changes:
- Add
[ValidateNotNullOrEmpty()]to thebuild.ps1-Taskparameter to reject''and$nullinputs earlier.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Adds
[ValidateNotNullOrEmpty()]to the$Taskparameter inbuild.ps1to match the canonical pattern from PowerShellModuleTemplate#23.Without the validator,
./build.ps1 -Task ''and./build.ps1 -Task$null` slip past parameter binding and produce confusing downstream errors from psake. The validator surfaces the misuse immediately.Test plan
./build.ps1still runs successfully (default'default'task)./build.ps1 -Task ''fails fast with a parameter-validation error🤖 Generated with Claude Code
Summary by CodeRabbit