Skip to content

Commit 923c701

Browse files
author
Kapil Borle
committed
Pass whitelist parameter to AvoidAlias rule
1 parent ce62cfa commit 923c701

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

Engine/Helper.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,30 @@ public void Initialize()
165165
}
166166
}
167167

168+
public Dictionary<string, Dictionary<string, object>> GetRuleArguments()
169+
{
170+
return ruleArguments;
171+
}
172+
173+
public Dictionary<string, object> GetRuleArguments(string ruleName)
174+
{
175+
if (ruleArguments.ContainsKey(ruleName))
176+
{
177+
return ruleArguments[ruleName];
178+
}
179+
return null;
180+
}
181+
182+
public void SetRuleArguments(Dictionary<string, Dictionary<string, object>> ruleArgs)
183+
{
184+
if (ruleArgs.Comparer != StringComparer.OrdinalIgnoreCase)
185+
{
186+
throw new ArgumentException(
187+
"Input dictionary should have OrdinalIgnoreCase comparer.",
188+
"ruleArgs");
189+
}
190+
ruleArguments = ruleArgs;
191+
}
168192
/// <summary>
169193
/// Returns all the rule arguments
170194
/// </summary>

Rules/AvoidAlias.cs

-4.68 KB
Binary file not shown.

0 commit comments

Comments
 (0)