PowerShell / PowerShell/PSScriptAnalyzer
Code Formatting: Whitespacing ValidateSet
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 414
- Avg merge
- 13h 1m
- Merged PRs (30d)
- 2
Description
Summary of the new feature
I've this validateset:

Sometimes I want it to have 2-3 per line so I start removing pressing delete button and I end up with what you see above. It would be nice if I could then press format and it would remove that unnessecary whitespace. While initially I thought it could be all automatic you said on twiter that it may quickly get out of control. I agree of course (even thou I would ant different styles to be available - like 3 validateset params per line) but at least maybe this can be addressed? It's just making sure there is only 1 white space per line (or defined value if it's needed).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the formatter or formatting command in PSScriptAnalyzer and reviewing any existing whitespace rules or tests. Clarify whether the goal is one whitespace style or configurable items per line, then define tests covering the ValidateSet example and the expected formatted output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100