Skip to content

Add new code formatting preset "OTPS": OTBS with else on new line#2269

Draft
o-l-a-v wants to merge 1 commit into
PowerShell:mainfrom
o-l-a-v:feat/add-new-formatting-preset
Draft

Add new code formatting preset "OTPS": OTBS with else on new line#2269
o-l-a-v wants to merge 1 commit into
PowerShell:mainfrom
o-l-a-v:feat/add-new-formatting-preset

Conversation

@o-l-a-v

@o-l-a-v o-l-a-v commented Mar 1, 2026

Copy link
Copy Markdown

Edit: Blocked, see PowerShell/PSScriptAnalyzer#2045 (comment).

PR Summary

This PR adds a new code formatting preset, "OTPS" (One True PowerShell Style): OTBS with else on new line.

PR Context

Thoughts behind the name:

  • To mock the idea of one true formatting style, even though there are none.
  • We do ONE change from OTBS (else on new line), also in the name (change B with P).

Feature request:

Context:

@o-l-a-v

o-l-a-v commented Mar 1, 2026

Copy link
Copy Markdown
Author

@JustinGrote:

PowerShell/vscode-powershell#5109 (comment)

So a PR could be fairly straightforward to just add a new entry to the enum with the appropriate settings. Changing the switch to an exhausive pattern matching would also help catch any net-new issues.

Do you mean a default case could catch both Stroustrup and this new proposed style OTPS as have the same values?

@o-l-a-v o-l-a-v marked this pull request as draft March 7, 2026 12:33
@andyleejordan andyleejordan added Issue-Enhancement A feature request (enhancement). Area-Code Formatting labels Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Code Formatting Issue-Enhancement A feature request (enhancement).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants