File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,13 +13,15 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic
1313 // and keep it internal as it consumed only by a handful of rules.
1414 public abstract class ConfigurableScriptRule : IScriptRule
1515 {
16+ // Configurable rules should define a default value
17+ // because if reading the configuration fails
18+ // we use the property's default value
1619 [ ConfigurableRuleProperty ( ) ]
1720 public bool Enable { get ; protected set ; } = false ;
1821
19- public bool IsRuleConfigured { get ; protected set ; } = false ;
20-
2122 public virtual void ConfigureRule ( )
2223 {
24+ // TODO Do not use Helper. Pass this method a dictionary instead
2325 var arguments = Helper . Instance . GetRuleArguments ( this . GetName ( ) ) ;
2426 try
2527 {
@@ -42,8 +44,6 @@ public virtual void ConfigureRule()
4244 // but we know that this should not crash the program hence we
4345 // have this empty catch block
4446 }
45-
46- IsRuleConfigured = true ;
4747 }
4848
4949 private IEnumerable < PropertyInfo > GetConfigurableProperties ( )
You can’t perform that action at this time.
0 commit comments