René's URL Explorer Experiment


Title: Improve pipeline indentation handling in UseConsistentIndentation rule by liamjpeters · Pull Request #2173 · PowerShell/PSScriptAnalyzer · GitHub

Open Graph Title: Improve pipeline indentation handling in UseConsistentIndentation rule by liamjpeters · Pull Request #2173 · PowerShell/PSScriptAnalyzer

X Title: Improve pipeline indentation handling in UseConsistentIndentation rule by liamjpeters · Pull Request #2173 · PowerShell/PSScriptAnalyzer

Description: PR Summary Two small improvements in the UseConsistentIndentation rule's handing of pipeline indentation. Flagged in this issue and issue comment. Rule never finds the ends of nested pipelines, as it had a fast-return when it reached a pipeline who's end position was beyond the current tokens line. It would always find the outer/parent pipeline (which contains the nested pipeline and spans past it) and return early, empty-handed. This would lead to some cases of "runaway" indents. PR sorts the pipelines, in place, by their end line number and column number. This allows the nested pipeline to be found first (as they end before their parent pipeline). Rule was using a single counter to keep track of pipeline indentation and then removing it all when it found a pipeline end. There were some edge cases that were, even with the first issue resolved, not quite right. PR adds in tracking of each pipeline's indentation contribution separately. Small improvements in the UseConsistentIndentation rule's handling of indentation where opening braces are on the same line. Previously, adjacent openers like .foreach({, @(@{, or ([PSCustomObject]@{ each incremented the indentation level, producing double or triple indentation. Now only the last unclosed opener on a line affects indentation, fixing common patterns like .foreach({...}) and $list.Add([PSCustomObject]@{...}). Copilot generated (and I reviewed) a bunch of tests to cover these cases. It's really getting quite good at generating tests now 🤖 Fixes #1680 Fixes #1933 Fixes #2159 Potentially also Fixes the main issue raised in #1168 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.

Open Graph Description: PR Summary Two small improvements in the UseConsistentIndentation rule's handing of pipeline indentation. Flagged in this issue and issue comment. Rule never finds the ends of nested pipeli...

X Description: PR Summary Two small improvements in the UseConsistentIndentation rule's handing of pipeline indentation. Flagged in this issue and issue comment. Rule never finds the ends of nested pi...

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

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:d7bfa67c-6ebd-ae62-1902-e51657963167
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9766:1FE4AF:5D10B:7BA93:6AFD29D8
html-safe-noncec0e97fdc9f427ac441029bd84c014e8fe5c42a593a2d6a37dfd312ec1af4ea00
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzY2OjFGRTRBRjo1RDEwQjo3QkE5Mzo2QUZEMjlEOCIsInZpc2l0b3JfaWQiOiI0NzU3ODIyMDgwNjA1MzAxMjA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac10b7c0dd4754fe629ff0d1db0d5e4259c94869bec5b8be8c68a430b97f444201
hovercard-subject-tagpull_request:3482019599
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/2173/files
twitter:imagehttps://avatars.githubusercontent.com/u/6566675?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/6566675?s=400&v=4
og:image:altPR Summary Two small improvements in the UseConsistentIndentation rule's handing of pipeline indentation. Flagged in this issue and issue comment. Rule never finds the ends of nested pipeli...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None065128366c233a9d57ff68ab6c96e25b99dd1b0ab70d23b70873d3dd6b5e4f19
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
release941021edf0c2ec58298f4a2c8f27ae507d129c92
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPSScriptAnalyzer%2Fpull%2F2173%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPSScriptAnalyzer%2Fpull%2F2173%2Ffiles
Sign uphttps://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/2173/files
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files
PowerShellhttps://github.com/PowerShell
PSScriptAnalyzerhttps://github.com/PowerShell/PSScriptAnalyzer
Codehttps://github.com/PowerShell/PSScriptAnalyzer
Issues407 (407)https://github.com/PowerShell/PSScriptAnalyzer/issues
Pull requests34 (34)https://github.com/PowerShell/PSScriptAnalyzer/pulls
Discussionshttps://github.com/PowerShell/PSScriptAnalyzer/discussions
Actionshttps://github.com/PowerShell/PSScriptAnalyzer/actions
Projectshttps://github.com/PowerShell/PSScriptAnalyzer/projects
Wikihttps://github.com/PowerShell/PSScriptAnalyzer/wiki
Security and qualityhttps://github.com/PowerShell/PSScriptAnalyzer/security
Insightshttps://github.com/PowerShell/PSScriptAnalyzer/insights
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
Andy Jordan (andyleejordan)https://github.com/andyleejordan
PowerShell:mainhttps://github.com/PowerShell/PSScriptAnalyzer/tree/main
liamjpeters:#1933-PipelineIndentationIssuehttps://github.com/liamjpeters/PSScriptAnalyzer/tree/%231933-PipelineIndentationIssue
Conversation 1 https://github.com/PowerShell/PSScriptAnalyzer/pull/2173
Commits 4 https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/commits
Checks 4 https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/checks
Files changed https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files
Improve pipeline indentation handling in UseConsistentIndentation rule https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files#top
Show all changes 4 commits https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files
ab4a695 Improve pipeline indentation handling in UseConsistentIndentation rule liamjpeters Apr 2, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/commits/ab4a69559131ef8c7e1a14da1e09bf43f06d9976
2af0dae Merge branch 'main' into #1933-PipelineIndentationIssue liamjpeters Apr 3, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/commits/2af0dae478945d7f5749be7c17fce7b2b12e1269
d89d877 Fix over-indentation when multiple openers appear on the same line liamjpeters Apr 15, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/commits/d89d877f317e53fdc3d2d13ec6c036aa6d1e64d4
b470da8 Merge branch '#1933-PipelineIndentationIssue' of https://github.com/l… liamjpeters Apr 15, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/commits/b470da8f40e3a8d965cea117a14011993c53fd73
Clear filters https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files
UseConsistentIndentation.cs https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files#diff-b941a26916664319ebb13944c360128a3d2ef19d0dcfd02f0ec2628667f119d9
UseConsistentIndentation.tests.ps1 https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files#diff-4f1aee1705062e647b53ca8965dc2e245c1e00c7549a3a96ad19d76a4e73df84
https://github.com/PowerShell/PSScriptAnalyzer/blob/main/.github/CODEOWNERS#L2
Rules/UseConsistentIndentation.cshttps://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files#diff-b941a26916664319ebb13944c360128a3d2ef19d0dcfd02f0ec2628667f119d9
View file https://github.com/liamjpeters/PSScriptAnalyzer/blob/b470da8f40e3a8d965cea117a14011993c53fd73/Rules/UseConsistentIndentation.cs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/{{ revealButtonHref }}
https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files#diff-b941a26916664319ebb13944c360128a3d2ef19d0dcfd02f0ec2628667f119d9
https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files#diff-b941a26916664319ebb13944c360128a3d2ef19d0dcfd02f0ec2628667f119d9
https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files#diff-b941a26916664319ebb13944c360128a3d2ef19d0dcfd02f0ec2628667f119d9
https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files#diff-b941a26916664319ebb13944c360128a3d2ef19d0dcfd02f0ec2628667f119d9
https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files#diff-b941a26916664319ebb13944c360128a3d2ef19d0dcfd02f0ec2628667f119d9
https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files#diff-b941a26916664319ebb13944c360128a3d2ef19d0dcfd02f0ec2628667f119d9
https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files#diff-b941a26916664319ebb13944c360128a3d2ef19d0dcfd02f0ec2628667f119d9
https://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files#diff-b941a26916664319ebb13944c360128a3d2ef19d0dcfd02f0ec2628667f119d9
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2173/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2173/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.