Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
3 changes: 2 additions & 1 deletion Rules/UseSingularNouns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public class CmdletSingularNoun : IScriptRule

private readonly string[] nounAllowList =
{
"Data"
"Data",
"Windows"
};

/// <summary>
Expand Down
14 changes: 14 additions & 0 deletions Tests/Rules/UseSingularNounsReservedVerbs.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ Write-Output "Adding some data"
-OutVariable violations
$violations.Count | Should -Be 0
}

It "ignores function name ending with Windows" {
$nounViolationScript = @'
Function Test-Windows
{
Write-Output "Testing Microsoft Windows"
}
'@
Invoke-ScriptAnalyzer -ScriptDefinition $nounViolationScript `
-IncludeRule "PSUseSingularNouns" `
-OutVariable violations
$violations.Count | Should -Be 0
}

}

Context "When there are no violations" {
Expand Down