Skip to content

Commit 10ba224

Browse files
committed
Merge pull request #5 from yutingc/master
Skip ProvideCommentHelp for DSC functions
2 parents c7289d0 + 67fe204 commit 10ba224

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Rules/ProvideCommentHelp.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,17 @@ public override AstVisitAction VisitFunctionDefinition(FunctionDefinitionAst fun
4747
return AstVisitAction.SkipChildren;
4848
}
4949

50-
if (funcAst.GetHelpContent() == null)
50+
if (!string.Equals(funcAst.Name, "Get-TargetResource", StringComparison.OrdinalIgnoreCase) && !string.Equals(funcAst.Name, "Set-TargetResource", StringComparison.OrdinalIgnoreCase) &&
51+
!string.Equals(funcAst.Name, "Test-TargetResource", StringComparison.OrdinalIgnoreCase))
5152
{
52-
DiagnosticRecords.Add(new DiagnosticRecord(string.Format(CultureInfo.CurrentCulture, Strings.ProvideCommentHelpError, funcAst.Name),
53-
funcAst.Extent, GetName(), DiagnosticSeverity.Strict, fileName));
53+
54+
if (funcAst.GetHelpContent() == null)
55+
{
56+
DiagnosticRecords.Add(
57+
new DiagnosticRecord(
58+
string.Format(CultureInfo.CurrentCulture, Strings.ProvideCommentHelpError, funcAst.Name),
59+
funcAst.Extent, GetName(), DiagnosticSeverity.Strict, fileName));
60+
}
5461
}
5562

5663
return AstVisitAction.Continue;

0 commit comments

Comments
 (0)