Skip to content

Commit 4ec8e7c

Browse files
committed
Add "-" to the verb to make sure Verb appears at the beginning of the function name
1 parent b3064e9 commit 4ec8e7c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Rules/UseShouldProcessForStateChangingFunctions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
4444
string funcName = funcDefAst.Name;
4545
bool hasShouldProcessAttribute = false;
4646

47-
if (funcName.IndexOf("Get", StringComparison.OrdinalIgnoreCase) >= 0 ||
48-
funcName.IndexOf("Stop", StringComparison.OrdinalIgnoreCase) >= 0 ||
49-
funcName.IndexOf("New", StringComparison.OrdinalIgnoreCase) >= 0 ||
50-
funcName.IndexOf("Set", StringComparison.OrdinalIgnoreCase) >= 0 ||
51-
funcName.IndexOf("Update", StringComparison.OrdinalIgnoreCase) >= 0 ||
52-
funcName.IndexOf("Reset", StringComparison.OrdinalIgnoreCase) >= 0)
47+
if (funcName.IndexOf("Get-", StringComparison.OrdinalIgnoreCase) >= 0 ||
48+
funcName.IndexOf("Stop-", StringComparison.OrdinalIgnoreCase) >= 0 ||
49+
funcName.IndexOf("New-", StringComparison.OrdinalIgnoreCase) >= 0 ||
50+
funcName.IndexOf("Set-", StringComparison.OrdinalIgnoreCase) >= 0 ||
51+
funcName.IndexOf("Update-", StringComparison.OrdinalIgnoreCase) >= 0 ||
52+
funcName.IndexOf("Reset-", StringComparison.OrdinalIgnoreCase) >= 0)
5353
{
5454
IEnumerable<Ast> attributeAsts = funcDefAst.FindAll(testAst => testAst is NamedAttributeArgumentAst, true);
5555
if (funcDefAst.Body != null && funcDefAst.Body.ParamBlock != null

0 commit comments

Comments
 (0)