Skip to content

Commit 2d91cdb

Browse files
committed
Modify DSC rule severity
1 parent cdcc4e5 commit 2d91cdb

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Rules/UseIdenticalMandatoryParametersDSC.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public IEnumerable<DiagnosticRecord> AnalyzeDSCResource(Ast ast, string fileName
9898
{
9999
List<string> functionsNotContainingParam = expectedTargetResourceFunctionNames.Except(mandatoryParameters[paramName]).ToList();
100100
yield return new DiagnosticRecord(string.Format(CultureInfo.InvariantCulture, Strings.UseIdenticalMandatoryParametersDSCError, paramName, string.Join(", ", functionsNotContainingParam.ToArray())),
101-
ast.Extent, GetName(), DiagnosticSeverity.Information, fileName);
101+
ast.Extent, GetName(), DiagnosticSeverity.Error, fileName);
102102
}
103103

104104
}
@@ -159,7 +159,7 @@ public SourceType GetSourceType()
159159
/// <returns></returns>
160160
public RuleSeverity GetSeverity()
161161
{
162-
return RuleSeverity.Information;
162+
return RuleSeverity.Error;
163163
}
164164

165165
/// <summary>

Rules/UseIdenticalParametersDSC.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public IEnumerable<DiagnosticRecord> AnalyzeDSCResource(Ast ast, string fileName
6767
|| !CompareParamAsts(paramAst, paramNames[paramAst.Name.VariablePath.UserPath]))
6868
{
6969
yield return new DiagnosticRecord(string.Format(CultureInfo.CurrentCulture, Strings.UseIdenticalParametersDSCError),
70-
paramAst.Extent, GetName(), DiagnosticSeverity.Information, fileName);
70+
paramAst.Extent, GetName(), DiagnosticSeverity.Error, fileName);
7171
}
7272
}
7373
}
@@ -166,7 +166,7 @@ public SourceType GetSourceType()
166166
/// <returns></returns>
167167
public RuleSeverity GetSeverity()
168168
{
169-
return RuleSeverity.Warning;
169+
return RuleSeverity.Error;
170170
}
171171

172172
/// <summary>

Rules/UseStandardDSCFunctionsInResource.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public IEnumerable<DiagnosticRecord> AnalyzeDSCResource(Ast ast, string fileName
5454
if (!targetResourceFunctionNamesInAst.Contains(expectedTargetResourceFunctionName, StringComparer.CurrentCultureIgnoreCase))
5555
{
5656
yield return new DiagnosticRecord(string.Format(CultureInfo.CurrentCulture, Strings.UseStandardDSCFunctionsInResourceError, expectedTargetResourceFunctionName),
57-
ast.Extent, GetName(), DiagnosticSeverity.Information, fileName);
57+
ast.Extent, GetName(), DiagnosticSeverity.Error, fileName);
5858
}
5959
}
6060
}
@@ -85,7 +85,7 @@ item is TypeDefinitionAst
8585
if (!functions.Any(function => String.Equals(resourceFunctionName, (function as FunctionMemberAst).Name)))
8686
{
8787
yield return new DiagnosticRecord(string.Format(CultureInfo.CurrentCulture, Strings.UseStandardDSCFunctionsInClassError, resourceFunctionName),
88-
dscClass.Extent, GetName(), DiagnosticSeverity.Information, fileName);
88+
dscClass.Extent, GetName(), DiagnosticSeverity.Error, fileName);
8989
}
9090
}
9191
}

0 commit comments

Comments
 (0)