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.
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.
Copilot
AI
changed the title
[WIP] Fix code based on review comment #2231
Preserve relative indentation in commented-out code
Oct 26, 2026
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.
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
Review effort: Balanced
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Copilot resolve the merge conflicts in this pull request
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…tation-issue' into copilot/fix-code-review-comment-2231
# Conflicts:
# Rules/UseConsistentIndentation.cs
# Tests/Rules/UseConsistentIndentation.tests.ps1
Co-authored-by: bergmeister <[email protected]>
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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
Review effort: Balanced
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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
2 resolved since last review
Review effort: Balanced
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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
Review effort: Balanced
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
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.
|