File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,30 @@ public void CleanUp()
198
198
suppressedOnly = false ;
199
199
}
200
200
201
+ /// <summary>
202
+ /// Update includerules, excluderules, severity and rule arguments.
203
+ /// </summary>
204
+ /// <param name="settings">An object of type Settings</param>
205
+ public void UpdateSettings ( Settings settings )
206
+ {
207
+ if ( settings == null )
208
+ {
209
+ throw new ArgumentNullException ( nameof ( settings ) ) ;
210
+ }
211
+
212
+ this . severity = ( ! settings . Severity . Any ( ) ) ? null : settings . Severity . ToArray ( ) ;
213
+ this . includeRule = ( ! settings . IncludeRules . Any ( ) ) ? null : settings . IncludeRules . ToArray ( ) ;
214
+ this . excludeRule = ( ! settings . ExcludeRules . Any ( ) ) ? null : settings . ExcludeRules . ToArray ( ) ;
215
+ if ( settings . RuleArguments != null )
216
+ {
217
+ Helper . Instance . SetRuleArguments (
218
+ settings . RuleArguments . ToDictionary (
219
+ kvp => kvp . Key ,
220
+ kvp => kvp . Value as object ,
221
+ StringComparer . OrdinalIgnoreCase ) ) ;
222
+ }
223
+ }
224
+
201
225
internal bool ParseProfile ( object profileObject , PathIntrinsics path , IOutputWriter writer )
202
226
{
203
227
// profile was not given
You can’t perform that action at this time.
0 commit comments