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

Make all Multitool command and options classes public. #1988

Merged
merged 1 commit into from
Jul 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/ReleaseHistory.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# SARIF Package Release History (SDK, Driver, Converters, and Multitool)

## **v2.3.2** [Sdk](https://www.nuget.org/packages/Sarif.Sdk/2.3.2) | [Driver](https://www.nuget.org/packages/Sarif.Driver/2.3.2) | [Converters](https://www.nuget.org/packages/Sarif.Converters/2.3.2) | [Multitool](https://www.nuget.org/packages/Sarif.Multitool/2.3.2)
* FEATURE: The `Sarif.Multitool` command line verbs are now exposed programmatically. For example, the `validate` verb is exposed through the classes `ValidateCommand` and `ValidateOptions`.

## **v2.3.1** [Sdk](https://www.nuget.org/packages/Sarif.Sdk/2.3.1) | [Driver](https://www.nuget.org/packages/Sarif.Driver/2.3.1) | [Converters](https://www.nuget.org/packages/Sarif.Converters/2.3.1) | [Multitool](https://www.nuget.org/packages/Sarif.Multitool/2.3.1)
* FEATURE: Revised and improved validation rules in `Sarif.Multitool`.
* FEATURE: Properties serialization performance improved (~20% faster load when Results use Properties).
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/AbsoluteUriCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
internal class AbsoluteUriCommand : CommandBase
public class AbsoluteUriCommand : CommandBase
{
private readonly IFileSystem _fileSystem;

Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/AbsoluteUriOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
[Verb("absoluteuri", HelpText = "Turn all relative Uris into absolute URIs (to be used after rebaseUri is run)")]
internal class AbsoluteUriOptions : MultipleFilesOptionsBase
public class AbsoluteUriOptions : MultipleFilesOptionsBase
{

}
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/ConvertCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
internal class ConvertCommand : CommandBase
public class ConvertCommand : CommandBase
{
public int Run(ConvertOptions convertOptions, IFileSystem fileSystem = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/ConvertOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
[Verb("convert", HelpText = "Convert a tool output log to SARIF format.")]
internal class ConvertOptions : SingleFileOptionsBase
public class ConvertOptions : SingleFileOptionsBase
{
[Option(
't',
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/FileWorkItemsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Microsoft.CodeAnalysis.Sarif.Multitool
/// configured options are valid, the command will instantiate an instance of
/// SarifWorkItemFiler in order to complete the work.
/// </summary>
internal class FileWorkItemsCommand : CommandBase
public class FileWorkItemsCommand : CommandBase
Copy link
Author

Choose a reason for hiding this comment

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

public [](start = 4, length = 6)

Are you comfortable exposing this one, or do you think it still needs more private baking?

(Note: its Options class was already public. That's why you don't see it in the PR.)

{
[ThreadStatic]
internal static bool s_validateOptionsOnly;
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/MergeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
internal class MergeCommand : CommandBase
public class MergeCommand : CommandBase
{
private readonly IFileSystem _fileSystem;

Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/MergeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
[Verb("merge", HelpText = "Merge multiple SARIF files into one.")]
internal class MergeOptions : MultipleFilesOptionsBase
public class MergeOptions : MultipleFilesOptionsBase
{
[Option(
"output-file",
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/PageCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
internal class PageCommand : CommandBase
public class PageCommand : CommandBase
{
private readonly IFileSystem _fileSystem;

Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/PageOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Microsoft.CodeAnalysis.Sarif.Multitool
/// inline: We build a map of the input, so we don't want to write inline and immediately invalidate it.
/// </remarks>
[Verb("page", HelpText = "Extract a subset of results from a source SARIF file.")]
internal class PageOptions
public class PageOptions
{
[Value(0,
MetaName = "<inputFile>",
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/QueryCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
internal class QueryCommand : CommandBase
public class QueryCommand : CommandBase
{
private const int TOO_MANY_RESULTS = 2;

Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/QueryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.Sarif.Multitool
/// and shows results.
/// </summary>
[Verb("query", HelpText = "Find the matching subset of a SARIF file and output it or log it.")]
internal class QueryOptions
public class QueryOptions
{
[Value(0,
MetaName = "<inputFile>",
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/RebaseUriCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
internal class RebaseUriCommand : CommandBase
public class RebaseUriCommand : CommandBase
{
private readonly IFileSystem _fileSystem;

Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/RebaseUriOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
[Verb("rebaseuri", HelpText = "Rebase the URIs in one or more sarif files.")]
internal class RebaseUriOptions : MultipleFilesOptionsBase
public class RebaseUriOptions : MultipleFilesOptionsBase
{
[Option(
'b',
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/ResultMatchSetCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
internal class ResultMatchSetCommand : CommandBase
public class ResultMatchSetCommand : CommandBase
{
private readonly IFileSystem _fileSystem;

Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/ResultMatchSetOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
[Verb("result-match-set", HelpText = "Match Results across runs in the same Group in a folder.")]
internal class ResultMatchSetOptions : CommonOptionsBase
public class ResultMatchSetOptions : CommonOptionsBase
{
[Value(0,
MetaName = "folder-path",
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/ResultMatchingCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
internal class ResultMatchingCommand : CommandBase
public class ResultMatchingCommand : CommandBase
{
private readonly IFileSystem _fileSystem;

Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/ResultMatchingOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
[Verb("match-results-forward", HelpText = "Track results run over run by persisting IDs and then matching them forward")]
internal class ResultMatchingOptions : CommonOptionsBase
public class ResultMatchingOptions : CommonOptionsBase
{
[Option(
'r',
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/RewriteCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
internal class RewriteCommand : CommandBase
public class RewriteCommand : CommandBase
{
private readonly IFileSystem _fileSystem;

Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/RewriteOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
[Verb("rewrite", HelpText = "Transform a SARIF file to a reformatted version.")]
internal class RewriteOptions : SingleFileOptionsBase
public class RewriteOptions : SingleFileOptionsBase
{

}
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/TransformCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
internal class TransformCommand : CommandBase
public class TransformCommand : CommandBase
{
private readonly IFileSystem _fileSystem;

Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/TransformOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
[Verb("transform", HelpText = "Transform a SARIF log to a different version.")]
internal class TransformOptions : SingleFileOptionsBase
public class TransformOptions : SingleFileOptionsBase
{
}
}
4 changes: 2 additions & 2 deletions src/Sarif.Multitool/ValidateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
internal class ValidateCommand : AnalyzeCommandBase<SarifValidationContext, ValidateOptions>
public class ValidateCommand : AnalyzeCommandBase<SarifValidationContext, ValidateOptions>
{
private List<Assembly> _defaultPlugInAssemblies;

Expand Down Expand Up @@ -143,7 +143,7 @@ private void PerformSchemaValidation(
string schemaResource = "Microsoft.CodeAnalysis.Sarif.Multitool.sarif-2.1.0.json";

using (Stream stream = this.GetType().Assembly.GetManifestResourceStream(schemaResource))
using (StreamReader reader = new StreamReader(stream))
using (var reader = new StreamReader(stream))
{
schemaText = reader.ReadToEnd();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/ValidateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
[Verb("validate", HelpText = "Validate a SARIF file against the schema and against additional correctness rules.")]
internal class ValidateOptions : AnalyzeOptionsBase
public class ValidateOptions : AnalyzeOptionsBase
{
[Option(
'j',
Expand Down
6 changes: 3 additions & 3 deletions src/Test.UnitTests.Sarif.Multitool/ValidateCommandTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public class ValidateCommandTests
""type"": ""object""
}";
private const string SchemaFilePath = @"c:\schemas\SimpleSchemaForTest.json";
const string LogFileDirectory = @"C:\Users\John\logs";
const string LogFileName = "example.sarif";
const string OutputFilePath = @"C:\Users\John\output\example-validation.sarif";
private const string LogFileDirectory = @"C:\Users\John\logs";
private const string LogFileName = "example.sarif";
private const string OutputFilePath = @"C:\Users\John\output\example-validation.sarif";

[Fact]
[Trait(TestTraits.Bug, "/~https://github.com/microsoft/sarif-sdk/issues/1064")]
Expand Down
4 changes: 2 additions & 2 deletions src/build.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
having all the relevant values in one place. This property is actually used by the PowerShell
script that hides ("delists") the previous package versions on nuget.org.
-->
<VersionPrefix>2.3.1</VersionPrefix>
<PreviousVersionPrefix>2.3.0</PreviousVersionPrefix>
<VersionPrefix>2.3.2</VersionPrefix>
<PreviousVersionPrefix>2.3.1</PreviousVersionPrefix>

<!-- SchemaVersionAsPublishedToSchemaStoreOrg identifies the current published version on json schema store at https://schemastore.azurewebsites.net/schemas/json/ -->
<SchemaVersionAsPublishedToSchemaStoreOrg>2.1.0-rtm.5</SchemaVersionAsPublishedToSchemaStoreOrg>
Expand Down