Skip to content

Commit 9e16982

Browse files
author
Kapil Borle
committed
Update usewhitespace rule documentation
1 parent 1369cb6 commit 9e16982

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

RuleDocumentation/UseWhitespace.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,35 @@
22
**Severity Level: Warning**
33

44
## Description
5+
This rule enforces consistent brace, parenthesis, binary operator, assignment operator and separator styles. For more information please see the [Parameters](#parameters) section.
56

6-
## How to Fix
7-
8-
## Example
9-
### Wrong:
10-
```PowerShell
7+
**Note**: This rule is not enabled by default. The user needs to enable it through settings.
118

9+
## Configuration
10+
```powershell
11+
Rules = @{
12+
PSUseWhitespace = @{
13+
Enable = $true
14+
CheckOpenBrace = $true
15+
CheckOpenParen = $true
16+
CheckOperator = $true
17+
CheckSeparator = $true
18+
}
1219
```
1320

14-
### Correct:
15-
```PowerShell
21+
### Parameters
1622

17-
```
23+
#### Enable: bool (Default value is `$false`)
24+
Enable or disable the rule during ScriptAnalyzer invocation.
25+
26+
#### CheckOpenBrace: bool (Default value is `$true`)
27+
Checks if there is a space between a keyword and its corresponding open brace. E.g. `foo { }`.
28+
29+
#### CheckOpenParen: bool (Default value is `$true`)
30+
Checks if there is space between a keyword and its corresponding open parenthesis. E.g. `if (true)`.
31+
32+
#### CheckOperator: bool (Default value is `$true`)
33+
Checks if a binary operator is surrounded on both sides by a space. E.g. `$x = 1`.
34+
35+
#### CheckSeparator: bool (Default value is `$true`)
36+
Checks if a comma or a semicolon is followed by a space. E.g. `@(1, 2, 3)` or `@{a = 1; b = 2}`.

0 commit comments

Comments
 (0)