Skip to content

Convert UseSingularNouns to configurable rule and add Windows to allowlist #1858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update UseSingularNouns docs with configuration information
  • Loading branch information
MJVL committed Nov 8, 2022
commit 386624542ffa85c8d11424e96b97ce482166c730
2 changes: 1 addition & 1 deletion docs/Rules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The PSScriptAnalyzer contains the following rule definitions.
| [UseProcessBlockForPipelineCommand](./UseProcessBlockForPipelineCommand.md) | Warning | Yes | |
| [UsePSCredentialType](./UsePSCredentialType.md) | Warning | Yes | |
| [UseShouldProcessForStateChangingFunctions](./UseShouldProcessForStateChangingFunctions.md) | Warning | Yes | |
| [UseSingularNouns](./UseSingularNouns.md) | Warning | Yes | |
| [UseSingularNouns](./UseSingularNouns.md) | Warning | Yes | Yes |
| [UseSupportsShouldProcess](./UseSupportsShouldProcess.md) | Warning | Yes | |
| [UseToExportFieldsInManifest](./UseToExportFieldsInManifest.md) | Warning | Yes | |
| [UseUsingScopeModifierInNewRunspaces](./UseUsingScopeModifierInNewRunspaces.md) | Warning | Yes | |
Expand Down
21 changes: 21 additions & 0 deletions docs/Rules/UseSingularNouns.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,27 @@ title: UseSingularNouns

PowerShell team best practices state cmdlets should use singular nouns and not plurals.

## Configuration

```powershell
Rules = @{
UseSingularNouns = @{
NounAllowList = 'Data', 'Windows', 'Foos'
Enable = $true
}
}
```

### Parameters

#### `UseSingularNouns: string[]` (Default value is `{'Data', 'Windows'}`)

Commands to be excluded from this rule. `Data` and `Windows` are common false positives and are excluded by default

#### Enable: `bool` (Default value is `$true`)

Enable or disable the rule during ScriptAnalyzer invocation.

## How

Change plurals to singular.
Expand Down