Skip to content

Commit e280479

Browse files
sdwheelerCopilot
andauthored
Sync rules docs from docs repo (#2144)
* Sync rules docs from docs repo * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update codeowners --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 67ffb24 commit e280479

File tree

4 files changed

+25
-22
lines changed

4 files changed

+25
-22
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
* @PowerShell/extension @bergmeister
33

44
# Version bumps and documentation updates
5-
Directory.Build.props @sdwheeler @michaeltlombardi
5+
Directory.Build.props @PowerShell/extension @sdwheeler @michaeltlombardi
66
/docs/ @PowerShell/extension @sdwheeler @michaeltlombardi

docs/Rules/AvoidLongLines.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Avoid long lines
3-
ms.date: 06/28/2023
3+
ms.date: 04/29/2025
44
ms.topic: reference
55
title: AvoidLongLines
66
---
@@ -10,10 +10,11 @@ title: AvoidLongLines
1010

1111
## Description
1212

13-
Lines should be no longer than a configured number of characters (default: 120), including leading
14-
whitespace (indentation).
13+
The length of lines, including leading spaces (indentation), should be less than the configured number
14+
of characters. The default length is 120 characters.
1515

16-
**Note**: This rule is not enabled by default. The user needs to enable it through settings.
16+
> [!NOTE]
17+
> This rule isn't enabled by default. The user needs to enable it through settings.
1718
1819
## Configuration
1920

@@ -26,12 +27,12 @@ Rules = @{
2627
}
2728
```
2829

29-
### Parameters
30+
## Parameters
3031

31-
#### Enable: bool (Default value is `$false`)
32+
### `Enable`: bool (Default value is `$false`)
3233

3334
Enable or disable the rule during ScriptAnalyzer invocation.
3435

35-
#### MaximumLineLength: int (Default value is 120)
36+
### `MaximumLineLength`: int (Default value is 120)
3637

3738
Optional parameter to override the default maximum line length.

docs/Rules/AvoidReservedWordsAsFunctionNames.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,15 @@ title: AvoidReservedWordsAsFunctionNames
1010

1111
## Description
1212

13-
Avoid using reserved words as function names. Using reserved words as function
14-
names can cause errors or unexpected behavior in scripts.
13+
Avoid using reserved words as function names. Using reserved words as function names can cause
14+
errors or unexpected behavior in scripts.
1515

1616
## How to Fix
1717

18-
Avoid using any of the reserved words as function names. Instead, choose a
19-
different name that is not reserved.
18+
Avoid using any of the reserved words as function names. Choose a different name that's not a
19+
reserved word.
2020

21-
See [`about_Reserved_Words`](https://learn.microsoft.com/en-gb/powershell/module/microsoft.powershell.core/about/about_reserved_words) for a list of reserved
22-
words in PowerShell.
21+
See [about_Reserved_Words][01] for a list of reserved words in PowerShell.
2322

2423
## Example
2524

@@ -39,4 +38,7 @@ function function {
3938
function myFunction {
4039
Write-Host "Hello, World!"
4140
}
42-
```
41+
```
42+
43+
<!-- link references -->
44+
[01]: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_reserved_words

docs/Rules/UseCorrectCasing.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ title: UseCorrectCasing
1111
## Description
1212

1313
This is a style/formatting rule. PowerShell is case insensitive wherever possible, so the casing of
14-
cmdlet names, parameters, keywords and operators does not matter. This rule nonetheless ensures
14+
cmdlet names, parameters, keywords and operators doesn't matter. This rule nonetheless ensures
1515
consistent casing for clarity and readability. Using lowercase keywords helps distinguish them from
1616
commands. Using lowercase operators helps distinguish them from parameters.
1717

@@ -34,23 +34,23 @@ Rules = @{
3434
}
3535
```
3636

37-
### Parameters
37+
## Parameters
3838

39-
#### Enable: bool (Default value is `$false`)
39+
### Enable: bool (Default value is `$false`)
4040

4141
Enable or disable the rule during ScriptAnalyzer invocation.
4242

43-
#### CheckCommands: bool (Default value is `$true`)
43+
### CheckCommands: bool (Default value is `$true`)
4444

4545
If true, require the case of all command and parameter names to match their canonical casing.
4646

47-
#### CheckKeyword: bool (Default value is `$true`)
47+
### CheckKeyword: bool (Default value is `$true`)
4848

4949
If true, require the case of all keywords to be lowercase.
5050

51-
#### CheckOperator: bool (Default value is `$true`)
51+
### CheckOperator: bool (Default value is `$true`)
5252

53-
If true, require the case of all operators (e.g. -eq, -ne, -gt) to be lowercase.
53+
If true, require the case of all operators to be lowercase. For example: `-eq`, `-ne`, `-gt`
5454

5555
## Examples
5656

0 commit comments

Comments
 (0)