-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Runtime.Serialization; | ||
|
||
using Newtonsoft.Json; | ||
|
||
namespace Microsoft.CodeAnalysis.Sarif | ||
{ | ||
[Serializable] | ||
[JsonConverter(typeof(TypedPropertiesDictionaryConverter))] | ||
public class RuleKindSet : HashSet<RuleKind> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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. |
||
{ | ||
public RuleKindSet() { } | ||
|
||
public RuleKindSet(IEnumerable<RuleKind> values) : base(values) { } | ||
|
||
protected RuleKindSet(SerializationInfo info, StreamingContext context) | ||
: base(info, context) | ||
{ | ||
} | ||
} | ||
} |
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.
Can we use this simpler syntax?
options.RuleKindOption ?? context.RuleKinds #Closed
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 asoptions.ResultKinds
.p.s. I think the naming before is not good for
Kind
forResultKinds
, it is better to name using xxxOption, or some pattern. People will not knowKind
is the command line option forResultKinds