GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Preserve relative indentation in commented-out code by Copilot · Pull Request #2238 · PowerShell/PSScriptAnalyzer

Conversation

Copilot AI commented Oct 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Formatting could flatten indentation within commented-out code blocks. The formatter now preserves relative indentation when aligning comment runs.

  • Comment-run indentation: Keep the first comment aligned with the surrounding code while retaining each subsequent comment’s offset, for both spaces and tabs.
  • Suggested corrections: Apply the calculated indentation to formatter corrections as well as diagnostics.

For example, nested indentation remains intact when the block is shifted:

    # if ($b) {
        # doThing
    # }

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Initial plan
6b8f1af
Copilot AI assigned Copilot and Christoph Bergmeister (bergmeister) Oct 26, 2026
Copilot started work on behalf of Christoph Bergmeister (bergmeister) October 26, 2026 10:05
View session
Copilot AI changed the title [WIP] Fix code based on review comment #2231 Preserve relative indentation in commented-out code Oct 26, 2026
Copilot finished work on behalf of Christoph Bergmeister (bergmeister) October 26, 2026 10:19
Copilot AI requested a review from Christoph Bergmeister (bergmeister) October 26, 2026 10:19
@bergmeister
Christoph Bergmeister (bergmeister) marked this pull request as ready for review October 26, 2026 10:41
@bergmeister
Christoph Bergmeister (bergmeister) requested a balanced review from Copilot October 26, 2026 10:41
Copilot AI reviewed Oct 26, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot started work on behalf of Christoph Bergmeister (bergmeister) October 26, 2026 10:47
View session
@bergmeister
Fix comment runs after line continuations
312ded6
Co-authored-by: bergmeister <[email protected]>
Copilot AI requested a review from a team as a code owner October 26, 2026 10:50
Copilot finished work on behalf of Christoph Bergmeister (bergmeister) October 26, 2026 10:52
@bergmeister
Christoph Bergmeister (bergmeister) marked this pull request as draft October 26, 2026 10:54
@bergmeister Christoph Bergmeister (bergmeister) closed this Oct 26, 2026
@bergmeister Christoph Bergmeister (bergmeister) reopened this Oct 26, 2026
@bergmeister
Christoph Bergmeister (bergmeister) requested a balanced review from Copilot October 26, 2026 10:55
@bergmeister
Christoph Bergmeister (bergmeister) marked this pull request as ready for review October 26, 2026 10:55
Copilot started reviewing on behalf of Christoph Bergmeister (bergmeister) October 26, 2026 10:55
View session
@bergmeister
Christoph Bergmeister (bergmeister) added this pull request to stack #2239 October 26, 2026 10:58
Copilot AI reviewed Oct 26, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🟡 Changes recommended

Continuation indentation is still lost on the command argument following multiple comments, conflicting with the new regression assertion.

1 open issue
  • Medium severity Apply continuation indentation after comment runs · New

Review effort: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Rules/UseConsistentIndentation.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Copilot started work on behalf of Christoph Bergmeister (bergmeister) October 26, 2026 11:17
View session
@bergmeister
Fix continuation indent after comment runs
7778cbe
Co-authored-by: bergmeister <[email protected]>
Copilot finished work on behalf of Christoph Bergmeister (bergmeister) October 26, 2026 11:25
@bergmeister
Christoph Bergmeister (bergmeister) removed this pull request from stack #2239 October 26, 2026 11:41
@bergmeister

Christoph Bergmeister (bergmeister) commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Copilot resolve the merge conflicts in this pull request

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot started work on behalf of Christoph Bergmeister (bergmeister) October 26, 2026 11:42
View session
@bergmeister
Merge remote-tracking branch 'origin/copilot/fix-psuseconsistentinden…
fa021dd
…tation-issue' into copilot/fix-code-review-comment-2231

# Conflicts:
#	Rules/UseConsistentIndentation.cs
#	Tests/Rules/UseConsistentIndentation.tests.ps1

Co-authored-by: bergmeister <[email protected]>
@bergmeister
Christoph Bergmeister (bergmeister) added this pull request to stack #2240 October 26, 2026 11:47
@bergmeister
Christoph Bergmeister (bergmeister) requested a balanced review from Copilot October 26, 2026 11:51

