Skip to content

[Formatter] Do not force indentation style unless certain line length were met #2148

@sharpchen

Description

@sharpchen

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been requested.

Summary

Formatter always format code as the specified indent style no matter how long the statement is:

# before
$foo = if ($true) {1} else {0}

# after 
$foo = if ($true) {
    1
} else {
    0
}

# expected
$foo = if ($true) { 1 } else { 0 }

The code became too sparse by being enforced to the indentation style.

Proposed Design

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions