You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RFC: Change Pipeline Indentation Style default from NoIndentation to IncreaseIndentationForFirstPipeline #4296
I have searched all issues to ensure it has not already been reported.
Summary
I've discovered that our default value to configure PSScriptAnalyzer's PipelineIndentation setting is NoIndentation, which differs from PSSA's own default (and arguably more popular) of IncreaseIndentationForFirstPipeline. This was last updated in May 2020 via #2698 which alludes to a bug in PSSA that I hope is since fixed.
Just update the default in package.json to IncreaseIndentationForFirstPipeline. While I think this is a very desirable behavior, it would come at the cost of user-facing change that would affect formatting of scripts. So the question is, have the vast majority of people already overridden it with IncreaseIndentationForFirstPipeline?
Further RFC: Should we do a just an overhaul of all our default code formatting settings to match PSSA's defaults?
The only issue I can think of is that people who have format-on-save set are gonna have a lot of suddenly large git commits and not understand why.
I think all the defaults to match PSSA defaults should be done all at once as a single breaking change with a popup dialog at start letting people know it has changed and give them a button to go back, maybe have an overarching "classic" setting to allow people to bypass that, rather than onesy-twosy.
Reacted by Andy Jordan, Patrick Meinecke and oceans-of-time
This needs historic background:
When I first added this feature and setting, IncreaseIndentationForFirstPipeline was actually the default but it turned out that even after a couple iterations there were still some edge cases. Therefore I added this NoIndentation option later, which kind of acts like a feature flag to provide the behaviour it had before I added the feature to reduce the blast radius and give me more time to work on fixing edge cases.
It's hard to say whether the feature is now good enough for everyone to be on by default but with the preview extension we could try temporarily? Would it help if I look up existing issues of this setting to help make a decision?
Hi all. I found this ticket from a link in VSCode settings requesting for comments.
My comment is that IncreaseIndentationForFirstPipeline is good for readability. And that we need the same setting for indentation for multiline statements that are written with a backtick ` at the end of the line. And you could extend this setting to cover cases where the pipe | is placed at the beginning of the next line rather than at the end of the preceding line, having backtick or not.
I'll add a comment in case it is useful in some way: it's simply that PowerShell "appends to the pipe as it goes" and having no indent indicates to me as difference between that language and C#; and also, a parenthised block becomes indented, which visually continues the same connection to the flow. (I.E: it's better to understand the actual Scopes; which didn't change between two pipeline outputs; making that indent less about the actual Scope than an arbitrary choice "as you type". It's too flowery.)
If the default changes, I myself may change it back ...
# Which function is guaranteed to pipeline 3 items?
function Foo()
{
DoA
DoB
DoC
if (x) {
throw
}
}
function Bar()
{
DoA
DoB
DoC
if (x) {
throw
}
}
Activity
JustinGrote commentedon Dec 1, 2022
The only issue I can think of is that people who have format-on-save set are gonna have a lot of suddenly large git commits and not understand why.
I think all the defaults to match PSSA defaults should be done all at once as a single breaking change with a popup dialog at start letting people know it has changed and give them a button to go back, maybe have an overarching "classic" setting to allow people to bypass that, rather than onesy-twosy.
bergmeister commentedon Dec 2, 2022
This needs historic background:
When I first added this feature and setting, IncreaseIndentationForFirstPipeline was actually the default but it turned out that even after a couple iterations there were still some edge cases. Therefore I added this NoIndentation option later, which kind of acts like a feature flag to provide the behaviour it had before I added the feature to reduce the blast radius and give me more time to work on fixing edge cases.
It's hard to say whether the feature is now good enough for everyone to be on by default but with the preview extension we could try temporarily? Would it help if I look up existing issues of this setting to help make a decision?
seppo498573908457 commentedon Jun 16, 2026
Hi all. I found this ticket from a link in VSCode settings requesting for comments.
My comment is that
IncreaseIndentationForFirstPipelineis good for readability. And that we need the same setting for indentation for multiline statements that are written with a backtick`at the end of the line. And you could extend this setting to cover cases where the pipe|is placed at the beginning of the next line rather than at the end of the preceding line, having backtick or not.steevcoco commentedon Oct 18, 2026
I'll add a comment in case it is useful in some way: it's simply that PowerShell "appends to the pipe as it goes" and having no indent indicates to me as difference between that language and C#; and also, a parenthised block becomes indented, which visually continues the same connection to the flow. (I.E: it's better to understand the actual Scopes; which didn't change between two pipeline outputs; making that indent less about the actual Scope than an arbitrary choice "as you type". It's too flowery.)
If the default changes, I myself may change it back ...