Skip to content
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

Add baseline option for analyze command #2371

Merged
merged 4 commits into from
Jul 14, 2021

Conversation

yongyan-gh
Copy link
Collaborator

No description provided.

@lgtm-com
Copy link

lgtm-com bot commented Jul 7, 2021

This pull request introduces 2 alerts when merging 69728b4 into 744db99 - view on LGTM.com

new alerts:

  • 2 for Useless assignment to local variable

using (var reader = new JsonTextReader(new StreamReader(fileSystem.FileOpenRead(options.BaselineSarifFile))))
{
baselineFile = serializer.Deserialize<SarifLog>(reader);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can replace this by:

baselineFile = SarifLog.Load(optons.BaselineSarifFile)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I inject a mock IFileSystem to SarifLog for test cases?

using (var reader = new JsonTextReader(new StreamReader(fileSystem.FileOpenRead(options.OutputFilePath))))
{
currentSarifLog = serializer.Deserialize<SarifLog>(reader);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use this:

currentSarifLog = SarifLog.Load(xyz)

@yongyan-gh yongyan-gh marked this pull request as ready for review July 12, 2021 17:20
Copy link
Member

@michaelcfanning michaelcfanning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@michaelcfanning michaelcfanning merged commit 095e95e into main Jul 14, 2021
@michaelcfanning michaelcfanning deleted the users/yongyan-gh/baseline branch July 14, 2021 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide --baseline driver command argument that accepts SARIF log baseline file.
3 participants