Skip to content

Commit f54f239

Browse files
author
Kapil Borle
committed
Add source name to AvoidGlobalFunctions rule name
1 parent 4cda851 commit f54f239

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Rules/AvoidGlobalFunctions.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ public string GetDescription()
8787

8888
public string GetName()
8989
{
90-
return string.Format(CultureInfo.CurrentCulture, Strings.AvoidGlobalFunctionsName);
90+
return string.Format(
91+
CultureInfo.CurrentCulture,
92+
Strings.NameSpaceFormat,
93+
GetSourceName(),
94+
Strings.AvoidGlobalFunctionsName);
9195
}
9296

9397
public RuleSeverity GetSeverity()

Tests/Rules/AvoidGlobalFunctions.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Import-Module PSScriptAnalyzer
22

33
$functionErroMessage = "Avoid creating functions with a Global scope."
4-
$violationName = "AvoidGlobalFunctions"
4+
$violationName = "PSAvoidGlobalFunctions"
55

66
$directory = Split-Path -Parent $MyInvocation.MyCommand.Path
77
$violations = Invoke-ScriptAnalyzer $directory\AvoidGlobalFunctions.psm1 | Where-Object {$_.RuleName -eq $violationName}

0 commit comments

Comments
 (0)