Skip to content

Commit 34a4fea

Browse files
author
Kapil Borle
committed
Move Enable property to base class
1 parent cb177d8 commit 34a4fea

File tree

4 files changed

+3
-9
lines changed

4 files changed

+3
-9
lines changed

Engine/Generic/ConfigurableScriptRule.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ 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+
[ConfigurableRuleProperty()]
17+
public bool Enable { get; protected set; } = false;
18+
1619
public bool IsRuleConfigured { get; protected set; } = false;
1720

1821
public virtual void ConfigureRule()

Rules/PlaceCloseBrace.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules
2828
#endif
2929
public class PlaceCloseBrace : ConfigurableScriptRule
3030
{
31-
[ConfigurableRuleProperty()]
32-
public bool Enable { get; protected set; } = false;
33-
3431
[ConfigurableRuleProperty()]
3532
public bool NoEmptyLineBefore { get; protected set; } = false;
3633

Rules/PlaceOpenBrace.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ public class PlaceOpenBrace : ConfigurableScriptRule
3838
[ConfigurableRuleProperty()]
3939
public bool NewLineAfter { get; protected set; } = true;
4040

41-
[ConfigurableRuleProperty()]
42-
public bool Enable { get; protected set; } = false;
43-
4441
/// <summary>
4542
/// Analyzes the given ast to find the [violation]
4643
/// </summary>

Rules/UseConsistentIndentation.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ private enum IndentationKind { Space, Tab };
3636
[ConfigurableRuleProperty()]
3737
public int IndentationSize { get; protected set; } = 4;
3838

39-
[ConfigurableRuleProperty()]
40-
public bool Enable {get; protected set;} = false;
41-
4239
/// <summary>
4340
/// Analyzes the given ast to find the [violation]
4441
/// </summary>

0 commit comments

Comments
 (0)