PowerShell / DscResource.Template

MIT License
10 stars 15 forks source link

Update indentation style in settings.json (VS Code formatting) #27

Open johlju opened 5 years ago

johlju commented 5 years ago

We should add this to the VSCode settings.json

"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationAfterEveryPipeline"

Or

"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationForFirstPipeline"

The default is no indentation.

johlju commented 5 years ago

I vote for IncreaseIndentationAfterEveryPipeline

johlju commented 5 years ago

There are issues with this https://github.com/PowerShell/PSScriptAnalyzer/issues/1241#issuecomment-499841062

johlju commented 5 years ago

~This does not really work for tests. If we add this I don't think we can enforce it on Pester tests. https://github.com/PowerShell/PSScriptAnalyzer/issues/1241#issuecomment-499848159~

The issue has been resolved, so now the user need to move the portion to the right to a new line for the indentation to format. This is the behavior we like because we don't want it to update all the tests.

johlju commented 5 years ago

I read that the default in PSScriptAnalyzer for this property will eventually be IncreaseIndentationForFirstPipeline, so maybe we should go with that. 🤔

johlju commented 5 years ago

We should also add this once VS Code PowerShell extension has added the latest version to the extension, otherwise depending on version installed this will have different behavior.

PlagueHO commented 5 years ago

Get's my vote!