gaelcolas / gaelcolas/Sampler

Minor cleanups after PR #560 (`throw` style, `Features` casing, stray whitespace)

Open
#566 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
243
Forks
46
Avg merge
1h 41m
Merged PRs (30d)
1

Description

**Problem description**
Three low-priority cleanups noticed during review of #560:

1. **`throw` style inconsistency.** The new Plaster v1/v2 fallback in `Sampler/Public/Add-Sample.ps1` and `Sampler/Public/New-SamplerPipeline.ps1` uses a plain string `throw`. Sampler elsewhere uses `$script:localizedData` + a structured `ErrorRecord`, and the new `public-functions.instructions.md` / `private-functions.instructions.md` prescribe that style.
2. **`Features` `ValidateSet` casing.** The list mixes casing deliberately (`Enum`, `Classes`, `git`, `gitversion`, `github`, `vscode`, `codecov`, `azurepipelines`, `Gherkin`, `UnitTests`, `ModuleQuality`, `Build`, `AppVeyor`, `TestKitchen`). PowerShell binding and `-contains` in the manifest are case-insensitive, so it works, but the asymmetry is ugly and invites typos in downstream contributions.
3. **Stray whitespace.** `tests/Integration/PlasterTemplates/Sampler/CustomModulePlasterTemplate.Integration.Tests.ps1` lost a space before a trailing comment: `Features = 'git'# All,Enum,Classes,...`.

**Verbose logs**
N/A

**How to reproduce**
Read the files listed above.

**Expected behavior**
- Structured `ErrorRecord` throws with localized messages.
- Consistent casing across `ValidateSet` and manifest `` entries.
- Space before `#` comment.

**Current behavior**
Plain-string `throw`; mixed casing; missing space before `#`.

**Suggested solution**
Address each item in a single small cleanup PR; none of them are urgent.

**Operating system the target node is running**
N/A

**PowerShell version and build the target node is running**
N/A

**Module version used**
Sampler `Unreleased` / post-#560.

Contributor guide

Open the contributing guide

Research direction

Start with Sampler/Public/Add-Sample.ps1 and Sampler/Public/New-SamplerPipeline.ps1, comparing their fallback throws with the style prescribed in public-functions.instructions.md and private-functions.instructions.md. Inspect the Features ValidateSet and manifest choice entries, then fix the listed casing and update tests/Integration/PlasterTemplates/Sampler/CustomModulePlasterTemplate.Integration.Tests.ps1 so the trailing comment has a preceding space; done means all three cleanups are consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
testing-qa, tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.