PowerShell / PowerShell/PSScriptAnalyzer

Code Formatting: Whitespacing ValidateSet

Open
#1,125 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area - Formatter Up-for-Grabs
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:

image

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.