FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(tests): added closing bracket test for formatting presets by o-l-a-v · Pull Request #2161 · PowerShell/PSScriptAnalyzer · GitHub

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

Merged
Andy Jordan (andyleejordan) merged 2 commits into
PowerShell:mainfrom
o-l-a-v:feat/add-test-for-formatting-presets-square-bracket-handling
Mar 18, 2026
Merged

feat(tests): added closing bracket test for formatting presets#2161
Andy Jordan (andyleejordan) merged 2 commits into
PowerShell:mainfrom
o-l-a-v:feat/add-test-for-formatting-presets-square-bracket-handling

Conversation

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Comment thread Tests/Rules/PlaceCloseBrace.tests.ps1 Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Always good to have more tests :-)

Andy Jordan (andyleejordan) merged commit ac48fad into PowerShell:main Mar 18, 2026
4 checks passed
Olav Rønnestad Birkeland (o-l-a-v) deleted the feat/add-test-for-formatting-presets-square-bracket-handling branch March 19, 2026 05:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

4 participants


Back | FazBrowse Home | New Git URL