vscode-powershell
vscode-powershell copied to clipboard
RFC: Change Pipeline Indentation Style default from `NoIndentation` to `IncreaseIndentationForFirstPipeline`
Prerequisites
- [X] I have written a descriptive issue title.
- [X] 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 https://github.com/PowerShell/vscode-powershell/pull/2698 which alludes to a bug in PSSA that I hope is since fixed.
@bergmeister in particular, what do you think?
Proposed Design
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.
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?