-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New AdvSec & GHAS - Enable using config file #2775
Conversation
{ | ||
[Serializable] | ||
[JsonConverter(typeof(TypedPropertiesDictionaryConverter))] | ||
public class RuleKindSet : HashSet<RuleKind> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is following the same pattern as other fields we have, the ResultKind.
The commanline nuget package the options have some limitation so there is some conversions needed
@@ -319,7 +319,7 @@ public virtual TContext InitializeGlobalContextFromOptions(TOptions options, ref | |||
context.TargetFileSpecifiers = options.TargetFileSpecifiers?.Any() == true ? InitializeStringSet(options.TargetFileSpecifiers) : context.TargetFileSpecifiers; | |||
context.InvocationPropertiesToLog = options.InvocationPropertiesToLog?.Any() == true ? InitializeStringSet(options.InvocationPropertiesToLog) : context.InvocationPropertiesToLog; | |||
context.Traces = options.Trace.Any() ? InitializeStringSet(options.Trace) : context.Traces; | |||
context.RuleKinds = options.RuleKinds; | |||
context.RuleKinds = options.RuleKindOption != null ? options.RuleKinds : context.RuleKinds; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no we can not,
options.RuleKindOption is not the same type as options.RuleKinds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you see lines above
context.ResultKinds = options.Kind != null ? options.ResultKinds : context.ResultKinds;
Some tricky here, the options.Kind
is not the same type as options.ResultKinds
.
p.s. I think the naming before is not good for Kind
for ResultKinds
, it is better to name using xxxOption, or some pattern. People will not know Kind
is the command line option for ResultKinds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EasyRhinoMSFT
This is to enable using config file to change settings for New AdvSec & GHAS work.