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

#2227 Move Transform functionality into Rewrite #2252

Merged
merged 24 commits into from
Jan 28, 2021

Conversation

jameswinkler
Copy link
Collaborator

Fixes #2227

....In preparation for the deletion of transform in its entirety.

Re-order commands alphabetically. Delete unused constructor.

(MergeOptions mergeOptions) => new MergeCommand().Run(mergeOptions),
(PageOptions pageOptions) => new PageCommand().Run(pageOptions),
(QueryOptions queryOptions) => new QueryCommand().Run(queryOptions),
(RebaseUriOptions rebaseOptions) => new RebaseUriCommand().Run(rebaseOptions),
(ResultMatchingOptions baselineOptions) => new ResultMatchingCommand().Run(baselineOptions),
Copy link
Collaborator

@eddynaka eddynaka Jan 21, 2021

Choose a reason for hiding this comment

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

ResultMatchingCommand [](start = 63, length = 21)

I didn't set in the alphabetical order because the resultmatching is equal match-results-foward command. #Closed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Would it be worthwhile to rename the file/class to something like "MatchResultOptions" for consistency?


In reply to: 561433654 [](ancestors = 561433654)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's do it in another pr, separating what we are doing right now :)


In reply to: 561480791 [](ancestors = 561480791,561433654)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.


In reply to: 564739449 [](ancestors = 564739449,561480791,561433654)

@jameswinkler jameswinkler marked this pull request as ready for review January 26, 2021 18:28
@@ -18,11 +18,9 @@ public abstract class CommandBase

protected IFileSystem FileSystem { get; set; }

public CommandBase(IFileSystem fileSystem = null)
Copy link
Collaborator

@eddynaka eddynaka Jan 26, 2021

Choose a reason for hiding this comment

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

public CommandBase(IFileSystem fileSystem = null) [](start = 8, length = 49)

don't remove this. For now, this is the way we initialize the FileSytem. If you check, that is used in MultifileCommandBase, calling the FileSystem directly. #Closed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.


In reply to: 564738564 [](ancestors = 564738564)

return null;
}

private void TransformFileToVersionTwo(SingleFileOptionsBase options, string inputVersion, string outputFilePath)
Copy link
Collaborator

@eddynaka eddynaka Jan 26, 2021

Choose a reason for hiding this comment

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

void [](start = 16, length = 4)

can you return SarifLog instead of void?
in the if, you could return visitor.SarifLog

remove the else and return JsonConvert.... to SarifLog.
With this, we won't need to save in disk #Closed

Copy link
Collaborator

Choose a reason for hiding this comment

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

i would change from options to the sarif string to facilitate, since we won't need to use the options


In reply to: 564740510 [](ancestors = 564740510)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.


In reply to: 564742595 [](ancestors = 564742595,564740510)

@lgtm-com
Copy link

lgtm-com bot commented Jan 26, 2021

This pull request fixes 1 alert when merging 79ca0bc into d7afbe6 - view on LGTM.com

fixed alerts:

  • 1 for Useless assignment to local variable

@@ -43,7 +43,8 @@ private SarifLog ExecuteTest(string path)
{
InputFilePath = path,
OutputFilePath = path,
Force = true
Force = true,
SarifOutputVersion = SarifVersion.Current
Copy link
Collaborator

@eddynaka eddynaka Jan 26, 2021

Choose a reason for hiding this comment

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

SarifOutputVersion = SarifVersion.Current [](start = 16, length = 41)

should we add this as default value in the options itself? #Closed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.


In reply to: 564751819 [](ancestors = 564751819)

@@ -11,6 +11,8 @@ namespace Microsoft.CodeAnalysis.Sarif.Writers
{
public class ConsoleLogger : BaseLogger, IAnalysisLogger
{
// TODO: We directly instantiate this logger in two classes, creating
// unamanged dependencies. Fix this pattern with dependency injection or a factory.
Copy link
Collaborator

@eddynaka eddynaka Jan 26, 2021

Choose a reason for hiding this comment

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

I don't think we have to worry in this. Since the lifetime of the use is a command, the unmanaged resource will go away when it finishes. #ByDesign

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As discussed, created an issue for this.


In reply to: 564753259 [](ancestors = 564753259)

@lgtm-com
Copy link

lgtm-com bot commented Jan 26, 2021

This pull request fixes 1 alert when merging d537617 into d7afbe6 - view on LGTM.com

fixed alerts:

  • 1 for Useless assignment to local variable

@lgtm-com
Copy link

lgtm-com bot commented Jan 26, 2021

This pull request fixes 1 alert when merging 405c18d into d7afbe6 - view on LGTM.com

fixed alerts:

  • 1 for Useless assignment to local variable

@lgtm-com
Copy link

lgtm-com bot commented Jan 26, 2021

This pull request fixes 1 alert when merging 74c7c74 into d7afbe6 - view on LGTM.com

fixed alerts:

  • 1 for Useless assignment to local variable

@lgtm-com
Copy link

lgtm-com bot commented Jan 26, 2021

This pull request fixes 1 alert when merging 263e636 into d7afbe6 - view on LGTM.com

fixed alerts:

  • 1 for Useless assignment to local variable #Closed

@lgtm-com
Copy link

lgtm-com bot commented Jan 26, 2021

This pull request fixes 1 alert when merging 4066d45 into d7afbe6 - view on LGTM.com

fixed alerts:

  • 1 for Useless assignment to local variable #Closed

@lgtm-com
Copy link

lgtm-com bot commented Jan 26, 2021

This pull request fixes 1 alert when merging f6efc3e into d7afbe6 - view on LGTM.com

fixed alerts:

  • 1 for Useless assignment to local variable #Closed

@@ -1,5 +1,7 @@
# SARIF Package Release History (SDK, Driver, Converters, and Multitool)

* BREAKING: Move "transform" functionality into "rewrite" and delete redundant "transform" command
Copy link
Collaborator

@eddynaka eddynaka Jan 26, 2021

Choose a reason for hiding this comment

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

" [](start = 17, length = 1)

change from " to `.
Add the pull request number and link.
Add period in the end #Closed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.


In reply to: 564879607 [](ancestors = 564879607)

Copy link
Collaborator

@eddynaka eddynaka left a comment

Choose a reason for hiding this comment

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

:shipit:

@lgtm-com
Copy link

lgtm-com bot commented Jan 26, 2021

This pull request fixes 1 alert when merging 01d26b9 into d7afbe6 - view on LGTM.com

fixed alerts:

  • 1 for Useless assignment to local variable

@lgtm-com
Copy link

lgtm-com bot commented Jan 28, 2021

This pull request fixes 1 alert when merging 8bf66a5 into 2dd2854 - view on LGTM.com

fixed alerts:

  • 1 for Useless assignment to local variable

@michaelcfanning michaelcfanning merged commit 689b73d into main Jan 28, 2021
@michaelcfanning michaelcfanning deleted the users/v-jwinkler/#2227_MergeTransformRewrite branch January 28, 2021 16:11
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.

Merge the multitool 'transform' command into the 'rewrite' command.
3 participants