Skip to content

Commit cb177d8

Browse files
author
Kapil Borle
committed
Move rule configuration outside loading
1 parent b715d32 commit cb177d8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Engine/ScriptAnalyzer.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,7 @@ private void Initialize(
776776
try
777777
{
778778
this.LoadRules(this.validationResults, invokeCommand, includeDefaultRules);
779+
this.ConfigureScriptRules();
779780
}
780781
catch (Exception ex)
781782
{
@@ -964,6 +965,18 @@ private void LoadRules(Dictionary<string, List<string>> result, CommandInvocatio
964965
}
965966
}
966967

968+
// Configure rules derived from ConfigurableScriptRule class
969+
private void ConfigureScriptRules()
970+
{
971+
if (ScriptRules != null)
972+
{
973+
foreach (var scriptRule in ScriptRules)
974+
{
975+
(scriptRule as ConfigurableScriptRule)?.ConfigureRule();
976+
}
977+
}
978+
}
979+
967980
internal string[] GetValidModulePaths()
968981
{
969982
List<string> validModulePaths = null;

0 commit comments

Comments
 (0)