Skip to content

feat(tests): added closing bracket test for formatting presets#2161

Open
o-l-a-v wants to merge 2 commits intoPowerShell:mainfrom
o-l-a-v:feat/add-test-for-formatting-presets-square-bracket-handling
Open

feat(tests): added closing bracket test for formatting presets#2161
o-l-a-v wants to merge 2 commits intoPowerShell:mainfrom
o-l-a-v:feat/add-test-for-formatting-presets-square-bracket-handling

Conversation

@o-l-a-v
Copy link

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

PR Summary

Since #2158 is blocked due to PSScriptAnalyzer formatting limitations #2045 (comment) I thought I could at least add the relevant tests I created in that PR, without the proposed new preset OTPS.

PR Checklist

Copilot AI review requested due to automatic review settings March 7, 2026 12:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds regression-style tests for Invoke-Formatter behavior around if/else close-brace placement across formatting presets, to preserve expected formatting semantics while broader preset work remains blocked upstream.

Changes:

  • Adds new Pester context validating if/else formatting output for CodeFormattingAllman, CodeFormattingOTBS, and CodeFormattingStroustrup.
  • Introduces canonical input/expected script definitions for the three brace styles and asserts formatter round-trips between them.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@o-l-a-v o-l-a-v requested review from a team and bergmeister as code owners March 7, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants