René's URL Explorer Experiment


Title: Add new code formatting preset "OTPS": OTBS with `else` on new line by o-l-a-v · Pull Request #2158 · PowerShell/PSScriptAnalyzer · GitHub

Open Graph Title: Add new code formatting preset "OTPS": OTBS with `else` on new line by o-l-a-v · Pull Request #2158 · PowerShell/PSScriptAnalyzer

X Title: Add new code formatting preset "OTPS": OTBS with `else` on new line by o-l-a-v · Pull Request #2158 · PowerShell/PSScriptAnalyzer

Description: Edit: Blocked, see #2045 (comment). PR Summary Linked PR in PowerShellEditorServices: PowerShell/PowerShellEditorServices#2269 PR that can be merged after this in vscode-powershell: PowerShell/vscode-powershell#5413 This PR adds a new code formatting preset, "OTPS" (One True PowerShell Style): OTBS with else on new line. 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: #2045 Context: "There is no One True Brace Style": PoshCode/PowerShellPracticeAndStyle#177 About OTBS with else on a new line: PoshCode/PowerShellPracticeAndStyle#177 (comment) PoshCode/PowerShellPracticeAndStyle#177 (comment) PR Checklist PR has a meaningful title Use the present tense and imperative mood when describing your changes Summarized changes Change is not breaking Make sure all .cs, .ps1 and .psm1 files have the correct copyright header Make sure you've added a new test if existing tests do not effectively test the code changed and/or updated documentation This PR is ready to merge and is not Work in Progress. If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready. Tested like so # Build .\build.ps1 -PSVersion 7 -Configuration Release # Import built module Import-Module -Name './out/PSScriptAnalyzer\1.24.0\PSScriptAnalyzer.psd1' # Test new preset with OTBS as input Invoke-Formatter -Settings 'CodeFormattingOTPS' -ScriptDefinition (@' enum Color { Black, White } function Test-Code { [CmdletBinding()] param( [int]$ParameterOne ) end { if (10 -gt $ParameterOne) { "Greater" } else { "Lesser" } } } '@)

Open Graph Description: Edit: Blocked, see #2045 (comment). PR Summary Linked PR in PowerShellEditorServices: PowerShell/PowerShellEditorServices#2269 PR that can be merged after this in vscode-powershell: PowerShell/vsc...

X Description: Edit: Blocked, see #2045 (comment). PR Summary Linked PR in PowerShellEditorServices: PowerShell/PowerShellEditorServices#2269 PR that can be merged after this in vscode-powershell: PowerShell/vsc...

