Skip to content

Commit 079b2de

Browse files
author
Kapil Borle
committed
Update code formatting rule documentation
1 parent 8a6dd7f commit 079b2de

File tree

3 files changed

+54
-29
lines changed

3 files changed

+54
-29
lines changed

RuleDocumentation/PlaceCloseBrace.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
# PlaceCloseBrace
2-
**Severity Level: Information**
1+
# PlaceOpenBrace
2+
**Severity Level: Warning**
33

44
## Description
5+
Close brace placement should follow a consistent style. It should be on a new line by itself and should not be followed by an empty line.
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+
PSPlaceCloseBrace = @{
13+
Enable = $true
14+
NoEmptyLineBefore = $false
15+
}
1216
```
1317

14-
### Correct:
15-
```PowerShell
18+
### Parameters
1619

17-
```
20+
#### Enable: bool (Default value is `$false`)
21+
Enable or disable the rule during ScriptAnalyzer invocation.
22+
23+
#### NoEmptyLineBefore: bool (Default value is `$false`)
24+
Create violation if there is an empty line before a close brace.

RuleDocumentation/PlaceOpenBrace.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
# PlaceOpenBrace
2-
**Severity Level: Information**
2+
**Severity Level: Warning**
33

44
## Description
5+
Open brace placement should follow a consistent style. It can either follow KR style (on same line) or the Allman style (not on same line).
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+
PSPlaceOpenBrace = @{
13+
Enable = $true
14+
OnSameLine = $true
15+
NewLineAfter = $true
16+
}
1217
```
1318

14-
### Correct:
15-
```PowerShell
19+
### Parameters
1620

17-
```
21+
#### Enable: bool (Default value is `$false`)
22+
Enable or disable the rule during ScriptAnalyzer invocation.
23+
24+
#### OnSameLine: bool (Default value is `$true`)
25+
Provide an option to enforce the open brace to be on the same line as preceding keyword (KR style) or on the next line (Allman style). The default value is `#true.
26+
27+
#### NewLineAfter: bool (Default value is `$true`)
28+
Enforce a new line character after an open brace. The default value is true.
Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
# UseConsistentIndentation
2-
**Severity Level: Information**
1+
# PlaceOpenBrace
2+
**Severity Level: Warning**
33

44
## Description
5+
Indentation should be consistent throughout the source file.
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+
PSUseConsistentIndentation = @{
13+
Enable = $true
14+
NoEmptyLineBefore = $false
15+
}
1216
```
1317

14-
### Correct:
15-
```PowerShell
18+
### Parameters
1619

17-
```
20+
#### Enable: bool (Default value is `$false`)
21+
Enable or disable the rule during ScriptAnalyzer invocation.
22+
23+
#### IndentationSize: bool (Default value is `4`)
24+
Indentation size in the number of space characters.

0 commit comments

Comments
 (0)