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
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:f98848e6-9e84-cbb4-afa0-041847c94fa7 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C0F4:1406EF:83B69:AF9F6:6A594C63 |
| html-safe-nonce | 4bdc88c4e3394f6223b0ea211d7769da0fc9167ccde680f0d861b67f11a65c29 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMEY0OjE0MDZFRjo4M0I2OTpBRjlGNjo2QTU5NEM2MyIsInZpc2l0b3JfaWQiOiI2MTYwODQzNzI3MDMwNTM3MzE1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b3666a58b66c31299c9142986b8aee1fb5044b2f8db883f9170b87934c066f05 |
| hovercard-subject-tag | pull_request:3340559325 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/PowerShell/PSScriptAnalyzer/pull/2158/files |
| twitter:image | https://avatars.githubusercontent.com/u/6450056?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/6450056?s=400&v=4 |
| og:image:alt | 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... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9f801e05b35c85b2d72eae6534d2b1d4c02ba8732fd046450bab31e2f52450ce |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/PowerShell/PSScriptAnalyzer git https://github.com/PowerShell/PSScriptAnalyzer.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 33149177 |
| octolytics-dimension-repository_nwo | PowerShell/PSScriptAnalyzer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 33149177 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PSScriptAnalyzer |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 49918fc503387d6d65b6bc6ce6f711c14d17bfbd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width