Skip to content

Extend UseConsistentWhitespace to pipe and curly braces #1065

Closed
@avalery

Description

@avalery

Usually, powershell scripts follow those coding rules:

  • Spaces around pipe
Get-ChildItem -Path $path | Where-Object { ... }
# And not
Get-ChildItem -Path $path|Where-Object { ... }
  • Spaces inside curly braces
Where-Object { $_.Name -eq "test" }
# And not
Where-Object {$_.Name -eq "test"}

The rule UseConsistentWhitespace is close to checking that. It already checks if there is a space between a keyword and a brace (CheckOpenBrace option), and if operators are surrounded by spaces (CheckOperator option).

Is it possible to add options to check those additional rules?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions