Skip to content

Commit aa469df

Browse files
committed
Addressed a bug in handling Severity when using Custom Rules - the severity property was ignored and defaulted to Information
1 parent d867fbe commit aa469df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Engine/ScriptAnalyzer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,8 +926,8 @@ internal IEnumerable<DiagnosticRecord> GetExternalRecord(Ast ast, Token[] token,
926926

927927
// DiagnosticRecord may not be correctly returned from external rule.
928928
try
929-
{
930-
Enum.TryParse<DiagnosticSeverity>(psobject.Properties["Severity"].Value.ToString().ToUpper(), out severity);
929+
{
930+
severity = (DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), psobject.Properties["Severity"].Value.ToString());
931931
message = psobject.Properties["Message"].Value.ToString();
932932
extent = (IScriptExtent)psobject.Properties["Extent"].Value;
933933
ruleName = psobject.Properties["RuleName"].Value.ToString();

0 commit comments

Comments
 (0)