Skip to content

Commit 7ff2763

Browse files
author
Kapil Borle
committed
Filter class based DSC rules on severity
1 parent c23e487 commit 7ff2763

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

Engine/ScriptAnalyzer.cs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,28 +1895,7 @@ public IEnumerable<DiagnosticRecord> AnalyzeSyntaxTree(
18951895
// Run DSC Class rule
18961896
foreach (IDSCResourceRule dscResourceRule in this.DSCResourceRules)
18971897
{
1898-
bool includeRegexMatch = false;
1899-
bool excludeRegexMatch = false;
1900-
1901-
foreach (Regex include in includeRegexList)
1902-
{
1903-
if (include.IsMatch(dscResourceRule.GetName()))
1904-
{
1905-
includeRegexMatch = true;
1906-
break;
1907-
}
1908-
}
1909-
1910-
foreach (Regex exclude in excludeRegexList)
1911-
{
1912-
if (exclude.IsMatch(dscResourceRule.GetName()))
1913-
{
1914-
excludeRegexMatch = true;
1915-
break;
1916-
}
1917-
}
1918-
1919-
if ((includeRule == null || includeRegexMatch) && (excludeRule == null || excludeRegexMatch))
1898+
if (IsRuleAllowed(dscResourceRule))
19201899
{
19211900
this.outputWriter.WriteVerbose(string.Format(CultureInfo.CurrentCulture, Strings.VerboseRunningMessage, dscResourceRule.GetName()));
19221901

0 commit comments

Comments
 (0)