Copilot AI commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Copilot resolve the merge conflicts in this pull request

Resolved the merge conflicts and merged copilot/fix-psuseconsistentindentation-issue into this branch. The merge commit is fa021dd; all 97 focused indentation tests pass.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot finished work on behalf of Christoph Bergmeister (bergmeister) October 26, 2026 11:52
Copilot started reviewing on behalf of Christoph Bergmeister (bergmeister) October 26, 2026 11:52
View session
Copilot AI reviewed Oct 26, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🟡 Changes recommended

Inconsistent forward and backward scanning can still lose relative indentation in comment runs separated by explicit line continuations.

2 open issues
  • Medium severity Include LineContinuation in forward minimum-column scan · New
  • Medium severity Apply continuation indentation after comment runs

Review effort: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Rules/UseConsistentIndentation.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Copilot started work on behalf of Christoph Bergmeister (bergmeister) October 26, 2026 12:42
View session
@bergmeister
Include line continuations in comment scan
842d46c
Co-authored-by: bergmeister <[email protected]>
Copilot finished work on behalf of Christoph Bergmeister (bergmeister) October 26, 2026 12:47
@bergmeister
Christoph Bergmeister (bergmeister) requested a balanced review from Copilot October 26, 2026 19:15
Copilot started reviewing on behalf of Christoph Bergmeister (bergmeister) October 26, 2026 19:15
View session
Copilot AI reviewed Oct 26, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🟡 Changes recommended

A continuation inside a comment run can still cause indentation to grow on repeated formatting passes.

1 open issue
  • Medium severity Prevent double-counting indentation in comment runs · New
2 resolved since last review
  • Medium severity Include LineContinuation in forward minimum-column scan
  • Medium severity Apply continuation indentation after comment runs

Review effort: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Rules/UseConsistentIndentation.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bergmeister
Apply last suggestion 'Prevent double-counting indentation in comment…
9f65c73
… runs' #2238 (comment)
@bergmeister
Christoph Bergmeister (bergmeister) requested a review from Mikey Lombardi (He/Him) (michaeltlombardi) as a code owner October 26, 2026 20:26
@bergmeister
Christoph Bergmeister (bergmeister) marked this pull request as draft October 26, 2026 20:26
Copilot started work on behalf of Christoph Bergmeister (bergmeister) October 26, 2026 20:30
View session
@bergmeister
Fix Pester discovery by removing extra BOM
229da6b
Co-authored-by: bergmeister <[email protected]>
Copilot finished work on behalf of Christoph Bergmeister (bergmeister) October 26, 2026 20:33
@bergmeister
Christoph Bergmeister (bergmeister) requested a balanced review from Copilot October 26, 2026 20:36
Copilot started reviewing on behalf of Christoph Bergmeister (bergmeister) October 26, 2026 20:37
View session
Copilot AI reviewed Oct 26, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🟢 Approval recommended

The continuation handling is consistent, focused regression tests cover the changed behavior, and no blocking issues remain.

No open issues 🎉

1 resolved since last review
  • Medium severity Prevent double-counting indentation in comment runs

Review effort: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bergmeister
Christoph Bergmeister (bergmeister) removed this pull request from stack #2240 October 26, 2026 20:40
@bergmeister
Christoph Bergmeister (bergmeister) marked this pull request as ready for review October 26, 2026 20:40
@bergmeister
Christoph Bergmeister (bergmeister) merged commit 227ab25 into copilot/fix-psuseconsistentindentation-issue Oct 26, 2026
8 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bergmeister
Christoph Bergmeister (bergmeister) deleted the copilot/fix-code-review-comment-2231 branch October 26, 2026 20:44
@bergmeister Christoph Bergmeister (bergmeister) mentioned this pull request Oct 26, 2026
Preserve relative indentation in commented-out code #2231
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@bergmeister Christoph Bergmeister (bergmeister) Awaiting requested review from bergmeister bergmeister is a code owner
@michaeltlombardi Mikey Lombardi (He/Him) (michaeltlombardi) Awaiting requested review from michaeltlombardi michaeltlombardi is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@bergmeister Christoph Bergmeister (bergmeister)

Copilot code review Copilot

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@bergmeister
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.