From 6433ace0f1f8dee77ab9ab2792417350e85ac739 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 3 Dec 2025 10:56:41 -0600 Subject: [PATCH 1/3] Sync rules docs from docs repo --- docs/Rules/AvoidLongLines.md | 15 ++++++++------- docs/Rules/AvoidReservedWordsAsFunctionNames.md | 16 +++++++++------- docs/Rules/UseCorrectCasing.md | 14 +++++++------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/docs/Rules/AvoidLongLines.md b/docs/Rules/AvoidLongLines.md index cc2603c51..4a0d98d38 100644 --- a/docs/Rules/AvoidLongLines.md +++ b/docs/Rules/AvoidLongLines.md @@ -1,6 +1,6 @@ --- description: Avoid long lines -ms.date: 06/28/2023 +ms.date: 04/29/2025 ms.topic: reference title: AvoidLongLines --- @@ -10,10 +10,11 @@ title: AvoidLongLines ## Description -Lines should be no longer than a configured number of characters (default: 120), including leading -whitespace (indentation). +The length of lines, including leading spaces (indentation), should less than the configured number +of characters. The default length is 120 characters. -**Note**: This rule is not enabled by default. The user needs to enable it through settings. +> [!NOTE] +> This rule isn't enabled by default. The user needs to enable it through settings. ## Configuration @@ -26,12 +27,12 @@ Rules = @{ } ``` -### Parameters +## Parameters -#### Enable: bool (Default value is `$false`) +### `Enable`: bool (Default value is `$false`) Enable or disable the rule during ScriptAnalyzer invocation. -#### MaximumLineLength: int (Default value is 120) +### `MaximumLineLength`: int (Default value is 120) Optional parameter to override the default maximum line length. diff --git a/docs/Rules/AvoidReservedWordsAsFunctionNames.md b/docs/Rules/AvoidReservedWordsAsFunctionNames.md index cfe6b92ca..769cbb85f 100644 --- a/docs/Rules/AvoidReservedWordsAsFunctionNames.md +++ b/docs/Rules/AvoidReservedWordsAsFunctionNames.md @@ -10,16 +10,15 @@ title: AvoidReservedWordsAsFunctionNames ## Description -Avoid using reserved words as function names. Using reserved words as function -names can cause errors or unexpected behavior in scripts. +Avoid using reserved words as function names. Using reserved words as function names can cause +errors or unexpected behavior in scripts. ## How to Fix -Avoid using any of the reserved words as function names. Instead, choose a -different name that is not reserved. +Avoid using any of the reserved words as function names. Choose a different name that's not a +reserved word. -See [`about_Reserved_Words`](https://learn.microsoft.com/en-gb/powershell/module/microsoft.powershell.core/about/about_reserved_words) for a list of reserved -words in PowerShell. +See [about_Reserved_Words][01] for a list of reserved words in PowerShell. ## Example @@ -39,4 +38,7 @@ function function { function myFunction { Write-Host "Hello, World!" } -``` \ No newline at end of file +``` + + +[01]: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_reserved_words diff --git a/docs/Rules/UseCorrectCasing.md b/docs/Rules/UseCorrectCasing.md index 9d7e96a18..b73df6415 100644 --- a/docs/Rules/UseCorrectCasing.md +++ b/docs/Rules/UseCorrectCasing.md @@ -11,7 +11,7 @@ title: UseCorrectCasing ## Description This is a style/formatting rule. PowerShell is case insensitive wherever possible, so the casing of -cmdlet names, parameters, keywords and operators does not matter. This rule nonetheless ensures +cmdlet names, parameters, keywords and operators doesn't matter. This rule nonetheless ensures consistent casing for clarity and readability. Using lowercase keywords helps distinguish them from commands. Using lowercase operators helps distinguish them from parameters. @@ -34,23 +34,23 @@ Rules = @{ } ``` -### Parameters +## Parameters -#### Enable: bool (Default value is `$false`) +### Enable: bool (Default value is `$false`) Enable or disable the rule during ScriptAnalyzer invocation. -#### CheckCommands: bool (Default value is `$true`) +### CheckCommands: bool (Default value is `$true`) If true, require the case of all command and parameter names to match their canonical casing. -#### CheckKeyword: bool (Default value is `$true`) +### CheckKeyword: bool (Default value is `$true`) If true, require the case of all keywords to be lowercase. -#### CheckOperator: bool (Default value is `$true`) +### CheckOperator: bool (Default value is `$true`) -If true, require the case of all operators (e.g. -eq, -ne, -gt) to be lowercase. +If true, require the case of all operators to be lowercase. For example: `-eq`, `-ne`, `-gt` ## Examples From dd592ff90dbe585134f8866c78e7b7c4fc1dc3cd Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 3 Dec 2025 12:30:44 -0600 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/Rules/AvoidLongLines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Rules/AvoidLongLines.md b/docs/Rules/AvoidLongLines.md index 4a0d98d38..c36daaa86 100644 --- a/docs/Rules/AvoidLongLines.md +++ b/docs/Rules/AvoidLongLines.md @@ -10,7 +10,7 @@ title: AvoidLongLines ## Description -The length of lines, including leading spaces (indentation), should less than the configured number +The length of lines, including leading spaces (indentation), should be less than the configured number of characters. The default length is 120 characters. > [!NOTE] From 2e2533526e528f9397ade536cf180a49fcd0dee6 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 3 Dec 2025 13:41:16 -0600 Subject: [PATCH 3/3] Update codeowners --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 3c53a0af4..8de3ce904 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,5 +2,5 @@ * @PowerShell/extension @bergmeister # Version bumps and documentation updates -Directory.Build.props @sdwheeler @michaeltlombardi +Directory.Build.props @PowerShell/extension @sdwheeler @michaeltlombardi /docs/ @PowerShell/extension @sdwheeler @michaeltlombardi