PowerShell / PowerShell/vscode-powershell

RFC: Change Pipeline Indentation Style default from `NoIndentation` to `IncreaseIndentationForFirstPipeline`

Open
#4,296 3 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Code Formatting Issue-Discussion
Dominant language
TypeScript
Stars
1.9k
Forks
547
PR merge metrics
No merged PRs in 30d

Description

Prerequisites
  • I have written a descriptive issue title.
  • 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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in package.json and compare the current PipelineIndentation default with PSScriptAnalyzer's PipelineIndentation documentation. The focused work is done when the default is changed to IncreaseIndentationForFirstPipeline; the broader question about aligning all formatting defaults needs a maintainer decision before expanding scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.