Opengraph URL: https://github.com/PowerShell/PSScriptAnalyzer/pull/2158

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:f98848e6-9e84-cbb4-afa0-041847c94fa7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC0F4:1406EF:83B69:AF9F6:6A594C63
html-safe-nonce4bdc88c4e3394f6223b0ea211d7769da0fc9167ccde680f0d861b67f11a65c29
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMEY0OjE0MDZFRjo4M0I2OTpBRjlGNjo2QTU5NEM2MyIsInZpc2l0b3JfaWQiOiI2MTYwODQzNzI3MDMwNTM3MzE1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacb3666a58b66c31299c9142986b8aee1fb5044b2f8db883f9170b87934c066f05
hovercard-subject-tagpull_request:3340559325
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files
twitter:imagehttps://avatars.githubusercontent.com/u/6450056?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/6450056?s=400&v=4
og:image:altEdit: Blocked, see #2045 (comment). PR Summary Linked PR in PowerShellEditorServices: PowerShell/PowerShellEditorServices#2269 PR that can be merged after this in vscode-powershell: PowerShell/vsc...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9f801e05b35c85b2d72eae6534d2b1d4c02ba8732fd046450bab31e2f52450ce
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/PowerShell/PSScriptAnalyzer git https://github.com/PowerShell/PSScriptAnalyzer.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id33149177
octolytics-dimension-repository_nwoPowerShell/PSScriptAnalyzer
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id33149177
octolytics-dimension-repository_network_root_nwoPowerShell/PSScriptAnalyzer
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release49918fc503387d6d65b6bc6ce6f711c14d17bfbd
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPSScriptAnalyzer%2Fpull%2F2158%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPSScriptAnalyzer%2Fpull%2F2158%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=PowerShell%2FPSScriptAnalyzer
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files
PowerShell https://github.com/PowerShell
PSScriptAnalyzerhttps://github.com/PowerShell/PSScriptAnalyzer
Notifications https://github.com/login?return_to=%2FPowerShell%2FPSScriptAnalyzer
Fork 411 https://github.com/login?return_to=%2FPowerShell%2FPSScriptAnalyzer
Star 2.1k https://github.com/login?return_to=%2FPowerShell%2FPSScriptAnalyzer
Code https://github.com/PowerShell/PSScriptAnalyzer
Issues 393 https://github.com/PowerShell/PSScriptAnalyzer/issues
Pull requests 14 https://github.com/PowerShell/PSScriptAnalyzer/pulls
Discussions https://github.com/PowerShell/PSScriptAnalyzer/discussions
Actions https://github.com/PowerShell/PSScriptAnalyzer/actions
Projects https://github.com/PowerShell/PSScriptAnalyzer/projects
Wiki https://github.com/PowerShell/PSScriptAnalyzer/wiki
Security and quality 0 https://github.com/PowerShell/PSScriptAnalyzer/security
Insights https://github.com/PowerShell/PSScriptAnalyzer/pulse
Code https://github.com/PowerShell/PSScriptAnalyzer
Issues https://github.com/PowerShell/PSScriptAnalyzer/issues
Pull requests https://github.com/PowerShell/PSScriptAnalyzer/pulls
Discussions https://github.com/PowerShell/PSScriptAnalyzer/discussions
Actions https://github.com/PowerShell/PSScriptAnalyzer/actions
Projects https://github.com/PowerShell/PSScriptAnalyzer/projects
Wiki https://github.com/PowerShell/PSScriptAnalyzer/wiki
Security and quality https://github.com/PowerShell/PSScriptAnalyzer/security
Insights https://github.com/PowerShell/PSScriptAnalyzer/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FPowerShell%2FPSScriptAnalyzer%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FPowerShell%2FPSScriptAnalyzer%2Fissues%2Fnew%2Fchoose
o-l-a-vhttps://github.com/o-l-a-v
PowerShell:mainhttps://github.com/PowerShell/PSScriptAnalyzer/tree/main
o-l-a-v:feat/add-new-formatting-presethttps://github.com/o-l-a-v/PowerShell--PSScriptAnalyzer/tree/feat/add-new-formatting-preset
Conversation 9 https://github.com/PowerShell/PSScriptAnalyzer/pull/2158
Commits 6 https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/commits
Checks 4 https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/checks
Files changed 4 https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files
Add new code formatting preset "OTPS": OTBS with else on new line https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#top
Show all changes 6 commits https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files
6949890 feat: added new code formatting preset OTPS o-l-a-v Mar 1, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/commits/69498906d3f2853343256e8e4623f2b3050505a4
5e8ed23 feat: added new code formatting preset OTPS to some tests where i fou… o-l-a-v Mar 1, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/commits/5e8ed23c0ad5374ba291a287bd3b7ddbcf118126
52ba0d0 feat(tests): added dedicated test for code formatting presets o-l-a-v Mar 6, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/commits/52ba0d0c267cccba37995cf0094fd423ff71b79b
3db1d6d feat(tests): added context for how code formatting presets handles cl… o-l-a-v Mar 6, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/commits/3db1d6d81f181f910eeab3b9d6f67f8947a32ca8
75a4be0 fix(tests): fix preset test presets o-l-a-v Mar 6, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/commits/75a4be03fe1f15868e54ac67c58ee82b049ca220
29da161 fix(tests): fixed string quotes for new test o-l-a-v Mar 7, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/commits/29da161183998287d100d5479b6dc3db56d835d9
Clear filters https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files
CodeFormattingOTPS.psd1 https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#diff-4fea40228d902bf2c6af91cfcf1d691eb99f47028a9639d5c5e77c48ba2103fb
CodeFormattingPresets.tests.ps1 https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#diff-71b174bc98b3a49210804885e7e08406c53a9c76a72f91eba499e2a4ee8115a3
PlaceCloseBrace.tests.ps1 https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#diff-d92c1b89bfb8f26076ce183bb3e8cf44968e34f781cf5c05f0dec164737fd007
PlaceOpenBrace.tests.ps1 https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#diff-ee321a08c3559fb7f2b2e7f2cdabf2bc238158e9cdf7d42657801d32d7284191
https://github.com/PowerShell/PSScriptAnalyzer/blob/main/.github/CODEOWNERS#L2
Engine/Settings/CodeFormattingOTPS.psd1https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#diff-4fea40228d902bf2c6af91cfcf1d691eb99f47028a9639d5c5e77c48ba2103fb
View file https://github.com/PowerShell/PSScriptAnalyzer/blob/29da161183998287d100d5479b6dc3db56d835d9/Engine/Settings/CodeFormattingOTPS.psd1
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/{{ revealButtonHref }}
https://github.com/PowerShell/PSScriptAnalyzer/blob/main/.github/CODEOWNERS#L2
Tests/Rules/CodeFormattingPresets.tests.ps1https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#diff-71b174bc98b3a49210804885e7e08406c53a9c76a72f91eba499e2a4ee8115a3
View file https://github.com/PowerShell/PSScriptAnalyzer/blob/29da161183998287d100d5479b6dc3db56d835d9/Tests/Rules/CodeFormattingPresets.tests.ps1
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/{{ revealButtonHref }}
https://github.com/PowerShell/PSScriptAnalyzer/blob/main/.github/CODEOWNERS#L2
Tests/Rules/PlaceCloseBrace.tests.ps1https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#diff-d92c1b89bfb8f26076ce183bb3e8cf44968e34f781cf5c05f0dec164737fd007
View file https://github.com/PowerShell/PSScriptAnalyzer/blob/29da161183998287d100d5479b6dc3db56d835d9/Tests/Rules/PlaceCloseBrace.tests.ps1
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/{{ revealButtonHref }}
https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#diff-d92c1b89bfb8f26076ce183bb3e8cf44968e34f781cf5c05f0dec164737fd007
Copilothttps://github.com/apps/copilot-pull-request-reviewer
Mar 6, 2026https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#r2897265070
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files
Copilothttps://docs.github.com/copilot/responsible-use-of-github-copilot-features/responsible-use-of-github-copilot-code-review
o-l-a-vhttps://github.com/o-l-a-v
Mar 6, 2026https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#r2897281759
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files
https://github.com/PowerShell/PSScriptAnalyzer/blob/main/.github/CODEOWNERS#L2
Tests/Rules/PlaceOpenBrace.tests.ps1https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#diff-ee321a08c3559fb7f2b2e7f2cdabf2bc238158e9cdf7d42657801d32d7284191
View file https://github.com/PowerShell/PSScriptAnalyzer/blob/29da161183998287d100d5479b6dc3db56d835d9/Tests/Rules/PlaceOpenBrace.tests.ps1
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/{{ revealButtonHref }}
https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#diff-ee321a08c3559fb7f2b2e7f2cdabf2bc238158e9cdf7d42657801d32d7284191
https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#diff-ee321a08c3559fb7f2b2e7f2cdabf2bc238158e9cdf7d42657801d32d7284191
https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#diff-ee321a08c3559fb7f2b2e7f2cdabf2bc238158e9cdf7d42657801d32d7284191
https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files#diff-ee321a08c3559fb7f2b2e7f2cdabf2bc238158e9cdf7d42657801d32d7284191
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.