diff --git a/BuildAndTest.cmd b/BuildAndTest.cmd
index 8a6dd938f..a247a1208 100644
--- a/BuildAndTest.cmd
+++ b/BuildAndTest.cmd
@@ -114,6 +114,12 @@ if "%ERRORLEVEL%" NEQ "0" (
goto ExitFailed
)
+src\packages\xunit.runner.console.2.1.0\tools\xunit.console.x86.exe bld\bin\SarifCli.FunctionalTests\AnyCPU_%Configuration%\Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.dll
+
+if "%ERRORLEVEL%" NEQ "0" (
+goto ExitFailed
+)
+
goto Exit
:ExitFailed
diff --git a/appveyor.yml b/appveyor.yml
index fb291fc32..3a8c67c10 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -31,6 +31,7 @@ test:
- '**\Sarif.FunctionalTests.dll'
- '**\Sarif.ValidationTests.dll'
- '**\Sarif.Viewer.VisualStudio.UnitTests.dll'
+ - '**\Microsoft.CodeAnalysis.SarifCli.FunctionalTests.dll'
notifications:
- provider: Email
diff --git a/src/Everything.sln b/src/Everything.sln
index b689ba895..89c14a77d 100644
--- a/src/Everything.sln
+++ b/src/Everything.sln
@@ -33,7 +33,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sarif.Converters", "Sarif.C
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sarif.Viewer.VisualStudio.UnitTests", "Sarif.Viewer.VisualStudio.UnitTests\Sarif.Viewer.VisualStudio.UnitTests.csproj", "{D0210D4B-32A8-46CA-8BA4-0703517481B4}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SarifValidator", "SarifValidator\SarifValidator.csproj", "{0EBA700D-29E7-4FFF-8EBF-20B8C0EF9A98}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SarifCli", "SarifCli\SarifCli.csproj", "{0EBA700D-29E7-4FFF-8EBF-20B8C0EF9A98}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SarifCli.FunctionalTests", "SarifCli.FunctionalTests\SarifCli.FunctionalTests.csproj", "{859920F3-DB09-4C1D-9EAD-DFB1D7A03A46}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -201,6 +203,18 @@ Global
{0EBA700D-29E7-4FFF-8EBF-20B8C0EF9A98}.Release|x64.Build.0 = Release|Any CPU
{0EBA700D-29E7-4FFF-8EBF-20B8C0EF9A98}.Release|x86.ActiveCfg = Release|Any CPU
{0EBA700D-29E7-4FFF-8EBF-20B8C0EF9A98}.Release|x86.Build.0 = Release|Any CPU
+ {859920F3-DB09-4C1D-9EAD-DFB1D7A03A46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {859920F3-DB09-4C1D-9EAD-DFB1D7A03A46}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {859920F3-DB09-4C1D-9EAD-DFB1D7A03A46}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {859920F3-DB09-4C1D-9EAD-DFB1D7A03A46}.Debug|x64.Build.0 = Debug|Any CPU
+ {859920F3-DB09-4C1D-9EAD-DFB1D7A03A46}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {859920F3-DB09-4C1D-9EAD-DFB1D7A03A46}.Debug|x86.Build.0 = Debug|Any CPU
+ {859920F3-DB09-4C1D-9EAD-DFB1D7A03A46}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {859920F3-DB09-4C1D-9EAD-DFB1D7A03A46}.Release|Any CPU.Build.0 = Release|Any CPU
+ {859920F3-DB09-4C1D-9EAD-DFB1D7A03A46}.Release|x64.ActiveCfg = Release|Any CPU
+ {859920F3-DB09-4C1D-9EAD-DFB1D7A03A46}.Release|x64.Build.0 = Release|Any CPU
+ {859920F3-DB09-4C1D-9EAD-DFB1D7A03A46}.Release|x86.ActiveCfg = Release|Any CPU
+ {859920F3-DB09-4C1D-9EAD-DFB1D7A03A46}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/src/References/Microsoft.Json.Schema.dll b/src/References/Microsoft.Json.Schema.dll
deleted file mode 100644
index e249f0a32..000000000
Binary files a/src/References/Microsoft.Json.Schema.dll and /dev/null differ
diff --git a/src/Sarif.ValidationTests/Sarif.ValidationTests.csproj b/src/Sarif.ValidationTests/Sarif.ValidationTests.csproj
index 651f54ef1..de86c425c 100644
--- a/src/Sarif.ValidationTests/Sarif.ValidationTests.csproj
+++ b/src/Sarif.ValidationTests/Sarif.ValidationTests.csproj
@@ -16,8 +16,9 @@
v4.5.1
-
- ..\References\Microsoft.Json.Schema.dll
+
+ ..\packages\Microsoft.Json.Schema.0.46.0\lib\net451\Microsoft.Json.Schema.dll
+ True
..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll
@@ -39,8 +40,8 @@
-
- ..\packages\Sarif.Sdk.1.5.25\lib\net45\Sarif.dll
+
+ ..\packages\Sarif.Sdk.1.5.29\lib\net45\Sarif.dll
True
diff --git a/src/Sarif.ValidationTests/packages.config b/src/Sarif.ValidationTests/packages.config
index b952e2631..a4a5ec8a9 100644
--- a/src/Sarif.ValidationTests/packages.config
+++ b/src/Sarif.ValidationTests/packages.config
@@ -2,7 +2,8 @@
-
+
+
diff --git a/src/Sarif/Autogenerated/AlgorithmKind.cs b/src/Sarif/Autogenerated/AlgorithmKind.cs
index be7f08771..cd72579d0 100644
--- a/src/Sarif/Autogenerated/AlgorithmKind.cs
+++ b/src/Sarif/Autogenerated/AlgorithmKind.cs
@@ -8,7 +8,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Values specifying different hashing algorithms.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public enum AlgorithmKind
{
Unknown,
diff --git a/src/Sarif/Autogenerated/AnnotatedCodeLocation.cs b/src/Sarif/Autogenerated/AnnotatedCodeLocation.cs
index 5e9481328..405c5afd1 100644
--- a/src/Sarif/Autogenerated/AnnotatedCodeLocation.cs
+++ b/src/Sarif/Autogenerated/AnnotatedCodeLocation.cs
@@ -14,7 +14,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// An annotation used to express code flows through a method or other locations that are related to a result.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class AnnotatedCodeLocation : PropertyBagHolder, ISarifNode
{
public static IEqualityComparer ValueComparer => AnnotatedCodeLocationEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/AnnotatedCodeLocationEqualityComparer.cs b/src/Sarif/Autogenerated/AnnotatedCodeLocationEqualityComparer.cs
index 66668d659..a8a7f8e73 100644
--- a/src/Sarif/Autogenerated/AnnotatedCodeLocationEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/AnnotatedCodeLocationEqualityComparer.cs
@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type AnnotatedCodeLocation for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class AnnotatedCodeLocationEqualityComparer : IEqualityComparer
{
internal static readonly AnnotatedCodeLocationEqualityComparer Instance = new AnnotatedCodeLocationEqualityComparer();
diff --git a/src/Sarif/Autogenerated/AnnotatedCodeLocationImportance.cs b/src/Sarif/Autogenerated/AnnotatedCodeLocationImportance.cs
index 54a66eeae..933146cff 100644
--- a/src/Sarif/Autogenerated/AnnotatedCodeLocationImportance.cs
+++ b/src/Sarif/Autogenerated/AnnotatedCodeLocationImportance.cs
@@ -8,7 +8,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Values specifying the importance of an "annotatedCodeLocation" within the "codeFlow" in which it occurs
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public enum AnnotatedCodeLocationImportance
{
Important,
diff --git a/src/Sarif/Autogenerated/AnnotatedCodeLocationKind.cs b/src/Sarif/Autogenerated/AnnotatedCodeLocationKind.cs
index fc8e1b4fc..f87fdc06c 100644
--- a/src/Sarif/Autogenerated/AnnotatedCodeLocationKind.cs
+++ b/src/Sarif/Autogenerated/AnnotatedCodeLocationKind.cs
@@ -8,7 +8,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Values specifying the kind of an annotated code location.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public enum AnnotatedCodeLocationKind
{
Unknown,
diff --git a/src/Sarif/Autogenerated/BaselineState.cs b/src/Sarif/Autogenerated/BaselineState.cs
index a9169913f..3364a311d 100644
--- a/src/Sarif/Autogenerated/BaselineState.cs
+++ b/src/Sarif/Autogenerated/BaselineState.cs
@@ -8,7 +8,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// The state of a result relative to a baseline of a previous run.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public enum BaselineState
{
None,
diff --git a/src/Sarif/Autogenerated/CodeFlow.cs b/src/Sarif/Autogenerated/CodeFlow.cs
index 63a511bc0..3a005c762 100644
--- a/src/Sarif/Autogenerated/CodeFlow.cs
+++ b/src/Sarif/Autogenerated/CodeFlow.cs
@@ -10,7 +10,7 @@
namespace Microsoft.CodeAnalysis.Sarif
{
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class CodeFlow : PropertyBagHolder, ISarifNode
{
public static IEqualityComparer ValueComparer => CodeFlowEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/CodeFlowEqualityComparer.cs b/src/Sarif/Autogenerated/CodeFlowEqualityComparer.cs
index fd28f4aeb..ab67c92d4 100644
--- a/src/Sarif/Autogenerated/CodeFlowEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/CodeFlowEqualityComparer.cs
@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type CodeFlow for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class CodeFlowEqualityComparer : IEqualityComparer
{
internal static readonly CodeFlowEqualityComparer Instance = new CodeFlowEqualityComparer();
diff --git a/src/Sarif/Autogenerated/ExceptionData.cs b/src/Sarif/Autogenerated/ExceptionData.cs
index aff4239f5..992211453 100644
--- a/src/Sarif/Autogenerated/ExceptionData.cs
+++ b/src/Sarif/Autogenerated/ExceptionData.cs
@@ -9,7 +9,7 @@
namespace Microsoft.CodeAnalysis.Sarif
{
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class ExceptionData : ISarifNode
{
public static IEqualityComparer ValueComparer => ExceptionDataEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/ExceptionDataEqualityComparer.cs b/src/Sarif/Autogenerated/ExceptionDataEqualityComparer.cs
index e2ea2b0c9..5da078a42 100644
--- a/src/Sarif/Autogenerated/ExceptionDataEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/ExceptionDataEqualityComparer.cs
@@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type ExceptionData for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class ExceptionDataEqualityComparer : IEqualityComparer
{
internal static readonly ExceptionDataEqualityComparer Instance = new ExceptionDataEqualityComparer();
diff --git a/src/Sarif/Autogenerated/FileChange.cs b/src/Sarif/Autogenerated/FileChange.cs
index 8efced3ab..d1ddf96b6 100644
--- a/src/Sarif/Autogenerated/FileChange.cs
+++ b/src/Sarif/Autogenerated/FileChange.cs
@@ -12,7 +12,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// A change to a single file.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class FileChange : ISarifNode
{
public static IEqualityComparer ValueComparer => FileChangeEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/FileChangeEqualityComparer.cs b/src/Sarif/Autogenerated/FileChangeEqualityComparer.cs
index c988d7768..f4898249e 100644
--- a/src/Sarif/Autogenerated/FileChangeEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/FileChangeEqualityComparer.cs
@@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type FileChange for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class FileChangeEqualityComparer : IEqualityComparer
{
internal static readonly FileChangeEqualityComparer Instance = new FileChangeEqualityComparer();
diff --git a/src/Sarif/Autogenerated/FileData.cs b/src/Sarif/Autogenerated/FileData.cs
index fb5f6e5b0..38a677d1e 100644
--- a/src/Sarif/Autogenerated/FileData.cs
+++ b/src/Sarif/Autogenerated/FileData.cs
@@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// A single file. In some cases, this file might be nested within another file.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class FileData : PropertyBagHolder, ISarifNode
{
public static IEqualityComparer ValueComparer => FileDataEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/FileDataEqualityComparer.cs b/src/Sarif/Autogenerated/FileDataEqualityComparer.cs
index 37631978b..b9ee67c43 100644
--- a/src/Sarif/Autogenerated/FileDataEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/FileDataEqualityComparer.cs
@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type FileData for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class FileDataEqualityComparer : IEqualityComparer
{
internal static readonly FileDataEqualityComparer Instance = new FileDataEqualityComparer();
diff --git a/src/Sarif/Autogenerated/Fix.cs b/src/Sarif/Autogenerated/Fix.cs
index 7ad48903f..f0dd2627b 100644
--- a/src/Sarif/Autogenerated/Fix.cs
+++ b/src/Sarif/Autogenerated/Fix.cs
@@ -12,7 +12,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// A proposed fix for the problem represented by a result object. A fix specifies a set of file to modify. For each file, it specifies a set of bytes to remove, and provides a set of new bytes to replace them.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class Fix : ISarifNode
{
public static IEqualityComparer ValueComparer => FixEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/FixEqualityComparer.cs b/src/Sarif/Autogenerated/FixEqualityComparer.cs
index 53b1d11f8..f960441af 100644
--- a/src/Sarif/Autogenerated/FixEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/FixEqualityComparer.cs
@@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type Fix for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class FixEqualityComparer : IEqualityComparer
{
internal static readonly FixEqualityComparer Instance = new FixEqualityComparer();
diff --git a/src/Sarif/Autogenerated/FormattedRuleMessage.cs b/src/Sarif/Autogenerated/FormattedRuleMessage.cs
index 0a82d673e..52b500c77 100644
--- a/src/Sarif/Autogenerated/FormattedRuleMessage.cs
+++ b/src/Sarif/Autogenerated/FormattedRuleMessage.cs
@@ -12,7 +12,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// Contains information that can be used to construct a formatted message that describes a result.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class FormattedRuleMessage : ISarifNode
{
public static IEqualityComparer ValueComparer => FormattedRuleMessageEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/FormattedRuleMessageEqualityComparer.cs b/src/Sarif/Autogenerated/FormattedRuleMessageEqualityComparer.cs
index fb75ae274..6d0c3b0c4 100644
--- a/src/Sarif/Autogenerated/FormattedRuleMessageEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/FormattedRuleMessageEqualityComparer.cs
@@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type FormattedRuleMessage for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class FormattedRuleMessageEqualityComparer : IEqualityComparer
{
internal static readonly FormattedRuleMessageEqualityComparer Instance = new FormattedRuleMessageEqualityComparer();
diff --git a/src/Sarif/Autogenerated/Hash.cs b/src/Sarif/Autogenerated/Hash.cs
index 1306a01b0..2625bae79 100644
--- a/src/Sarif/Autogenerated/Hash.cs
+++ b/src/Sarif/Autogenerated/Hash.cs
@@ -12,7 +12,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// A hash value of some file or collection of files, together with the algorithm used to compute the hash.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class Hash : ISarifNode
{
public static IEqualityComparer ValueComparer => HashEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/HashEqualityComparer.cs b/src/Sarif/Autogenerated/HashEqualityComparer.cs
index 51ca29337..57d03b7c2 100644
--- a/src/Sarif/Autogenerated/HashEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/HashEqualityComparer.cs
@@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type Hash for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class HashEqualityComparer : IEqualityComparer
{
internal static readonly HashEqualityComparer Instance = new HashEqualityComparer();
diff --git a/src/Sarif/Autogenerated/IRule.cs b/src/Sarif/Autogenerated/IRule.cs
index 1ca241fe6..052f44feb 100644
--- a/src/Sarif/Autogenerated/IRule.cs
+++ b/src/Sarif/Autogenerated/IRule.cs
@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Interface exposed by objects that provide information about analysis rules.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial interface IRule
{
///
diff --git a/src/Sarif/Autogenerated/ISarifNode.cs b/src/Sarif/Autogenerated/ISarifNode.cs
index e4609695d..0a0f398d7 100644
--- a/src/Sarif/Autogenerated/ISarifNode.cs
+++ b/src/Sarif/Autogenerated/ISarifNode.cs
@@ -8,7 +8,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// An interface for all types generated from the Sarif schema.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public interface ISarifNode
{
///
diff --git a/src/Sarif/Autogenerated/Invocation.cs b/src/Sarif/Autogenerated/Invocation.cs
index 1e15b371e..2cef493b2 100644
--- a/src/Sarif/Autogenerated/Invocation.cs
+++ b/src/Sarif/Autogenerated/Invocation.cs
@@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// The runtime environment of the analysis tool run.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class Invocation : PropertyBagHolder, ISarifNode
{
public static IEqualityComparer ValueComparer => InvocationEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/InvocationEqualityComparer.cs b/src/Sarif/Autogenerated/InvocationEqualityComparer.cs
index d197524ce..67eb00c61 100644
--- a/src/Sarif/Autogenerated/InvocationEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/InvocationEqualityComparer.cs
@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type Invocation for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class InvocationEqualityComparer : IEqualityComparer
{
internal static readonly InvocationEqualityComparer Instance = new InvocationEqualityComparer();
diff --git a/src/Sarif/Autogenerated/Location.cs b/src/Sarif/Autogenerated/Location.cs
index 42916722e..c277a6615 100644
--- a/src/Sarif/Autogenerated/Location.cs
+++ b/src/Sarif/Autogenerated/Location.cs
@@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// The location where an analysis tool produced a result.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class Location : PropertyBagHolder, ISarifNode
{
public static IEqualityComparer ValueComparer => LocationEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/LocationEqualityComparer.cs b/src/Sarif/Autogenerated/LocationEqualityComparer.cs
index 5ee3cab89..232a5d891 100644
--- a/src/Sarif/Autogenerated/LocationEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/LocationEqualityComparer.cs
@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type Location for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class LocationEqualityComparer : IEqualityComparer
{
internal static readonly LocationEqualityComparer Instance = new LocationEqualityComparer();
diff --git a/src/Sarif/Autogenerated/LogicalLocation.cs b/src/Sarif/Autogenerated/LogicalLocation.cs
index a7b7b5dc8..49ac5bfb1 100644
--- a/src/Sarif/Autogenerated/LogicalLocation.cs
+++ b/src/Sarif/Autogenerated/LogicalLocation.cs
@@ -12,7 +12,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// A logical location of a construct that produced a result.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class LogicalLocation : ISarifNode
{
public static IEqualityComparer ValueComparer => LogicalLocationEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/LogicalLocationEqualityComparer.cs b/src/Sarif/Autogenerated/LogicalLocationEqualityComparer.cs
index f9bdda10e..1a8e011d4 100644
--- a/src/Sarif/Autogenerated/LogicalLocationEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/LogicalLocationEqualityComparer.cs
@@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type LogicalLocation for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class LogicalLocationEqualityComparer : IEqualityComparer
{
internal static readonly LogicalLocationEqualityComparer Instance = new LogicalLocationEqualityComparer();
diff --git a/src/Sarif/Autogenerated/Notification.cs b/src/Sarif/Autogenerated/Notification.cs
index 7db943ba5..9fe34f8bf 100644
--- a/src/Sarif/Autogenerated/Notification.cs
+++ b/src/Sarif/Autogenerated/Notification.cs
@@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// Describes a condition relevant to the tool itself, as opposed to being relevant to a target being analyzed by the tool.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class Notification : PropertyBagHolder, ISarifNode
{
public static IEqualityComparer ValueComparer => NotificationEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/NotificationEqualityComparer.cs b/src/Sarif/Autogenerated/NotificationEqualityComparer.cs
index 2b8627f15..c14f3e569 100644
--- a/src/Sarif/Autogenerated/NotificationEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/NotificationEqualityComparer.cs
@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type Notification for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class NotificationEqualityComparer : IEqualityComparer
{
internal static readonly NotificationEqualityComparer Instance = new NotificationEqualityComparer();
diff --git a/src/Sarif/Autogenerated/NotificationLevel.cs b/src/Sarif/Autogenerated/NotificationLevel.cs
index b691e1010..2870157e4 100644
--- a/src/Sarif/Autogenerated/NotificationLevel.cs
+++ b/src/Sarif/Autogenerated/NotificationLevel.cs
@@ -8,7 +8,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Values specifying the level of a notification.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public enum NotificationLevel
{
Warning,
diff --git a/src/Sarif/Autogenerated/PhysicalLocation.cs b/src/Sarif/Autogenerated/PhysicalLocation.cs
index 9599fb1ca..ddbb1c1db 100644
--- a/src/Sarif/Autogenerated/PhysicalLocation.cs
+++ b/src/Sarif/Autogenerated/PhysicalLocation.cs
@@ -12,7 +12,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class PhysicalLocation : ISarifNode
{
public static IEqualityComparer ValueComparer => PhysicalLocationEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/PhysicalLocationEqualityComparer.cs b/src/Sarif/Autogenerated/PhysicalLocationEqualityComparer.cs
index f9debd0f6..7a6d86be1 100644
--- a/src/Sarif/Autogenerated/PhysicalLocationEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/PhysicalLocationEqualityComparer.cs
@@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type PhysicalLocation for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class PhysicalLocationEqualityComparer : IEqualityComparer
{
internal static readonly PhysicalLocationEqualityComparer Instance = new PhysicalLocationEqualityComparer();
diff --git a/src/Sarif/Autogenerated/Region.cs b/src/Sarif/Autogenerated/Region.cs
index 6acee91ec..5b4728756 100644
--- a/src/Sarif/Autogenerated/Region.cs
+++ b/src/Sarif/Autogenerated/Region.cs
@@ -12,7 +12,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// A region within a file where a result was detected.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class Region : ISarifNode
{
public static IEqualityComparer ValueComparer => RegionEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/RegionEqualityComparer.cs b/src/Sarif/Autogenerated/RegionEqualityComparer.cs
index 9fa16cd2b..9d7350ee4 100644
--- a/src/Sarif/Autogenerated/RegionEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/RegionEqualityComparer.cs
@@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type Region for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class RegionEqualityComparer : IEqualityComparer
{
internal static readonly RegionEqualityComparer Instance = new RegionEqualityComparer();
diff --git a/src/Sarif/Autogenerated/Replacement.cs b/src/Sarif/Autogenerated/Replacement.cs
index 87dae7721..47a7a47d1 100644
--- a/src/Sarif/Autogenerated/Replacement.cs
+++ b/src/Sarif/Autogenerated/Replacement.cs
@@ -12,7 +12,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// The replacement of a single range of bytes in a file. Specifies the location within the file where the replacement is to be made, the number of bytes to remove at that location, and a sequence of bytes to insert at that location.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class Replacement : ISarifNode
{
public static IEqualityComparer ValueComparer => ReplacementEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/ReplacementEqualityComparer.cs b/src/Sarif/Autogenerated/ReplacementEqualityComparer.cs
index a5de8d22d..1dbcfe456 100644
--- a/src/Sarif/Autogenerated/ReplacementEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/ReplacementEqualityComparer.cs
@@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type Replacement for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class ReplacementEqualityComparer : IEqualityComparer
{
internal static readonly ReplacementEqualityComparer Instance = new ReplacementEqualityComparer();
diff --git a/src/Sarif/Autogenerated/Result.cs b/src/Sarif/Autogenerated/Result.cs
index 00c6cf406..14fc269f4 100644
--- a/src/Sarif/Autogenerated/Result.cs
+++ b/src/Sarif/Autogenerated/Result.cs
@@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// A result produced by an analysis tool.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class Result : PropertyBagHolder, ISarifNode
{
public static IEqualityComparer ValueComparer => ResultEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/ResultEqualityComparer.cs b/src/Sarif/Autogenerated/ResultEqualityComparer.cs
index 7e7acaee7..c1e21521d 100644
--- a/src/Sarif/Autogenerated/ResultEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/ResultEqualityComparer.cs
@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type Result for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class ResultEqualityComparer : IEqualityComparer
{
internal static readonly ResultEqualityComparer Instance = new ResultEqualityComparer();
diff --git a/src/Sarif/Autogenerated/ResultLevel.cs b/src/Sarif/Autogenerated/ResultLevel.cs
index 1870e2649..074185dfc 100644
--- a/src/Sarif/Autogenerated/ResultLevel.cs
+++ b/src/Sarif/Autogenerated/ResultLevel.cs
@@ -8,7 +8,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Values specifying the level of a result.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public enum ResultLevel
{
Default,
diff --git a/src/Sarif/Autogenerated/Rule.cs b/src/Sarif/Autogenerated/Rule.cs
index 808d9dbb7..9bb561366 100644
--- a/src/Sarif/Autogenerated/Rule.cs
+++ b/src/Sarif/Autogenerated/Rule.cs
@@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// Describes an analysis rule.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class Rule : PropertyBagHolder, IRule, ISarifNode
{
public static IEqualityComparer ValueComparer => RuleEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/RuleEqualityComparer.cs b/src/Sarif/Autogenerated/RuleEqualityComparer.cs
index d6f7486a2..2dbe88f4b 100644
--- a/src/Sarif/Autogenerated/RuleEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/RuleEqualityComparer.cs
@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type Rule for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class RuleEqualityComparer : IEqualityComparer
{
internal static readonly RuleEqualityComparer Instance = new RuleEqualityComparer();
diff --git a/src/Sarif/Autogenerated/Run.cs b/src/Sarif/Autogenerated/Run.cs
index c11683bbe..ed84f7dea 100644
--- a/src/Sarif/Autogenerated/Run.cs
+++ b/src/Sarif/Autogenerated/Run.cs
@@ -12,7 +12,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// Describes a single run of an analysis tool, and contains the output of that run.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class Run : ISarifNode
{
public static IEqualityComparer ValueComparer => RunEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/RunEqualityComparer.cs b/src/Sarif/Autogenerated/RunEqualityComparer.cs
index 74827c3c6..fdd50a7d9 100644
--- a/src/Sarif/Autogenerated/RunEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/RunEqualityComparer.cs
@@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type Run for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class RunEqualityComparer : IEqualityComparer
{
internal static readonly RunEqualityComparer Instance = new RunEqualityComparer();
diff --git a/src/Sarif/Autogenerated/SarifLog.cs b/src/Sarif/Autogenerated/SarifLog.cs
index 541ad6cc5..70f98cb2f 100644
--- a/src/Sarif/Autogenerated/SarifLog.cs
+++ b/src/Sarif/Autogenerated/SarifLog.cs
@@ -12,7 +12,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// Static Analysis Results Format (SARIF) Version 1.0.0 JSON Schema: a standard format for the output of static analysis and other tools.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class SarifLog : ISarifNode
{
public static IEqualityComparer ValueComparer => SarifLogEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/SarifLogEqualityComparer.cs b/src/Sarif/Autogenerated/SarifLogEqualityComparer.cs
index be90125da..c5df5b1f5 100644
--- a/src/Sarif/Autogenerated/SarifLogEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/SarifLogEqualityComparer.cs
@@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type SarifLog for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class SarifLogEqualityComparer : IEqualityComparer
{
internal static readonly SarifLogEqualityComparer Instance = new SarifLogEqualityComparer();
diff --git a/src/Sarif/Autogenerated/SarifNodeKind.cs b/src/Sarif/Autogenerated/SarifNodeKind.cs
index 400657607..999df5588 100644
--- a/src/Sarif/Autogenerated/SarifNodeKind.cs
+++ b/src/Sarif/Autogenerated/SarifNodeKind.cs
@@ -8,7 +8,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// A set of values for all the types that implement .
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public enum SarifNodeKind
{
///
diff --git a/src/Sarif/Autogenerated/SarifRewritingVisitor.cs b/src/Sarif/Autogenerated/SarifRewritingVisitor.cs
index e4c6729ff..2806f87cf 100644
--- a/src/Sarif/Autogenerated/SarifRewritingVisitor.cs
+++ b/src/Sarif/Autogenerated/SarifRewritingVisitor.cs
@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Rewriting visitor for the Sarif object model.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public abstract class SarifRewritingVisitor
{
///
diff --git a/src/Sarif/Autogenerated/SarifVersion.cs b/src/Sarif/Autogenerated/SarifVersion.cs
index f7fb88d57..c11e5a816 100644
--- a/src/Sarif/Autogenerated/SarifVersion.cs
+++ b/src/Sarif/Autogenerated/SarifVersion.cs
@@ -8,7 +8,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Possible values for the SARIF schema version.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public enum SarifVersion
{
Unknown,
diff --git a/src/Sarif/Autogenerated/Stack.cs b/src/Sarif/Autogenerated/Stack.cs
index d8fa281e8..808dedaa9 100644
--- a/src/Sarif/Autogenerated/Stack.cs
+++ b/src/Sarif/Autogenerated/Stack.cs
@@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// A call stack that is relevant to a result.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class Stack : PropertyBagHolder, ISarifNode
{
public static IEqualityComparer ValueComparer => StackEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/StackEqualityComparer.cs b/src/Sarif/Autogenerated/StackEqualityComparer.cs
index 47933bd1f..7d9c3595f 100644
--- a/src/Sarif/Autogenerated/StackEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/StackEqualityComparer.cs
@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type Stack for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class StackEqualityComparer : IEqualityComparer
{
internal static readonly StackEqualityComparer Instance = new StackEqualityComparer();
diff --git a/src/Sarif/Autogenerated/StackFrame.cs b/src/Sarif/Autogenerated/StackFrame.cs
index 81e937d81..81bf8485b 100644
--- a/src/Sarif/Autogenerated/StackFrame.cs
+++ b/src/Sarif/Autogenerated/StackFrame.cs
@@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// A function call within a stack trace.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class StackFrame : PropertyBagHolder, ISarifNode
{
public static IEqualityComparer ValueComparer => StackFrameEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/StackFrameEqualityComparer.cs b/src/Sarif/Autogenerated/StackFrameEqualityComparer.cs
index 8e0776fd6..96a779184 100644
--- a/src/Sarif/Autogenerated/StackFrameEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/StackFrameEqualityComparer.cs
@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type StackFrame for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class StackFrameEqualityComparer : IEqualityComparer
{
internal static readonly StackFrameEqualityComparer Instance = new StackFrameEqualityComparer();
diff --git a/src/Sarif/Autogenerated/SuppressionStates.cs b/src/Sarif/Autogenerated/SuppressionStates.cs
index 2fba538e2..16e668992 100644
--- a/src/Sarif/Autogenerated/SuppressionStates.cs
+++ b/src/Sarif/Autogenerated/SuppressionStates.cs
@@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// The state of a result relative to a baseline of a previous run.
///
[Flags]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public enum SuppressionStates
{
None,
diff --git a/src/Sarif/Autogenerated/TaintKind.cs b/src/Sarif/Autogenerated/TaintKind.cs
index 47a15d2a6..705edb7f5 100644
--- a/src/Sarif/Autogenerated/TaintKind.cs
+++ b/src/Sarif/Autogenerated/TaintKind.cs
@@ -8,7 +8,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Values that classify the annotated code location in terms of a taint analysis.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public enum TaintKind
{
Unknown,
diff --git a/src/Sarif/Autogenerated/Tool.cs b/src/Sarif/Autogenerated/Tool.cs
index 54d756a00..5b5b38164 100644
--- a/src/Sarif/Autogenerated/Tool.cs
+++ b/src/Sarif/Autogenerated/Tool.cs
@@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.Sarif
/// The analysis tool that was run.
///
[DataContract]
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
public partial class Tool : PropertyBagHolder, ISarifNode
{
public static IEqualityComparer ValueComparer => ToolEqualityComparer.Instance;
diff --git a/src/Sarif/Autogenerated/ToolEqualityComparer.cs b/src/Sarif/Autogenerated/ToolEqualityComparer.cs
index e0ec8c3c5..108dc6d57 100644
--- a/src/Sarif/Autogenerated/ToolEqualityComparer.cs
+++ b/src/Sarif/Autogenerated/ToolEqualityComparer.cs
@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Sarif
///
/// Defines methods to support the comparison of objects of type Tool for equality.
///
- [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.42.0.0")]
+ [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.46.0.0")]
internal sealed class ToolEqualityComparer : IEqualityComparer
{
internal static readonly ToolEqualityComparer Instance = new ToolEqualityComparer();
diff --git a/src/Sarif/ConsoleLogger.cs b/src/Sarif/ConsoleLogger.cs
index fae862a86..5db2283f5 100644
--- a/src/Sarif/ConsoleLogger.cs
+++ b/src/Sarif/ConsoleLogger.cs
@@ -206,7 +206,7 @@ public static string NormalizeMessage(string message, bool enquote)
}
return (enquote ? "\"" : "") +
- message.Replace('"', '\'') +
+ message +
(enquote ? "\"" : "");
}
diff --git a/src/Sarif/ToDotNet/ToDotNet.targets b/src/Sarif/ToDotNet/ToDotNet.targets
index 72277bc01..68b631f9e 100644
--- a/src/Sarif/ToDotNet/ToDotNet.targets
+++ b/src/Sarif/ToDotNet/ToDotNet.targets
@@ -10,7 +10,7 @@
$(MSBuildProjectDirectory)\..\..\.nuget
- ..\packages\Microsoft.Json.Schema.ToDotNet.0.42.0\tools\JsonSchemaToDotNet.exe
+ ..\packages\Microsoft.Json.Schema.ToDotNet.0.46.0\tools\JsonSchemaToDotNet.exe
<_ObjectModelOutputDirectory>$(FlavorIndependentIntermediateOutputPath)Autogenerated
diff --git a/src/Sarif/ToDotNet/packages.config b/src/Sarif/ToDotNet/packages.config
index 3b7ea18df..4adfcc039 100644
--- a/src/Sarif/ToDotNet/packages.config
+++ b/src/Sarif/ToDotNet/packages.config
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/src/Sarif/Writers/MimeType.cs b/src/Sarif/Writers/MimeType.cs
index 26f310767..62b9678b2 100644
--- a/src/Sarif/Writers/MimeType.cs
+++ b/src/Sarif/Writers/MimeType.cs
@@ -73,6 +73,8 @@ public static string DetermineFromFileExtension(Uri fileUri)
public static readonly string Directory = "application/x-directory";
/// The MIME type used for CSharp files.
public static readonly string CSharp = "text/x-csharp";
+ /// The MIME type for SARIF files.
+ public static readonly string Sarif = "text/x-sarif";
private static bool HasExtension(string fileName, string extension)
{
@@ -117,6 +119,7 @@ private static bool HasExtension(string fileName, string extension)
ImmutableArray.Create("text/python", "py"),
ImmutableArray.Create("text/x-cshtml", "cshtml"),
ImmutableArray.Create("text/ruby", "ruby", "gemspec"),
+ ImmutableArray.Create(MimeType.Sarif, "sarif"),
ImmutableArray.Create("text/scss", "scss"),
ImmutableArray.Create("text/typescript", "ts"),
ImmutableArray.Create("text/x-vb", "vb"),
diff --git a/src/SarifCli.FunctionalTests/AnalyzeCommandTests.cs b/src/SarifCli.FunctionalTests/AnalyzeCommandTests.cs
new file mode 100644
index 000000000..75c141efe
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/AnalyzeCommandTests.cs
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All Rights Reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.IO;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests
+{
+ public class AnalyzeCommandTests : SarifCliTestBase
+ {
+ [Fact(DisplayName = nameof(AnalyzeCommand_ReportsJsonSyntaxError))]
+ public void AnalyzeCommand_ReportsJsonSyntaxError()
+ {
+ Verify("SyntaxError.sarif");
+ }
+
+ [Fact(DisplayName = nameof(AnalyzeCommand_ReportsDeserializationError))]
+ public void AnalyzeCommand_ReportsDeserializationError()
+ {
+ Verify("DeserializationError.sarif");
+ }
+
+ private void Verify(string testFileName)
+ {
+ string testDirectory = Path.Combine(Environment.CurrentDirectory, TestDataDirectory);
+
+ string testFilePath = Path.Combine(TestDataDirectory, testFileName);
+ string expectedFilePath = MakeExpectedFilePath(testDirectory, testFileName);
+ string actualFilePath = MakeActualFilePath(testDirectory, testFileName);
+
+ var analyzeOptions = new AnalyzeOptions
+ {
+ TargetFileSpecifiers = new[] { testFilePath },
+ OutputFilePath = actualFilePath,
+ SchemaFilePath = JsonSchemaFile,
+ Quiet = true
+ };
+
+ new AnalyzeCommand().Run(analyzeOptions);
+
+ string actualLogContents = File.ReadAllText(actualFilePath);
+ string expectedLogContents = File.ReadAllText(expectedFilePath);
+
+ // We can't just compare the text of the log files because properties
+ // like start time, and absolute paths, will differ from run to run.
+ // Until SarifLogger has a "deterministic" option (see http://github.com/Microsoft/sarif-sdk/issues/500),
+ // we perform a selective compare of just the elements we care about.
+ SelectiveCompare(actualLogContents, expectedLogContents);
+ }
+ }
+}
diff --git a/src/SarifCli.FunctionalTests/Properties/AssemblyInfo.cs b/src/SarifCli.FunctionalTests/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..c42c39663
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/Properties/AssemblyInfo.cs
@@ -0,0 +1,10 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System.Reflection;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Sarif CLI Functional Tests")]
+[assembly: AssemblyDescription("Functional tests for the SARIF command line interface tool")]
diff --git a/src/SarifCli.FunctionalTests/Rules/AnnotatedCodeLocationEssentialIsObsoleteTests.cs b/src/SarifCli.FunctionalTests/Rules/AnnotatedCodeLocationEssentialIsObsoleteTests.cs
new file mode 100644
index 000000000..2da7db2ae
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/Rules/AnnotatedCodeLocationEssentialIsObsoleteTests.cs
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.CodeAnalysis.Sarif.Cli.Rules;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.Rules
+{
+ public class AnnotatedCodeLocationEssentialIsObsoleteTests : SkimmerTestsBase
+ {
+ [Fact(DisplayName = nameof(AnnotatedCodeLocationEssentialIsObsolete_AnnotatedCodeLocationDoesNotHaveEssential))]
+ public void AnnotatedCodeLocationEssentialIsObsolete_AnnotatedCodeLocationDoesNotHaveEssential()
+ {
+ Verify(new AnnotatedCodeLocationEssentialIsObsolete(), "AnnotatedCodeLocationDoesNotHaveEssential.sarif");
+ }
+
+ [Fact(DisplayName = nameof(AnnotatedCodeLocationEssentialIsObsolete_AnnotatedCodeLocationHasEssentialInCodeFlow))]
+ public void AnnotatedCodeLocationEssentialIsObsolete_AnnotatedCodeLocationHasEssentialInCodeFlow()
+ {
+ Verify(new AnnotatedCodeLocationEssentialIsObsolete(), "AnnotatedCodeLocationHasEssentialInCodeFlow.sarif");
+ }
+
+ [Fact(DisplayName = nameof(AnnotatedCodeLocationEssentialIsObsolete_AnnotatedCodeLocationHasDefaultEssentialInCodeFlow))]
+ public void AnnotatedCodeLocationEssentialIsObsolete_AnnotatedCodeLocationHasDefaultEssentialInCodeFlow()
+ {
+ Verify(new AnnotatedCodeLocationEssentialIsObsolete(), "AnnotatedCodeLocationHasDefaultEssentialInCodeFlow.sarif");
+ }
+
+ [Fact(DisplayName = nameof(AnnotatedCodeLocationEssentialIsObsolete_AnnotatedCodeLocationHasEssentialInRelatedLocation))]
+ public void AnnotatedCodeLocationEssentialIsObsolete_AnnotatedCodeLocationHasEssentialInRelatedLocation()
+ {
+ Verify(new AnnotatedCodeLocationEssentialIsObsolete(), "AnnotatedCodeLocationHasEssentialInRelatedLocation.sarif");
+ }
+
+ [Fact(DisplayName = nameof(AnnotatedCodeLocationEssentialIsObsolete_AnnotatedCodeLocationHasDefaultEssentialInRelatedLocation))]
+ public void AnnotatedCodeLocationEssentialIsObsolete_AnnotatedCodeLocationHasDefaultEssentialInRelatedLocation()
+ {
+ Verify(new AnnotatedCodeLocationEssentialIsObsolete(), "AnnotatedCodeLocationHasDefaultEssentialInRelatedLocation.sarif");
+ }
+ }
+}
diff --git a/src/SarifCli.FunctionalTests/Rules/AnnotatedCodeLocationIdIsObsoleteTests.cs b/src/SarifCli.FunctionalTests/Rules/AnnotatedCodeLocationIdIsObsoleteTests.cs
new file mode 100644
index 000000000..ab965834d
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/Rules/AnnotatedCodeLocationIdIsObsoleteTests.cs
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.CodeAnalysis.Sarif.Cli.Rules;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.Rules
+{
+ public class AnnotatedCodeLocationIdIsObsoleteTests : SkimmerTestsBase
+ {
+ [Fact(DisplayName = nameof(AnnotatedCodeLocationIdIsObsolete_AnnotatedCodeLocationDoesNotHaveId))]
+ public void AnnotatedCodeLocationIdIsObsolete_AnnotatedCodeLocationDoesNotHaveId()
+ {
+ Verify(new AnnotatedCodeLocationIdIsObsolete(), "AnnotatedCodeLocationDoesNotHaveId.sarif");
+ }
+
+ [Fact(DisplayName = nameof(AnnotatedCodeLocationIdIsObsolete_AnnotatedCodeLocationHasIdInCodeFlow))]
+ public void AnnotatedCodeLocationIdIsObsolete_AnnotatedCodeLocationHasIdInCodeFlow()
+ {
+ Verify(new AnnotatedCodeLocationIdIsObsolete(), "AnnotatedCodeLocationHasIdInCodeFlow.sarif");
+ }
+
+ [Fact(DisplayName = nameof(AnnotatedCodeLocationIdIsObsolete_AnnotatedCodeLocationHasIdInRelatedLocation))]
+ public void AnnotatedCodeLocationIdIsObsolete_AnnotatedCodeLocationHasIdInRelatedLocation()
+ {
+ Verify(new AnnotatedCodeLocationIdIsObsolete(), "AnnotatedCodeLocationHasIdInRelatedLocation.sarif");
+ }
+ }
+}
diff --git a/src/SarifCli.FunctionalTests/Rules/DoNotUseFriendlyNameAsRuleIdTests.cs b/src/SarifCli.FunctionalTests/Rules/DoNotUseFriendlyNameAsRuleIdTests.cs
new file mode 100644
index 000000000..c5b9cd85a
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/Rules/DoNotUseFriendlyNameAsRuleIdTests.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.CodeAnalysis.Sarif.Cli.Rules;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.Rules
+{
+ public class DoNotUseFriendlyNameAsRuleIdTests : SkimmerTestsBase
+ {
+ [Fact(DisplayName = nameof(DoNotUseFriendlyNameAsRuleId_RuleIdDoesNotMatchFriendlyName))]
+ public void DoNotUseFriendlyNameAsRuleId_RuleIdDoesNotMatchFriendlyName()
+ {
+ Verify(new DoNotUseFriendlyNameAsRuleId(), "RuleIdDoesNotMatchFriendlyName.sarif");
+ }
+
+ [Fact(DisplayName = nameof(DoNotUseFriendlyNameAsRuleId_RuleIdMatchesFriendlyName))]
+ public void DoNotUseFriendlyNameAsRuleId_RuleIdMatchesFriendlyName()
+ {
+ Verify(new DoNotUseFriendlyNameAsRuleId(), "RuleIdMatchesFriendlyName.sarif");
+ }
+ }
+}
diff --git a/src/SarifCli.FunctionalTests/Rules/EndColumnMustNotBeLessThanStartColumnTests.cs b/src/SarifCli.FunctionalTests/Rules/EndColumnMustNotBeLessThanStartColumnTests.cs
new file mode 100644
index 000000000..14fe59ab8
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/Rules/EndColumnMustNotBeLessThanStartColumnTests.cs
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.CodeAnalysis.Sarif.Cli.Rules;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.Rules
+{
+ public class EndColumnMustNotBeLessThanStartColumnTests : SkimmerTestsBase
+ {
+ [Fact(DisplayName = nameof(EndColumnMustNotBeLessThanStartColumn_EndColumnEqualsStartColumn))]
+ public void EndColumnMustNotBeLessThanStartColumn_EndColumnEqualsStartColumn()
+ {
+ Verify(new EndColumnMustNotBeLessThanStartColumn(), "EndColumnEqualsStartColumn.sarif");
+ }
+
+ [Fact(DisplayName = nameof(EndColumnMustNotBeLessThanStartColumn_EndColumnEqualsStartColumnNoEndLine))]
+ public void EndColumnMustNotBeLessThanStartColumn_EndColumnEqualsStartColumnNoEndLine()
+ {
+ Verify(new EndColumnMustNotBeLessThanStartColumn(), "EndColumnEqualsStartColumnNoEndLine.sarif");
+ }
+
+ [Fact(DisplayName = nameof(EndColumnMustNotBeLessThanStartColumn_EndColumnGreaterThanStartColumn))]
+ public void EndColumnMustNotBeLessThanStartColumn_EndColumnGreaterThanStartColumn()
+ {
+ Verify(new EndColumnMustNotBeLessThanStartColumn(), "EndColumnGreaterThanStartColumn.sarif");
+ }
+
+ [Fact(DisplayName = nameof(EndColumnMustNotBeLessThanStartColumn_EndColumnLessThanStartColumnInAnalysisTarget))]
+ public void EndColumnMustNotBeLessThanStartColumn_EndColumnLessThanStartColumnInAnalysisTarget()
+ {
+ Verify(new EndColumnMustNotBeLessThanStartColumn(), "EndColumnLessThanStartColumnInAnalysisTarget.sarif");
+ }
+
+ [Fact(DisplayName = nameof(EndColumnMustNotBeLessThanStartColumn_EndColumnLessThanStartColumnInAnalysisTargetNoEndLine))]
+ public void EndColumnMustNotBeLessThanStartColumn_EndColumnLessThanStartColumnInAnalysisTargetNoEndLine()
+ {
+ Verify(new EndColumnMustNotBeLessThanStartColumn(), "EndColumnLessThanStartColumnInAnalysisTargetNoEndLine.sarif");
+ }
+
+ [Fact(DisplayName = nameof(EndColumnMustNotBeLessThanStartColumn_EndColumnLessThanStartColumnInCodeFlow))]
+ public void EndColumnMustNotBeLessThanStartColumn_EndColumnLessThanStartColumnInCodeFlow()
+ {
+ Verify(new EndColumnMustNotBeLessThanStartColumn(), "EndColumnLessThanStartColumnInCodeFlow.sarif");
+ }
+
+ [Fact(DisplayName = nameof(EndColumnMustNotBeLessThanStartColumn_EndColumnLessThanStartColumnInRelatedLocation))]
+ public void EndColumnMustNotBeLessThanStartColumn_EndColumnLessThanStartColumnInRelatedLocation()
+ {
+ Verify(new EndColumnMustNotBeLessThanStartColumn(), "EndColumnLessThanStartColumnInRelatedLocation.sarif");
+ }
+
+ [Fact(DisplayName = nameof(EndColumnMustNotBeLessThanStartColumn_EndColumnLessThanStartColumnInResultFile))]
+ public void EndColumnMustNotBeLessThanStartColumn_EndColumnLessThanStartColumnInResultFile()
+ {
+ Verify(new EndColumnMustNotBeLessThanStartColumn(), "EndColumnLessThanStartColumnInResultFile.sarif");
+ }
+
+ [Fact(DisplayName = nameof(EndColumnMustNotBeLessThanStartColumn_EndColumnNotSpecified))]
+ public void EndColumnMustNotBeLessThanStartColumn_EndColumnNotSpecified()
+ {
+ Verify(new EndColumnMustNotBeLessThanStartColumn(), "EndColumnNotSpecified.sarif");
+ }
+ }
+}
diff --git a/src/SarifCli.FunctionalTests/Rules/EndLineMustNotBeLessThanStartLineTests.cs b/src/SarifCli.FunctionalTests/Rules/EndLineMustNotBeLessThanStartLineTests.cs
new file mode 100644
index 000000000..4204d4fbe
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/Rules/EndLineMustNotBeLessThanStartLineTests.cs
@@ -0,0 +1,53 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.CodeAnalysis.Sarif.Cli.Rules;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.Rules
+{
+ public class EndLineMustNotBeLessThanStartLineTests : SkimmerTestsBase
+ {
+ [Fact(DisplayName = nameof(EndLineMustNotBeLessThanStartLine_EndLineEqualsStartLine))]
+ public void EndLineMustNotBeLessThanStartLine_EndLineEqualsStartLine()
+ {
+ Verify(new EndLineMustNotBeLessThanStartLine(), "EndLineEqualsStartLine.sarif");
+ }
+
+ [Fact(DisplayName = nameof(EndLineMustNotBeLessThanStartLine_EndLineGreaterThanStartLine))]
+ public void EndLineMustNotBeLessThanStartLine_EndLineGreaterThanStartLine()
+ {
+ Verify(new EndLineMustNotBeLessThanStartLine(), "EndLineGreaterThanStartLine.sarif");
+ }
+
+ [Fact(DisplayName = nameof(EndLineMustNotBeLessThanStartLine_EndLineLessThanStartLineInCodeFlow))]
+ public void EndLineMustNotBeLessThanStartLine_EndLineLessThanStartLineInCodeFlow()
+ {
+ Verify(new EndLineMustNotBeLessThanStartLine(), "EndLineLessThanStartLineInCodeFlow.sarif");
+ }
+
+ [Fact(DisplayName = nameof(EndLineMustNotBeLessThanStartLine_EndLineLessThanStartLineInRelatedLocation))]
+ public void EndLineMustNotBeLessThanStartLine_EndLineLessThanStartLineInRelatedLocation()
+ {
+ Verify(new EndLineMustNotBeLessThanStartLine(), "EndLineLessThanStartLineInRelatedLocation.sarif");
+ }
+
+ [Fact(DisplayName = nameof(EndLineMustNotBeLessThanStartLine_EndLineNotSpecified))]
+ public void EndLineMustNotBeLessThanStartLine_EndLineNotSpecified()
+ {
+ Verify(new EndLineMustNotBeLessThanStartLine(), "EndLineNotSpecified.sarif");
+ }
+
+ [Fact(DisplayName = nameof(EndLineMustNotBeLessThanStartLine_EndLineLessThanStartLineInAnalysisTarget))]
+ public void EndLineMustNotBeLessThanStartLine_EndLineLessThanStartLineInAnalysisTarget()
+ {
+ Verify(new EndLineMustNotBeLessThanStartLine(), "EndLineLessThanStartLineInAnalysisTarget.sarif");
+ }
+
+ [Fact(DisplayName = nameof(EndLineMustNotBeLessThanStartLine_EndLineLessThanStartLineInResultFile))]
+ public void EndLineMustNotBeLessThanStartLine_EndLineLessThanStartLineInResultFile()
+ {
+ Verify(new EndLineMustNotBeLessThanStartLine(), "EndLineLessThanStartLineInResultFile.sarif");
+ }
+ }
+}
diff --git a/src/SarifCli.FunctionalTests/Rules/EndTimeMustBeAfterStartTimeTests.cs b/src/SarifCli.FunctionalTests/Rules/EndTimeMustBeAfterStartTimeTests.cs
new file mode 100644
index 000000000..11284a0d7
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/Rules/EndTimeMustBeAfterStartTimeTests.cs
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.CodeAnalysis.Sarif.Cli.Rules;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.Rules
+{
+ public class EndTimeMustBeAfterStartTimeTests : SkimmerTestsBase
+ {
+ [Fact(DisplayName = nameof(EndTimeMustBeAfterStartTime_EndTimeIsAfterStartTime))]
+ public void EndTimeMustBeAfterStartTime_EndTimeIsAfterStartTime()
+ {
+ Verify(new EndTimeMustBeAfterStartTime(), "EndTimeIsAfterStartTime.sarif");
+ }
+
+ [Fact(DisplayName = nameof(EndTimeMustBeAfterStartTime_EndTimeEqualsStartTime))]
+ public void EndTimeMustBeAfterStartTime_EndTimeEqualsStartTime()
+ {
+ Verify(new EndTimeMustBeAfterStartTime(), "EndTimeEqualsStartTime.sarif");
+ }
+
+ [Fact(DisplayName = nameof(EndTimeMustBeAfterStartTime_EndTimeIsBeforeStartTime))]
+ public void EndTimeMustBeAfterStartTime_EndTimeIsBeforeStartTime()
+ {
+ Verify(new EndTimeMustBeAfterStartTime(), "EndTimeIsBeforeStartTime.sarif");
+ }
+ }
+}
diff --git a/src/SarifCli.FunctionalTests/Rules/HashAlgorithmsMustBeUniqueTests.cs b/src/SarifCli.FunctionalTests/Rules/HashAlgorithmsMustBeUniqueTests.cs
new file mode 100644
index 000000000..fe9ae4eaf
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/Rules/HashAlgorithmsMustBeUniqueTests.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.CodeAnalysis.Sarif.Cli.Rules;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.Rules
+{
+ public class HashAlgorithmsMustBeUniqueTests : SkimmerTestsBase
+ {
+ [Fact(DisplayName = nameof(HashAlgorithmsMustBeUnique_UniqueHashAlgorithms))]
+ public void HashAlgorithmsMustBeUnique_UniqueHashAlgorithms()
+ {
+ Verify(new HashAlgorithmsMustBeUnique(), "UniqueHashAlgorithms.sarif");
+ }
+
+ [Fact(DisplayName = nameof(HashAlgorithmsMustBeUnique_NonUniqueHashAlgorithms))]
+ public void HashAlgorithmsMustBeUnique_NonUniqueHashAlgorithms()
+ {
+ Verify(new HashAlgorithmsMustBeUnique(), "NonUniqueHashAlgorithms.sarif");
+ }
+ }
+}
diff --git a/src/SarifCli.FunctionalTests/Rules/ImportanceMustAppearOnlyInCodeFlowLocationsTests.cs b/src/SarifCli.FunctionalTests/Rules/ImportanceMustAppearOnlyInCodeFlowLocationsTests.cs
new file mode 100644
index 000000000..61d9b1066
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/Rules/ImportanceMustAppearOnlyInCodeFlowLocationsTests.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.CodeAnalysis.Sarif.Cli.Rules;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.Rules
+{
+ public class ImportanceMustAppearOnlyInCodeFlowLocationsTests : SkimmerTestsBase
+ {
+ [Fact(DisplayName = nameof(ImportanceMustAppearOnlyInCodeFlowLocations_ImportanceAppearsInCodeFlow))]
+ public void ImportanceMustAppearOnlyInCodeFlowLocations_ImportanceAppearsInCodeFlow()
+ {
+ Verify(new ImportanceMustAppearOnlyInCodeFlowLocations(), "ImportanceAppearsInCodeFlow.sarif");
+ }
+
+ [Fact(DisplayName = nameof(ImportanceMustAppearOnlyInCodeFlowLocations_ImportanceAppearsInRelatedLocation))]
+ public void ImportanceMustAppearOnlyInCodeFlowLocations_ImportanceAppearsInRelatedLocation()
+ {
+ Verify(new ImportanceMustAppearOnlyInCodeFlowLocations(), "ImportanceAppearsInRelatedLocation.sarif");
+ }
+ }
+}
diff --git a/src/SarifCli.FunctionalTests/Rules/MessagesShouldEndWithPeriodTests.cs b/src/SarifCli.FunctionalTests/Rules/MessagesShouldEndWithPeriodTests.cs
new file mode 100644
index 000000000..3099e3293
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/Rules/MessagesShouldEndWithPeriodTests.cs
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.CodeAnalysis.Sarif.Cli.Rules;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.Rules
+{
+ public class MessagesShouldEndWithPeriodTests : SkimmerTestsBase
+ {
+ [Fact(DisplayName = nameof(MessagesShouldEndWithPeriod_AnnotatedCodeLocationDoesNotHaveEssential))]
+ public void MessagesShouldEndWithPeriod_AnnotatedCodeLocationDoesNotHaveEssential()
+ {
+ Verify(new MessagesShouldEndWithPeriod(), "PeriodsAfterAllMessages.sarif");
+ }
+
+ [Fact(DisplayName = nameof(MessagesShouldEndWithPeriod_AnnotatedCodeLocationMessageWithoutPeriod))]
+ public void MessagesShouldEndWithPeriod_AnnotatedCodeLocationMessageWithoutPeriod()
+ {
+ Verify(new MessagesShouldEndWithPeriod(), "AnnotatedCodeLocationMessageWithoutPeriod.sarif");
+ }
+
+ [Fact(DisplayName = nameof(MessagesShouldEndWithPeriod_CodeFlowMessageWithoutPeriod))]
+ public void MessagesShouldEndWithPeriod_CodeFlowMessageWithoutPeriod()
+ {
+ Verify(new MessagesShouldEndWithPeriod(), "CodeFlowMessageWithoutPeriod.sarif");
+ }
+
+ [Fact(DisplayName = nameof(MessagesShouldEndWithPeriod_NotificationMessageWithoutPeriod))]
+ public void MessagesShouldEndWithPeriod_NotificationMessageWithoutPeriod()
+ {
+ Verify(new MessagesShouldEndWithPeriod(), "NotificationMessageWithoutPeriod.sarif");
+ }
+
+ [Fact(DisplayName = nameof(MessagesShouldEndWithPeriod_ResultMessageWithoutPeriod))]
+ public void MessagesShouldEndWithPeriod_ResultMessageWithoutPeriod()
+ {
+ Verify(new MessagesShouldEndWithPeriod(), "ResultMessageWithoutPeriod.sarif");
+ }
+
+ [Fact(DisplayName = nameof(MessagesShouldEndWithPeriod_RuleMessageFormatWithoutPeriod))]
+ public void MessagesShouldEndWithPeriod_RuleMessageFormatWithoutPeriod()
+ {
+ Verify(new MessagesShouldEndWithPeriod(), "RuleMessageFormatWithoutPeriod.sarif");
+ }
+
+ [Fact(DisplayName = nameof(MessagesShouldEndWithPeriod_StackMessageWithoutPeriod))]
+ public void MessagesShouldEndWithPeriod_StackMessageWithoutPeriod()
+ {
+ Verify(new MessagesShouldEndWithPeriod(), "StackMessageWithoutPeriod.sarif");
+ }
+
+ [Fact(DisplayName = nameof(MessagesShouldEndWithPeriod_StackFrameMessageWithoutPeriod))]
+ public void MessagesShouldEndWithPeriod_StackFrameMessageWithoutPeriod()
+ {
+ Verify(new MessagesShouldEndWithPeriod(), "StackFrameMessageWithoutPeriod.sarif");
+ }
+ }
+}
diff --git a/src/SarifCli.FunctionalTests/Rules/SkimmerTestsBase.cs b/src/SarifCli.FunctionalTests/Rules/SkimmerTestsBase.cs
new file mode 100644
index 000000000..107c06954
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/Rules/SkimmerTestsBase.cs
@@ -0,0 +1,72 @@
+// 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.IO;
+using Microsoft.CodeAnalysis.Sarif.Cli.Rules;
+using Microsoft.CodeAnalysis.Sarif.Readers;
+using Microsoft.CodeAnalysis.Sarif.Writers;
+using Newtonsoft.Json;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.Rules
+{
+ public abstract class SkimmerTestsBase : SarifCliTestBase
+ {
+ protected void Verify(SarifValidationSkimmerBase skimmer, string testFileName)
+ {
+ string ruleName = skimmer.GetType().Name;
+ string testDirectory = Path.Combine(Environment.CurrentDirectory, TestDataDirectory, ruleName);
+
+ string targetPath = Path.Combine(testDirectory, testFileName);
+ string expectedFilePath = MakeExpectedFilePath(testDirectory, testFileName);
+ string actualFilePath = MakeActualFilePath(testDirectory, testFileName);
+
+ string inputLogContents = File.ReadAllText(targetPath);
+
+ JsonSerializerSettings settings = new JsonSerializerSettings
+ {
+ ContractResolver = SarifContractResolver.Instance
+ };
+
+ SarifLog inputLog = JsonConvert.DeserializeObject(inputLogContents, settings);
+
+ using (var logger = new SarifLogger(
+ actualFilePath,
+ new string[] { targetPath },
+ verbose: false,
+ logEnvironment: false,
+ computeTargetsHash: false,
+ prereleaseInfo: null,
+ invocationTokensToRedact: null))
+ {
+ logger.AnalysisStarted();
+
+ var context = new SarifValidationContext
+ {
+ Rule = skimmer,
+ Logger = logger,
+ TargetUri = new Uri(targetPath),
+ SchemaFilePath = JsonSchemaFile,
+ InputLogContents = inputLogContents,
+ InputLog = inputLog
+ };
+
+ skimmer.Initialize(context);
+ context.Logger.AnalyzingTarget(context);
+
+ skimmer.Analyze(context);
+
+ logger.AnalysisStopped(RuntimeConditions.None);
+ }
+
+ string actualLogContents = File.ReadAllText(actualFilePath);
+ string expectedLogContents = File.ReadAllText(expectedFilePath);
+
+ // We can't just compare the text of the log files because properties
+ // like start time, and absolute paths, will differ from run to run.
+ // Until SarifLogger has a "deterministic" option (see http://github.com/Microsoft/sarif-sdk/issues/500),
+ // we perform a selective compare of just the elements we care about.
+ SelectiveCompare(actualLogContents, expectedLogContents);
+ }
+ }
+}
diff --git a/src/SarifCli.FunctionalTests/Rules/StepMustAppearOnlyInCodeFlowLocationsTests.cs b/src/SarifCli.FunctionalTests/Rules/StepMustAppearOnlyInCodeFlowLocationsTests.cs
new file mode 100644
index 000000000..c3e344068
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/Rules/StepMustAppearOnlyInCodeFlowLocationsTests.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.CodeAnalysis.Sarif.Cli.Rules;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.Rules
+{
+ public class StepMustAppearOnlyInCodeFlowLocationsTests : SkimmerTestsBase
+ {
+ [Fact(DisplayName = nameof(StepMustAppearOnlyInCodeFlowLocations_StepAppearsInCodeFlow))]
+ public void StepMustAppearOnlyInCodeFlowLocations_StepAppearsInCodeFlow()
+ {
+ Verify(new StepMustAppearOnlyInCodeFlowLocations(), "StepAppearsInCodeFlow.sarif");
+ }
+
+ [Fact(DisplayName = nameof(StepMustAppearOnlyInCodeFlowLocations_StepAppearsInRelatedLocation))]
+ public void StepMustAppearOnlyInCodeFlowLocations_StepAppearsInRelatedLocation()
+ {
+ Verify(new StepMustAppearOnlyInCodeFlowLocations(), "StepAppearsInRelatedLocation.sarif");
+ }
+ }
+}
diff --git a/src/SarifCli.FunctionalTests/Rules/StepValuesMustFormOneBasedSequenceTests.cs b/src/SarifCli.FunctionalTests/Rules/StepValuesMustFormOneBasedSequenceTests.cs
new file mode 100644
index 000000000..6829b9872
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/Rules/StepValuesMustFormOneBasedSequenceTests.cs
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.CodeAnalysis.Sarif.Cli.Rules;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.Rules
+{
+ public class StepValuesMustFormOneBasedSequenceTests : SkimmerTestsBase
+ {
+ [Fact(DisplayName = nameof(StepValuesMustFormOneBasedSequence_ValidSteps))]
+ public void StepValuesMustFormOneBasedSequence_ValidSteps()
+ {
+ Verify(new StepValuesMustFormOneBasedSequence(), "ValidSteps.sarif");
+ }
+
+ [Fact(DisplayName = nameof(StepValuesMustFormOneBasedSequence_NoStepsPresent))]
+ public void StepValuesMustFormOneBasedSequence_NoStepsPresent()
+ {
+ Verify(new StepValuesMustFormOneBasedSequence(), "NoStepsPresent.sarif");
+ }
+
+ [Fact(DisplayName = nameof(StepValuesMustFormOneBasedSequence_StepNotPresentOnAllLocations))]
+ public void StepValuesMustFormOneBasedSequence_StepNotPresentOnAllLocations()
+ {
+ Verify(new StepValuesMustFormOneBasedSequence(), "StepNotPresentOnAllLocations.sarif");
+ }
+
+ [Fact(DisplayName = nameof(StepValuesMustFormOneBasedSequence_InvalidStepValues))]
+ public void StepValuesMustFormOneBasedSequence_InvalidStepValues()
+ {
+ Verify(new StepValuesMustFormOneBasedSequence(), "InvalidStepValues.sarif");
+ }
+ }
+}
diff --git a/src/SarifCli.FunctionalTests/Rules/UrisMustBeValidTests.cs b/src/SarifCli.FunctionalTests/Rules/UrisMustBeValidTests.cs
new file mode 100644
index 000000000..0f9b0965e
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/Rules/UrisMustBeValidTests.cs
@@ -0,0 +1,77 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.CodeAnalysis.Sarif.Cli.Rules;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.Rules
+{
+ public class UrisMustBeValidTests : SkimmerTestsBase
+ {
+ [Fact(DisplayName = nameof(UrisMustBeValid_ValidUris))]
+ public void UrisMustBeValid_ValidUris()
+ {
+ Verify(new UrisMustBeValid(), "ValidUris.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UrisMustBeValid_InvalidHelpUriInRule))]
+ public void UrisMustBeValid_InvalidHelpUriInRule()
+ {
+ Verify(new UrisMustBeValid(), "InvalidHelpUriInRule.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UrisMustBeValid_InvalidUriInAnalysisTarget))]
+ public void UrisMustBeValid_InvalidUriInAnalysisTarget()
+ {
+ Verify(new UrisMustBeValid(), "InvalidUriInAnalysisTarget.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UrisMustBeValid_InvalidUriInCodeFlowLocation))]
+ public void UrisMustBeValid_InvalidUriInCodeFlowLocation()
+ {
+ Verify(new UrisMustBeValid(), "InvalidUriInCodeFlowLocation.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UrisMustBeValid_InvalidUriInConfigurationNotification))]
+ public void UrisMustBeValid_InvalidUriInConfigurationNotification()
+ {
+ Verify(new UrisMustBeValid(), "InvalidUriInConfigurationNotification.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UrisMustBeValid_InvalidUriInFileChange))]
+ public void UrisMustBeValid_InvalidUriInFileChange()
+ {
+ Verify(new UrisMustBeValid(), "InvalidUriInFileChange.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UrisMustBeValid_InvalidUriInFilePropertyName))]
+ public void UrisMustBeValid_InvalidUriInFilePropertyName()
+ {
+ Verify(new UrisMustBeValid(), "InvalidUriInFilePropertyName.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UrisMustBeValid_InvalidUriInRelatedLocation))]
+ public void UrisMustBeValid_InvalidUriInRelatedLocation()
+ {
+ Verify(new UrisMustBeValid(), "InvalidUriInRelatedLocation.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UrisMustBeValid_InvalidUriInResultFile))]
+ public void UrisMustBeValid_InvalidUriInResultFile()
+ {
+ Verify(new UrisMustBeValid(), "InvalidUriInResultFile.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UrisMustBeValid_InvalidUriInStackFrame))]
+ public void UrisMustBeValid_InvalidUriInStackFrame()
+ {
+ Verify(new UrisMustBeValid(), "InvalidUriInStackFrame.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UrisMustBeValid_InvalidUriInToolNotification))]
+ public void UrisMustBeValid_InvalidUriInToolNotification()
+ {
+ Verify(new UrisMustBeValid(), "InvalidUriInToolNotification.sarif");
+ }
+ }
+}
diff --git a/src/SarifCli.FunctionalTests/Rules/UseAbsolutePathsForNestedFileUriFragmentsTests.cs b/src/SarifCli.FunctionalTests/Rules/UseAbsolutePathsForNestedFileUriFragmentsTests.cs
new file mode 100644
index 000000000..9e32e30a3
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/Rules/UseAbsolutePathsForNestedFileUriFragmentsTests.cs
@@ -0,0 +1,71 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.CodeAnalysis.Sarif.Cli.Rules;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.Rules
+{
+ public class UseAbsolutePathsForNestedFileUriFragmentsTests : SkimmerTestsBase
+ {
+ [Fact(DisplayName = nameof(UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentsAreAbsolute))]
+ public void UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentsAreAbsolute()
+ {
+ Verify(new UseAbsolutePathsForNestedFileUriFragments(), "NestedFileUriFragmentsAreAbsolute.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInAnalysisTargetUri))]
+ public void UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInAnalysisTargetUri()
+ {
+ Verify(new UseAbsolutePathsForNestedFileUriFragments(), "NestedFileUriFragmentIsRelativeInAnalysisTargetUri.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInCodeFlowLocationUri))]
+ public void UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInCodeFlowLocationUri()
+ {
+ Verify(new UseAbsolutePathsForNestedFileUriFragments(), "NestedFileUriFragmentIsRelativeInCodeFlowLocationUri.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInConfigurationNotificationUri))]
+ public void UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInConfigurationNotificationUri()
+ {
+ Verify(new UseAbsolutePathsForNestedFileUriFragments(), "NestedFileUriFragmentIsRelativeInConfigurationNotificationUri.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInFileChangeUri))]
+ public void UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInFileChangeUri()
+ {
+ Verify(new UseAbsolutePathsForNestedFileUriFragments(), "NestedFileUriFragmentIsRelativeInFileChangeUri.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInFilePropertyName))]
+ public void UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInFilePropertyName()
+ {
+ Verify(new UseAbsolutePathsForNestedFileUriFragments(), "NestedFileUriFragmentIsRelativeInFilePropertyName.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInRelatedLocationUri))]
+ public void UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInRelatedLocationUri()
+ {
+ Verify(new UseAbsolutePathsForNestedFileUriFragments(), "NestedFileUriFragmentIsRelativeInRelatedLocationUri.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInResultFileUri))]
+ public void UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInResultFileUri()
+ {
+ Verify(new UseAbsolutePathsForNestedFileUriFragments(), "NestedFileUriFragmentIsRelativeInResultFileUri.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInStackFrameUri))]
+ public void UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInStackFrameUri()
+ {
+ Verify(new UseAbsolutePathsForNestedFileUriFragments(), "NestedFileUriFragmentIsRelativeInStackFrameUri.sarif");
+ }
+
+ [Fact(DisplayName = nameof(UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInToolNotificationUri))]
+ public void UseAbsolutePathsForNestedFileUriFragments_NestedFileUriFragmentIsRelativeInToolNotificationUri()
+ {
+ Verify(new UseAbsolutePathsForNestedFileUriFragments(), "NestedFileUriFragmentIsRelativeInToolNotificationUri.sarif");
+ }
+ }
+}
diff --git a/src/SarifCli.FunctionalTests/SarifCli.FunctionalTests.csproj b/src/SarifCli.FunctionalTests/SarifCli.FunctionalTests.csproj
new file mode 100644
index 000000000..f4c10be15
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/SarifCli.FunctionalTests.csproj
@@ -0,0 +1,544 @@
+
+
+
+
+ {859920F3-DB09-4C1D-9EAD-DFB1D7A03A46}
+ Library
+ Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests
+ Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests
+
+
+
+
+ true
+ ..\TestKey.snk
+
+
+
+ v4.5.1
+
+
+
+ ..\packages\FluentAssertions.4.2.1\lib\net45\FluentAssertions.dll
+ True
+
+
+ ..\packages\FluentAssertions.4.2.1\lib\net45\FluentAssertions.Core.dll
+ True
+
+
+ ..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll
+ True
+
+
+ ..\packages\Sarif.Sdk.1.5.29\lib\net45\Sarif.dll
+ True
+
+
+ ..\packages\Sarif.Driver.1.5.29\lib\net45\Sarif.Driver.dll
+ True
+
+
+
+ ..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll
+ True
+
+
+ ..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.Convention.dll
+ True
+
+
+ ..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.Hosting.dll
+ True
+
+
+ ..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.Runtime.dll
+ True
+
+
+ ..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll
+ True
+
+
+
+
+
+
+
+
+
+ ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll
+ True
+
+
+ ..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll
+ True
+
+
+ ..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll
+ True
+
+
+ ..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll
+ True
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {0eba700d-29e7-4fff-8ebf-20b8c0ef9a98}
+ SarifCli
+
+
+
+
+ Designer
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/SarifCliTestBase.cs b/src/SarifCli.FunctionalTests/SarifCliTestBase.cs
new file mode 100644
index 000000000..a115f5c2d
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/SarifCliTestBase.cs
@@ -0,0 +1,123 @@
+// Copyright (c) Microsoft Corporation. All Rights Reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using FluentAssertions;
+using Microsoft.CodeAnalysis.Sarif.Readers;
+using Newtonsoft.Json;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests
+{
+ public abstract class SarifCliTestBase
+ {
+ protected const string JsonSchemaFile = "Sarif.schema.json";
+ protected const string TestDataDirectory = "TestData";
+
+ protected static string MakeExpectedFilePath(string testDirectory, string testFileName)
+ {
+ return MakeQualifiedFilePath(testDirectory, testFileName, "Expected");
+ }
+
+ protected static string MakeActualFilePath(string testDirectory, string testFileName)
+ {
+ return MakeQualifiedFilePath(testDirectory, testFileName, "Actual");
+ }
+
+ // We can't just compare the text of the log files because properties
+ // like start time, and absolute paths, will differ from run to run.
+ // Until SarifLogger has a "deterministic" option (see http://github.com/Microsoft/sarif-sdk/issues/500),
+ // we perform a selective compare of just the elements we care about.
+ protected static void SelectiveCompare(string actualLogContents, string expectedLogContents)
+ {
+ var settings = new JsonSerializerSettings()
+ {
+ ContractResolver = SarifContractResolver.Instance
+ };
+
+ SarifLog actualLog = JsonConvert.DeserializeObject(actualLogContents, settings);
+ SarifLog expectedLog = JsonConvert.DeserializeObject(expectedLogContents, settings);
+
+ SelectiveCompare(actualLog, expectedLog);
+ }
+
+ private static string MakeQualifiedFilePath(string testDirectory, string testFileName, string qualifier)
+ {
+ string qualifiedFileName =
+ Path.GetFileNameWithoutExtension(testFileName) + "_" + qualifier + Path.GetExtension(testFileName);
+
+ return Path.Combine(testDirectory, qualifiedFileName);
+ }
+
+ private static void SelectiveCompare(SarifLog actualLog, SarifLog expectedLog)
+ {
+ Result[] actualResults = SafeListToArray(actualLog.Runs[0].Results);
+ Result[] expectedResults = SafeListToArray(expectedLog.Runs[0].Results);
+
+ SelectiveCompare(actualResults, expectedResults);
+
+ Notification[] actualConfigurationNotifications = SafeListToArray(actualLog.Runs[0].ConfigurationNotifications);
+ Notification[] expectedConfigurationNotifications = SafeListToArray(expectedLog.Runs[0].ConfigurationNotifications);
+
+ SelectiveCompare(actualConfigurationNotifications, expectedConfigurationNotifications);
+
+ Notification[] actualToolNotifications = SafeListToArray(actualLog.Runs[0].ToolNotifications);
+ Notification[] expectedToolNotifications = SafeListToArray(expectedLog.Runs[0].ToolNotifications);
+
+ SelectiveCompare(actualToolNotifications, expectedToolNotifications);
+ }
+
+ private static void SelectiveCompare(Notification[] actualNotifications, Notification[] expectedNotifications)
+ {
+ bool actualHasNotifications = actualNotifications != null && actualNotifications.Length > 0;
+ bool expectedHasNotifications = expectedNotifications != null && expectedNotifications.Length > 0;
+ actualHasNotifications.Should().Be(expectedHasNotifications);
+
+ if (actualHasNotifications && expectedHasNotifications)
+ {
+ actualNotifications.Length.Should().Be(expectedNotifications.Length);
+
+ for (int i = 0; i < actualNotifications.Length; ++i)
+ {
+ Notification actualNotification = actualNotifications[i];
+ Notification expectedNotification = expectedNotifications[i];
+
+ actualNotification.RuleId.Should().Be(expectedNotification.RuleId);
+
+ actualNotification.Level.Should().Be(expectedNotification.Level);
+ }
+ }
+ }
+
+ private static void SelectiveCompare(Result[] actualResults, Result[] expectedResults)
+ {
+ bool actualHasResults = actualResults != null && actualResults.Length > 0;
+ bool expectedHasResults = expectedResults != null && expectedResults.Length > 0;
+ actualHasResults.Should().Be(expectedHasResults);
+
+ if (actualHasResults && expectedHasResults)
+ {
+ actualResults.Length.Should().Be(expectedResults.Length);
+
+ for (int i = 0; i < actualResults.Length; ++i)
+ {
+ Result actualResult = actualResults[i];
+ Result expectedResult = expectedResults[i];
+
+ actualResult.RuleId.Should().Be(expectedResult.RuleId);
+
+ actualResult.Level.Should().Be(expectedResult.Level);
+
+ actualResult.Locations[0].AnalysisTarget.Region.ValueEquals(
+ expectedResult.Locations[0].AnalysisTarget.Region).Should().BeTrue();
+ }
+ }
+ }
+
+ private static T[] SafeListToArray(IList list)
+ {
+ return list == null ? null : list.ToArray();
+ }
+ }
+}
diff --git a/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationDoesNotHaveEssential.sarif b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationDoesNotHaveEssential.sarif
new file mode 100644
index 000000000..46b8bdd10
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationDoesNotHaveEssential.sarif
@@ -0,0 +1,45 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationDoesNotHaveEssential_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationDoesNotHaveEssential_Expected.sarif
new file mode 100644
index 000000000..5e8d68310
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationDoesNotHaveEssential_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "72266e9a-82cf-416b-b165-f08cf1ce54ae",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationDoesNotHaveEssential.sarif"
+ },
+ "message": "Analyzing 'AnnotatedCodeLocationDoesNotHaveEssential.sarif'...",
+ "level": "note",
+ "time": "2016-08-27T03:33:36.903Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationDoesNotHaveEssential.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\AnnotatedCodeLocationEssentialIsObsolete\\AnnotatedCodeLocationDoesNotHaveEssential.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\AnnotatedCodeLocationEssentialIsObsolete\\AnnotatedCodeLocationDoesNotHaveEssential_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-27T03:33:36.721Z",
+ "endTime": "2016-08-27T03:33:37.140Z",
+ "processId": 19020,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInCodeFlow.sarif b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInCodeFlow.sarif
new file mode 100644
index 000000000..f47c9cf35
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInCodeFlow.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "essential": false,
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInCodeFlow_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInCodeFlow_Expected.sarif
new file mode 100644
index 000000000..52a9ecb7e
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInCodeFlow_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "70bff1e1-2f05-4e43-9508-f7bd55b3a330",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0005",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "AnnotatedCodeLocationHasDefaultEssentialInCodeFlow.sarif",
+ "/runs/0/results/0/codeFlows/0/locations/0/essential"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInCodeFlow.sarif",
+ "region": {
+ "startLine": 30,
+ "startColumn": 37
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInCodeFlow.sarif"
+ },
+ "message": "Analyzing 'AnnotatedCodeLocationHasDefaultEssentialInCodeFlow.sarif'...",
+ "level": "note",
+ "time": "2016-08-28T16:30:21.488Z"
+ }
+ ],
+ "rules": {
+ "SV0005": {
+ "id": "SV0005",
+ "name": "AnnotatedCodeLocationEssentialIsObsolete",
+ "shortDescription": "Do not use the obsolete \"essential\" property of the annotatedCodeLocation object.",
+ "fullDescription": "Do not use the obsolete \"essential\" property of the annotatedCodeLocation object. Instead use \"importance\", which is an string-valued property that must have one of the values \"essential\", \"important\", or \"unimportant\".",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the obsolete \"essential\" property is used. Remove it, and instead use the \"importance\" property, whose value is a string with one of the values \"essential\", \"important\", or \"unimportant\".",
+ "OnlyInCodeFlow": "In \"{0}\", at \"{1}\", the obsolete \"essential\" property is used. This property has been replaced by the \"importance\" property, but the \"importance\" property is used only in annotatedCodeLocations objects that occur within a code flow. Remove the \"essential\" property."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInCodeFlow.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\AnnotatedCodeLocationEssentialIsObsolete\\AnnotatedCodeLocationHasDefaultEssentialInCodeFlow.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\AnnotatedCodeLocationEssentialIsObsolete\\AnnotatedCodeLocationHasDefaultEssentialInCodeFlow_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-28T16:30:21.409Z",
+ "endTime": "2016-08-28T16:30:21.738Z",
+ "processId": 15500,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInRelatedLocation.sarif b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInRelatedLocation.sarif
new file mode 100644
index 000000000..e1663d2ee
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInRelatedLocation.sarif
@@ -0,0 +1,42 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "relatedLocations": [
+ {
+ "essential": false,
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInRelatedLocation_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInRelatedLocation_Expected.sarif
new file mode 100644
index 000000000..f77641f36
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInRelatedLocation_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "b2cc57c0-aac6-4468-a57d-5258774f0311",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0005",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "OnlyInCodeFlow",
+ "arguments": [
+ "AnnotatedCodeLocationHasDefaultEssentialInRelatedLocation.sarif",
+ "/runs/0/results/0/relatedLocations/0/essential"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInRelatedLocation.sarif",
+ "region": {
+ "startLine": 28,
+ "startColumn": 33
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInRelatedLocation.sarif"
+ },
+ "message": "Analyzing 'AnnotatedCodeLocationHasDefaultEssentialInRelatedLocation.sarif'...",
+ "level": "note",
+ "time": "2016-08-28T16:29:29.571Z"
+ }
+ ],
+ "rules": {
+ "SV0005": {
+ "id": "SV0005",
+ "name": "AnnotatedCodeLocationEssentialIsObsolete",
+ "shortDescription": "Do not use the obsolete \"essential\" property of the annotatedCodeLocation object.",
+ "fullDescription": "Do not use the obsolete \"essential\" property of the annotatedCodeLocation object. Instead use \"importance\", which is an string-valued property that must have one of the values \"essential\", \"important\", or \"unimportant\".",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the obsolete \"essential\" property is used. Remove it, and instead use the \"importance\" property, whose value is a string with one of the values \"essential\", \"important\", or \"unimportant\".",
+ "OnlyInCodeFlow": "In \"{0}\", at \"{1}\", the obsolete \"essential\" property is used. This property has been replaced by the \"importance\" property, but the \"importance\" property is used only in annotatedCodeLocations objects that occur within a code flow. Remove the \"essential\" property."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasDefaultEssentialInRelatedLocation.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\AnnotatedCodeLocationEssentialIsObsolete\\AnnotatedCodeLocationHasDefaultEssentialInRelatedLocation.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\AnnotatedCodeLocationEssentialIsObsolete\\AnnotatedCodeLocationHasDefaultEssentialInRelatedLocation_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-28T16:29:29.400Z",
+ "endTime": "2016-08-28T16:29:29.900Z",
+ "processId": 2164,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInCodeFlow.sarif b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInCodeFlow.sarif
new file mode 100644
index 000000000..854371350
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInCodeFlow.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "essential": true,
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInCodeFlow_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInCodeFlow_Expected.sarif
new file mode 100644
index 000000000..c5a40ce4c
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInCodeFlow_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "fbf4e8ba-fb01-4103-87db-3fe84334aa78",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0005",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "AnnotatedCodeLocationHasEssentialInCodeFlow.sarif",
+ "/runs/0/results/0/codeFlows/0/locations/0/essential"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInCodeFlow.sarif",
+ "region": {
+ "startLine": 30,
+ "startColumn": 36
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInCodeFlow.sarif"
+ },
+ "message": "Analyzing 'AnnotatedCodeLocationHasEssentialInCodeFlow.sarif'...",
+ "level": "note",
+ "time": "2016-08-27T03:36:58.146Z"
+ }
+ ],
+ "rules": {
+ "SV0005": {
+ "id": "SV0005",
+ "name": "AnnotatedCodeLocationEssentialIsObsolete",
+ "shortDescription": "Do not use the obsolete \"essential\" property of the annotatedCodeLocation object.",
+ "fullDescription": "Do not use the obsolete \"essential\" property of the annotatedCodeLocation object. Instead use \"importance\", which is an string-valued property that must have one of the values \"essential\", \"important\", or \"unimportant\".",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the obsolete \"essential\" property is used. Remove it, and instead use the \"importance\" property, whose value is a string with one of the values \"essential\", \"important\", or \"unimportant\".",
+ "OnlyInCodeFlow": "In \"{0}\", at \"{1}\", the obsolete \"essential\" property is used. This property has been replaced by the \"importance\" property, but the \"importance\" property is used only in annotatedCodeLocations objects that occur within a code flow. Remove the \"essential\" property."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInCodeFlow.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\AnnotatedCodeLocationEssentialIsObsolete\\AnnotatedCodeLocationHasEssentialInCodeFlow.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\AnnotatedCodeLocationEssentialIsObsolete\\AnnotatedCodeLocationHasEssentialInCodeFlow_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-27T03:36:58.060Z",
+ "endTime": "2016-08-27T03:36:58.416Z",
+ "processId": 9192,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInRelatedLocation.sarif b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInRelatedLocation.sarif
new file mode 100644
index 000000000..4751cc178
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInRelatedLocation.sarif
@@ -0,0 +1,42 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "relatedLocations": [
+ {
+ "essential": true,
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInRelatedLocation_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInRelatedLocation_Expected.sarif
new file mode 100644
index 000000000..1e0612bce
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInRelatedLocation_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "ea49ba66-d278-4a80-bdd7-07bf6d47c150",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0005",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "OnlyInCodeFlow",
+ "arguments": [
+ "AnnotatedCodeLocationHasEssentialInRelatedLocation.sarif",
+ "/runs/0/results/0/relatedLocations/0/essential"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInRelatedLocation.sarif",
+ "region": {
+ "startLine": 28,
+ "startColumn": 32
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInRelatedLocation.sarif"
+ },
+ "message": "Analyzing 'AnnotatedCodeLocationHasEssentialInRelatedLocation.sarif'...",
+ "level": "note",
+ "time": "2016-08-27T03:38:46.717Z"
+ }
+ ],
+ "rules": {
+ "SV0005": {
+ "id": "SV0005",
+ "name": "AnnotatedCodeLocationEssentialIsObsolete",
+ "shortDescription": "Do not use the obsolete \"essential\" property of the annotatedCodeLocation object.",
+ "fullDescription": "Do not use the obsolete \"essential\" property of the annotatedCodeLocation object. Instead use \"importance\", which is an string-valued property that must have one of the values \"essential\", \"important\", or \"unimportant\".",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the obsolete \"essential\" property is used. Remove it, and instead use the \"importance\" property, whose value is a string with one of the values \"essential\", \"important\", or \"unimportant\".",
+ "OnlyInCodeFlow": "In \"{0}\", at \"{1}\", the obsolete \"essential\" property is used. This property has been replaced by the \"importance\" property, but the \"importance\" property is used only in annotatedCodeLocations objects that occur within a code flow. Remove the \"essential\" property."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationEssentialIsObsolete/AnnotatedCodeLocationHasEssentialInRelatedLocation.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\AnnotatedCodeLocationEssentialIsObsolete\\AnnotatedCodeLocationHasEssentialInRelatedLocation.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\AnnotatedCodeLocationEssentialIsObsolete\\AnnotatedCodeLocationHasEssentialInRelatedLocation_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-27T03:38:46.633Z",
+ "endTime": "2016-08-27T03:38:46.992Z",
+ "processId": 9984,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationDoesNotHaveId.sarif b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationDoesNotHaveId.sarif
new file mode 100644
index 000000000..46b8bdd10
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationDoesNotHaveId.sarif
@@ -0,0 +1,45 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationDoesNotHaveId_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationDoesNotHaveId_Expected.sarif
new file mode 100644
index 000000000..fe75330b4
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationDoesNotHaveId_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "22d91896-a2bc-4b98-aaa5-705865aedc63",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationDoesNotHaveId.sarif"
+ },
+ "message": "Analyzing 'AnnotatedCodeLocationDoesNotHaveId.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T22:12:22.998Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationDoesNotHaveId.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\AnnotatedCodeLocationIdIsObsolete\\AnnotatedCodeLocationDoesNotHaveId.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\AnnotatedCodeLocationDoesNotHaveId_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T22:12:22.826Z",
+ "endTime": "2016-08-26T22:12:23.294Z",
+ "processId": 15404,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInCodeFlow.sarif b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInCodeFlow.sarif
new file mode 100644
index 000000000..b0c15ee94
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInCodeFlow.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "id": "1",
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInCodeFlow_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInCodeFlow_Expected.sarif
new file mode 100644
index 000000000..d9269a456
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInCodeFlow_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "89530820-f4a3-4c9c-b0fc-f7706130657f",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0004",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "DefaultFormatId",
+ "arguments": [
+ "AnnotatedCodeLocationHasIdInCodeFlow.sarif",
+ "/runs/0/results/0/codeFlows/0/locations/0/id"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInCodeFlow.sarif",
+ "region": {
+ "startLine": 30,
+ "startColumn": 28
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInCodeFlow.sarif"
+ },
+ "message": "Analyzing 'AnnotatedCodeLocationHasIdInCodeFlow.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T22:20:01.779Z"
+ }
+ ],
+ "rules": {
+ "SV0004": {
+ "id": "SV0004",
+ "name": "AnnotatedCodeLocationIdIsObsolete",
+ "shortDescription": "Do not use the property annotatedCodeLocation.",
+ "fullDescription": "Do not use the property annotatedCodeLocation.id, which is obsolete. Instead use annotatedCodeLocation.step, which is an integer-valued property that is 1 for the first annotatedCodeLocation in a codeFlow, and increments by 1 for every subsequent step.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the obsolete annotatedCodeLocation.id property is used. Remove it, and instead use the step property, whose value is an integer which is 1 for the first location in a code flow, and increments by 1 for each subsequent location in the code flow.",
+ "OnlyInCodeFlow": "In \"{0}\", at \"{1}\", the obsolete annotatedCodeLocation.id property is used. This property has been replaced by the step property, but the step property is used only in annotatedCodeLocations objects that occur within a code flow. Remove the id property."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInCodeFlow.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\AnnotatedCodeLocationIdIsObsolete\\AnnotatedCodeLocationHasIdInCodeFlow.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\AnnotatedCodeLocationHasIdInCodeFlow_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T22:20:01.701Z",
+ "endTime": "2016-08-26T22:20:02.029Z",
+ "processId": 11124,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInRelatedLocation.sarif b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInRelatedLocation.sarif
new file mode 100644
index 000000000..2f7b9c78c
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInRelatedLocation.sarif
@@ -0,0 +1,42 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "relatedLocations": [
+ {
+ "id": "1",
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInRelatedLocation_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInRelatedLocation_Expected.sarif
new file mode 100644
index 000000000..c8f9cdd09
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInRelatedLocation_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "06223ed7-67f3-4c8f-a379-824adb998dc2",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0004",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "OnlyInCodeFlowFormatId",
+ "arguments": [
+ "AnnotatedCodeLocationHasIdInRelatedLocation.sarif",
+ "/runs/0/results/0/relatedLocations/0/id"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInRelatedLocation.sarif",
+ "region": {
+ "startLine": 28,
+ "startColumn": 24
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInRelatedLocation.sarif"
+ },
+ "message": "Analyzing 'AnnotatedCodeLocationHasIdInRelatedLocation.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T22:18:28.178Z"
+ }
+ ],
+ "rules": {
+ "SV0004": {
+ "id": "SV0004",
+ "name": "AnnotatedCodeLocationIdIsObsolete",
+ "shortDescription": "Do not use the property annotatedCodeLocation.",
+ "fullDescription": "Do not use the property annotatedCodeLocation.id, which is obsolete. Instead use annotatedCodeLocation.step, which is an integer-valued property that is 1 for the first annotatedCodeLocation in a codeFlow, and increments by 1 for every subsequent step.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the obsolete annotatedCodeLocation.id property is used. Remove it, and instead use the step property, whose value is an integer which is 1 for the first location in a code flow, and increments by 1 for each subsequent location in the code flow.",
+ "OnlyInCodeFlow": "In \"{0}\", at \"{1}\", the obsolete annotatedCodeLocation.id property is used. This property has been replaced by the step property, but the step property is used only in annotatedCodeLocations objects that occur within a code flow. Remove the id property."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/AnnotatedCodeLocationIdIsObsolete/AnnotatedCodeLocationHasIdInRelatedLocation.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\AnnotatedCodeLocationIdIsObsolete\\AnnotatedCodeLocationHasIdInRelatedLocation.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\AnnotatedCodeLocationHasIdInRelatedLocation_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T22:18:28.100Z",
+ "endTime": "2016-08-26T22:18:28.428Z",
+ "processId": 10472,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/DeserializationError.sarif b/src/SarifCli.FunctionalTests/TestData/DeserializationError.sarif
new file mode 100644
index 000000000..b22c7db36
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/DeserializationError.sarif
@@ -0,0 +1,38 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c"
+ }
+ }
+ ],
+ "stacks": [
+ {
+ "frames": [
+ {
+ "uri": "file:///c:/src/file.c",
+ "line": 42
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "rules": {
+ "TST0001": {
+ "id": "TST0001",
+ "helpUri": "http://www.example.com/rules/tst0001.html"
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/DeserializationError_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/DeserializationError_Expected.sarif
new file mode 100644
index 000000000..cbd2bb8eb
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/DeserializationError_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "c4c42f77-ff81-40a5-8fd3-93cc78ace9af",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "JS1002",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "default",
+ "arguments": [
+ "runs[0].results[0].stacks[0].frames[0]",
+ "fullyQualifiedLogicalName"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/DeserializationError.sarif",
+ "region": {
+ "startLine": 21,
+ "startColumn": 18
+ }
+ }
+ }
+ ],
+ "properties": {
+ "jsonPath": "runs[0].results[0].stacks[0].frames[0]"
+ }
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/DeserializationError.sarif"
+ },
+ "message": "Analyzing 'DeserializationError.sarif'...",
+ "level": "note",
+ "time": "2016-08-27T21:47:00.464Z"
+ }
+ ],
+ "rules": {
+ "JS1002": {
+ "id": "JS1002",
+ "name": "RequiredPropertyMissing",
+ "fullDescription": "A property required by the schema's \"required\" property is missing.",
+ "messageFormats": {
+ "default": "at \"{0}\": The required property \"{1}\" is missing."
+ },
+ "defaultLevel": "error"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/DeserializationError.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\DeserializationError.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\DeserializationError_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-27T21:47:00.378Z",
+ "endTime": "2016-08-27T21:47:00.733Z",
+ "processId": 4696,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdDoesNotMatchFriendlyName.sarif b/src/SarifCli.FunctionalTests/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdDoesNotMatchFriendlyName.sarif
new file mode 100644
index 000000000..bb0b6bf98
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdDoesNotMatchFriendlyName.sarif
@@ -0,0 +1,25 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0",
+ "version": "1.0.0"
+ },
+ "results": [],
+ "rules": {
+ "ImportantRule": {
+ "id": "TST0001",
+ "name": "ImportantRule",
+ "shortDescription": "Important rule",
+ "fullDescription": "Important rule",
+ "messageFormats": {
+ "DefaultFormatId": "\"{0}\" violates an important rule."
+ }
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdDoesNotMatchFriendlyName_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdDoesNotMatchFriendlyName_Expected.sarif
new file mode 100644
index 000000000..da16f24f8
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdDoesNotMatchFriendlyName_Expected.sarif
@@ -0,0 +1,47 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "5b242950-d48d-4093-a21f-94885100c31e",
+ "tool": {
+ "name": "Sarif",
+ "fullName": "Sarif 1.5.27.0",
+ "version": "1.5.27.0",
+ "semanticVersion": "1.5.27",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Object model and utilities for reading and writing files in the SARIF format.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Release/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdDoesNotMatchFriendlyName.sarif"
+ },
+ "message": "Analyzing 'RuleIdDoesNotMatchFriendlyName.sarif'...",
+ "level": "note",
+ "time": "2016-08-25T21:26:41.799Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Release/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdDoesNotMatchFriendlyName.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "src\\packages\\xunit.runner.console.2.1.0\\tools\\xunit.console.x86.exe bld\\bin\\SarifCli.FunctionalTests\\AnyCPU_Release\\Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.dll",
+ "startTime": "2016-08-25T21:26:41.798Z",
+ "endTime": "2016-08-25T21:26:41.887Z",
+ "processId": 8856,
+ "fileName": "C:\\Users\\lgolding\\AppData\\Local\\Temp\\108c7547-93f9-41d7-9466-6cf860afad5d\\108c7547-93f9-41d7-9466-6cf860afad5d\\assembly\\dl3\\660ee2c2\\00b7775a_e6e9d101\\Sarif.dll",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli.FunctionalTests\\AnyCPU_Release"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdMatchesFriendlyName.sarif b/src/SarifCli.FunctionalTests/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdMatchesFriendlyName.sarif
new file mode 100644
index 000000000..61f46e4af
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdMatchesFriendlyName.sarif
@@ -0,0 +1,25 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0",
+ "version": "1.0.0"
+ },
+ "results": [],
+ "rules": {
+ "ImportantRule": {
+ "id": "ImportantRule",
+ "name": "ImportantRule",
+ "shortDescription": "Important rule",
+ "fullDescription": "Important rule",
+ "messageFormats": {
+ "DefaultFormatId": "\"{0}\" violates an important rule."
+ }
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdMatchesFriendlyName_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdMatchesFriendlyName_Expected.sarif
new file mode 100644
index 000000000..2f2eb2745
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdMatchesFriendlyName_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "4a05bc1d-fcf7-4d8e-880b-0a4941710af7",
+ "tool": {
+ "name": "Sarif",
+ "fullName": "Sarif 1.5.27.0",
+ "version": "1.5.27.0",
+ "semanticVersion": "1.5.27",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Object model and utilities for reading and writing files in the SARIF format.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0001",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "DefaultFormatId",
+ "arguments": [
+ "RuleIdMatchesFriendlyName.sarif",
+ "/runs/0/rules/ImportantRule",
+ "ImportantRule"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Release/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdMatchesFriendlyName.sarif",
+ "region": {
+ "startLine": 13,
+ "startColumn": 27
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Release/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdMatchesFriendlyName.sarif"
+ },
+ "message": "Analyzing 'RuleIdMatchesFriendlyName.sarif'...",
+ "level": "note",
+ "time": "2016-08-25T21:26:42.049Z"
+ }
+ ],
+ "rules": {
+ "SV0001": {
+ "id": "SV0001",
+ "name": "DoNotUseFriendlyNameAsRuleId",
+ "shortDescription": "Do not use the same string for a rule's id and name properties. The id property ...",
+ "fullDescription": "Do not use the same string for a rule's id and name properties. The id property must be a stable, opaque identifer such as \"SV0001\". The name property should be a string that is understandable to an end user, such as \"DoNotUserFriendlyNameAsRuleId\".",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the name and id properties of rule \"{2}\" are the same."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Release/TestData/DoNotUseFriendlyNameAsRuleId/RuleIdMatchesFriendlyName.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "src\\packages\\xunit.runner.console.2.1.0\\tools\\xunit.console.x86.exe bld\\bin\\SarifCli.FunctionalTests\\AnyCPU_Release\\Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.dll",
+ "startTime": "2016-08-25T21:26:42.049Z",
+ "endTime": "2016-08-25T21:26:42.052Z",
+ "processId": 8856,
+ "fileName": "C:\\Users\\lgolding\\AppData\\Local\\Temp\\108c7547-93f9-41d7-9466-6cf860afad5d\\108c7547-93f9-41d7-9466-6cf860afad5d\\assembly\\dl3\\660ee2c2\\00b7775a_e6e9d101\\Sarif.dll",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli.FunctionalTests\\AnyCPU_Release"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnEqualsStartColumn.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnEqualsStartColumn.sarif
new file mode 100644
index 000000000..875f68c79
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnEqualsStartColumn.sarif
@@ -0,0 +1,31 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1,
+ "endLine": 1,
+ "startColumn": 5,
+ "endColumn": 5
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnEqualsStartColumnNoEndLine.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnEqualsStartColumnNoEndLine.sarif
new file mode 100644
index 000000000..8c19041f5
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnEqualsStartColumnNoEndLine.sarif
@@ -0,0 +1,30 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1,
+ "startColumn": 5,
+ "endColumn": 5
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnEqualsStartColumnNoEndLine_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnEqualsStartColumnNoEndLine_Expected.sarif
new file mode 100644
index 000000000..554bd2faa
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnEqualsStartColumnNoEndLine_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "5d4a4af6-02ee-4c06-95c6-cdebe48131a3",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnEqualsStartColumnNoEndLine.sarif"
+ },
+ "message": "Analyzing 'EndColumnEqualsStartColumnNoEndLine.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T22:45:00.345Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnEqualsStartColumnNoEndLine.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnEqualsStartColumnNoEndLine.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnEqualsStartColumnNoEndLine_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T22:45:00.252Z",
+ "endTime": "2016-08-29T22:45:00.577Z",
+ "processId": 18692,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnEqualsStartColumn_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnEqualsStartColumn_Expected.sarif
new file mode 100644
index 000000000..c555e2c92
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnEqualsStartColumn_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "180b373a-b1ed-4a13-87e4-8d45be979492",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnEqualsStartColumn.sarif"
+ },
+ "message": "Analyzing 'EndColumnEqualsStartColumn.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T22:43:23.693Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnEqualsStartColumn.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnEqualsStartColumn.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnEqualsStartColumn_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T22:43:23.457Z",
+ "endTime": "2016-08-29T22:43:23.973Z",
+ "processId": 11972,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnGreaterThanStartColumn.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnGreaterThanStartColumn.sarif
new file mode 100644
index 000000000..148b2f678
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnGreaterThanStartColumn.sarif
@@ -0,0 +1,30 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1,
+ "startColumn": 1,
+ "endColumn": 2
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnGreaterThanStartColumn_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnGreaterThanStartColumn_Expected.sarif
new file mode 100644
index 000000000..9739b569a
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnGreaterThanStartColumn_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "39ec3553-1ac6-46e8-acdd-74ab2aa8e9d7",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnGreaterThanStartColumn.sarif"
+ },
+ "message": "Analyzing 'EndColumnGreaterThanStartColumn.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T22:46:13.496Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnGreaterThanStartColumn.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnGreaterThanStartColumn.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnGreaterThanStartColumn_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T22:46:13.418Z",
+ "endTime": "2016-08-29T22:46:13.746Z",
+ "processId": 15640,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTarget.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTarget.sarif
new file mode 100644
index 000000000..17f6c7570
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTarget.sarif
@@ -0,0 +1,31 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 2,
+ "endLine": 2,
+ "startColumn": 2,
+ "endColumn": 1
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTargetNoEndLine.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTargetNoEndLine.sarif
new file mode 100644
index 000000000..5951ff773
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTargetNoEndLine.sarif
@@ -0,0 +1,30 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 2,
+ "startColumn": 2,
+ "endColumn": 1
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTargetNoEndLine_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTargetNoEndLine_Expected.sarif
new file mode 100644
index 000000000..e32391013
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTargetNoEndLine_Expected.sarif
@@ -0,0 +1,85 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "2d9f0c97-2380-49ef-912c-de278ff978ca",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0013",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "EndColumnLessThanStartColumnInAnalysisTargetNoEndLine.sarif",
+ "/runs/0/results/0/locations/0/analysisTarget/region/endColumn",
+ "1",
+ "2"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTargetNoEndLine.sarif",
+ "region": {
+ "startLine": 21,
+ "startColumn": 33
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTargetNoEndLine.sarif"
+ },
+ "message": "Analyzing 'EndColumnLessThanStartColumnInAnalysisTargetNoEndLine.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T22:55:15.445Z"
+ }
+ ],
+ "rules": {
+ "SV0013": {
+ "id": "SV0013",
+ "name": "EndColumnMustNotBeLessThanStartColumn",
+ "shortDescription": "The \"endColumn\" property of a region object must not be less than the \"startColumn\" property.",
+ "fullDescription": "The \"endColumn\" property of a region object must not be less than the \"startColumn\" property.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the value of the \"endColumn\" property is {2}, which is less than the value of the \"startColumn\" property, which is {3}."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTargetNoEndLine.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnLessThanStartColumnInAnalysisTargetNoEndLine.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnLessThanStartColumnInAnalysisTargetNoEndLine_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T22:55:15.365Z",
+ "endTime": "2016-08-29T22:55:15.699Z",
+ "processId": 8660,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTarget_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTarget_Expected.sarif
new file mode 100644
index 000000000..2d503a8f6
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTarget_Expected.sarif
@@ -0,0 +1,85 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "656db149-9960-4e66-8d52-01f025509706",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0013",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "EndColumnLessThanStartColumnInAnalysisTarget.sarif",
+ "/runs/0/results/0/locations/0/analysisTarget/region/endColumn",
+ "1",
+ "2"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTarget.sarif",
+ "region": {
+ "startLine": 22,
+ "startColumn": 33
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTarget.sarif"
+ },
+ "message": "Analyzing 'EndColumnLessThanStartColumnInAnalysisTarget.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T22:54:31.283Z"
+ }
+ ],
+ "rules": {
+ "SV0013": {
+ "id": "SV0013",
+ "name": "EndColumnMustNotBeLessThanStartColumn",
+ "shortDescription": "The \"endColumn\" property of a region object must not be less than the \"startColumn\" property.",
+ "fullDescription": "The \"endColumn\" property of a region object must not be less than the \"startColumn\" property.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the value of the \"endColumn\" property is {2}, which is less than the value of the \"startColumn\" property, which is {3}."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInAnalysisTarget.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnLessThanStartColumnInAnalysisTarget.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnLessThanStartColumnInAnalysisTarget_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T22:54:31.192Z",
+ "endTime": "2016-08-29T22:54:31.542Z",
+ "processId": 540,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInCodeFlow.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInCodeFlow.sarif
new file mode 100644
index 000000000..009501417
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInCodeFlow.sarif
@@ -0,0 +1,44 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 2,
+ "startColumn": 2,
+ "endColumn": 1
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInCodeFlow_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInCodeFlow_Expected.sarif
new file mode 100644
index 000000000..4834e30b9
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInCodeFlow_Expected.sarif
@@ -0,0 +1,85 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "07216c89-437f-4257-9332-a4654890e958",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0013",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "EndColumnLessThanStartColumnInCodeFlow.sarif",
+ "/runs/0/results/0/codeFlows/0/locations/0/physicalLocation/region/endColumn",
+ "1",
+ "2"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInCodeFlow.sarif",
+ "region": {
+ "startLine": 33,
+ "startColumn": 37
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInCodeFlow.sarif"
+ },
+ "message": "Analyzing 'EndColumnLessThanStartColumnInCodeFlow.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T22:56:07.975Z"
+ }
+ ],
+ "rules": {
+ "SV0013": {
+ "id": "SV0013",
+ "name": "EndColumnMustNotBeLessThanStartColumn",
+ "shortDescription": "The \"endColumn\" property of a region object must not be less than the \"startColumn\" property.",
+ "fullDescription": "The \"endColumn\" property of a region object must not be less than the \"startColumn\" property.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the value of the \"endColumn\" property is {2}, which is less than the value of the \"startColumn\" property, which is {3}."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInCodeFlow.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnLessThanStartColumnInCodeFlow.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnLessThanStartColumnInCodeFlow_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T22:56:07.896Z",
+ "endTime": "2016-08-29T22:56:08.240Z",
+ "processId": 9316,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInRelatedLocation.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInRelatedLocation.sarif
new file mode 100644
index 000000000..dbd03defc
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInRelatedLocation.sarif
@@ -0,0 +1,40 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "relatedLocations": [
+ {
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 2,
+ "startColumn": 2,
+ "endColumn": 1
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInRelatedLocation_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInRelatedLocation_Expected.sarif
new file mode 100644
index 000000000..313af8ff0
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInRelatedLocation_Expected.sarif
@@ -0,0 +1,85 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "9cff9928-f161-4658-9090-327b4a3e44bb",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0013",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "EndColumnLessThanStartColumnInRelatedLocation.sarif",
+ "/runs/0/results/0/relatedLocations/0/physicalLocation/region/endColumn",
+ "1",
+ "2"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInRelatedLocation.sarif",
+ "region": {
+ "startLine": 31,
+ "startColumn": 34
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInRelatedLocation.sarif"
+ },
+ "message": "Analyzing 'EndColumnLessThanStartColumnInRelatedLocation.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T23:11:40.966Z"
+ }
+ ],
+ "rules": {
+ "SV0013": {
+ "id": "SV0013",
+ "name": "EndColumnMustNotBeLessThanStartColumn",
+ "shortDescription": "The \"endColumn\" property of a region object must not be less than the \"startColumn\" property.",
+ "fullDescription": "The \"endColumn\" property of a region object must not be less than the \"startColumn\" property.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the value of the \"endColumn\" property is {2}, which is less than the value of the \"startColumn\" property, which is {3}."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInRelatedLocation.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnLessThanStartColumnInRelatedLocation.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnLessThanStartColumnInRelatedLocation_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T23:11:40.876Z",
+ "endTime": "2016-08-29T23:11:41.222Z",
+ "processId": 12580,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInResultFile.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInResultFile.sarif
new file mode 100644
index 000000000..38a377058
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInResultFile.sarif
@@ -0,0 +1,30 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "resultFile": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 2,
+ "startColumn": 2,
+ "endColumn": 1
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInResultFile_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInResultFile_Expected.sarif
new file mode 100644
index 000000000..eb61180fe
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInResultFile_Expected.sarif
@@ -0,0 +1,85 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "b4d344e3-cf08-40fb-a416-c7d691717d56",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0013",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "EndColumnLessThanStartColumnInResultFile.sarif",
+ "/runs/0/results/0/locations/0/resultFile/region/endColumn",
+ "1",
+ "2"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInResultFile.sarif",
+ "region": {
+ "startLine": 21,
+ "startColumn": 33
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInResultFile.sarif"
+ },
+ "message": "Analyzing 'EndColumnLessThanStartColumnInResultFile.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T23:11:08.694Z"
+ }
+ ],
+ "rules": {
+ "SV0013": {
+ "id": "SV0013",
+ "name": "EndColumnMustNotBeLessThanStartColumn",
+ "shortDescription": "The \"endColumn\" property of a region object must not be less than the \"startColumn\" property.",
+ "fullDescription": "The \"endColumn\" property of a region object must not be less than the \"startColumn\" property.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the value of the \"endColumn\" property is {2}, which is less than the value of the \"startColumn\" property, which is {3}."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnLessThanStartColumnInResultFile.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnLessThanStartColumnInResultFile.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnLessThanStartColumnInResultFile_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T23:11:08.603Z",
+ "endTime": "2016-08-29T23:11:08.949Z",
+ "processId": 3548,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnNotSpecified.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnNotSpecified.sarif
new file mode 100644
index 000000000..e909f1aa8
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnNotSpecified.sarif
@@ -0,0 +1,29 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1,
+ "startColumn": 2
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnNotSpecified_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnNotSpecified_Expected.sarif
new file mode 100644
index 000000000..299deddf6
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnNotSpecified_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "dc4a37c2-19b8-4db5-8d4b-93016a5b34ba",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnNotSpecified.sarif"
+ },
+ "message": "Analyzing 'EndColumnNotSpecified.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T22:59:10.501Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndColumnMustNotBeLessThanStartColumn/EndColumnNotSpecified.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnNotSpecified.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndColumnMustNotBeLessThanStartColumn\\EndColumnNotSpecified_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T22:59:10.406Z",
+ "endTime": "2016-08-29T22:59:10.736Z",
+ "processId": 3772,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineEqualsStartLine.sarif b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineEqualsStartLine.sarif
new file mode 100644
index 000000000..2fec37ad4
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineEqualsStartLine.sarif
@@ -0,0 +1,29 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1,
+ "endLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineEqualsStartLine_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineEqualsStartLine_Expected.sarif
new file mode 100644
index 000000000..8292ce44f
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineEqualsStartLine_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "a452680c-dd09-4644-90ec-0fc0f64edf77",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineEqualsStartLine.sarif"
+ },
+ "message": "Analyzing 'EndLineEqualsStartLine.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T21:52:27.769Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineEqualsStartLine.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndLineMustNotBeLessThanStartLine\\EndLineEqualsStartLine.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndLineMustNotBeLessThanStartLine\\EndLineEqualsStartLine_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T21:52:27.606Z",
+ "endTime": "2016-08-29T21:52:28.038Z",
+ "processId": 8304,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineGreaterThanStartLine.sarif b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineGreaterThanStartLine.sarif
new file mode 100644
index 000000000..fd7c1afae
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineGreaterThanStartLine.sarif
@@ -0,0 +1,29 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1,
+ "endLine": 2
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineGreaterThanStartLine_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineGreaterThanStartLine_Expected.sarif
new file mode 100644
index 000000000..53269fe80
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineGreaterThanStartLine_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "99acc70c-6c97-4490-af91-8181c5ed3759",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineGreaterThanStartLine.sarif"
+ },
+ "message": "Analyzing 'EndLineGreaterThanStartLine.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T21:53:35.930Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineGreaterThanStartLine.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndLineMustNotBeLessThanStartLine\\EndLineGreaterThanStartLine.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndLineMustNotBeLessThanStartLine\\EndLineGreaterThanStartLine_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T21:53:35.850Z",
+ "endTime": "2016-08-29T21:53:36.165Z",
+ "processId": 15636,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInAnalysisTarget.sarif b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInAnalysisTarget.sarif
new file mode 100644
index 000000000..1491dfab9
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInAnalysisTarget.sarif
@@ -0,0 +1,29 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 2,
+ "endLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInAnalysisTarget_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInAnalysisTarget_Expected.sarif
new file mode 100644
index 000000000..5c01e72a3
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInAnalysisTarget_Expected.sarif
@@ -0,0 +1,85 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "3529dda6-e6ed-4bc3-b6fb-24d714a39183",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0012",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "EndLineLessThanStartLineInAnalysisTarget.sarif",
+ "/runs/0/results/0/locations/0/analysisTarget/region/endLine",
+ "1",
+ "2"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInAnalysisTarget.sarif",
+ "region": {
+ "startLine": 20,
+ "startColumn": 31
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInAnalysisTarget.sarif"
+ },
+ "message": "Analyzing 'EndLineLessThanStartLineInAnalysisTarget.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T23:01:05.747Z"
+ }
+ ],
+ "rules": {
+ "SV0012": {
+ "id": "SV0012",
+ "name": "EndLineMustNotBeLessThanStartLine",
+ "shortDescription": "The \"endLine\" property of a region object must not be less than the \"startLine\" property.",
+ "fullDescription": "The \"endLine\" property of a region object must not be less than the \"startLine\" property.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the value of the \"endLine\" property is {2}, which is less than the value of the \"startLine\" property, which is {3}."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInAnalysisTarget.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndLineMustNotBeLessThanStartLine\\EndLineLessThanStartLineInAnalysisTarget.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndLineMustNotBeLessThanStartLine\\EndLineLessThanStartLineInAnalysisTarget_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T23:01:05.654Z",
+ "endTime": "2016-08-29T23:01:05.995Z",
+ "processId": 19144,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInCodeFlow.sarif b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInCodeFlow.sarif
new file mode 100644
index 000000000..8d7167f6f
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInCodeFlow.sarif
@@ -0,0 +1,43 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 2,
+ "endLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInCodeFlow_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInCodeFlow_Expected.sarif
new file mode 100644
index 000000000..b7bb4cb1c
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInCodeFlow_Expected.sarif
@@ -0,0 +1,85 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "8cb0b1ed-810c-43f3-9121-ba39bcd1c0e5",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0012",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "EndLineLessThanStartLineInCodeFlow.sarif",
+ "/runs/0/results/0/codeFlows/0/locations/0/physicalLocation/region/endLine",
+ "1",
+ "2"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInCodeFlow.sarif",
+ "region": {
+ "startLine": 32,
+ "startColumn": 35
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInCodeFlow.sarif"
+ },
+ "message": "Analyzing 'EndLineLessThanStartLineInCodeFlow.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T23:02:10.430Z"
+ }
+ ],
+ "rules": {
+ "SV0012": {
+ "id": "SV0012",
+ "name": "EndLineMustNotBeLessThanStartLine",
+ "shortDescription": "The \"endLine\" property of a region object must not be less than the \"startLine\" property.",
+ "fullDescription": "The \"endLine\" property of a region object must not be less than the \"startLine\" property.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the value of the \"endLine\" property is {2}, which is less than the value of the \"startLine\" property, which is {3}."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInCodeFlow.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndLineMustNotBeLessThanStartLine\\EndLineLessThanStartLineInCodeFlow.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndLineMustNotBeLessThanStartLine\\EndLineLessThanStartLineInCodeFlow_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T23:02:10.353Z",
+ "endTime": "2016-08-29T23:02:10.709Z",
+ "processId": 7948,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInRelatedLocation.sarif b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInRelatedLocation.sarif
new file mode 100644
index 000000000..d5a7c3732
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInRelatedLocation.sarif
@@ -0,0 +1,39 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "relatedLocations": [
+ {
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 2,
+ "endLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInRelatedLocation_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInRelatedLocation_Expected.sarif
new file mode 100644
index 000000000..90f608b4a
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInRelatedLocation_Expected.sarif
@@ -0,0 +1,85 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "472f867a-692a-4dd8-96c0-7a8d6e787d6b",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0012",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "EndLineLessThanStartLineInRelatedLocation.sarif",
+ "/runs/0/results/0/relatedLocations/0/physicalLocation/region/endLine",
+ "1",
+ "2"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInRelatedLocation.sarif",
+ "region": {
+ "startLine": 30,
+ "startColumn": 32
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInRelatedLocation.sarif"
+ },
+ "message": "Analyzing 'EndLineLessThanStartLineInRelatedLocation.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T23:02:50.227Z"
+ }
+ ],
+ "rules": {
+ "SV0012": {
+ "id": "SV0012",
+ "name": "EndLineMustNotBeLessThanStartLine",
+ "shortDescription": "The \"endLine\" property of a region object must not be less than the \"startLine\" property.",
+ "fullDescription": "The \"endLine\" property of a region object must not be less than the \"startLine\" property.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the value of the \"endLine\" property is {2}, which is less than the value of the \"startLine\" property, which is {3}."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInRelatedLocation.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndLineMustNotBeLessThanStartLine\\EndLineLessThanStartLineInRelatedLocation.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndLineMustNotBeLessThanStartLine\\EndLineLessThanStartLineInRelatedLocation_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T23:02:50.134Z",
+ "endTime": "2016-08-29T23:02:50.495Z",
+ "processId": 7572,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInResultFile.sarif b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInResultFile.sarif
new file mode 100644
index 000000000..0d3d8ac04
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInResultFile.sarif
@@ -0,0 +1,29 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "resultFile": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 2,
+ "endLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInResultFile_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInResultFile_Expected.sarif
new file mode 100644
index 000000000..6754eced1
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInResultFile_Expected.sarif
@@ -0,0 +1,85 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "354bf806-7d23-41d9-854a-36cdfbcc91f5",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0012",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "EndLineLessThanStartLineInResultFile.sarif",
+ "/runs/0/results/0/locations/0/resultFile/region/endLine",
+ "1",
+ "2"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInResultFile.sarif",
+ "region": {
+ "startLine": 20,
+ "startColumn": 31
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInResultFile.sarif"
+ },
+ "message": "Analyzing 'EndLineLessThanStartLineInResultFile.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T23:03:12.459Z"
+ }
+ ],
+ "rules": {
+ "SV0012": {
+ "id": "SV0012",
+ "name": "EndLineMustNotBeLessThanStartLine",
+ "shortDescription": "The \"endLine\" property of a region object must not be less than the \"startLine\" property.",
+ "fullDescription": "The \"endLine\" property of a region object must not be less than the \"startLine\" property.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the value of the \"endLine\" property is {2}, which is less than the value of the \"startLine\" property, which is {3}."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInResultFile.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndLineMustNotBeLessThanStartLine\\EndLineLessThanStartLineInResultFile.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndLineMustNotBeLessThanStartLine\\EndLineLessThanStartLineInResultFile_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T23:03:12.380Z",
+ "endTime": "2016-08-29T23:03:12.709Z",
+ "processId": 10512,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInResultLocation_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInResultLocation_Expected.sarif
new file mode 100644
index 000000000..60702fd31
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInResultLocation_Expected.sarif
@@ -0,0 +1,85 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "433c232f-5c94-481f-8d09-801cd7ab886b",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0012",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "EndLineLessThanStartLineInResultLocation.sarif",
+ "/runs/0/results/0/locations/0/analysisTarget/region",
+ "1",
+ "2"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInResultLocation.sarif",
+ "region": {
+ "startLine": 18,
+ "startColumn": 28
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInResultLocation.sarif"
+ },
+ "message": "Analyzing 'EndLineLessThanStartLineInResultLocation.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T21:57:37.433Z"
+ }
+ ],
+ "rules": {
+ "SV0012": {
+ "id": "SV0012",
+ "name": "EndLineMustNotBeLessThanStartLine",
+ "shortDescription": "The \"endLine\" property of a region object must not be less than the \"startLine\" property.",
+ "fullDescription": "The \"endLine\" property of a region object must not be less than the \"startLine\" property.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the value of the \"endLine\" property is {2}, which is less than the value of the \"startLine\" property, which is {3}."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineLessThanStartLineInResultLocation.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndLineMustNotBeLessThanStartLine\\EndLineLessThanStartLineInResultLocation.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndLineMustNotBeLessThanStartLine\\EndLineLessThanStartLineInResultLocation_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T21:57:37.351Z",
+ "endTime": "2016-08-29T21:57:37.683Z",
+ "processId": 13632,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineNotSpecified.sarif b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineNotSpecified.sarif
new file mode 100644
index 000000000..c6c6eeea6
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineNotSpecified.sarif
@@ -0,0 +1,28 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineNotSpecified_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineNotSpecified_Expected.sarif
new file mode 100644
index 000000000..898f37436
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineNotSpecified_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "7f8e843a-e181-4f76-84f6-ec63f9c48c46",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineNotSpecified.sarif"
+ },
+ "message": "Analyzing 'EndLineNotSpecified.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T21:56:01.857Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndLineMustNotBeLessThanStartLine/EndLineNotSpecified.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndLineMustNotBeLessThanStartLine\\EndLineNotSpecified.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndLineMustNotBeLessThanStartLine\\EndLineNotSpecified_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T21:56:01.765Z",
+ "endTime": "2016-08-29T21:56:02.096Z",
+ "processId": 11996,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeEqualsStartTime.sarif b/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeEqualsStartTime.sarif
new file mode 100644
index 000000000..7a11b875d
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeEqualsStartTime.sarif
@@ -0,0 +1,17 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [],
+ "invocation": {
+ "commandLine": "CodeScanner.exe *.dll",
+ "startTime": "2016-08-25T21:26:42.049Z",
+ "endTime": "2016-08-25T21:26:42.049Z"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeEqualsStartTime_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeEqualsStartTime_Expected.sarif
new file mode 100644
index 000000000..44b576d15
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeEqualsStartTime_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "73efc698-2c45-4d59-b871-ab73f35cae0e",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeEqualsStartTime.sarif"
+ },
+ "message": "Analyzing 'EndTimeEqualsStartTime.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T23:57:20.601Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeEqualsStartTime.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndTimeMustBeAfterStartTime\\EndTimeEqualsStartTime.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndTimeMustBeAfterStartTime\\EndTimeEqualsStartTime_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T23:57:20.507Z",
+ "endTime": "2016-08-26T23:57:20.820Z",
+ "processId": 11104,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsAfterStartTime.sarif b/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsAfterStartTime.sarif
new file mode 100644
index 000000000..d7fb1dba2
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsAfterStartTime.sarif
@@ -0,0 +1,17 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [],
+ "invocation": {
+ "commandLine": "CodeScanner.exe *.dll",
+ "startTime": "2016-08-25T21:26:42.049Z",
+ "endTime": "2016-08-25T21:26:42.051Z"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsAfterStartTime_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsAfterStartTime_Expected.sarif
new file mode 100644
index 000000000..56199997a
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsAfterStartTime_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "fb405af4-cfb8-4680-9ed7-77646cfdb823",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsAfterStartTime.sarif"
+ },
+ "message": "Analyzing 'EndTimeIsAfterStartTime.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T23:56:43.024Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsAfterStartTime.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndTimeMustBeAfterStartTime\\EndTimeIsAfterStartTime.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndTimeMustBeAfterStartTime\\EndTimeIsAfterStartTime_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T23:56:42.939Z",
+ "endTime": "2016-08-26T23:56:43.243Z",
+ "processId": 4852,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsBeforeStartTime.sarif b/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsBeforeStartTime.sarif
new file mode 100644
index 000000000..abe506d24
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsBeforeStartTime.sarif
@@ -0,0 +1,17 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [],
+ "invocation": {
+ "commandLine": "CodeScanner.exe *.dll",
+ "startTime": "2016-08-25T21:26:42.049Z",
+ "endTime": "2016-08-25T21:26:41.051Z"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsBeforeStartTime_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsBeforeStartTime_Expected.sarif
new file mode 100644
index 000000000..5ab7ed64d
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsBeforeStartTime_Expected.sarif
@@ -0,0 +1,85 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "b703b243-53e4-42d4-b07e-c80b7b27ad78",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0007",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "EndTimeIsBeforeStartTime.sarif",
+ "/runs/0/invocation/endTime",
+ "2016-08-25T21:26:41.051Z",
+ "2016-08-25T21:26:42.049Z"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsBeforeStartTime.sarif",
+ "region": {
+ "startLine": 13,
+ "startColumn": 46
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsBeforeStartTime.sarif"
+ },
+ "message": "Analyzing 'EndTimeIsBeforeStartTime.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T23:55:39.788Z"
+ }
+ ],
+ "rules": {
+ "SV0007": {
+ "id": "SV0007",
+ "name": "EndTimeMustBeAfterStartTime",
+ "shortDescription": "The end time of a run must be after the start time.",
+ "fullDescription": "The end time of a run must be after the start time. To allow for the possibility that the duration of the run is less than the resolution of the string representation of the time, the start time and the end time may be equal.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the end time \"{2}\" is before the start time \"{3}\"."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/EndTimeMustBeAfterStartTime/EndTimeIsBeforeStartTime.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndTimeMustBeAfterStartTime\\EndTimeIsBeforeStartTime.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\EndTimeMustBeAfterStartTime\\EndTimeIsBeforeStartTime_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T23:55:39.694Z",
+ "endTime": "2016-08-26T23:55:40.038Z",
+ "processId": 14564,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/NonUniqueHashAlgorithms.sarif b/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/NonUniqueHashAlgorithms.sarif
new file mode 100644
index 000000000..dcb71d3da
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/NonUniqueHashAlgorithms.sarif
@@ -0,0 +1,44 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "files": {
+ "file:///c:/src/file.c": {
+ "hashes": [
+ {
+ "algorithm": "sha256",
+ "value": "b13ce2678a8807ba0765ab94a0ecd394f869bc81"
+ },
+ {
+ "algorithm": "sha256",
+ "value": "8a8807ba0765ab94a0ecd394f869bc81b13ce267"
+ }
+ ]
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/NonUniqueHashAlgorithms_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/NonUniqueHashAlgorithms_Expected.sarif
new file mode 100644
index 000000000..d0ca6156c
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/NonUniqueHashAlgorithms_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "df8b548d-4333-47ba-af26-ad35e8b83016",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0006",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "NonUniqueHashAlgorithms.sarif",
+ "/runs/0/files/file:~1~1~1c:~1src~1file.c/hashes",
+ "Sha256"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/NonUniqueHashAlgorithms.sarif",
+ "region": {
+ "startLine": 30,
+ "startColumn": 22
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/NonUniqueHashAlgorithms.sarif"
+ },
+ "message": "Analyzing 'NonUniqueHashAlgorithms.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T23:19:47.392Z"
+ }
+ ],
+ "rules": {
+ "SV0006": {
+ "id": "SV0006",
+ "name": "HashAlgorithmsMustBeUnique",
+ "shortDescription": "In any given \"file\" object, every element of the \"hashes\" array must have a different value for its \"algorithm\" property.",
+ "fullDescription": "In any given \"file\" object, every element of the \"hashes\" array must have a different value for its \"algorithm\" property. ",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the array contains multiple objects with the value \"{2}\" for the algorithm property."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/NonUniqueHashAlgorithms.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\HashAlgorithmsMustBeUnique\\NonUniqueHashAlgorithms.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\NonUniqueHashAlgorithms_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T23:19:47.220Z",
+ "endTime": "2016-08-26T23:19:47.658Z",
+ "processId": 8552,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/UniqueHashAlgorithms.sarif b/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/UniqueHashAlgorithms.sarif
new file mode 100644
index 000000000..0eb19cab3
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/UniqueHashAlgorithms.sarif
@@ -0,0 +1,44 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "files": {
+ "file:///c:/src/file.c": {
+ "hashes": [
+ {
+ "algorithm": "sha256",
+ "value": "b13ce2678a8807ba0765ab94a0ecd394f869bc81"
+ },
+ {
+ "algorithm": "sha1",
+ "value": "8a8807ba0765ab94a0ecd394f869bc81b13ce267"
+ }
+ ]
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/UniqueHashAlgorithms_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/UniqueHashAlgorithms_Expected.sarif
new file mode 100644
index 000000000..b395570d8
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/UniqueHashAlgorithms_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "f5936d09-1147-487f-a44f-8cc4c4e6aa0c",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/UniqueHashAlgorithms.sarif"
+ },
+ "message": "Analyzing 'UniqueHashAlgorithms.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T23:21:00.776Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/HashAlgorithmsMustBeUnique/UniqueHashAlgorithms.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\HashAlgorithmsMustBeUnique\\UniqueHashAlgorithms.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\UniqueHashAlgorithms_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T23:21:00.682Z",
+ "endTime": "2016-08-26T23:21:01.011Z",
+ "processId": 17508,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInCodeFlow.sarif b/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInCodeFlow.sarif
new file mode 100644
index 000000000..0634d7c74
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInCodeFlow.sarif
@@ -0,0 +1,44 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "importance": "essential",
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInCodeFlow_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInCodeFlow_Expected.sarif
new file mode 100644
index 000000000..a49820240
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInCodeFlow_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "f6a2a2d6-6bb7-4414-bc6a-5a5dde691c1b",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInCodeFlow.sarif"
+ },
+ "message": "Analyzing 'ImportanceAppearsInCodeFlow.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T17:33:46.605Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInCodeFlow.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\ImportanceMustAppearOnlyInCodeFlowLocations\\ImportanceAppearsInCodeFlow.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\ImportanceMustAppearOnlyInCodeFlowLocations\\ImportanceAppearsInCodeFlow_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T17:33:46.509Z",
+ "endTime": "2016-08-29T17:33:46.865Z",
+ "processId": 20180,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInRelatedLocation.sarif b/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInRelatedLocation.sarif
new file mode 100644
index 000000000..a56de65b6
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInRelatedLocation.sarif
@@ -0,0 +1,39 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "relatedLocations": [
+ {
+ "importance": "essential",
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 2
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInRelatedLocation_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInRelatedLocation_Expected.sarif
new file mode 100644
index 000000000..2e72018e1
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInRelatedLocation_Expected.sarif
@@ -0,0 +1,83 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "12383704-8153-4818-94eb-6dc88ceff477",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0011",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "ImportanceAppearsInRelatedLocation.sarif",
+ "/runs/0/results/0/relatedLocations/0/importance"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInRelatedLocation.sarif",
+ "region": {
+ "startLine": 26,
+ "startColumn": 40
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInRelatedLocation.sarif"
+ },
+ "message": "Analyzing 'ImportanceAppearsInRelatedLocation.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T17:33:03.071Z"
+ }
+ ],
+ "rules": {
+ "SV0011": {
+ "id": "SV0011",
+ "name": "ImportanceMustAppearOnlyInCodeFlowLocations",
+ "shortDescription": "The \"importance\" property must appear only in annotatedCodeLocation objects which occur within code flows.",
+ "fullDescription": "The \"importance\" property must appear only in annotatedCodeLocation objects which occur within code flows.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the \"importance\" property appears in an annotatedCodeLocation object which does not occur in a code flow. The \"importance\" property must appear only in annotatedCodeLocation objects which occur within code flows."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/ImportanceMustAppearOnlyInCodeFlowLocations/ImportanceAppearsInRelatedLocation.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\ImportanceMustAppearOnlyInCodeFlowLocations\\ImportanceAppearsInRelatedLocation.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\ImportanceMustAppearOnlyInCodeFlowLocations\\ImportanceAppearsInRelatedLocation_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T17:33:02.876Z",
+ "endTime": "2016-08-29T17:33:03.324Z",
+ "processId": 9608,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/AnnotatedCodeLocationMessageWithoutPeriod.sarif b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/AnnotatedCodeLocationMessageWithoutPeriod.sarif
new file mode 100644
index 000000000..9f6fd1f29
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/AnnotatedCodeLocationMessageWithoutPeriod.sarif
@@ -0,0 +1,44 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message with period.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "message": "CodeFlow location message without period",
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/AnnotatedCodeLocationMessageWithoutPeriod_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/AnnotatedCodeLocationMessageWithoutPeriod_Expected.sarif
new file mode 100644
index 000000000..531b395d3
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/AnnotatedCodeLocationMessageWithoutPeriod_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "4226acda-784d-43cc-a173-cb719bdbb27a",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0008",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "AnnotatedCodeLocationMessageWithoutPeriod.sarif",
+ "/runs/0/results/0/codeFlows/0/locations/0/message",
+ "CodeFlow location message without period"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/AnnotatedCodeLocationMessageWithoutPeriod.sarif",
+ "region": {
+ "startLine": 28,
+ "startColumn": 72
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/AnnotatedCodeLocationMessageWithoutPeriod.sarif"
+ },
+ "message": "Analyzing 'AnnotatedCodeLocationMessageWithoutPeriod.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T01:54:58.429Z"
+ }
+ ],
+ "rules": {
+ "SV0008": {
+ "id": "SV0008",
+ "name": "MessagesShouldEndWithPeriod",
+ "shortDescription": "Messages should consist of one or more complete sentences, ending with a period.",
+ "fullDescription": "Messages should consist of one or more complete sentences, ending with a period.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the message \"{2}\" does not end with a period."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/AnnotatedCodeLocationMessageWithoutPeriod.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\MessagesShouldEndWithPeriod\\AnnotatedCodeLocationMessageWithoutPeriod.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\MessagesShouldEndWithPeriod\\AnnotatedCodeLocationMessageWithoutPeriod_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T01:54:58.335Z",
+ "endTime": "2016-08-29T01:54:58.685Z",
+ "processId": 14032,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/CodeFlowMessageWithoutPeriod.sarif b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/CodeFlowMessageWithoutPeriod.sarif
new file mode 100644
index 000000000..c3c73f704
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/CodeFlowMessageWithoutPeriod.sarif
@@ -0,0 +1,44 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message with period.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "message": "CodeFlow message without period",
+ "locations": [
+ {
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/CodeFlowMessageWithoutPeriod_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/CodeFlowMessageWithoutPeriod_Expected.sarif
new file mode 100644
index 000000000..ae2132d44
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/CodeFlowMessageWithoutPeriod_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "c5cf9835-25a9-41ab-b8bf-f104557c4586",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0008",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "CodeFlowMessageWithoutPeriod.sarif",
+ "/runs/0/results/0/codeFlows/0/message",
+ "CodeFlow message without period"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/CodeFlowMessageWithoutPeriod.sarif",
+ "region": {
+ "startLine": 26,
+ "startColumn": 59
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/CodeFlowMessageWithoutPeriod.sarif"
+ },
+ "message": "Analyzing 'CodeFlowMessageWithoutPeriod.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T01:51:02.775Z"
+ }
+ ],
+ "rules": {
+ "SV0008": {
+ "id": "SV0008",
+ "name": "MessagesShouldEndWithPeriod",
+ "shortDescription": "Messages should consist of one or more complete sentences, ending with a period.",
+ "fullDescription": "Messages should consist of one or more complete sentences, ending with a period.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the message \"{2}\" does not end with a period."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/CodeFlowMessageWithoutPeriod.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\MessagesShouldEndWithPeriod\\CodeFlowMessageWithoutPeriod.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\MessagesShouldEndWithPeriod\\CodeFlowMessageWithoutPeriod_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T01:51:02.681Z",
+ "endTime": "2016-08-29T01:51:03.041Z",
+ "processId": 18668,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/NotificationMessageWithoutPeriod.sarif b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/NotificationMessageWithoutPeriod.sarif
new file mode 100644
index 000000000..2c171f3c4
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/NotificationMessageWithoutPeriod.sarif
@@ -0,0 +1,22 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [],
+ "toolNotifications": [
+ {
+ "message": "Run started"
+ }
+ ],
+ "configurationNotifications": [
+ {
+ "message": "Using default configuration"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/NotificationMessageWithoutPeriod_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/NotificationMessageWithoutPeriod_Expected.sarif
new file mode 100644
index 000000000..8eb481a80
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/NotificationMessageWithoutPeriod_Expected.sarif
@@ -0,0 +1,107 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "6d939a43-9463-4adc-ae69-9b72175bb750",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0008",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "NotificationMessageWithoutPeriod.sarif",
+ "/runs/0/toolNotifications/0/message",
+ "Run started"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/NotificationMessageWithoutPeriod.sarif",
+ "region": {
+ "startLine": 12,
+ "startColumn": 35
+ }
+ }
+ }
+ ]
+ },
+ {
+ "ruleId": "SV0008",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "NotificationMessageWithoutPeriod.sarif",
+ "/runs/0/configurationNotifications/0/message",
+ "Using default configuration"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/NotificationMessageWithoutPeriod.sarif",
+ "region": {
+ "startLine": 17,
+ "startColumn": 51
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/NotificationMessageWithoutPeriod.sarif"
+ },
+ "message": "Analyzing 'NotificationMessageWithoutPeriod.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T02:03:26.927Z"
+ }
+ ],
+ "rules": {
+ "SV0008": {
+ "id": "SV0008",
+ "name": "MessagesShouldEndWithPeriod",
+ "shortDescription": "Messages should consist of one or more complete sentences, ending with a period.",
+ "fullDescription": "Messages should consist of one or more complete sentences, ending with a period.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the message \"{2}\" does not end with a period."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/NotificationMessageWithoutPeriod.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\MessagesShouldEndWithPeriod\\NotificationMessageWithoutPeriod.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\MessagesShouldEndWithPeriod\\NotificationMessageWithoutPeriod_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T02:03:26.848Z",
+ "endTime": "2016-08-29T02:03:27.192Z",
+ "processId": 904,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/PeriodsAfterAllMessages.sarif b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/PeriodsAfterAllMessages.sarif
new file mode 100644
index 000000000..2618c731b
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/PeriodsAfterAllMessages.sarif
@@ -0,0 +1,64 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message with period.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "message": "CodeFlow message with period.",
+ "locations": [
+ {
+ "message": "AnnotatedCodeLocation message with period.",
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "stacks": [
+ {
+ "message": "Stack message with period.",
+ "frames": [
+ {
+ "fullyQualifiedLogicalName": "func",
+ "message": "Frame message with period."
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "rules": {
+ "TST0001": {
+ "id": "TST0001",
+ "messageFormats": {
+ "Default": "Message format with period."
+ }
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/PeriodsAfterAllMessages_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/PeriodsAfterAllMessages_Expected.sarif
new file mode 100644
index 000000000..844564001
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/PeriodsAfterAllMessages_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "c31ac324-eee6-453b-a725-026769de4c09",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/PeriodsAfterAllMessages.sarif"
+ },
+ "message": "Analyzing 'PeriodsAfterAllMessages.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T00:07:33.033Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/PeriodsAfterAllMessages.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\MessagesShouldEndWithPeriod\\PeriodsAfterAllMessages.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\MessagesShouldEndWithPeriod\\PeriodsAfterAllMessages_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T00:07:32.955Z",
+ "endTime": "2016-08-29T00:07:33.298Z",
+ "processId": 11668,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/ResultMessageWithoutPeriod.sarif b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/ResultMessageWithoutPeriod.sarif
new file mode 100644
index 000000000..d1d70fa8d
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/ResultMessageWithoutPeriod.sarif
@@ -0,0 +1,28 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message without period",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/ResultMessageWithoutPeriod_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/ResultMessageWithoutPeriod_Expected.sarif
new file mode 100644
index 000000000..2c73748e0
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/ResultMessageWithoutPeriod_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "f55c1c12-1729-4c51-8dad-13caa2b192df",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0008",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "ResultMessageWithoutPeriod.sarif",
+ "/runs/0/results/0/message",
+ "Result message without period"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/ResultMessageWithoutPeriod.sarif",
+ "region": {
+ "startLine": 13,
+ "startColumn": 53
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/ResultMessageWithoutPeriod.sarif"
+ },
+ "message": "Analyzing 'ResultMessageWithoutPeriod.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T00:39:41.034Z"
+ }
+ ],
+ "rules": {
+ "SV0008": {
+ "id": "SV0008",
+ "name": "MessagesShouldEndWithPeriod",
+ "shortDescription": "Messages should consist of one or more complete sentences, ending with a period.",
+ "fullDescription": "Messages should consist of one or more complete sentences, ending with a period.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the message \"{2}\" does not end with a period."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/ResultMessageWithoutPeriod.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\MessagesShouldEndWithPeriod\\ResultMessageWithoutPeriod.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\MessagesShouldEndWithPeriod\\ResultMessageWithoutPeriod_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T00:39:40.862Z",
+ "endTime": "2016-08-29T00:39:41.362Z",
+ "processId": 16724,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/RuleMessageFormatWithoutPeriod.sarif b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/RuleMessageFormatWithoutPeriod.sarif
new file mode 100644
index 000000000..f7dbad2ae
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/RuleMessageFormatWithoutPeriod.sarif
@@ -0,0 +1,21 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "rules": {
+ "TST0001": {
+ "id": "TST0001",
+ "messageFormats": {
+ "One": "Message format without period",
+ "Two": "Message format with period.",
+ "Three": "Another message format without period"
+ }
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/RuleMessageFormatWithoutPeriod_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/RuleMessageFormatWithoutPeriod_Expected.sarif
new file mode 100644
index 000000000..7d5f7bf59
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/RuleMessageFormatWithoutPeriod_Expected.sarif
@@ -0,0 +1,107 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "45d9024d-b8c1-4e7d-bbfe-10d3e0b2e521",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0008",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "RuleMessageFormatWithoutPeriod.sarif",
+ "/runs/0/rules/TST0001/messageFormats/One",
+ "Message format without period"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/RuleMessageFormatWithoutPeriod.sarif",
+ "region": {
+ "startLine": 13,
+ "startColumn": 51
+ }
+ }
+ }
+ ]
+ },
+ {
+ "ruleId": "SV0008",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "RuleMessageFormatWithoutPeriod.sarif",
+ "/runs/0/rules/TST0001/messageFormats/Three",
+ "Another message format without period"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/RuleMessageFormatWithoutPeriod.sarif",
+ "region": {
+ "startLine": 15,
+ "startColumn": 61
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/RuleMessageFormatWithoutPeriod.sarif"
+ },
+ "message": "Analyzing 'RuleMessageFormatWithoutPeriod.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T00:57:04.316Z"
+ }
+ ],
+ "rules": {
+ "SV0008": {
+ "id": "SV0008",
+ "name": "MessagesShouldEndWithPeriod",
+ "shortDescription": "Messages should consist of one or more complete sentences, ending with a period.",
+ "fullDescription": "Messages should consist of one or more complete sentences, ending with a period.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the message \"{2}\" does not end with a period."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/RuleMessageFormatWithoutPeriod.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\MessagesShouldEndWithPeriod\\RuleMessageFormatWithoutPeriod.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\MessagesShouldEndWithPeriod\\RuleMessageFormatWithoutPeriod_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T00:57:04.223Z",
+ "endTime": "2016-08-29T00:57:04.566Z",
+ "processId": 1068,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackFrameMessageWithoutPeriod.sarif b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackFrameMessageWithoutPeriod.sarif
new file mode 100644
index 000000000..e56eaec28
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackFrameMessageWithoutPeriod.sarif
@@ -0,0 +1,38 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message with period.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "stacks": [
+ {
+ "frames": [
+ {
+ "message": "Stack frame message without period",
+ "fullyQualifiedLogicalName": "func"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackFrameMessageWithoutPeriod_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackFrameMessageWithoutPeriod_Expected.sarif
new file mode 100644
index 000000000..e9b9e87a3
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackFrameMessageWithoutPeriod_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "9d6f7ec2-1b38-48fb-bb3c-955cc88f0e1d",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0008",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "StackFrameMessageWithoutPeriod.sarif",
+ "/runs/0/results/0/stacks/0/frames/0/message",
+ "Stack frame message without period"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackFrameMessageWithoutPeriod.sarif",
+ "region": {
+ "startLine": 28,
+ "startColumn": 66
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackFrameMessageWithoutPeriod.sarif"
+ },
+ "message": "Analyzing 'StackFrameMessageWithoutPeriod.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T01:18:35.506Z"
+ }
+ ],
+ "rules": {
+ "SV0008": {
+ "id": "SV0008",
+ "name": "MessagesShouldEndWithPeriod",
+ "shortDescription": "Messages should consist of one or more complete sentences, ending with a period.",
+ "fullDescription": "Messages should consist of one or more complete sentences, ending with a period.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the message \"{2}\" does not end with a period."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackFrameMessageWithoutPeriod.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\MessagesShouldEndWithPeriod\\StackFrameMessageWithoutPeriod.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\MessagesShouldEndWithPeriod\\StackFrameMessgeWithoutPeriod_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T01:18:35.413Z",
+ "endTime": "2016-08-29T01:18:35.761Z",
+ "processId": 13460,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackMessageWithoutPeriod.sarif b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackMessageWithoutPeriod.sarif
new file mode 100644
index 000000000..5e4548ebe
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackMessageWithoutPeriod.sarif
@@ -0,0 +1,38 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message with period.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "stacks": [
+ {
+ "message": "Stack message without period",
+ "frames": [
+ {
+ "fullyQualifiedLogicalName": "func"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackMessageWithoutPeriod_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackMessageWithoutPeriod_Expected.sarif
new file mode 100644
index 000000000..d7da028bf
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackMessageWithoutPeriod_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "a873e1dd-d3e8-43ef-8120-cca5614ed720",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0008",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "StackMessageWithoutPeriod.sarif",
+ "/runs/0/results/0/stacks/0/message",
+ "Stack message without period"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackMessageWithoutPeriod.sarif",
+ "region": {
+ "startLine": 26,
+ "startColumn": 56
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackMessageWithoutPeriod.sarif"
+ },
+ "message": "Analyzing 'StackMessageWithoutPeriod.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T01:11:43.471Z"
+ }
+ ],
+ "rules": {
+ "SV0008": {
+ "id": "SV0008",
+ "name": "MessagesShouldEndWithPeriod",
+ "shortDescription": "Messages should consist of one or more complete sentences, ending with a period.",
+ "fullDescription": "Messages should consist of one or more complete sentences, ending with a period.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the message \"{2}\" does not end with a period."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/MessagesShouldEndWithPeriod/StackMessageWithoutPeriod.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\MessagesShouldEndWithPeriod\\StackMessageWithoutPeriod.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\MessagesShouldEndWithPeriod\\StackMessgeWithoutPeriod_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T01:11:43.393Z",
+ "endTime": "2016-08-29T01:11:43.737Z",
+ "processId": 16720,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlowLocations/StepAppearsInCodeFlow.sarif b/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlowLocations/StepAppearsInCodeFlow.sarif
new file mode 100644
index 000000000..057475c5f
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlowLocations/StepAppearsInCodeFlow.sarif
@@ -0,0 +1,44 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "step": 1,
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlowLocations/StepAppearsInCodeFlow_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlowLocations/StepAppearsInCodeFlow_Expected.sarif
new file mode 100644
index 000000000..9d91278b5
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlowLocations/StepAppearsInCodeFlow_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "61035d62-fb6e-4bfa-9444-6c7815200f83",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlows/StepAppearsInCodeFlow.sarif"
+ },
+ "message": "Analyzing 'StepAppearsInCodeFlow.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T17:02:34.741Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlows/StepAppearsInCodeFlow.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\StepMustAppearOnlyInCodeFlows\\StepAppearsInCodeFlow.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\StepMustAppearOnlyInCodeFlows\\StepAppearsInCodeFlow_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T17:02:34.569Z",
+ "endTime": "2016-08-29T17:02:35.053Z",
+ "processId": 5956,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlowLocations/StepAppearsInRelatedLocation.sarif b/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlowLocations/StepAppearsInRelatedLocation.sarif
new file mode 100644
index 000000000..a834b3b54
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlowLocations/StepAppearsInRelatedLocation.sarif
@@ -0,0 +1,39 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "relatedLocations": [
+ {
+ "step": 1,
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 2
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlowLocations/StepAppearsInRelatedLocation_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlowLocations/StepAppearsInRelatedLocation_Expected.sarif
new file mode 100644
index 000000000..2e1989584
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlowLocations/StepAppearsInRelatedLocation_Expected.sarif
@@ -0,0 +1,83 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "6b85686a-cbde-4836-bec4-a9803bf9970b",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0010",
+ "level": "warning",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "StepAppearsInRelatedLocation.sarif",
+ "/runs/0/results/0/relatedLocations/0/step"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlows/StepAppearsInRelatedLocation.sarif",
+ "region": {
+ "startLine": 26,
+ "startColumn": 24
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlows/StepAppearsInRelatedLocation.sarif"
+ },
+ "message": "Analyzing 'StepAppearsInRelatedLocation.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T17:03:22.820Z"
+ }
+ ],
+ "rules": {
+ "SV0010": {
+ "id": "SV0010",
+ "name": "StepMustAppearOnlyInCodeFlowLocations",
+ "shortDescription": "The \"step\" property must appear only in annotatedCodeLocation objects which occur within code flows.",
+ "fullDescription": "The \"step\" property must appear only in annotatedCodeLocation objects which occur within code flows.",
+ "messageFormats": {
+ "Default": "In \"{0}\", at \"{1}\", the \"step\" property appears in an annotatedCodeLocation object which does not occur in a code flow. The \"step\" property must appear only in annotatedCodeLocation objects which occur within code flows."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepMustAppearOnlyInCodeFlows/StepAppearsInRelatedLocation.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\StepMustAppearOnlyInCodeFlows\\StepAppearsInRelatedLocation.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\StepMustAppearOnlyInCodeFlows\\StepAppearsInRelatedLocation_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T17:03:22.730Z",
+ "endTime": "2016-08-29T17:03:23.076Z",
+ "processId": 3024,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/InvalidStepValues.sarif b/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/InvalidStepValues.sarif
new file mode 100644
index 000000000..ef5e92107
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/InvalidStepValues.sarif
@@ -0,0 +1,63 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "step": 2,
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ },
+ {
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 43,
+ "startColumn": 12
+ }
+ }
+ },
+ {
+ "step": 4,
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 44,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/InvalidStepValues_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/InvalidStepValues_Expected.sarif
new file mode 100644
index 000000000..37ce6eeed
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/InvalidStepValues_Expected.sarif
@@ -0,0 +1,132 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "048b53be-1275-4771-af1d-941cd2e1365b",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0009",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "StepNotPresentOnAllLocations",
+ "arguments": [
+ "InvalidStepValues.sarif",
+ "/runs/0/results/0/codeFlows/0/locations/1"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/InvalidStepValues.sarif",
+ "region": {
+ "startLine": 37,
+ "startColumn": 18
+ }
+ }
+ }
+ ]
+ },
+ {
+ "ruleId": "SV0009",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "InvalidStepValue",
+ "arguments": [
+ "InvalidStepValues.sarif",
+ "/runs/0/results/0/codeFlows/0/locations/0/step",
+ "1",
+ "2"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/InvalidStepValues.sarif",
+ "region": {
+ "startLine": 28,
+ "startColumn": 29
+ }
+ }
+ }
+ ]
+ },
+ {
+ "ruleId": "SV0009",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "InvalidStepValue",
+ "arguments": [
+ "InvalidStepValues.sarif",
+ "/runs/0/results/0/codeFlows/0/locations/2/step",
+ "3",
+ "4"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/InvalidStepValues.sarif",
+ "region": {
+ "startLine": 47,
+ "startColumn": 29
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/InvalidStepValues.sarif"
+ },
+ "message": "Analyzing 'InvalidStepValues.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T16:22:31.571Z"
+ }
+ ],
+ "rules": {
+ "SV0009": {
+ "id": "SV0009",
+ "name": "StepValuesMustFormOneBasedSequence",
+ "shortDescription": "If the \"step\" property is used on any annotatedCodeLocation in a code flow, then it must be present for every location in the code flow, its value must be 1 for the first location, and its value must increase by 1 for each succeeding location.",
+ "fullDescription": "If the \"step\" property is used on any annotatedCodeLocation in a code flow, then it must be present for every location in the code flow, its value must be 1 for the first location, and its value must increase by 1 for each succeeding location.",
+ "messageFormats": {
+ "StepNotPresentOnAllLocations": "In \"{0}\", at \"{1}\", the \"step\" property is absent. The \"step\" property is present on some but not all locations in this code flow. If the \"step\" property is used on any location in a code flow, it must be present on every location in that code flow.",
+ "InvalidStepValue": "In \"{0}\", at \"{1}\", the value of the \"step\" property should be {2}, but is {3}. The step values must form a 1-based sequence starting at the first location in the code flow."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/InvalidStepValues.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\StepValuesMustFormOneBasedSequence\\InvalidStepValues.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\StepValuesMustFormOneBasedSequence\\InvalidStepValues_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T16:22:31.477Z",
+ "endTime": "2016-08-29T16:22:31.821Z",
+ "processId": 20192,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/NoStepsPresent.sarif b/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/NoStepsPresent.sarif
new file mode 100644
index 000000000..b53de80de
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/NoStepsPresent.sarif
@@ -0,0 +1,61 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ },
+ {
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 43,
+ "startColumn": 12
+ }
+ }
+ },
+ {
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 44,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/NoStepsPresent_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/NoStepsPresent_Expected.sarif
new file mode 100644
index 000000000..70765250a
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/NoStepsPresent_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "bbe1aafb-f5ea-4882-8d75-a14123b28c7c",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/NoStepsPresent.sarif"
+ },
+ "message": "Analyzing 'NoStepsPresent.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T15:39:58.160Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/NoStepsPresent.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\StepValuesMustFormOneBasedSequence\\NoStepsPresent.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\StepValuesMustFormOneBasedSequence\\NoStepsPresent_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T15:39:58.067Z",
+ "endTime": "2016-08-29T15:39:58.395Z",
+ "processId": 20184,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/StepNotPresentOnAllLocations.sarif b/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/StepNotPresentOnAllLocations.sarif
new file mode 100644
index 000000000..7ecad770c
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/StepNotPresentOnAllLocations.sarif
@@ -0,0 +1,63 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "step": 1,
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ },
+ {
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 43,
+ "startColumn": 12
+ }
+ }
+ },
+ {
+ "step": 3,
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 44,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/StepNotPresentOnAllLocations_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/StepNotPresentOnAllLocations_Expected.sarif
new file mode 100644
index 000000000..bf5179e07
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/StepNotPresentOnAllLocations_Expected.sarif
@@ -0,0 +1,83 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "c8e08f7b-e61b-4cd0-9c03-85747743db3f",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0009",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "StepNotPresentOnAllLocations",
+ "arguments": [
+ "StepNotPresentOnAllLocations.sarif",
+ "/runs/0/results/0/codeFlows/0/locations/1"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepMustIncreaseByOneFromOne/StepNotPresentOnAllLocations.sarif",
+ "region": {
+ "startLine": 37,
+ "startColumn": 18
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepMustIncreaseByOneFromOne/StepNotPresentOnAllLocations.sarif"
+ },
+ "message": "Analyzing 'StepNotPresentOnAllLocations.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T13:54:49.704Z"
+ }
+ ],
+ "rules": {
+ "SV0009": {
+ "id": "SV0009",
+ "name": "StepMustIncreaseByOneFromOne",
+ "shortDescription": "If the \"step\" property is used on any annotatedCodeLocation in a code flow, then it must be present for every location in the code flow, its value must be 1 for the first location, and its value must increase by 1 for each succeeding location.",
+ "fullDescription": "If the \"step\" property is used on any annotatedCodeLocation in a code flow, then it must be present for every location in the code flow, its value must be 1 for the first location, and its value must increase by 1 for each succeeding location.",
+ "messageFormats": {
+ "StepNotPresentOnAllLocations": "In \"{0}\", at \"{1}\", the \"step\" property is absent. The \"step\" property is present on some but not all locations in this code flow. If the \"step\" property is used on any location in a code flow, it must be present on every location in that code flow."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepMustIncreaseByOneFromOne/StepNotPresentOnAllLocations.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\StepMustIncreaseByOneFromOne\\StepNotPresentOnAllLocations.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\StepMustIncreaseByOneFromOne\\StepNotPresentOnAllLocations_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T13:54:49.625Z",
+ "endTime": "2016-08-29T13:54:50.000Z",
+ "processId": 8808,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/ValidSteps.sarif b/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/ValidSteps.sarif
new file mode 100644
index 000000000..a2d0b6739
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/ValidSteps.sarif
@@ -0,0 +1,64 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "message": "Result message.",
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "step": 1,
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ },
+ {
+ "step": 2,
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 43,
+ "startColumn": 12
+ }
+ }
+ },
+ {
+ "step": 3,
+ "physicalLocation": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 44,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/ValidSteps_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/ValidSteps_Expected.sarif
new file mode 100644
index 000000000..7eae808aa
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/StepValuesMustFormOneBasedSequence/ValidSteps_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "90d42f85-74c7-4301-bc4b-2dbf98453f46",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepMustIncreaseByOneFromOne/ValidSteps.sarif"
+ },
+ "message": "Analyzing 'ValidSteps.sarif'...",
+ "level": "note",
+ "time": "2016-08-29T13:40:25.242Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/StepMustIncreaseByOneFromOne/ValidSteps.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\StepMustIncreaseByOneFromOne\\ValidSteps.sarif -o G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\StepMustIncreaseByOneFromOne\\ValidSteps_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-29T13:40:25.054Z",
+ "endTime": "2016-08-29T13:40:25.554Z",
+ "processId": 8500,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/SyntaxError.sarif b/src/SarifCli.FunctionalTests/TestData/SyntaxError.sarif
new file mode 100644
index 000000000..d2c0ab785
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/SyntaxError.sarif
@@ -0,0 +1,18 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ ,
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "rules": {
+ "TST0001": {
+ "id": "TST0001",
+ "helpUri": "http://www.example.com/rules/tst0001.html"
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/SyntaxError_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/SyntaxError_Expected.sarif
new file mode 100644
index 000000000..d7690e59a
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/SyntaxError_Expected.sarif
@@ -0,0 +1,81 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "b7cd6b83-2433-4b4e-80c4-d04cc65de2dd",
+ "tool": {
+ "name": "Sarif",
+ "fullName": "Sarif 1.5.27.0",
+ "version": "1.5.27.0",
+ "semanticVersion": "1.5.27",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Object model and utilities for reading and writing files in the SARIF format.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "JS0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "default",
+ "arguments": [
+ "$schema",
+ "Invalid property identifier character: ,. Path '$schema', line 3, position 3."
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Debug/TestData/SyntaxError.sarif",
+ "region": {
+ "startLine": 3,
+ "startColumn": 3
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Debug/TestData/SyntaxError.sarif"
+ },
+ "message": "Analyzing 'SyntaxError.sarif'...",
+ "level": "note",
+ "time": "2016-08-27T13:42:14.981Z"
+ }
+ ],
+ "rules": {
+ "JS0001": {
+ "id": "JS0001",
+ "name": "SyntaxError",
+ "fullDescription": "The schema is not a valid JSON document.",
+ "messageFormats": {
+ "default": "at \"{0}\": JSON syntax error: {1}"
+ },
+ "defaultLevel": "error"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Debug/TestData/SyntaxError.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"C:\\PROGRAM FILES (X86)\\MICROSOFT VISUAL STUDIO 14.0\\COMMON7\\IDE\\COMMONEXTENSIONS\\MICROSOFT\\TESTWINDOW\\vstest.executionengine.x86.exe\" /parentProcessId 13468 ",
+ "startTime": "2016-08-27T13:42:14.503Z",
+ "endTime": "2016-08-27T13:42:15.495Z",
+ "processId": 13476,
+ "fileName": "C:\\Users\\lgolding\\AppData\\Local\\Temp\\25c745bf-a38e-4299-bc25-51a57f4bb617\\25c745bf-a38e-4299-bc25-51a57f4bb617\\assembly\\dl3\\54e8f1c0\\00b7775a_e6e9d101\\Sarif.dll",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli.FunctionalTests\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidHelpUriInRule.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidHelpUriInRule.sarif
new file mode 100644
index 000000000..a6f734fb3
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidHelpUriInRule.sarif
@@ -0,0 +1,17 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "rules": {
+ "TST0001": {
+ "id": "TST0001",
+ "helpUri": "ht%tp://www.example.com/rules/tst0001.html"
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidHelpUriInRule_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidHelpUriInRule_Expected.sarif
new file mode 100644
index 000000000..b8e43fea8
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidHelpUriInRule_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "3fad9fad-f16a-439c-8048-a477db9af638",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0003",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "InvalidHelpUriInRule.sarif",
+ "/runs/0/rules/TST0001/helpUri",
+ "ht%tp://www.example.com/rules/tst0001.html"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidHelpUriInRule.sarif",
+ "region": {
+ "startLine": 12,
+ "startColumn": 66
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidHelpUriInRule.sarif"
+ },
+ "message": "Analyzing 'InvalidHelpUriInRule.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T21:16:18.879Z"
+ }
+ ],
+ "rules": {
+ "SV0003": {
+ "id": "SV0003",
+ "name": "UrisMustBeValid",
+ "shortDescription": "Specify a valid URI reference for every URI-valued property.",
+ "fullDescription": "Specify a valid URI reference for every URI-valued property.",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the string \"{2}\" is not a valid URI reference."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidHelpUriInRule.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UrisMustBeValid\\InvalidHelpUriInRule.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\InvalidHelpUriInRule_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T21:16:18.796Z",
+ "endTime": "2016-08-26T21:16:19.128Z",
+ "processId": 14160,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInAnalysisTarget.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInAnalysisTarget.sarif
new file mode 100644
index 000000000..55df88942
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInAnalysisTarget.sarif
@@ -0,0 +1,30 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "fi&le:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInAnalysisTarget_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInAnalysisTarget_Expected.sarif
new file mode 100644
index 000000000..d612a82e6
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInAnalysisTarget_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "8212c13f-8154-4ead-b761-a3172b41f6ae",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0003",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "InvalidUriInAnalysisTarget.sarif",
+ "/runs/0/results/0/locations/0/analysisTarget/uri",
+ "fi&le:///c:/src/file.c"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInAnalysisTarget.sarif",
+ "region": {
+ "startLine": 19,
+ "startColumn": 48
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInAnalysisTarget.sarif"
+ },
+ "message": "Analyzing 'InvalidUriInAnalysisTarget.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T16:59:59.658Z"
+ }
+ ],
+ "rules": {
+ "SV0003": {
+ "id": "SV0003",
+ "name": "UrisMustBeValid",
+ "shortDescription": "Specify a valid URI reference for every URI-valued property.",
+ "fullDescription": "Specify a valid URI reference for every URI-valued property.",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the string \"{2}\" is not a valid URI reference."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInAnalysisTarget.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UrisMustBeValid\\InvalidUriInAnalysisTarget.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\InvalidUriInAnalysisTarget_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T16:59:59.574Z",
+ "endTime": "2016-08-26T16:59:59.912Z",
+ "processId": 4908,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInCodeFlowLocation.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInCodeFlowLocation.sarif
new file mode 100644
index 000000000..bfdd73847
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInCodeFlowLocation.sarif
@@ -0,0 +1,45 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "physicalLocation": {
+ "uri": "fi%le:///c:/src/file.c",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInCodeFlowLocation_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInCodeFlowLocation_Expected.sarif
new file mode 100644
index 000000000..1ef6c9942
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInCodeFlowLocation_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "ea65bf9d-f012-4a0e-84e6-5cbe1d57c6d7",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0003",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "InvalidUriInCodeFlowLocation.sarif",
+ "/runs/0/results/0/codeFlows/0/locations/0/physicalLocation/uri",
+ "fi%le:///c:/src/file.c"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInCodeFlowLocation.sarif",
+ "region": {
+ "startLine": 31,
+ "startColumn": 52
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInCodeFlowLocation.sarif"
+ },
+ "message": "Analyzing 'InvalidUriInCodeFlowLocation.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T17:05:59.382Z"
+ }
+ ],
+ "rules": {
+ "SV0003": {
+ "id": "SV0003",
+ "name": "UrisMustBeValid",
+ "shortDescription": "Specify a valid URI reference for every URI-valued property.",
+ "fullDescription": "Specify a valid URI reference for every URI-valued property.",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the string \"{2}\" is not a valid URI reference."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInCodeFlowLocation.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UrisMustBeValid\\InvalidUriInCodeFlowLocation.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\InvalidUriInCodeFlowLocation_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T17:05:59.300Z",
+ "endTime": "2016-08-26T17:05:59.638Z",
+ "processId": 14512,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInConfigurationNotification.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInConfigurationNotification.sarif
new file mode 100644
index 000000000..4c0aa43a2
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInConfigurationNotification.sarif
@@ -0,0 +1,20 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [],
+ "configurationNotifications": [
+ {
+ "message": "The message",
+ "physicalLocation": {
+ "uri": "fi%le:///c:/src/file.c"
+ }
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInConfigurationNotification_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInConfigurationNotification_Expected.sarif
new file mode 100644
index 000000000..3966c5ae6
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInConfigurationNotification_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "89ae6a35-e89e-4b17-97d0-4ada36a8f54a",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0003",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "InvalidUriInConfigurationNotification.sarif",
+ "/runs/0/configurationNotifications/0/physicalLocation/uri",
+ "fi%le:///c:/src/file.c"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInConfigurationNotification.sarif",
+ "region": {
+ "startLine": 14,
+ "startColumn": 44
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInConfigurationNotification.sarif"
+ },
+ "message": "Analyzing 'InvalidUriInConfigurationNotification.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T17:08:28.958Z"
+ }
+ ],
+ "rules": {
+ "SV0003": {
+ "id": "SV0003",
+ "name": "UrisMustBeValid",
+ "shortDescription": "Specify a valid URI reference for every URI-valued property.",
+ "fullDescription": "Specify a valid URI reference for every URI-valued property.",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the string \"{2}\" is not a valid URI reference."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInConfigurationNotification.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UrisMustBeValid\\InvalidUriInConfigurationNotification.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\InvalidUriInConfigurationNotification_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T17:08:28.875Z",
+ "endTime": "2016-08-26T17:08:29.206Z",
+ "processId": 11716,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFileChange.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFileChange.sarif
new file mode 100644
index 000000000..58dc44f4e
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFileChange.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "fixes": [
+ {
+ "description": "The description",
+ "fileChanges": [
+ {
+ "uri": "fi%le:///c:/src/file.c",
+ "replacements": [
+ {
+ "offset": 109,
+ "insertedBytes": "PSBudWxs"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFileChange_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFileChange_Expected.sarif
new file mode 100644
index 000000000..13b3d314c
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFileChange_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "74014d14-07b1-4591-a7c3-bbde7e63d548",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0003",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "InvalidUriInFileChange.sarif",
+ "/runs/0/results/0/fixes/0/fileChanges/0/uri",
+ "fi%le:///c:/src/file.c"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFileChange.sarif",
+ "region": {
+ "startLine": 31,
+ "startColumn": 50
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFileChange.sarif"
+ },
+ "message": "Analyzing 'InvalidUriInFileChange.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T18:01:47.806Z"
+ }
+ ],
+ "rules": {
+ "SV0003": {
+ "id": "SV0003",
+ "name": "UrisMustBeValid",
+ "shortDescription": "Specify a valid URI reference for every URI-valued property.",
+ "fullDescription": "Specify a valid URI reference for every URI-valued property.",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the string \"{2}\" is not a valid URI reference."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFileChange.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UrisMustBeValid\\InvalidUriInFileChange.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\InvalidUriInFileChange_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T18:01:47.628Z",
+ "endTime": "2016-08-26T18:01:48.114Z",
+ "processId": 17640,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFilePropertyName.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFilePropertyName.sarif
new file mode 100644
index 000000000..a647133ac
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFilePropertyName.sarif
@@ -0,0 +1,35 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "files": {
+ "fi%le:///c:/src/file.c": {
+ "mimeType": "text/x-c"
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFilePropertyName_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFilePropertyName_Expected.sarif
new file mode 100644
index 000000000..bd2cd12e3
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFilePropertyName_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "72cf3faa-9108-45a4-ae8c-1f04cab979b0",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0003",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "InvalidUriInFilePropertyName.sarif",
+ "/runs/0/files/fi%le:~1~1~1c:~1src~1file.c",
+ "fi%le:///c:/src/file.c"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFilePropertyName.sarif",
+ "region": {
+ "startLine": 29,
+ "startColumn": 36
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFilePropertyName.sarif"
+ },
+ "message": "Analyzing 'InvalidUriInFilePropertyName.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T18:13:11.879Z"
+ }
+ ],
+ "rules": {
+ "SV0003": {
+ "id": "SV0003",
+ "name": "UrisMustBeValid",
+ "shortDescription": "Specify a valid URI reference for every URI-valued property.",
+ "fullDescription": "Specify a valid URI reference for every URI-valued property.",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the string \"{2}\" is not a valid URI reference."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInFilePropertyName.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UrisMustBeValid\\InvalidUriInFilePropertyName.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\InvalidUriInFileCPropertyName_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T18:13:11.795Z",
+ "endTime": "2016-08-26T18:13:12.146Z",
+ "processId": 18768,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInRelatedLocation.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInRelatedLocation.sarif
new file mode 100644
index 000000000..8892b4672
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInRelatedLocation.sarif
@@ -0,0 +1,37 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "relatedLocations": [
+ {
+ "physicalLocation": {
+ "uri": "fi%le:///c:/src/other.other"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInRelatedLocation_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInRelatedLocation_Expected.sarif
new file mode 100644
index 000000000..cf90ae6df
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInRelatedLocation_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "01986463-f0ce-4a1f-8616-ba473d5b6248",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0003",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "InvalidUriInRelatedLocation.sarif",
+ "/runs/0/results/0/relatedLocations/0/physicalLocation/uri",
+ "fi%le:///c:/src/other.other"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInRelatedLocation.sarif",
+ "region": {
+ "startLine": 29,
+ "startColumn": 53
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInRelatedLocation.sarif"
+ },
+ "message": "Analyzing 'InvalidUriInRelatedLocation.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T18:15:52.051Z"
+ }
+ ],
+ "rules": {
+ "SV0003": {
+ "id": "SV0003",
+ "name": "UrisMustBeValid",
+ "shortDescription": "Specify a valid URI reference for every URI-valued property.",
+ "fullDescription": "Specify a valid URI reference for every URI-valued property.",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the string \"{2}\" is not a valid URI reference."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInRelatedLocation.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UrisMustBeValid\\InvalidUriInRelatedLocation.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\InvalidUriInRelatedLocation_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T18:15:51.968Z",
+ "endTime": "2016-08-26T18:15:52.305Z",
+ "processId": 11120,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInResultFile.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInResultFile.sarif
new file mode 100644
index 000000000..274dcbb62
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInResultFile.sarif
@@ -0,0 +1,30 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "resultFile": {
+ "uri": "fi&le:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInResultFile_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInResultFile_Expected.sarif
new file mode 100644
index 000000000..02c7bc110
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInResultFile_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "6179d101-91a8-480c-ac93-95a95556e39b",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0003",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "InvalidUriInResultFile.sarif",
+ "/runs/0/results/0/locations/0/resultFile/uri",
+ "fi&le:///c:/src/file.c"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInResultFile.sarif",
+ "region": {
+ "startLine": 19,
+ "startColumn": 48
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInResultFile.sarif"
+ },
+ "message": "Analyzing 'InvalidUriInResultFile.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T17:02:56.314Z"
+ }
+ ],
+ "rules": {
+ "SV0003": {
+ "id": "SV0003",
+ "name": "UrisMustBeValid",
+ "shortDescription": "Specify a valid URI reference for every URI-valued property.",
+ "fullDescription": "Specify a valid URI reference for every URI-valued property.",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the string \"{2}\" is not a valid URI reference."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInResultFile.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UrisMustBeValid\\InvalidUriInResultFile.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\InvalidUriInResultFile_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T17:02:56.230Z",
+ "endTime": "2016-08-26T17:02:56.569Z",
+ "processId": 11052,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInStackFrame.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInStackFrame.sarif
new file mode 100644
index 000000000..633d85177
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInStackFrame.sarif
@@ -0,0 +1,41 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "stacks": [
+ {
+ "frames": [
+ {
+ "uri": "fi%le:///c:/src/file.cs",
+ "fullyQualifiedLogicalName": "func",
+ "line": 23
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInStackFrame_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInStackFrame_Expected.sarif
new file mode 100644
index 000000000..b2739b257
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInStackFrame_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "89a247ca-e1ea-4820-9d00-b5635e5234c6",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0003",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "InvalidUriInStackFrame.sarif",
+ "/runs/0/results/0/stacks/0/frames/0/uri",
+ "fi%le:///c:/src/file.cs"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInStackFrame.sarif",
+ "region": {
+ "startLine": 30,
+ "startColumn": 51
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInStackFrame.sarif"
+ },
+ "message": "Analyzing 'InvalidUriInStackFrame.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T18:18:25.351Z"
+ }
+ ],
+ "rules": {
+ "SV0003": {
+ "id": "SV0003",
+ "name": "UrisMustBeValid",
+ "shortDescription": "Specify a valid URI reference for every URI-valued property.",
+ "fullDescription": "Specify a valid URI reference for every URI-valued property.",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the string \"{2}\" is not a valid URI reference."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInStackFrame.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UrisMustBeValid\\InvalidUriInStackFrame.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\InvalidUriInStackFrame_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T18:18:25.269Z",
+ "endTime": "2016-08-26T18:18:25.619Z",
+ "processId": 11436,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInToolNotification.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInToolNotification.sarif
new file mode 100644
index 000000000..a5a0c3941
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInToolNotification.sarif
@@ -0,0 +1,20 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [],
+ "toolNotifications": [
+ {
+ "message": "The message",
+ "physicalLocation": {
+ "uri": "fi%le:///c:/src/file.c"
+ }
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInToolNotification_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInToolNotification_Expected.sarif
new file mode 100644
index 000000000..3109dd248
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInToolNotification_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "5f5f37ee-fa60-41c9-a266-4c60dfbc9c25",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0003",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "InvalidUriInToolNotification.sarif",
+ "/runs/0/toolNotifications/0/physicalLocation/uri",
+ "fi%le:///c:/src/file.c"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInToolNotification.sarif",
+ "region": {
+ "startLine": 14,
+ "startColumn": 44
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInToolNotification.sarif"
+ },
+ "message": "Analyzing 'InvalidUriInToolNotification.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T18:20:49.926Z"
+ }
+ ],
+ "rules": {
+ "SV0003": {
+ "id": "SV0003",
+ "name": "UrisMustBeValid",
+ "shortDescription": "Specify a valid URI reference for every URI-valued property.",
+ "fullDescription": "Specify a valid URI reference for every URI-valued property.",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the string \"{2}\" is not a valid URI reference."
+ },
+ "defaultLevel": "error",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/InvalidUriInToolNotification.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UrisMustBeValid\\InvalidUriInToolNotification.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\InvalidUriInToolNotification_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T18:20:49.844Z",
+ "endTime": "2016-08-26T18:20:50.180Z",
+ "processId": 7292,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/ValidUris.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/ValidUris.sarif
new file mode 100644
index 000000000..7db174266
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/ValidUris.sarif
@@ -0,0 +1,91 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/src/file.c",
+ "region": {
+ "startLine": 1
+ }
+ },
+ "resultFile": {
+ "uri": "file:///c:/src/file2.c",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "relatedLocations": [
+ {
+ "physicalLocation": {
+ "uri": "file:///c:/src/file3.c"
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "physicalLocation": {
+ "uri": "file:///c:/src/file1.c"
+ }
+ }
+ ]
+ }
+ ],
+ "stacks": [
+ {
+ "frames": [
+ {
+ "fullyQualifiedLogicalName": "func",
+ "uri": "file:///c:/src/file1.c"
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "configurationNotifications": [
+ {
+ "message": "Message",
+ "physicalLocation": {
+ "uri": "file:///c:/src/file1.c"
+ }
+ }
+ ],
+ "toolNotifications": [
+ {
+ "message": "Message",
+ "physicalLocation": {
+ "uri": "file:///c:/src/file1.c"
+ }
+ }
+ ],
+ "files": {
+ "file:///c:/src/file1.c": {
+ "uri": "file:///c:/src/file1.c"
+ }
+ },
+ "rules": {
+ "TST0001": {
+ "id": "TST0001",
+ "helpUri": "http://www.example.com/rules/tst0001.html"
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/ValidUris_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/ValidUris_Expected.sarif
new file mode 100644
index 000000000..373a18b34
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/ValidUris_Expected.sarif
@@ -0,0 +1,46 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "bf97329b-d388-4956-865a-e33b522df6d4",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/ValidUris.sarif"
+ },
+ "message": "Analyzing 'ValidUris.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T21:08:15.619Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UrisMustBeValid/ValidUris.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UrisMustBeValid\\ValidUris.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\ValidUris_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T21:08:15.536Z",
+ "endTime": "2016-08-26T21:08:15.878Z",
+ "processId": 13060,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInAnalysisTargetUri.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInAnalysisTargetUri.sarif
new file mode 100644
index 000000000..5f7dd987d
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInAnalysisTargetUri.sarif
@@ -0,0 +1,40 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/bin/myApp.appx#js/minified.js",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "files": {
+ "file:///c:/bin/myApp.appx": {
+ "mimeType": "application/vns.ms-appx"
+ },
+ "file:///c:/bin/myApp.appx#/js/minified.js": {
+ "uri": "/js/minified.js",
+ "parentKey": "file:///c:/bin/myApp.appx",
+ "mimeType": "text/javascript"
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInAnalysisTargetUri_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInAnalysisTargetUri_Expected.sarif
new file mode 100644
index 000000000..f7041def7
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInAnalysisTargetUri_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "0f3d4fac-c5a9-4008-82d8-5ca2005ac157",
+ "tool": {
+ "name": "Sarif",
+ "fullName": "Sarif 1.5.27.0",
+ "version": "1.5.27.0",
+ "semanticVersion": "1.5.27",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Object model and utilities for reading and writing files in the SARIF format.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0002",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "NestedFileUriFragmentIsRelativeInAnalysisTargetUri.sarif",
+ "/runs/0/results/0/locations/0/analysisTarget/uri",
+ "file:///c:/bin/myApp.appx#js/minified.js"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Release/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInAnalysisTargetUri.sarif",
+ "region": {
+ "startLine": 19,
+ "startColumn": 66
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Release/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInAnalysisTargetUri.sarif"
+ },
+ "message": "Analyzing 'NestedFileUriFragmentIsRelativeInAnalysisTargetUri.sarif'...",
+ "level": "note",
+ "time": "2016-08-25T21:26:42.049Z"
+ }
+ ],
+ "rules": {
+ "SV0002": {
+ "id": "SV0002",
+ "name": "UseAbsolutePathsForNestedFileUriFragments",
+ "shortDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path.",
+ "fullDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path. That is, begin the with a forward slash, for example \"file:///C:/bin/MyApp.zip#/images/grape.jpg\".",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the fragment portion of the URI \"{2}\", which specifies the location of a nested file with respect to its parent, does not begin with a forward slash."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Release/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInAnalysisTargetUri.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "src\\packages\\xunit.runner.console.2.1.0\\tools\\xunit.console.x86.exe bld\\bin\\SarifCli.FunctionalTests\\AnyCPU_Release\\Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.dll",
+ "startTime": "2016-08-25T21:26:42.049Z",
+ "endTime": "2016-08-25T21:26:42.051Z",
+ "processId": 8856,
+ "fileName": "C:\\Users\\lgolding\\AppData\\Local\\Temp\\108c7547-93f9-41d7-9466-6cf860afad5d\\108c7547-93f9-41d7-9466-6cf860afad5d\\assembly\\dl3\\660ee2c2\\00b7775a_e6e9d101\\Sarif.dll",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli.FunctionalTests\\AnyCPU_Release"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInCodeFlowLocationUri.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInCodeFlowLocationUri.sarif
new file mode 100644
index 000000000..dcefc123f
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInCodeFlowLocationUri.sarif
@@ -0,0 +1,60 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/bin/myApp.appx#/js/minified.js",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "codeFlows": [
+ {
+ "locations": [
+ {
+ "physicalLocation": {
+ "uri": "file:///c:/bin/myApp.appx#js/minified.js",
+ "region": {
+ "startLine": 42,
+ "startColumn": 12
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "files": {
+ "file:///c:/bin/myApp.appx": {
+ "mimeType": "application/vns.ms-appx"
+ },
+ "file:///c:/bin/myApp.appx#/js/minified.js": {
+ "uri": "/js/minified.js",
+ "parentKey": "file:///c:/bin/myApp.appx",
+ "mimeType": "text/javascript"
+ },
+ "file:///c:/bin/myApp.appx#/js/other.js": {
+ "uri": "/js/other.js",
+ "parentKey": "file:///c:/bin/myApp.appx",
+ "mimeType": "text/javascript"
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInCodeFlowLocationUri_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInCodeFlowLocationUri_Expected.sarif
new file mode 100644
index 000000000..f003af1c3
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInCodeFlowLocationUri_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "391375f4-09bc-4f6a-b09a-0c2317759901",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0002",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "NestedFileUriFragmentIsRelativeInCodeFlowLocationUri.sarif",
+ "/runs/0/results/0/codeFlows/0/locations/0/physicalLocation/uri",
+ "file:///c:/bin/myApp.appx#js/minified.js"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInCodeFlowLocationUri.sarif",
+ "region": {
+ "startLine": 31,
+ "startColumn": 70
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInCodeFlowLocationUri.sarif"
+ },
+ "message": "Analyzing 'NestedFileUriFragmentIsRelativeInCodeFlowLocationUri.sarif'...",
+ "level": "note",
+ "time": "2016-08-25T22:51:53.317Z"
+ }
+ ],
+ "rules": {
+ "SV0002": {
+ "id": "SV0002",
+ "name": "UseAbsolutePathsForNestedFileUriFragments",
+ "shortDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path.",
+ "fullDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path. That is, begin the with a forward slash, for example \"file:///C:/bin/MyApp.zip#/images/grape.jpg\".",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the fragment portion of the URI \"{2}\", which specifies the location of a nested file with respect to its parent, does not begin with a forward slash."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInCodeFlowLocationUri.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UseAbsolutePathsForNestedFileUriFragments\\NestedFileUriFragmentIsRelativeInCodeFlowLocationUri.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\NestedFileUriFragmentIsRelativeInCodeFlowLocationUri_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-25T22:51:53.238Z",
+ "endTime": "2016-08-25T22:51:53.582Z",
+ "processId": 13832,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInConfigurationNotificationUri.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInConfigurationNotificationUri.sarif
new file mode 100644
index 000000000..0756df540
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInConfigurationNotificationUri.sarif
@@ -0,0 +1,20 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [],
+ "configurationNotifications": [
+ {
+ "message": "The message",
+ "physicalLocation": {
+ "uri": "file:///c:/bin/myApp.appx#js/minified.js"
+ }
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInConfigurationNotificationUri_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInConfigurationNotificationUri_Expected.sarif
new file mode 100644
index 000000000..13094df50
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInConfigurationNotificationUri_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "6812f90a-ff4c-403d-8547-c9f621df9fea",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0002",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "NestedFileUriFragmentIsRelativeInConfigurationNotificationUri.sarif",
+ "/runs/0/configurationNotifications/0/physicalLocation/uri",
+ "file:///c:/bin/myApp.appx#js/minified.js"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInConfigurationNotificationUri.sarif",
+ "region": {
+ "startLine": 14,
+ "startColumn": 62
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInConfigurationNotificationUri.sarif"
+ },
+ "message": "Analyzing 'NestedFileUriFragmentIsRelativeInConfigurationNotificationUri.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T00:19:23.582Z"
+ }
+ ],
+ "rules": {
+ "SV0002": {
+ "id": "SV0002",
+ "name": "UseAbsolutePathsForNestedFileUriFragments",
+ "shortDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path.",
+ "fullDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path. That is, begin the with a forward slash, for example \"file:///C:/bin/MyApp.zip#/images/grape.jpg\".",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the fragment portion of the URI \"{2}\", which specifies the location of a nested file with respect to its parent, does not begin with a forward slash."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInConfigurationNotificationUri.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UseAbsolutePathsForNestedFileUriFragments\\NestedFileUriFragmentIsRelativeInConfigurationNotificationUri.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\NestedFileUriFragmentIsRelativeInConfigurationNotificationUri_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T00:19:23.499Z",
+ "endTime": "2016-08-26T00:19:23.840Z",
+ "processId": 10620,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileChangeUri.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileChangeUri.sarif
new file mode 100644
index 000000000..f8b104c98
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileChangeUri.sarif
@@ -0,0 +1,57 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/bin/myApp.appx#/js/minified.js",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "fixes": [
+ {
+ "description": "The description",
+ "fileChanges": [
+ {
+ "uri": "file:///c:/bin/myApp.appx#js/minified.js",
+ "replacements": [
+ {
+ "offset": 109,
+ "insertedBytes": "PSBudWxs"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+
+ }
+ ],
+ "files": {
+ "file:///c:/bin/myApp.appx": {
+ "mimeType": "application/vns.ms-appx"
+ },
+ "file:///c:/bin/myApp.appx#/js/minified.js": {
+ "uri": "/js/minified.js",
+ "parentKey": "file:///c:/bin/myApp.appx",
+ "mimeType": "text/javascript"
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileChangeUri_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileChangeUri_Expected.sarif
new file mode 100644
index 000000000..ddbe41640
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileChangeUri_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "9f4205fd-3182-44d7-acbb-c97055bf567d",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0002",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "NestedFileUriFragmentIsRelativeInFileChangeUri.sarif",
+ "/runs/0/results/0/fixes/0/fileChanges/0/uri",
+ "file:///c:/bin/myApp.appx#js/minified.js"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileChangeUri.sarif",
+ "region": {
+ "startLine": 31,
+ "startColumn": 68
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileChangeUri.sarif"
+ },
+ "message": "Analyzing 'NestedFileUriFragmentIsRelativeInFileChangeUri.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T15:36:38.827Z"
+ }
+ ],
+ "rules": {
+ "SV0002": {
+ "id": "SV0002",
+ "name": "UseAbsolutePathsForNestedFileUriFragments",
+ "shortDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path.",
+ "fullDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path. That is, begin the with a forward slash, for example \"file:///C:/bin/MyApp.zip#/images/grape.jpg\".",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the fragment portion of the URI \"{2}\", which specifies the location of a nested file with respect to its parent, does not begin with a forward slash."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileChangeUri.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UseAbsolutePathsForNestedFileUriFragments\\NestedFileUriFragmentIsRelativeInFileChangeUri.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\NestedFileUriFragmentIsRelativeInFileChangeUri_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T15:36:38.743Z",
+ "endTime": "2016-08-26T15:36:39.109Z",
+ "processId": 12976,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName.sarif
new file mode 100644
index 000000000..e9c156131
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName.sarif
@@ -0,0 +1,40 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/bin/myApp.appx#/js/minified.js",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "files": {
+ "file:///c:/bin/myApp.appx": {
+ "mimeType": "application/vns.ms-appx"
+ },
+ "file:///c:/bin/myApp.appx#js/minified.js": {
+ "uri": "/js/minified.js",
+ "parentKey": "file:///c:/bin/myApp.appx",
+ "mimeType": "text/javascript"
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName_Expected.sarif
new file mode 100644
index 000000000..64ee35e0e
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "9ae11e51-d960-4aca-aba8-574b056e9588",
+ "tool": {
+ "name": "Sarif",
+ "fullName": "Sarif 1.5.27.0",
+ "version": "1.5.27.0",
+ "semanticVersion": "1.5.27",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Object model and utilities for reading and writing files in the SARIF format.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0002",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "NestedFileUriFragmentIsRelativeInFilePropertyName.sarif",
+ "/runs/0/files/file:~1~1~1c:~1bin~1myApp.appx#js~1minified.js",
+ "file:///c:/bin/myApp.appx#js/minified.js"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Release/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName.sarif",
+ "region": {
+ "startLine": 32,
+ "startColumn": 54
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Release/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName.sarif"
+ },
+ "message": "Analyzing 'NestedFileUriFragmentIsRelativeInFilePropertyName.sarif'...",
+ "level": "note",
+ "time": "2016-08-25T21:26:42.061Z"
+ }
+ ],
+ "rules": {
+ "SV0002": {
+ "id": "SV0002",
+ "name": "UseAbsolutePathsForNestedFileUriFragments",
+ "shortDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path.",
+ "fullDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path. That is, begin the with a forward slash, for example \"file:///C:/bin/MyApp.zip#/images/grape.jpg\".",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the fragment portion of the URI \"{2}\", which specifies the location of a nested file with respect to its parent, does not begin with a forward slash."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Release/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFilePropertyName.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "src\\packages\\xunit.runner.console.2.1.0\\tools\\xunit.console.x86.exe bld\\bin\\SarifCli.FunctionalTests\\AnyCPU_Release\\Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.dll",
+ "startTime": "2016-08-25T21:26:42.061Z",
+ "endTime": "2016-08-25T21:26:42.062Z",
+ "processId": 8856,
+ "fileName": "C:\\Users\\lgolding\\AppData\\Local\\Temp\\108c7547-93f9-41d7-9466-6cf860afad5d\\108c7547-93f9-41d7-9466-6cf860afad5d\\assembly\\dl3\\660ee2c2\\00b7775a_e6e9d101\\Sarif.dll",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli.FunctionalTests\\AnyCPU_Release"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileUri.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileUri.sarif
new file mode 100644
index 000000000..d64dc96c7
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInFileUri.sarif
@@ -0,0 +1,54 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "e7d5cf38-c160-4bf9-aed1-e84ad6849df3",
+ "tool": {
+ "name": "ModernCop",
+ "fullName": "mod50 7.0.7000.0",
+ "version": "7.0.7000.0",
+ "semanticVersion": "7.0.7000",
+ "fileVersion": "7.0.20811.0",
+ "language": "en-US",
+ "properties": {
+ "CompanyName": "Microsoft Corporation"
+ }
+ },
+ "results": [
+ {
+ "ruleKey": "M1003.DoNotShipObfuscatedCode",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/bin/myBundle.appxBundle#/myApp.appx/js/minified.js",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "files": {
+ "file:///c:/bin/myBundle.appxBundle": {
+ "mimeType": "application/vns.ms-appxBundle"
+ },
+ "file:///c:/bin/myBundle.appxBundle#/myApp.appx": {
+ "uri": "/myApp.appx",
+ "parentKey": "file:///c:/bin/myBundle.appxBundle",
+ "mimeType": "application/vns.ms-appx"
+ },
+ "file:///c:/bin/myBundle.appxBundle#/myApp.appx/js/minified.js": {
+ "uri": "js/minified.js",
+ "parentKey": "file:///c:/bin/myBundle.appxBundle#/myApp.appx",
+ "mimeType": "text/javascript"
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInRelatedLocationUri.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInRelatedLocationUri.sarif
new file mode 100644
index 000000000..bc30f0a7f
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInRelatedLocationUri.sarif
@@ -0,0 +1,52 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/bin/myApp.appx#/js/minified.js",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "relatedLocations": [
+ {
+ "physicalLocation": {
+ "uri": "file:///c:/bin/myApp.appx#js/other.js"
+ }
+ }
+ ]
+ }
+ ],
+ "files": {
+ "file:///c:/bin/myApp.appx": {
+ "mimeType": "application/vns.ms-appx"
+ },
+ "file:///c:/bin/myApp.appx#/js/minified.js": {
+ "uri": "/js/minified.js",
+ "parentKey": "file:///c:/bin/myApp.appx",
+ "mimeType": "text/javascript"
+ },
+ "file:///c:/bin/myApp.appx#/js/other.js": {
+ "uri": "/js/other.js",
+ "parentKey": "file:///c:/bin/myApp.appx",
+ "mimeType": "text/javascript"
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInRelatedLocationUri_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInRelatedLocationUri_Expected.sarif
new file mode 100644
index 000000000..8f97bb858
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInRelatedLocationUri_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "17727053-b68e-4e9c-a67a-62c97d59b4e0",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0002",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "NestedFileUriFragmentIsRelativeInRelatedLocationUri.sarif",
+ "/runs/0/results/0/relatedLocations/0/physicalLocation/uri",
+ "file:///c:/bin/myApp.appx#js/other.js"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInRelatedLocationUri.sarif",
+ "region": {
+ "startLine": 29,
+ "startColumn": 63
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInRelatedLocationUri.sarif"
+ },
+ "message": "Analyzing 'NestedFileUriFragmentIsRelativeInRelatedLocationUri.sarif'...",
+ "level": "note",
+ "time": "2016-08-25T22:31:05.958Z"
+ }
+ ],
+ "rules": {
+ "SV0002": {
+ "id": "SV0002",
+ "name": "UseAbsolutePathsForNestedFileUriFragments",
+ "shortDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path.",
+ "fullDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path. That is, begin the with a forward slash, for example \"file:///C:/bin/MyApp.zip#/images/grape.jpg\".",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the fragment portion of the URI \"{2}\", which specifies the location of a nested file with respect to its parent, does not begin with a forward slash."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInRelatedLocationUri.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UseAbsolutePathsForNestedFileUriFragments\\NestedFileUriFragmentIsRelativeInRelatedLocationUri.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\NestedFileUriFragmentIsRelativeInRelatedLocationUri_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-25T22:31:05.864Z",
+ "endTime": "2016-08-25T22:31:06.239Z",
+ "processId": 14368,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInResultFileUri.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInResultFileUri.sarif
new file mode 100644
index 000000000..b87cefa6a
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInResultFileUri.sarif
@@ -0,0 +1,40 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "resultFile": {
+ "uri": "file:///c:/bin/myApp.appx#js/minified.js",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "files": {
+ "file:///c:/bin/myApp.appx": {
+ "mimeType": "application/vns.ms-appx"
+ },
+ "file:///c:/bin/myApp.appx#/js/minified.js": {
+ "uri": "/js/minified.js",
+ "parentKey": "file:///c:/bin/myApp.appx",
+ "mimeType": "text/javascript"
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInResultFileUri_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInResultFileUri_Expected.sarif
new file mode 100644
index 000000000..b5e0540c5
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInResultFileUri_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "67f66031-c56f-4e01-9914-122dc31b55db",
+ "tool": {
+ "name": "Sarif",
+ "fullName": "Sarif 1.5.27.0",
+ "version": "1.5.27.0",
+ "semanticVersion": "1.5.27",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Object model and utilities for reading and writing files in the SARIF format.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0002",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "NestedFileUriFragmentIsRelativeInResultFileUri.sarif",
+ "/runs/0/results/0/locations/0/resultFile/uri",
+ "file:///c:/bin/myApp.appx#js/minified.js"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Release/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInResultFileUri.sarif",
+ "region": {
+ "startLine": 19,
+ "startColumn": 66
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Release/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInResultFileUri.sarif"
+ },
+ "message": "Analyzing 'NestedFileUriFragmentIsRelativeInResultFileUri.sarif'...",
+ "level": "note",
+ "time": "2016-08-25T21:26:41.799Z"
+ }
+ ],
+ "rules": {
+ "SV0002": {
+ "id": "SV0002",
+ "name": "UseAbsolutePathsForNestedFileUriFragments",
+ "shortDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path.",
+ "fullDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path. That is, begin the with a forward slash, for example \"file:///C:/bin/MyApp.zip#/images/grape.jpg\".",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the fragment portion of the URI \"{2}\", which specifies the location of a nested file with respect to its parent, does not begin with a forward slash."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Release/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInResultFileUri.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "src\\packages\\xunit.runner.console.2.1.0\\tools\\xunit.console.x86.exe bld\\bin\\SarifCli.FunctionalTests\\AnyCPU_Release\\Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.dll",
+ "startTime": "2016-08-25T21:26:41.798Z",
+ "endTime": "2016-08-25T21:26:41.957Z",
+ "processId": 8856,
+ "fileName": "C:\\Users\\lgolding\\AppData\\Local\\Temp\\108c7547-93f9-41d7-9466-6cf860afad5d\\108c7547-93f9-41d7-9466-6cf860afad5d\\assembly\\dl3\\660ee2c2\\00b7775a_e6e9d101\\Sarif.dll",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli.FunctionalTests\\AnyCPU_Release"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInStackFrameUri.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInStackFrameUri.sarif
new file mode 100644
index 000000000..49bdf801c
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInStackFrameUri.sarif
@@ -0,0 +1,56 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/bin/myApp.appx#/js/minified.js",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ],
+ "stacks": [
+ {
+ "frames": [
+ {
+ "uri": "file:///c:/bin/myApp.appx#js/minified.js",
+ "fullyQualifiedLogicalName": "func",
+ "line": 23
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "files": {
+ "file:///c:/bin/myApp.appx": {
+ "mimeType": "application/vns.ms-appx"
+ },
+ "file:///c:/bin/myApp.appx#/js/minified.js": {
+ "uri": "/js/minified.js",
+ "parentKey": "file:///c:/bin/myApp.appx",
+ "mimeType": "text/javascript"
+ },
+ "file:///c:/bin/myApp.appx#/js/other.js": {
+ "uri": "/js/other.js",
+ "parentKey": "file:///c:/bin/myApp.appx",
+ "mimeType": "text/javascript"
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInStackFrameUri_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInStackFrameUri_Expected.sarif
new file mode 100644
index 000000000..be8410ec7
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInStackFrameUri_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "cfb342f0-5a8e-4eb0-ae50-aef0827d6813",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0002",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "NestedFileUriFragmentIsRelativeInStackFrameUri.sarif",
+ "/runs/0/results/0/stacks/0/frames/0/uri",
+ "file:///c:/bin/myApp.appx#js/minified.js"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInStackFrameUri.sarif",
+ "region": {
+ "startLine": 30,
+ "startColumn": 68
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInStackFrameUri.sarif"
+ },
+ "message": "Analyzing 'NestedFileUriFragmentIsRelativeInStackFrameUri.sarif'...",
+ "level": "note",
+ "time": "2016-08-25T23:16:44.436Z"
+ }
+ ],
+ "rules": {
+ "SV0002": {
+ "id": "SV0002",
+ "name": "UseAbsolutePathsForNestedFileUriFragments",
+ "shortDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path.",
+ "fullDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path. That is, begin the with a forward slash, for example \"file:///C:/bin/MyApp.zip#/images/grape.jpg\".",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the fragment portion of the URI \"{2}\", which specifies the location of a nested file with respect to its parent, does not begin with a forward slash."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInStackFrameUri.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UseAbsolutePathsForNestedFileUriFragments\\NestedFileUriFragmentIsRelativeInStackFrameUri.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\NestedFileUriFragmentIsRelativeInStackFrameUri_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-25T23:16:44.342Z",
+ "endTime": "2016-08-25T23:16:44.764Z",
+ "processId": 10452,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInToolNotificationUri.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInToolNotificationUri.sarif
new file mode 100644
index 000000000..667311881
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInToolNotificationUri.sarif
@@ -0,0 +1,20 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [],
+ "toolNotifications": [
+ {
+ "message": "The message",
+ "physicalLocation": {
+ "uri": "file:///c:/bin/myApp.appx#js/minified.js"
+ }
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInToolNotificationUri_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInToolNotificationUri_Expected.sarif
new file mode 100644
index 000000000..6c456c5c3
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInToolNotificationUri_Expected.sarif
@@ -0,0 +1,84 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "152cb07e-4340-4293-90c7-0fe96501eea9",
+ "tool": {
+ "name": "SarifCli",
+ "fullName": "SarifCli 1.0.0.0",
+ "version": "1.0.0.0",
+ "semanticVersion": "1.0.0",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Command line tool for working with SARIF log files.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [
+ {
+ "ruleId": "SV0002",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default",
+ "arguments": [
+ "NestedFileUriFragmentIsRelativeInToolNotificationUri.sarif",
+ "/runs/0/toolNotifications/0/physicalLocation/uri",
+ "file:///c:/bin/myApp.appx#js/minified.js"
+ ]
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInToolNotificationUri.sarif",
+ "region": {
+ "startLine": 14,
+ "startColumn": 62
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInToolNotificationUri.sarif"
+ },
+ "message": "Analyzing 'NestedFileUriFragmentIsRelativeInToolNotificationUri.sarif'...",
+ "level": "note",
+ "time": "2016-08-26T00:14:12.734Z"
+ }
+ ],
+ "rules": {
+ "SV0002": {
+ "id": "SV0002",
+ "name": "UseAbsolutePathsForNestedFileUriFragments",
+ "shortDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path.",
+ "fullDescription": "When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path. That is, begin the with a forward slash, for example \"file:///C:/bin/MyApp.zip#/images/grape.jpg\".",
+ "messageFormats": {
+ "DefaultFormatId": "In \"{0}\", at \"{1}\", the fragment portion of the URI \"{2}\", which specifies the location of a nested file with respect to its parent, does not begin with a forward slash."
+ },
+ "defaultLevel": "warning",
+ "helpUri": "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html"
+ }
+ },
+ "files": {
+ "file:///G:/Code/sarif-sdk/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentIsRelativeInToolNotificationUri.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "\"G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe\" validate G:\\Code\\sarif-sdk\\src\\SarifCli.FunctionalTests\\TestData\\UseAbsolutePathsForNestedFileUriFragments\\NestedFileUriFragmentIsRelativeInToolNotificationUri.sarif -o C:\\Users\\[REMOVED]\\Desktop\\SarifCli\\NestedFileUriFragmentIsRelativeInToolNotificationUri_Expected.sarif -j G:\\Code\\sarif-sdk\\src\\Sarif\\Schemata\\Sarif.schema.json ",
+ "startTime": "2016-08-26T00:14:12.651Z",
+ "endTime": "2016-08-26T00:14:13.069Z",
+ "processId": 4488,
+ "fileName": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug\\SarifCli.exe",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli\\AnyCPU_Debug"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute.sarif
new file mode 100644
index 000000000..fb2ae2143
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute.sarif
@@ -0,0 +1,40 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "tool": {
+ "name": "CodeScanner"
+ },
+ "results": [
+ {
+ "ruleId": "TST0001",
+ "level": "error",
+ "formattedRuleMessage": {
+ "formatId": "Default"
+ },
+ "locations": [
+ {
+ "analysisTarget": {
+ "uri": "file:///c:/bin/myApp.appx#/js/minified.js",
+ "region": {
+ "startLine": 1
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "files": {
+ "file:///c:/bin/myApp.appx": {
+ "mimeType": "application/vns.ms-appx"
+ },
+ "file:///c:/bin/myApp.appx#/js/minified.js": {
+ "uri": "/js/minified.js",
+ "parentKey": "file:///c:/bin/myApp.appx",
+ "mimeType": "text/javascript"
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute_Expected.sarif b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute_Expected.sarif
new file mode 100644
index 000000000..3dda0aa8a
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute_Expected.sarif
@@ -0,0 +1,47 @@
+{
+ "$schema": "http://json.schemastore.org/sarif-1.0.0",
+ "version": "1.0.0",
+ "runs": [
+ {
+ "id": "a9957393-94c6-464b-9ba5-cf05eb95f245",
+ "tool": {
+ "name": "Sarif",
+ "fullName": "Sarif 1.5.27.0",
+ "version": "1.5.27.0",
+ "semanticVersion": "1.5.27",
+ "sarifLoggerVersion": "1.5.27.0",
+ "language": "en-US",
+ "properties": {
+ "Comments": "Object model and utilities for reading and writing files in the SARIF format.",
+ "CompanyName": "Microsoft Corporation",
+ "ProductName": "Microsoft SARIF SDK"
+ }
+ },
+ "results": [],
+ "toolNotifications": [
+ {
+ "id": "MSG001.AnalyzingTarget",
+ "physicalLocation": {
+ "uri": "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Release/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute.sarif"
+ },
+ "message": "Analyzing 'NestedFileUriFragmentsAreAbsolute.sarif'...",
+ "level": "note",
+ "time": "2016-08-25T21:26:42.071Z"
+ }
+ ],
+ "files": {
+ "file:///G:/Code/sarif-sdk/bld/bin/SarifCli.FunctionalTests/AnyCPU_Release/TestData/UseAbsolutePathsForNestedFileUriFragments/NestedFileUriFragmentsAreAbsolute.sarif": {
+ "mimeType": "application/octet-stream"
+ }
+ },
+ "invocation": {
+ "commandLine": "src\\packages\\xunit.runner.console.2.1.0\\tools\\xunit.console.x86.exe bld\\bin\\SarifCli.FunctionalTests\\AnyCPU_Release\\Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests.dll",
+ "startTime": "2016-08-25T21:26:42.071Z",
+ "endTime": "2016-08-25T21:26:42.076Z",
+ "processId": 8856,
+ "fileName": "C:\\Users\\lgolding\\AppData\\Local\\Temp\\108c7547-93f9-41d7-9466-6cf860afad5d\\108c7547-93f9-41d7-9466-6cf860afad5d\\assembly\\dl3\\660ee2c2\\00b7775a_e6e9d101\\Sarif.dll",
+ "workingDirectory": "G:\\Code\\sarif-sdk\\bld\\bin\\SarifCli.FunctionalTests\\AnyCPU_Release"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/SarifCli.FunctionalTests/packages.config b/src/SarifCli.FunctionalTests/packages.config
new file mode 100644
index 000000000..c69b1fd20
--- /dev/null
+++ b/src/SarifCli.FunctionalTests/packages.config
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/SarifCli/AnalyzeCommand.cs b/src/SarifCli/AnalyzeCommand.cs
new file mode 100644
index 000000000..674492d3f
--- /dev/null
+++ b/src/SarifCli/AnalyzeCommand.cs
@@ -0,0 +1,205 @@
+// 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.IO;
+using System.Linq;
+using System.Reflection;
+using Microsoft.CodeAnalysis.Sarif.Driver;
+using Microsoft.CodeAnalysis.Sarif.Readers;
+using Microsoft.Json.Schema;
+using Microsoft.Json.Schema.Validation;
+using Newtonsoft.Json;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli
+{
+ internal class AnalyzeCommand : AnalyzeCommandBase
+ {
+ public override string Prerelease => VersionConstants.Prerelease;
+
+ private List _defaultPlugInAssemblies;
+
+ public override IEnumerable DefaultPlugInAssemblies
+ {
+ get
+ {
+ if (_defaultPlugInAssemblies == null)
+ {
+ _defaultPlugInAssemblies = new List
+ {
+ this.GetType().Assembly
+ };
+ }
+
+ return _defaultPlugInAssemblies;
+ }
+ }
+
+ protected override SarifValidationContext CreateContext(AnalyzeOptions options, IAnalysisLogger logger, RuntimeConditions runtimeErrors, string filePath = null)
+ {
+ SarifValidationContext context = base.CreateContext(options, logger, runtimeErrors, filePath);
+ context.SchemaFilePath = options.SchemaFilePath;
+ return context;
+ }
+
+ protected override void AnalyzeTarget(
+ IEnumerable> skimmers,
+ SarifValidationContext context,
+ HashSet disabledSkimmers)
+ {
+ // The base class knows how to invoke the skimmers that implement smart validation,
+ // but it doesn't know how to invoke schema validation, which has its own set of rules,
+ // so we do that ourselves.
+ //
+ // Validate will return false if there are any JSON syntax errors. In that case
+ // there's no point in going on.
+ bool ok = Validate(context.TargetUri.LocalPath, context.SchemaFilePath, context.Logger);
+
+ if (ok)
+ {
+ // Deserialize will return null if there are any JSON deserialization errors
+ // (which can happen, for example, if a property required by the schema is
+ // missing. In that case, again, there's no point in going on.
+ context.InputLogContents = File.ReadAllText(context.TargetUri.AbsolutePath);
+ context.InputLog = Deserialize(context.InputLogContents);
+
+ if (context.InputLog != null)
+ {
+ // Everything's ready, so run all the skimmers.
+ base.AnalyzeTarget(skimmers, context, disabledSkimmers);
+ }
+ }
+ }
+
+ private SarifLog Deserialize(string logContents)
+ {
+ JsonSerializerSettings settings = new JsonSerializerSettings
+ {
+ ContractResolver = SarifContractResolver.Instance
+ };
+
+ SarifLog log = null;
+ try
+ {
+ return JsonConvert.DeserializeObject(logContents, settings);
+ }
+ catch (JsonSerializationException)
+ {
+ // This exception can happen, for example, if a property required by the schema is
+ // missing.
+ }
+
+ return log;
+ }
+
+ private bool Validate(string instanceFilePath, string schemaFilePath, IAnalysisLogger logger)
+ {
+ bool ok = true;
+
+ try
+ {
+ string instanceText = File.ReadAllText(instanceFilePath);
+ PerformSchemaValidation(instanceText, instanceFilePath, schemaFilePath, logger);
+ }
+ catch (JsonSyntaxException ex)
+ {
+ ReportResult(ex.Result, logger);
+
+ // If the file isn't syntactically valid JSON, we won't be able to run
+ // the skimmers, because they rely on being able to deserialized the file
+ // into a SarifLog object.
+ ok = false;
+ }
+ catch (SchemaValidationException ex)
+ {
+ ReportInvalidSchemaErrors(ex, schemaFilePath, logger);
+ }
+ catch (Exception ex)
+ {
+ LogToolNotification(logger, ex.Message, NotificationLevel.Error, ex);
+
+ // Don't try to run the skimmers if something unexpected happened.
+ // Sure, if it were something schema-validation-specific, like "can't
+ // find schema file," then we could successfully run the skimmers,
+ // but I don't think it's worth trying to be that clever.
+ ok = false;
+ }
+
+ return ok;
+ }
+
+ private void PerformSchemaValidation(
+ string instanceText,
+ string instanceFilePath,
+ string schemaFilePath,
+ IAnalysisLogger logger)
+ {
+ string schemaText = File.ReadAllText(schemaFilePath);
+ JsonSchema schema = SchemaReader.ReadSchema(schemaText, schemaFilePath);
+
+ var validator = new Validator(schema);
+ Result[] results = validator.Validate(instanceText, instanceFilePath);
+
+ ReportResults(results, logger);
+ }
+
+ private static void ReportInvalidSchemaErrors(
+ SchemaValidationException ex,
+ string schemaFile,
+ IAnalysisLogger logger)
+ {
+ foreach (Result result in ex.Results)
+ {
+ result.SetAnalysisTargetUri(schemaFile);
+ ReportResult(result, logger);
+ }
+ }
+
+ private static void ReportResults(
+ Result[] results,
+ IAnalysisLogger logger)
+ {
+ foreach (Result result in results)
+ {
+ ReportResult(result, logger);
+ }
+ }
+
+ private static void ReportResult(
+ Result result,
+ IAnalysisLogger logger)
+ {
+ Rule rule = Json.Schema.Sarif.RuleFactory.GetRuleFromRuleId(result.RuleId);
+ logger.Log(rule, result);
+ }
+
+ private static void LogToolNotification(
+ IAnalysisLogger logger,
+ string message,
+ NotificationLevel level = NotificationLevel.Note,
+ Exception ex = null)
+ {
+ ExceptionData exceptionData = null;
+ if (ex != null)
+ {
+ exceptionData = new ExceptionData
+ {
+ Kind = ex.GetType().FullName,
+ Message = ex.Message,
+ Stack = Stack.CreateStacks(ex).FirstOrDefault()
+ };
+ }
+
+ TextWriter writer = level == NotificationLevel.Error ? Console.Error : Console.Out;
+ writer.WriteLine(message);
+
+ logger.LogToolNotification(new Notification
+ {
+ Level = level,
+ Message = message,
+ Exception = exceptionData
+ });
+ }
+ }
+}
diff --git a/src/SarifCli/AnalyzeOptions.cs b/src/SarifCli/AnalyzeOptions.cs
new file mode 100644
index 000000000..f7c723f18
--- /dev/null
+++ b/src/SarifCli/AnalyzeOptions.cs
@@ -0,0 +1,19 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using CommandLine;
+using Microsoft.CodeAnalysis.Sarif.Driver;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli
+{
+ [Verb("validate", HelpText = "Validate a SARIF file against the schema and against additional correctness rules.")]
+ internal class AnalyzeOptions : AnalyzeOptionsBase
+ {
+ [Option(
+ 'j',
+ "json-schema-file-path",
+ HelpText = "Path to the SARIF JSON schema.",
+ Required = true)]
+ public string SchemaFilePath { get; set; }
+ }
+}
diff --git a/src/SarifValidator/App.config b/src/SarifCli/App.config
similarity index 100%
rename from src/SarifValidator/App.config
rename to src/SarifCli/App.config
diff --git a/src/SarifCli/ExportRulesMetadataCommand.cs b/src/SarifCli/ExportRulesMetadataCommand.cs
new file mode 100644
index 000000000..27f9e49c3
--- /dev/null
+++ b/src/SarifCli/ExportRulesMetadataCommand.cs
@@ -0,0 +1,24 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System.Collections.Generic;
+using System.Reflection;
+using Microsoft.CodeAnalysis.Sarif.Driver;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli
+{
+ internal class ExportRulesMetadataCommand : ExportRulesMetadataCommandBase
+ {
+ public override IEnumerable DefaultPlugInAssemblies
+ {
+ get
+ {
+ return new Assembly[] {
+ this.GetType().Assembly
+ };
+ }
+ }
+
+ public override string Prerelease { get { return VersionConstants.Prerelease; } }
+ }
+}
diff --git a/src/SarifCli/IntegerExtensions.cs b/src/SarifCli/IntegerExtensions.cs
new file mode 100644
index 000000000..a44e091f3
--- /dev/null
+++ b/src/SarifCli/IntegerExtensions.cs
@@ -0,0 +1,15 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System.Globalization;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli
+{
+ internal static class IntegerExtensions
+ {
+ public static string ToInvariantString(this int n)
+ {
+ return n.ToString(CultureInfo.InvariantCulture);
+ }
+ }
+}
diff --git a/src/SarifCli/JPointerStringExtensions.cs b/src/SarifCli/JPointerStringExtensions.cs
new file mode 100644
index 000000000..5bba2460b
--- /dev/null
+++ b/src/SarifCli/JPointerStringExtensions.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli
+{
+ // TODO: These methods belong in the Microsoft.Json.Pointer library.
+ // Filed https://github.com/Microsoft/sarif-sdk/issues/512 for this.
+ internal static class JPointerStringExtensions
+ {
+ internal static string AtProperty(this string jPointer, string propertyName)
+ {
+ return $"{jPointer}/{propertyName.EscapeJsonPointer()}";
+ }
+
+ internal static string AtIndex(this string jPointer, int index)
+ {
+ return $"{jPointer}/{index}";
+ }
+
+ // The components of a JSON Pointer are separated by a '/' character. So when
+ // constructing a JSON Pointer one of whose components is a property name that
+ // includes the '/' character, that character must be escaped with "~1". But now
+ // the '~' character is also special, so it must be escaped with "~0".
+ //
+ // When escaping, the "~" replacement must come first. Otherwise, the string "/"
+ // would translate to "~01" instead of the correct "~1". Similarly, when
+ // unescaping, the "~1" replacement must come first.
+ internal static string EscapeJsonPointer(this string propertyName)
+ {
+ return propertyName.Replace("~", "~0").Replace("/", "~1");
+ }
+
+ internal static string UnescapeJsonPointer(this string jPointer)
+ {
+ return jPointer.Replace("~1", "/").Replace("~0", "~");
+ }
+ }
+}
diff --git a/src/SarifCli/JTokenExtensions.cs b/src/SarifCli/JTokenExtensions.cs
new file mode 100644
index 000000000..96b61c0cc
--- /dev/null
+++ b/src/SarifCli/JTokenExtensions.cs
@@ -0,0 +1,18 @@
+// 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.Linq;
+using Newtonsoft.Json.Linq;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli
+{
+ public static class JTokenExtensions
+ {
+ public static bool HasProperty(this JToken token, string propertyName)
+ {
+ return token.Children()
+ .Any(jp => jp.Name.Equals(propertyName, StringComparison.Ordinal));
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/SarifValidator/Program.cs b/src/SarifCli/Program.cs
similarity index 73%
rename from src/SarifValidator/Program.cs
rename to src/SarifCli/Program.cs
index f3886d873..76c78d1bf 100644
--- a/src/SarifValidator/Program.cs
+++ b/src/SarifCli/Program.cs
@@ -7,24 +7,24 @@
using System.Linq;
using System.Reflection;
using CommandLine;
+using Microsoft.CodeAnalysis.Sarif.Driver;
-namespace Microsoft.CodeAnalysis.Sarif.SarifValidator
+namespace Microsoft.CodeAnalysis.Sarif.Cli
{
internal class Program
{
private static int Main(string[] args)
- {
- return Parser.Default.ParseArguments(args)
- .MapResult(
- options => Run(options),
- errs => 1);
- }
-
- private static int Run(CommandLineOptions options)
{
Banner();
- return 0;
+ return Parser.Default.ParseArguments<
+ AnalyzeOptions,
+ ExportRulesMetadataOptions
+ >(args)
+ .MapResult(
+ (AnalyzeOptions analyzeOptions) => new AnalyzeCommand().Run(analyzeOptions),
+ (ExportRulesMetadataOptions exportRulesMetadataOptions) => new ExportRulesMetadataCommand().Run(exportRulesMetadataOptions),
+ errs => 1);
}
private static void Banner()
diff --git a/src/SarifCli/Properties/AssemblyInfo.cs b/src/SarifCli/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..1d96b9553
--- /dev/null
+++ b/src/SarifCli/Properties/AssemblyInfo.cs
@@ -0,0 +1,13 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle("SARIF Command Line Interface")]
+[assembly: AssemblyDescription("Command line tool for working with SARIF log files.")]
+
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+
+[assembly: InternalsVisibleTo("Microsoft.CodeAnalysis.Sarif.Cli.FunctionalTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100433fbf156abe9718142bdbd48a440e779a1b708fd21486ee0ae536f4c548edf8a7185c1e3ac89ceef76c15b8cc2497906798779a59402f9b9e27281fb15e7111566cdc9a9f8326301d45320623c5222089cf4d0013f365ae729fb0a9c9d15138042825cd511a0f3d4887a7b92f4c2749f81b410813d297b73244cf64995effb1")]
\ No newline at end of file
diff --git a/src/SarifValidator/Resources.Designer.cs b/src/SarifCli/Resources.Designer.cs
similarity index 86%
rename from src/SarifValidator/Resources.Designer.cs
rename to src/SarifCli/Resources.Designer.cs
index 0b18f83f6..cb99a9a38 100644
--- a/src/SarifValidator/Resources.Designer.cs
+++ b/src/SarifCli/Resources.Designer.cs
@@ -8,7 +8,7 @@
//
//------------------------------------------------------------------------------
-namespace Microsoft.CodeAnalysis.Sarif.SarifValidator {
+namespace Microsoft.CodeAnalysis.Sarif.Cli {
using System;
@@ -39,7 +39,7 @@ internal Resources() {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.CodeAnalysis.Sarif.SarifValidator.Resources", typeof(Resources).Assembly);
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.CodeAnalysis.Sarif.Cli.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
@@ -68,5 +68,14 @@ internal static string Banner {
return ResourceManager.GetString("Banner", resourceCulture);
}
}
+
+ ///
+ /// Looks up a localized string similar to A context object was reinitialized with a new target URI..
+ ///
+ internal static string ErrorIllegalContextReuse {
+ get {
+ return ResourceManager.GetString("ErrorIllegalContextReuse", resourceCulture);
+ }
+ }
}
}
diff --git a/src/SarifValidator/Resources.resx b/src/SarifCli/Resources.resx
similarity index 97%
rename from src/SarifValidator/Resources.resx
rename to src/SarifCli/Resources.resx
index 145eb0e32..fbee81e26 100644
--- a/src/SarifValidator/Resources.resx
+++ b/src/SarifCli/Resources.resx
@@ -120,4 +120,7 @@
{0} version {1}
+
+ A context object was reinitialized with a new target URI.
+
\ No newline at end of file
diff --git a/src/SarifCli/Rules/AnnotatedCodeLocationEssentialIsObsolete.cs b/src/SarifCli/Rules/AnnotatedCodeLocationEssentialIsObsolete.cs
new file mode 100644
index 000000000..2d1396b36
--- /dev/null
+++ b/src/SarifCli/Rules/AnnotatedCodeLocationEssentialIsObsolete.cs
@@ -0,0 +1,55 @@
+// 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.Linq;
+using Microsoft.Json.Pointer;
+using Newtonsoft.Json.Linq;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.Rules
+{
+ public class AnnotatedCodeLocationEssentialIsObsolete : SarifValidationSkimmerBase
+ {
+ public override string FullDescription => RuleResources.SV0005_AnnotatedCodeLocationEssentialIsObsolete;
+
+ public override ResultLevel DefaultLevel => ResultLevel.Warning;
+
+ ///
+ /// SV0005
+ ///
+ public override string Id => RuleId.AnnotatedCodeLocationEssentialIsObsolete;
+
+ protected override IEnumerable FormatIds
+ {
+ get
+ {
+ return new string[]
+ {
+ nameof(RuleResources.SV0005_Default),
+ nameof(RuleResources.SV0005_OnlyInCodeFlow)
+ };
+ }
+ }
+
+ protected override void Analyze(AnnotatedCodeLocation annotatedCodeLocation, string annotatedCodeLocationPointer)
+ {
+ var pointer = new JsonPointer(annotatedCodeLocationPointer);
+ JToken token = pointer.Evaluate(Context.InputLogToken);
+
+ if (token.HasProperty(SarifPropertyName.Essential))
+ {
+ string essentialPointer = annotatedCodeLocationPointer.AtProperty(SarifPropertyName.Essential);
+
+ // Emit a different warning depending on whether or not this annotatedCodeLocation
+ // occurs in a codeFlow, because the "importance" property is only meaningful within
+ // a codeFlow.
+ string formatId = annotatedCodeLocationPointer.Contains(SarifPropertyName.CodeFlows)
+ ? nameof(RuleResources.SV0005_Default)
+ : nameof(RuleResources.SV0005_OnlyInCodeFlow);
+
+ LogResult(essentialPointer, formatId);
+ }
+ }
+ }
+}
diff --git a/src/SarifCli/Rules/AnnotatedCodeLocationIdIsObsolete.cs b/src/SarifCli/Rules/AnnotatedCodeLocationIdIsObsolete.cs
new file mode 100644
index 000000000..ef2661897
--- /dev/null
+++ b/src/SarifCli/Rules/AnnotatedCodeLocationIdIsObsolete.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System.Collections.Generic;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.Rules
+{
+ public class AnnotatedCodeLocationIdIsObsolete : SarifValidationSkimmerBase
+ {
+ public override string FullDescription => RuleResources.SV0004_AnnotatedCodeLocationIdIsObsolete;
+
+ public override ResultLevel DefaultLevel => ResultLevel.Warning;
+
+ ///
+ /// SV0004
+ ///
+ public override string Id => RuleId.AnnotatedCodeLocationIdIsObsolete;
+
+ protected override IEnumerable FormatIds
+ {
+ get
+ {
+ return new string[]
+ {
+ nameof(RuleResources.SV0004_Default),
+ nameof(RuleResources.SV0004_OnlyInCodeFlow)
+ };
+ }
+ }
+
+ protected override void Analyze(AnnotatedCodeLocation annotatedCodeLocation, string annotatedCodeLocationPointer)
+ {
+ if (annotatedCodeLocation.Id != 0)
+ {
+ string idPointer = annotatedCodeLocationPointer.AtProperty(SarifPropertyName.Id);
+
+ // Emit a different warning depending on whether or not this annotatedCodeLocation
+ // occurs in a codeFlow, because the "step" property is only meaningful within
+ // a codeFlow.
+ string formatId = annotatedCodeLocationPointer.Contains(SarifPropertyName.CodeFlows)
+ ? nameof(RuleResources.SV0004_Default)
+ : nameof(RuleResources.SV0004_OnlyInCodeFlow);
+
+ LogResult(idPointer, formatId);
+ }
+ }
+ }
+}
diff --git a/src/SarifCli/Rules/DoNotUseFriendlyNameAsRuleId.cs b/src/SarifCli/Rules/DoNotUseFriendlyNameAsRuleId.cs
new file mode 100644
index 000000000..c2c5cbbc2
--- /dev/null
+++ b/src/SarifCli/Rules/DoNotUseFriendlyNameAsRuleId.cs
@@ -0,0 +1,44 @@
+// 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;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.Rules
+{
+ public class DoNotUseFriendlyNameAsRuleId : SarifValidationSkimmerBase
+ {
+ public override string FullDescription => RuleResources.SV0001_DoNotUseFriendlyNameAsRuleIdDescription;
+
+ public override ResultLevel DefaultLevel => ResultLevel.Warning;
+
+ ///
+ /// SV0001
+ ///
+ public override string Id => RuleId.DoNotUseFriendlyNameAsRuleId;
+
+ protected override IEnumerable FormatIds
+ {
+ get
+ {
+ return new string[]
+ {
+ nameof(RuleResources.SV0001_Default)
+ };
+ }
+ }
+
+ protected override void Analyze(Rule rule, string rulePointer)
+ {
+ if (rule.Id != null
+ && rule.Name != null
+ && rule.Id.Equals(rule.Name, StringComparison.OrdinalIgnoreCase))
+ {
+ LogResult(
+ rulePointer,
+ nameof(RuleResources.SV0001_Default),
+ rule.Id);
+ }
+ }
+ }
+}
diff --git a/src/SarifCli/Rules/EndColumnMustNotBeLessThanStartColumn.cs b/src/SarifCli/Rules/EndColumnMustNotBeLessThanStartColumn.cs
new file mode 100644
index 000000000..50f5c9ea2
--- /dev/null
+++ b/src/SarifCli/Rules/EndColumnMustNotBeLessThanStartColumn.cs
@@ -0,0 +1,59 @@
+// 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 Microsoft.Json.Pointer;
+using Newtonsoft.Json.Linq;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.Rules
+{
+ public class EndColumnMustNotBeLessThanStartColumn : SarifValidationSkimmerBase
+ {
+ public override string FullDescription => RuleResources.SV0013_EndColumnMustNotBeLessThanStartColumn;
+
+ public override ResultLevel DefaultLevel => ResultLevel.Error;
+
+ ///
+ /// SV0013
+ ///
+ public override string Id => RuleId.EndColumnMustNotBeLessThanStartColumn;
+
+ protected override IEnumerable FormatIds
+ {
+ get
+ {
+ return new string[]
+ {
+ nameof(RuleResources.SV0013_Default)
+ };
+ }
+ }
+
+ protected override void Analyze(Region region, string regionPointer)
+ {
+ var jsonPointer = new JsonPointer(regionPointer);
+ var regionToken = jsonPointer.Evaluate(Context.InputLogToken);
+
+ if (RegionIsOnOneLine(region, regionToken) &&
+ regionToken.HasProperty(SarifPropertyName.EndColumn) &&
+ region.EndColumn < region.StartColumn)
+ {
+ string endColumnPointer = regionPointer.AtProperty(SarifPropertyName.EndColumn);
+
+ LogResult(
+ endColumnPointer,
+ nameof(RuleResources.SV0013_Default),
+ region.EndColumn.ToInvariantString(),
+ region.StartColumn.ToInvariantString());
+ }
+ }
+
+ private static bool RegionIsOnOneLine(Region region, JToken regionToken)
+ {
+ return regionToken.HasProperty(SarifPropertyName.EndLine)
+ ? region.StartLine == region.EndLine
+ : true;
+ }
+ }
+}
diff --git a/src/SarifCli/Rules/EndLineMustNotBeLessThanStartLine.cs b/src/SarifCli/Rules/EndLineMustNotBeLessThanStartLine.cs
new file mode 100644
index 000000000..a1d77e191
--- /dev/null
+++ b/src/SarifCli/Rules/EndLineMustNotBeLessThanStartLine.cs
@@ -0,0 +1,49 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System.Collections.Generic;
+using Microsoft.Json.Pointer;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.Rules
+{
+ public class EndLineMustNotBeLessThanStartLine : SarifValidationSkimmerBase
+ {
+ public override string FullDescription => RuleResources.SV0012_EndLineMustNotBeLessThanStartLine;
+
+ public override ResultLevel DefaultLevel => ResultLevel.Error;
+
+ ///
+ /// SV0012
+ ///
+ public override string Id => RuleId.EndLineMustNotBeLessThanStartLine;
+
+ protected override IEnumerable FormatIds
+ {
+ get
+ {
+ return new string[]
+ {
+ nameof(RuleResources.SV0012_Default)
+ };
+ }
+ }
+
+ protected override void Analyze(Region region, string regionPointer)
+ {
+ var jsonPointer = new JsonPointer(regionPointer);
+ var regionToken = jsonPointer.Evaluate(Context.InputLogToken);
+
+ if (regionToken.HasProperty(SarifPropertyName.EndLine) &&
+ region.EndLine < region.StartLine)
+ {
+ string endLinePointer = regionPointer.AtProperty(SarifPropertyName.EndLine);
+
+ LogResult(
+ endLinePointer,
+ nameof(RuleResources.SV0012_Default),
+ region.EndLine.ToInvariantString(),
+ region.StartLine.ToInvariantString());
+ }
+ }
+ }
+}
diff --git a/src/SarifCli/Rules/EndTimeMustBeAfterStartTime.cs b/src/SarifCli/Rules/EndTimeMustBeAfterStartTime.cs
new file mode 100644
index 000000000..c230b49ed
--- /dev/null
+++ b/src/SarifCli/Rules/EndTimeMustBeAfterStartTime.cs
@@ -0,0 +1,53 @@
+// 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.Globalization;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.Rules
+{
+ public class EndTimeMustBeAfterStartTime : SarifValidationSkimmerBase
+ {
+ public override string FullDescription => RuleResources.SV0007_EndTimeMustBeAfterStartTime;
+
+ public override ResultLevel DefaultLevel => ResultLevel.Error;
+
+ ///
+ /// SV0006
+ ///
+ public override string Id => RuleId.EndTimeMustBeAfterStartTime;
+
+ protected override IEnumerable FormatIds
+ {
+ get
+ {
+ return new string[]
+ {
+ nameof(RuleResources.SV0007_Default)
+ };
+ }
+ }
+
+ protected override void Analyze(Invocation invocation, string invocationPointer)
+ {
+ if (invocation.StartTime > invocation.EndTime)
+ {
+ string endTimePointer = invocationPointer.AtProperty(SarifPropertyName.EndTime);
+
+ LogResult(
+ endTimePointer,
+ nameof(RuleResources.SV0007_Default),
+ FormatDateTime(invocation.EndTime),
+ FormatDateTime(invocation.StartTime));
+ }
+ }
+
+ private static string FormatDateTime(DateTime dateTime)
+ {
+ return dateTime.ToString(
+ SarifUtilities.SarifDateTimeFormatMillisecondsPrecision,
+ CultureInfo.InvariantCulture);
+ }
+ }
+}
diff --git a/src/SarifCli/Rules/HashAlgorithmsMustBeUnique.cs b/src/SarifCli/Rules/HashAlgorithmsMustBeUnique.cs
new file mode 100644
index 000000000..691bdb549
--- /dev/null
+++ b/src/SarifCli/Rules/HashAlgorithmsMustBeUnique.cs
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.Rules
+{
+ public class HashAlgorithmsMustBeUnique : SarifValidationSkimmerBase
+ {
+ public override string FullDescription => RuleResources.SV0006_HashAlgorithmsMustBeUnique;
+
+ public override ResultLevel DefaultLevel => ResultLevel.Error;
+
+ ///
+ /// SV0005
+ ///
+ public override string Id => RuleId.HashAlgorithmsMustBeUnique;
+
+ protected override IEnumerable FormatIds
+ {
+ get
+ {
+ return new string[]
+ {
+ nameof(RuleResources.SV0006_Default)
+ };
+ }
+ }
+
+ protected override void Analyze(FileData fileData, string fileKey, string filePointer)
+ {
+ if (fileData.Hashes != null)
+ {
+ foreach (AlgorithmKind algorithmKind in fileData.Hashes.Select(h => h.Algorithm).Distinct())
+ {
+ if (fileData.Hashes.Count(h => h.Algorithm == algorithmKind) > 1)
+ {
+ string hashesPointer = filePointer.AtProperty(SarifPropertyName.Hashes);
+
+ LogResult(
+ hashesPointer,
+ nameof(RuleResources.SV0006_Default),
+ algorithmKind.ToString());
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/SarifCli/Rules/ImportanceMustAppearOnlyInCodeFlowLocations.cs b/src/SarifCli/Rules/ImportanceMustAppearOnlyInCodeFlowLocations.cs
new file mode 100644
index 000000000..41ee75b6a
--- /dev/null
+++ b/src/SarifCli/Rules/ImportanceMustAppearOnlyInCodeFlowLocations.cs
@@ -0,0 +1,50 @@
+// 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.Linq;
+using Microsoft.Json.Pointer;
+using Newtonsoft.Json.Linq;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.Rules
+{
+ public class ImportanceMustAppearOnlyInCodeFlowLocations : SarifValidationSkimmerBase
+ {
+ public override string FullDescription => RuleResources.SV0011_ImportanceMustAppearOnlyInCodeFlowLocations;
+
+ public override ResultLevel DefaultLevel => ResultLevel.Warning;
+
+ ///
+ /// SV0011
+ ///
+ public override string Id => RuleId.ImportanceMustAppearOnlyInCodeFlowLocations;
+
+ protected override IEnumerable FormatIds
+ {
+ get
+ {
+ return new string[]
+ {
+ nameof(RuleResources.SV0011_Default)
+ };
+ }
+ }
+
+ protected override void Analyze(AnnotatedCodeLocation annotatedCodeLocation, string annotatedCodeLocationPointer)
+ {
+ var pointer = new JsonPointer(annotatedCodeLocationPointer);
+ JToken token = pointer.Evaluate(Context.InputLogToken);
+
+ if (token.HasProperty(SarifPropertyName.Importance))
+ {
+ if (!annotatedCodeLocationPointer.Contains(SarifPropertyName.CodeFlows))
+ {
+ string importancePointer = annotatedCodeLocationPointer.AtProperty(SarifPropertyName.Importance);
+
+ LogResult(importancePointer, nameof(RuleResources.SV0011_Default));
+ }
+ }
+ }
+ }
+}
diff --git a/src/SarifCli/Rules/MessagesShouldEndWithPeriod.cs b/src/SarifCli/Rules/MessagesShouldEndWithPeriod.cs
new file mode 100644
index 000000000..f24e109d2
--- /dev/null
+++ b/src/SarifCli/Rules/MessagesShouldEndWithPeriod.cs
@@ -0,0 +1,101 @@
+// 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;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.Rules
+{
+ public class MessagesShouldEndWithPeriod : SarifValidationSkimmerBase
+ {
+ public override string FullDescription => RuleResources.SV0008_MessagesShouldEndWithPeriod;
+
+ public override ResultLevel DefaultLevel => ResultLevel.Warning;
+
+ ///
+ /// SV0008
+ ///
+ public override string Id => RuleId.MessagesShouldEndWithPeriod;
+
+ protected override IEnumerable FormatIds
+ {
+ get
+ {
+ return new string[]
+ {
+ nameof(RuleResources.SV0008_Default)
+ };
+ }
+ }
+
+ protected override void Analyze(AnnotatedCodeLocation annotatedCodeLocation, string annotatedCodeLocationPointer)
+ {
+ Analyze(annotatedCodeLocation.Message, annotatedCodeLocationPointer);
+ }
+
+ protected override void Analyze(CodeFlow codeFlow, string codeFlowPointer)
+ {
+ Analyze(codeFlow.Message, codeFlowPointer);
+ }
+
+ protected override void Analyze(Notification notification, string notificationPointer)
+ {
+ Analyze(notification.Message, notificationPointer);
+ }
+
+ protected override void Analyze(Result result, string resultPointer)
+ {
+ Analyze(result.Message, resultPointer);
+ }
+
+ protected override void Analyze(Rule rule, string rulePointer)
+ {
+ if (rule.MessageFormats != null)
+ {
+ foreach (string formatId in rule.MessageFormats.Keys)
+ {
+ string messageFormat = rule.MessageFormats[formatId];
+ if (DoesNotEndWithPeriod(messageFormat))
+ {
+ string messagePointer = rulePointer
+ .AtProperty(SarifPropertyName.MessageFormats)
+ .AtProperty(formatId);
+
+ LogResult(
+ messagePointer,
+ nameof(RuleResources.SV0008_Default),
+ messageFormat);
+ }
+ }
+ }
+ }
+
+ protected override void Analyze(Stack stack, string stackPointer)
+ {
+ Analyze(stack.Message, stackPointer);
+ }
+
+ protected override void Analyze(StackFrame frame, string framePointer)
+ {
+ Analyze(frame.Message, framePointer);
+ }
+
+ private void Analyze(string message, string pointer)
+ {
+ if (DoesNotEndWithPeriod(message))
+ {
+ string messagePointer = pointer.AtProperty(SarifPropertyName.Message);
+
+ LogResult(
+ messagePointer,
+ nameof(RuleResources.SV0008_Default),
+ message);
+ }
+ }
+
+ private static bool DoesNotEndWithPeriod(string message)
+ {
+ return message != null && !message.EndsWith(".", StringComparison.Ordinal);
+ }
+ }
+}
diff --git a/src/SarifCli/Rules/RuleId.cs b/src/SarifCli/Rules/RuleId.cs
new file mode 100644
index 000000000..81e77de5f
--- /dev/null
+++ b/src/SarifCli/Rules/RuleId.cs
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.Rules
+{
+ public static class RuleId
+ {
+ public const string DoNotUseFriendlyNameAsRuleId = "SV0001";
+ public const string UseAbsolutePathsForNestedFileUriFragments = "SV0002";
+ public const string UrisMustBeValid = "SV0003";
+ public const string AnnotatedCodeLocationIdIsObsolete = "SV0004";
+ public const string AnnotatedCodeLocationEssentialIsObsolete = "SV0005";
+ public const string HashAlgorithmsMustBeUnique = "SV0006";
+ public const string EndTimeMustBeAfterStartTime = "SV0007";
+ public const string MessagesShouldEndWithPeriod = "SV0008";
+ public const string StepValuesMustFormOneBasedSequence = "SV0009";
+ public const string StepMustAppearOnlyInCodeFlowLocations = "SV0010";
+ public const string ImportanceMustAppearOnlyInCodeFlowLocations = "SV0011";
+ public const string EndLineMustNotBeLessThanStartLine = "SV0012";
+ public const string EndColumnMustNotBeLessThanStartColumn = "SV0013";
+ }
+}
diff --git a/src/SarifCli/Rules/RuleResources.Designer.cs b/src/SarifCli/Rules/RuleResources.Designer.cs
new file mode 100644
index 000000000..188fc1cbf
--- /dev/null
+++ b/src/SarifCli/Rules/RuleResources.Designer.cs
@@ -0,0 +1,324 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.Rules {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class RuleResources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal RuleResources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.CodeAnalysis.Sarif.Cli.Rules.RuleResources", typeof(RuleResources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In "{0}", at "{1}", the name and id properties of rule "{2}" are the same..
+ ///
+ internal static string SV0001_Default {
+ get {
+ return ResourceManager.GetString("SV0001_Default", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Do not use the same string for a rule's id and name properties. The id property must be a stable, opaque identifer such as "SV0001". The name property should be a string that is understandable to an end user, such as "DoNotUserFriendlyNameAsRuleId"..
+ ///
+ internal static string SV0001_DoNotUseFriendlyNameAsRuleIdDescription {
+ get {
+ return ResourceManager.GetString("SV0001_DoNotUseFriendlyNameAsRuleIdDescription", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In "{0}", at "{1}", the fragment portion of the URI "{2}", which specifies the location of a nested file with respect to its parent, does not begin with a forward slash..
+ ///
+ internal static string SV0002_Default {
+ get {
+ return ResourceManager.GetString("SV0002_Default", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path. That is, begin the with a forward slash, for example "file:///C:/bin/MyApp.zip#/images/grape.jpg"..
+ ///
+ internal static string SV0002_UseAbsolutePathsForNestedFileUriFragmentsDescription {
+ get {
+ return ResourceManager.GetString("SV0002_UseAbsolutePathsForNestedFileUriFragmentsDescription", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In "{0}", at "{1}", the string "{2}" is not a valid URI reference..
+ ///
+ internal static string SV0003_Default {
+ get {
+ return ResourceManager.GetString("SV0003_Default", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Specify a valid URI reference for every URI-valued property..
+ ///
+ internal static string SV0003_UrisMustBeValid {
+ get {
+ return ResourceManager.GetString("SV0003_UrisMustBeValid", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Do not use the obsolete "id" property of the annotatedCodeLocation object. Instead use "step", which is an integer-valued property that is 1 for the first annotatedCodeLocation in a codeFlow, and increments by 1 for every subsequent step..
+ ///
+ internal static string SV0004_AnnotatedCodeLocationIdIsObsolete {
+ get {
+ return ResourceManager.GetString("SV0004_AnnotatedCodeLocationIdIsObsolete", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In "{0}", at "{1}", the obsolete annotatedCodeLocation.id property is used. Remove it, and instead use the "step" property, whose value is an integer which is 1 for the first location in a code flow, and increments by 1 for each subsequent location in the code flow..
+ ///
+ internal static string SV0004_Default {
+ get {
+ return ResourceManager.GetString("SV0004_Default", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In "{0}", at "{1}", the obsolete "id" property is used. This property has been replaced by the "step" property, but the "step" property is used only in annotatedCodeLocations objects that occur within a code flow. Remove the "id" property..
+ ///
+ internal static string SV0004_OnlyInCodeFlow {
+ get {
+ return ResourceManager.GetString("SV0004_OnlyInCodeFlow", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Do not use the obsolete "essential" property of the annotatedCodeLocation object. Instead use "importance", which is an string-valued property that must have one of the values "essential", "important", or "unimportant"..
+ ///
+ internal static string SV0005_AnnotatedCodeLocationEssentialIsObsolete {
+ get {
+ return ResourceManager.GetString("SV0005_AnnotatedCodeLocationEssentialIsObsolete", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In "{0}", at "{1}", the obsolete "essential" property is used. Remove it, and instead use the "importance" property, whose value is a string with one of the values "essential", "important", or "unimportant"..
+ ///
+ internal static string SV0005_Default {
+ get {
+ return ResourceManager.GetString("SV0005_Default", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In "{0}", at "{1}", the obsolete "essential" property is used. This property has been replaced by the "importance" property, but the "importance" property is used only in annotatedCodeLocations objects that occur within a code flow. Remove the "essential" property..
+ ///
+ internal static string SV0005_OnlyInCodeFlow {
+ get {
+ return ResourceManager.GetString("SV0005_OnlyInCodeFlow", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In "{0}", at "{1}", the array contains multiple objects with the value "{2}" for the algorithm property..
+ ///
+ internal static string SV0006_Default {
+ get {
+ return ResourceManager.GetString("SV0006_Default", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In any given "file" object, every element of the "hashes" array must have a different value for its "algorithm" property. .
+ ///
+ internal static string SV0006_HashAlgorithmsMustBeUnique {
+ get {
+ return ResourceManager.GetString("SV0006_HashAlgorithmsMustBeUnique", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In "{0}", at "{1}", the end time "{2}" is before the start time "{3}"..
+ ///
+ internal static string SV0007_Default {
+ get {
+ return ResourceManager.GetString("SV0007_Default", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The end time of a run must be after the start time. To allow for the possibility that the duration of the run is less than the resolution of the string representation of the time, the start time and the end time may be equal..
+ ///
+ internal static string SV0007_EndTimeMustBeAfterStartTime {
+ get {
+ return ResourceManager.GetString("SV0007_EndTimeMustBeAfterStartTime", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In "{0}", at "{1}", the message "{2}" does not end with a period..
+ ///
+ internal static string SV0008_Default {
+ get {
+ return ResourceManager.GetString("SV0008_Default", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Messages should consist of one or more complete sentences, ending with a period..
+ ///
+ internal static string SV0008_MessagesShouldEndWithPeriod {
+ get {
+ return ResourceManager.GetString("SV0008_MessagesShouldEndWithPeriod", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In "{0}", at "{1}", the value of the "step" property should be {2}, but is {3}. The step values must form a 1-based sequence starting at the first location in the code flow..
+ ///
+ internal static string SV0009_InvalidStepValue {
+ get {
+ return ResourceManager.GetString("SV0009_InvalidStepValue", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In "{0}", at "{1}", the "step" property is absent. The "step" property is present on some but not all locations in this code flow. If the "step" property is used on any location in a code flow, it must be present on every location in that code flow..
+ ///
+ internal static string SV0009_StepNotPresentOnAllLocations {
+ get {
+ return ResourceManager.GetString("SV0009_StepNotPresentOnAllLocations", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to If the "step" property is used on any annotatedCodeLocation in a code flow, then it must be present for every location in the code flow, its value must be 1 for the first location, and its value must increase by 1 for each succeeding location..
+ ///
+ internal static string SV0009_StepValuesMustFormOneBasedSequence {
+ get {
+ return ResourceManager.GetString("SV0009_StepValuesMustFormOneBasedSequence", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In "{0}", at "{1}", the "step" property appears in an annotatedCodeLocation object which does not occur in a code flow. The "step" property must appear only in annotatedCodeLocation objects which occur within code flows..
+ ///
+ internal static string SV0010_Default {
+ get {
+ return ResourceManager.GetString("SV0010_Default", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The "step" property must appear only in annotatedCodeLocation objects which occur within code flows..
+ ///
+ internal static string SV0010_StepMustAppearOnlyInCodeFlowLocations {
+ get {
+ return ResourceManager.GetString("SV0010_StepMustAppearOnlyInCodeFlowLocations", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In "{0}", at "{1}", the "importance" property appears in an annotatedCodeLocation object which does not occur in a code flow. The "importance" property must appear only in annotatedCodeLocation objects which occur within code flows..
+ ///
+ internal static string SV0011_Default {
+ get {
+ return ResourceManager.GetString("SV0011_Default", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The "importance" property must appear only in annotatedCodeLocation objects which occur within code flows..
+ ///
+ internal static string SV0011_ImportanceMustAppearOnlyInCodeFlowLocations {
+ get {
+ return ResourceManager.GetString("SV0011_ImportanceMustAppearOnlyInCodeFlowLocations", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In "{0}", at "{1}", the value of the "endLine" property is {2}, which is less than the value of the "startLine" property, which is {3}..
+ ///
+ internal static string SV0012_Default {
+ get {
+ return ResourceManager.GetString("SV0012_Default", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The "endLine" property of a region object must not be less than the "startLine" property..
+ ///
+ internal static string SV0012_EndLineMustNotBeLessThanStartLine {
+ get {
+ return ResourceManager.GetString("SV0012_EndLineMustNotBeLessThanStartLine", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to In "{0}", at "{1}", the value of the "endColumn" property is {2}, which is less than the value of the "startColumn" property, which is {3}..
+ ///
+ internal static string SV0013_Default {
+ get {
+ return ResourceManager.GetString("SV0013_Default", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The "endColumn" property of a region object must not be less than the "startColumn" property..
+ ///
+ internal static string SV0013_EndColumnMustNotBeLessThanStartColumn {
+ get {
+ return ResourceManager.GetString("SV0013_EndColumnMustNotBeLessThanStartColumn", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/src/SarifCli/Rules/RuleResources.resx b/src/SarifCli/Rules/RuleResources.resx
new file mode 100644
index 000000000..716cc4afe
--- /dev/null
+++ b/src/SarifCli/Rules/RuleResources.resx
@@ -0,0 +1,207 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ In "{0}", at "{1}", the name and id properties of rule "{2}" are the same.
+
+
+ Do not use the same string for a rule's id and name properties. The id property must be a stable, opaque identifer such as "SV0001". The name property should be a string that is understandable to an end user, such as "DoNotUserFriendlyNameAsRuleId".
+
+
+ In "{0}", at "{1}", the fragment portion of the URI "{2}", which specifies the location of a nested file with respect to its parent, does not begin with a forward slash.
+
+
+ When specifying the URI of a nested file with a URI fragment, express the fragment as an absolute path. That is, begin the with a forward slash, for example "file:///C:/bin/MyApp.zip#/images/grape.jpg".
+
+
+ In "{0}", at "{1}", the string "{2}" is not a valid URI reference.
+
+
+ Specify a valid URI reference for every URI-valued property.
+
+
+ Do not use the obsolete "id" property of the annotatedCodeLocation object. Instead use "step", which is an integer-valued property that is 1 for the first annotatedCodeLocation in a codeFlow, and increments by 1 for every subsequent step.
+
+
+ In "{0}", at "{1}", the obsolete annotatedCodeLocation.id property is used. Remove it, and instead use the "step" property, whose value is an integer which is 1 for the first location in a code flow, and increments by 1 for each subsequent location in the code flow.
+
+
+ In "{0}", at "{1}", the obsolete "id" property is used. This property has been replaced by the "step" property, but the "step" property is used only in annotatedCodeLocations objects that occur within a code flow. Remove the "id" property.
+
+
+ Do not use the obsolete "essential" property of the annotatedCodeLocation object. Instead use "importance", which is an string-valued property that must have one of the values "essential", "important", or "unimportant".
+
+
+ In "{0}", at "{1}", the obsolete "essential" property is used. Remove it, and instead use the "importance" property, whose value is a string with one of the values "essential", "important", or "unimportant".
+
+
+ In "{0}", at "{1}", the obsolete "essential" property is used. This property has been replaced by the "importance" property, but the "importance" property is used only in annotatedCodeLocations objects that occur within a code flow. Remove the "essential" property.
+
+
+ In "{0}", at "{1}", the array contains multiple objects with the value "{2}" for the algorithm property.
+
+
+ In any given "file" object, every element of the "hashes" array must have a different value for its "algorithm" property.
+
+
+ In "{0}", at "{1}", the end time "{2}" is before the start time "{3}".
+
+
+ The end time of a run must be after the start time. To allow for the possibility that the duration of the run is less than the resolution of the string representation of the time, the start time and the end time may be equal.
+
+
+ In "{0}", at "{1}", the message "{2}" does not end with a period.
+
+
+ Messages should consist of one or more complete sentences, ending with a period.
+
+
+ In "{0}", at "{1}", the value of the "step" property should be {2}, but is {3}. The step values must form a 1-based sequence starting at the first location in the code flow.
+
+
+ In "{0}", at "{1}", the "step" property is absent. The "step" property is present on some but not all locations in this code flow. If the "step" property is used on any location in a code flow, it must be present on every location in that code flow.
+
+
+ If the "step" property is used on any annotatedCodeLocation in a code flow, then it must be present for every location in the code flow, its value must be 1 for the first location, and its value must increase by 1 for each succeeding location.
+
+
+ In "{0}", at "{1}", the "step" property appears in an annotatedCodeLocation object which does not occur in a code flow. The "step" property must appear only in annotatedCodeLocation objects which occur within code flows.
+
+
+ The "step" property must appear only in annotatedCodeLocation objects which occur within code flows.
+
+
+ In "{0}", at "{1}", the "importance" property appears in an annotatedCodeLocation object which does not occur in a code flow. The "importance" property must appear only in annotatedCodeLocation objects which occur within code flows.
+
+
+ The "importance" property must appear only in annotatedCodeLocation objects which occur within code flows.
+
+
+ In "{0}", at "{1}", the value of the "endLine" property is {2}, which is less than the value of the "startLine" property, which is {3}.
+
+
+ The "endLine" property of a region object must not be less than the "startLine" property.
+
+
+ In "{0}", at "{1}", the value of the "endColumn" property is {2}, which is less than the value of the "startColumn" property, which is {3}.
+
+
+ The "endColumn" property of a region object must not be less than the "startColumn" property.
+
+
\ No newline at end of file
diff --git a/src/SarifCli/Rules/SarifValidationSkimmerBase.cs b/src/SarifCli/Rules/SarifValidationSkimmerBase.cs
new file mode 100644
index 000000000..35c8933d3
--- /dev/null
+++ b/src/SarifCli/Rules/SarifValidationSkimmerBase.cs
@@ -0,0 +1,416 @@
+// 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.Linq;
+using System.Resources;
+using Microsoft.CodeAnalysis.Sarif.Driver;
+using Microsoft.Json.Pointer;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.Rules
+{
+ public abstract class SarifValidationSkimmerBase : SkimmerBase
+ {
+ private const string SarifSpecUri =
+ "https://rawgit.com/sarif-standard/sarif-spec/master/Static%20Analysis%20Results%20Interchange%20Format%20(SARIF).html";
+
+ private readonly Uri _defaultHelpUri = new Uri(SarifSpecUri);
+
+ public override Uri HelpUri => _defaultHelpUri;
+
+ protected SarifValidationContext Context { get; private set; }
+
+ protected override sealed ResourceManager ResourceManager => RuleResources.ResourceManager;
+
+ public override sealed void Analyze(SarifValidationContext context)
+ {
+ Context = context;
+ Context.InputLogToken = JToken.Parse(Context.InputLogContents);
+
+ Visit(Context.InputLog, logPointer: string.Empty);
+ }
+
+ protected void LogResult(string jPointer, string formatId, params string[] args)
+ {
+ Region region = GetRegionFromJPointer(jPointer);
+
+ // All messages start with "In {file}, at {jPointer}, ...". Prepend the jPointer to the args.
+ // The Sarif.Driver framework will take care of prepending the file name.
+ string[] argsWithPointer = new string[args.Length + 1];
+ Array.Copy(args, 0, argsWithPointer, 1, args.Length);
+ argsWithPointer[0] = jPointer;
+
+ Context.Logger.Log(this,
+ RuleUtilities.BuildResult(DefaultLevel, Context, region, formatId, argsWithPointer));
+ }
+
+ protected virtual void Analyze(AnnotatedCodeLocation annotatedCodeLocation, string annotatedCodeLocationPointer)
+ {
+ }
+
+ protected virtual void Analyze(CodeFlow codeFlow, string codeFlowPointer)
+ {
+ }
+
+ protected virtual void Analyze(FileChange fileChange, string fileChangePointer)
+ {
+ }
+
+ protected virtual void Analyze(FileData fileData, string fileKey, string filePointer)
+ {
+ }
+
+ protected virtual void Analyze(Invocation invocation, string invocationPointer)
+ {
+ }
+
+ protected virtual void Analyze(Notification notification, string notificationPointer)
+ {
+ }
+
+ protected virtual void Analyze(PhysicalLocation physicalLocation, string physicalLocationPointer)
+ {
+ }
+
+ protected virtual void Analyze(Region region, string regionPointer)
+ {
+ }
+
+ protected virtual void Analyze(Result result, string resultPointer)
+ {
+ }
+
+ protected virtual void Analyze(Rule rule, string rulePointer)
+ {
+ }
+
+ protected virtual void Analyze(Stack stack, string stackPointer)
+ {
+ }
+
+ protected virtual void Analyze(StackFrame frame, string framePointer)
+ {
+ }
+
+ private void Visit(SarifLog log, string logPointer)
+ {
+ if (log.Runs != null)
+ {
+ Run[] runs = log.Runs.ToArray();
+ string runsPointer = logPointer.AtProperty(SarifPropertyName.Runs);
+
+ for (int iRun = 0; iRun < runs.Length; ++iRun)
+ {
+ Run run = runs[iRun];
+ string runPointer = runsPointer.AtIndex(iRun);
+
+ Visit(run, runPointer);
+ }
+ }
+ }
+
+ private void Visit(AnnotatedCodeLocation annotatedCodeLocation, string annotatedCodeLocationPointer)
+ {
+ Analyze(annotatedCodeLocation, annotatedCodeLocationPointer);
+
+ if (annotatedCodeLocation.PhysicalLocation != null)
+ {
+ string physicalLocationPointer = annotatedCodeLocationPointer.AtProperty(SarifPropertyName.PhysicalLocation);
+ Visit(annotatedCodeLocation.PhysicalLocation, physicalLocationPointer);
+ }
+ }
+
+ private void Visit(CodeFlow codeFlow, string codeFlowPointer)
+ {
+ Analyze(codeFlow, codeFlowPointer);
+
+ if (codeFlow.Locations != null)
+ {
+ AnnotatedCodeLocation[] annotatedCodeLocations = codeFlow.Locations.ToArray();
+ string annotatedCodeLocationsPointer = codeFlowPointer.AtProperty(SarifPropertyName.Locations);
+
+ for (int iAnnotatedCodeLocation = 0; iAnnotatedCodeLocation < annotatedCodeLocations.Length; ++iAnnotatedCodeLocation)
+ {
+ AnnotatedCodeLocation annotatedCodeLocation = annotatedCodeLocations[iAnnotatedCodeLocation];
+ string annotatedCodeLocationPointer = annotatedCodeLocationsPointer.AtIndex(iAnnotatedCodeLocation);
+
+ Visit(annotatedCodeLocation, annotatedCodeLocationPointer);
+ }
+ }
+ }
+
+ private void Visit(FileData fileData, string fileKey, string filePointer)
+ {
+ Analyze(fileData, fileKey, filePointer);
+ }
+
+ private void Visit(Fix fix, string fixPointer)
+ {
+ if (fix.FileChanges != null)
+ {
+ FileChange[] fileChanges = fix.FileChanges.ToArray();
+ string fileChangesPointer = fixPointer.AtProperty(SarifPropertyName.FileChanges);
+
+ for (int iFileChange = 0; iFileChange < fileChanges.Length; ++iFileChange)
+ {
+ FileChange fileChange = fileChanges[iFileChange];
+ string fileChangePointer = fileChangesPointer.AtIndex(iFileChange);
+
+ Visit(fileChange, fileChangePointer);
+ }
+ }
+ }
+
+ private void Visit(FileChange fileChange, string fileChangePointer)
+ {
+ Analyze(fileChange, fileChangePointer);
+ }
+
+ private void Visit(Invocation invocation, string invocationPointer)
+ {
+ Analyze(invocation, invocationPointer);
+ }
+
+ private void Visit(Location location, string locationPointer)
+ {
+ if (location.AnalysisTarget != null)
+ {
+ string analysisTargetPointer = locationPointer.AtProperty(SarifPropertyName.AnalysisTarget);
+ Visit(location.AnalysisTarget, analysisTargetPointer);
+ }
+
+ if (location.ResultFile != null)
+ {
+ string resultFilePointer = locationPointer.AtProperty(SarifPropertyName.ResultFile);
+ Visit(location.ResultFile, resultFilePointer);
+ }
+ }
+
+ private void Visit(Notification notification, string notificationPointer)
+ {
+ Analyze(notification, notificationPointer);
+
+ if (notification.PhysicalLocation != null)
+ {
+ string physicalLocationPointer = notificationPointer.AtProperty(SarifPropertyName.PhysicalLocation);
+
+ Visit(notification.PhysicalLocation, physicalLocationPointer);
+ }
+ }
+
+ private void Visit(PhysicalLocation physicalLocation, string physicalLocationPointer)
+ {
+ Analyze(physicalLocation, physicalLocationPointer);
+
+ if (physicalLocation.Region != null)
+ {
+ string regionPointer = physicalLocationPointer.AtProperty(SarifPropertyName.Region);
+
+ Visit(physicalLocation.Region, regionPointer);
+ }
+ }
+
+ private void Visit(Region region, string regionPointer)
+ {
+ Analyze(region, regionPointer);
+ }
+
+ private void Visit(Result result, string resultPointer)
+ {
+ Analyze(result, resultPointer);
+
+ if (result.Locations != null)
+ {
+ Location[] locations = result.Locations.ToArray();
+ string locationsPointer = resultPointer.AtProperty(SarifPropertyName.Locations);
+
+ for (int iLocation = 0; iLocation < locations.Length; ++iLocation)
+ {
+ Location location = locations[iLocation];
+ string locationPointer = locationsPointer.AtIndex(iLocation);
+
+ Visit(location, locationPointer);
+ }
+ }
+
+ if (result.CodeFlows != null)
+ {
+ CodeFlow[] codeFlows = result.CodeFlows.ToArray();
+ string codeFlowsPointer = resultPointer.AtProperty(SarifPropertyName.CodeFlows);
+
+ for (int iCodeFlow = 0; iCodeFlow < codeFlows.Length; ++iCodeFlow)
+ {
+ CodeFlow codeFlow = codeFlows[iCodeFlow];
+ string codeFlowPointer = codeFlowsPointer.AtIndex(iCodeFlow);
+
+ Visit(codeFlow, codeFlowPointer);
+ }
+ }
+
+ if (result.Stacks != null)
+ {
+ Stack[] stacks = result.Stacks.ToArray();
+ string stacksPointer = resultPointer.AtProperty(SarifPropertyName.Stacks);
+
+ for (int iStack = 0; iStack < stacks.Length; ++iStack)
+ {
+ Stack stack = stacks[iStack];
+ string stackPointer = stacksPointer.AtIndex(iStack);
+
+ Visit(stack, stackPointer);
+ }
+ }
+
+ if (result.RelatedLocations != null)
+ {
+ AnnotatedCodeLocation[] relatedLocations = result.RelatedLocations.ToArray();
+ string relatedLocationsPointer = resultPointer.AtProperty(SarifPropertyName.RelatedLocations);
+
+ for (int iRelatedLocation = 0; iRelatedLocation < relatedLocations.Length; ++iRelatedLocation)
+ {
+ AnnotatedCodeLocation relatedLocation = relatedLocations[iRelatedLocation];
+ string relatedLocationPointer = relatedLocationsPointer.AtIndex(iRelatedLocation);
+
+ Visit(relatedLocation, relatedLocationPointer);
+ }
+ }
+
+ if (result.Fixes != null)
+ {
+ Fix[] fixes = result.Fixes.ToArray();
+ string fixesPointer = resultPointer.AtProperty(SarifPropertyName.Fixes);
+
+ for (int iFix = 0; iFix < fixes.Length; ++iFix)
+ {
+ Fix fix = fixes[iFix];
+ string fixPointer = fixesPointer.AtIndex(iFix);
+
+ Visit(fix, fixPointer);
+ }
+ }
+ }
+
+ private void Visit(Run run, string runPointer)
+ {
+ if (run.Results != null)
+ {
+ Result[] results = run.Results.ToArray();
+ string resultsPointer = runPointer.AtProperty(SarifPropertyName.Results);
+
+ for (int iResult = 0; iResult < results.Length; ++iResult)
+ {
+ Result result = results[iResult];
+ string resultPointer = resultsPointer.AtIndex(iResult);
+
+ Visit(result, resultPointer);
+ }
+ }
+
+ if (run.Files != null)
+ {
+ IDictionary files = run.Files;
+ string filesPointer = runPointer.AtProperty(SarifPropertyName.Files);
+
+ foreach (string fileKey in files.Keys)
+ {
+ string filePointer = filesPointer.AtProperty(fileKey);
+
+ Visit(files[fileKey], fileKey, filePointer);
+ }
+ }
+
+ if (run.Rules != null)
+ {
+ Rule[] rules = run.Rules.Values.ToArray();
+ string rulesPointer = runPointer.AtProperty(SarifPropertyName.Rules);
+
+ for (int iRule = 0; iRule < rules.Length; ++iRule)
+ {
+ Rule rule = rules[iRule];
+ if (rule.Id != null)
+ {
+ string rulePointer = rulesPointer.AtProperty(rule.Id);
+ Analyze(rule, rulePointer);
+ }
+ }
+ }
+
+ if (run.ToolNotifications != null)
+ {
+ Visit(run.ToolNotifications, runPointer, SarifPropertyName.ToolNotifications);
+ }
+
+ if (run.ConfigurationNotifications != null)
+ {
+ Visit(run.ConfigurationNotifications, runPointer, SarifPropertyName.ConfigurationNotifications);
+ }
+
+ if (run.Invocation != null)
+ {
+ string invocationPointer = runPointer.AtProperty(SarifPropertyName.Invocation);
+
+ Visit(run.Invocation, invocationPointer);
+ }
+ }
+
+ private void Visit(IList notifications, string parentPointer, string propertyName)
+ {
+ Notification[] notificationsArray = notifications.ToArray();
+ string notificationsPointer = parentPointer.AtProperty(propertyName);
+
+ for (int iNotification = 0; iNotification < notificationsArray.Length; ++iNotification)
+ {
+ Notification notification = notificationsArray[iNotification];
+ string notificationPointer = notificationsPointer.AtIndex(iNotification);
+
+ Visit(notification, notificationPointer);
+ }
+ }
+
+ private void Visit(Stack stack, string stackPointer)
+ {
+ Analyze(stack, stackPointer);
+
+ if (stack.Frames != null)
+ {
+ StackFrame[] frames = stack.Frames.ToArray();
+ string framesPointer = stackPointer.AtProperty(SarifPropertyName.Frames);
+
+ for (int iFrame = 0; iFrame < frames.Length; ++iFrame)
+ {
+ StackFrame frame = frames[iFrame];
+ string framePointer = framesPointer.AtIndex(iFrame);
+
+ Visit(frame, framePointer);
+ }
+ }
+ }
+
+ private void Visit(StackFrame frame, string framePointer)
+ {
+ Analyze(frame, framePointer);
+ }
+
+ private Region GetRegionFromJPointer(string jPointer)
+ {
+ JsonPointer jsonPointer = new JsonPointer(jPointer);
+ JToken jToken = jsonPointer.Evaluate(Context.InputLogToken);
+ IJsonLineInfo lineInfo = jToken;
+
+ Region region = null;
+ if (lineInfo.HasLineInfo())
+ {
+ region = new Region
+ {
+ StartLine = lineInfo.LineNumber,
+ StartColumn = lineInfo.LinePosition
+ };
+ }
+
+ return region;
+ }
+ }
+}
diff --git a/src/SarifCli/Rules/StepMustAppearOnlyInCodeFlowLocations.cs b/src/SarifCli/Rules/StepMustAppearOnlyInCodeFlowLocations.cs
new file mode 100644
index 000000000..e63ad93d3
--- /dev/null
+++ b/src/SarifCli/Rules/StepMustAppearOnlyInCodeFlowLocations.cs
@@ -0,0 +1,50 @@
+// 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.Linq;
+using Microsoft.Json.Pointer;
+using Newtonsoft.Json.Linq;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.Rules
+{
+ public class StepMustAppearOnlyInCodeFlowLocations : SarifValidationSkimmerBase
+ {
+ public override string FullDescription => RuleResources.SV0010_StepMustAppearOnlyInCodeFlowLocations;
+
+ public override ResultLevel DefaultLevel => ResultLevel.Warning;
+
+ ///
+ /// SV0010
+ ///
+ public override string Id => RuleId.StepMustAppearOnlyInCodeFlowLocations;
+
+ protected override IEnumerable FormatIds
+ {
+ get
+ {
+ return new string[]
+ {
+ nameof(RuleResources.SV0010_Default)
+ };
+ }
+ }
+
+ protected override void Analyze(AnnotatedCodeLocation annotatedCodeLocation, string annotatedCodeLocationPointer)
+ {
+ var pointer = new JsonPointer(annotatedCodeLocationPointer);
+ JToken token = pointer.Evaluate(Context.InputLogToken);
+
+ if (token.HasProperty(SarifPropertyName.Step))
+ {
+ if (!annotatedCodeLocationPointer.Contains(SarifPropertyName.CodeFlows))
+ {
+ string stepPointer = annotatedCodeLocationPointer.AtProperty(SarifPropertyName.Step);
+
+ LogResult(stepPointer, nameof(RuleResources.SV0010_Default));
+ }
+ }
+ }
+ }
+}
diff --git a/src/SarifCli/Rules/StepValuesMustFormOneBasedSequence.cs b/src/SarifCli/Rules/StepValuesMustFormOneBasedSequence.cs
new file mode 100644
index 000000000..4fbe15ef2
--- /dev/null
+++ b/src/SarifCli/Rules/StepValuesMustFormOneBasedSequence.cs
@@ -0,0 +1,139 @@
+// 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.Diagnostics;
+using System.Linq;
+using Microsoft.Json.Pointer;
+using Newtonsoft.Json.Linq;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.Rules
+{
+ public class StepValuesMustFormOneBasedSequence : SarifValidationSkimmerBase
+ {
+ public override string FullDescription => RuleResources.SV0009_StepValuesMustFormOneBasedSequence;
+
+ public override ResultLevel DefaultLevel => ResultLevel.Error;
+
+ ///
+ /// SV0009
+ ///
+ public override string Id => RuleId.StepValuesMustFormOneBasedSequence;
+
+ protected override IEnumerable FormatIds
+ {
+ get
+ {
+ return new string[]
+ {
+ nameof(RuleResources.SV0009_StepNotPresentOnAllLocations),
+ nameof(RuleResources.SV0009_InvalidStepValue)
+ };
+ }
+ }
+
+ protected override void Analyze(CodeFlow codeFlow, string codeFlowPointer)
+ {
+ var pointer = new JsonPointer(codeFlowPointer);
+ JToken codeFlowToken = pointer.Evaluate(Context.InputLogToken);
+
+ JProperty locationsProperty = codeFlowToken.Children()
+ .FirstOrDefault(prop => prop.Name.Equals(SarifPropertyName.Locations, StringComparison.Ordinal));
+ if (locationsProperty != null)
+ {
+ JArray annotatedCodeLocationArray = locationsProperty.Value as JArray;
+ string annotatedCodeLocationsPointer = codeFlowPointer.AtProperty(SarifPropertyName.Locations);
+
+ ReportMissingStepProperty(
+ annotatedCodeLocationArray,
+ annotatedCodeLocationsPointer);
+
+ ReportInvalidStepValues(
+ codeFlow.Locations.ToArray(),
+ annotatedCodeLocationArray,
+ annotatedCodeLocationsPointer);
+ }
+ }
+
+ private void ReportInvalidStepValues(
+ AnnotatedCodeLocation[] locations,
+ JArray annotatedCodeLocationArray,
+ string annotatedCodeLocationsPointer)
+ {
+ JObject[] annotatedCodeLocationObjects = annotatedCodeLocationArray.Children().ToArray();
+
+ for (int i = 0; i < locations.Length; ++i)
+ {
+ // Only report "invalid step value" for locations that actually specify
+ // the "step" property (the value of the Step property in the object
+ // model will be 0 for such steps, which is never valid), because we
+ // already reported the missing "step" properties.
+ if (LocationHasStep(annotatedCodeLocationObjects[i]) &&
+ locations[i].Step != i + 1)
+ {
+ string invalidStepPointer = annotatedCodeLocationsPointer
+ .AtIndex(i).AtProperty(SarifPropertyName.Step);
+
+ LogResult(
+ invalidStepPointer,
+ nameof(RuleResources.SV0009_InvalidStepValue),
+ (i + 1).ToInvariantString(),
+ (locations[i].Step).ToInvariantString());
+ }
+ }
+ }
+
+ private void ReportMissingStepProperty(
+ JArray annotatedCodeLocationArray,
+ string annotatedCodeLocationsPointer)
+ {
+ JObject[] annotatedCodeLocationObjects = annotatedCodeLocationArray.Children().ToArray();
+ if (annotatedCodeLocationObjects.Length > 0)
+ {
+ JObject[] locationsWithStep = GetLocationsWithStep(annotatedCodeLocationObjects);
+
+ // It's ok if there are no steps, but if any location has a step property,
+ // all locations must have it.
+ if (locationsWithStep.Length > 0 &&
+ locationsWithStep.Length < annotatedCodeLocationObjects.Length)
+ {
+ int missingStepIndex = FindFirstLocationWithMissingStep(annotatedCodeLocationObjects);
+ Debug.Assert(missingStepIndex != -1, "Couldn't find location with missing step.");
+
+ string missingStepPointer = annotatedCodeLocationsPointer.AtIndex(missingStepIndex);
+
+ LogResult(missingStepPointer, nameof(RuleResources.SV0009_StepNotPresentOnAllLocations));
+ }
+ }
+ }
+
+ private int FindFirstLocationWithMissingStep(JObject[] annotatedCodeLocationObjects)
+ {
+ int index = -1;
+
+ for (int i = 0; i < annotatedCodeLocationObjects.Length; ++i)
+ {
+ if (!annotatedCodeLocationObjects[i].HasProperty(SarifPropertyName.Step))
+ {
+ index = i;
+ break;
+ }
+ }
+
+ return index;
+ }
+
+ private static JObject[] GetLocationsWithStep(JObject[] annotatedCodeLocationObjects)
+ {
+ return annotatedCodeLocationObjects
+ .Where(LocationHasStep)
+ .ToArray();
+ }
+
+ private static bool LocationHasStep(JObject loc)
+ {
+ return loc.HasProperty(SarifPropertyName.Step);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/SarifCli/Rules/UrisMustBeValid.cs b/src/SarifCli/Rules/UrisMustBeValid.cs
new file mode 100644
index 000000000..4da5bdd37
--- /dev/null
+++ b/src/SarifCli/Rules/UrisMustBeValid.cs
@@ -0,0 +1,98 @@
+// 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;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.Rules
+{
+ public class UrisMustBeValid : SarifValidationSkimmerBase
+ {
+ public override string FullDescription => RuleResources.SV0003_UrisMustBeValid;
+
+ public override ResultLevel DefaultLevel => ResultLevel.Error;
+
+ ///
+ /// SV0003
+ ///
+ public override string Id => RuleId.UrisMustBeValid;
+
+ protected override IEnumerable FormatIds
+ {
+ get
+ {
+ return new string[]
+ {
+ nameof(RuleResources.SV0003_Default)
+ };
+ }
+ }
+
+ protected override void Analyze(FileChange fileChange, string fileChangePointer)
+ {
+ AnalyzeUri(fileChange.Uri, fileChangePointer);
+ }
+
+ protected override void Analyze(FileData fileData, string fileKey, string filePointer)
+ {
+ // Check the property name, which must be a valid URI.
+ // We can't use AnalyzeUri for this because that method appends "/uri"
+ // to the JSON pointer, whereas here, the JSON pointer we have in
+ // hand (filePointer) already points right to the property we are
+ // examining.
+ string fileUriReference = fileKey.UnescapeJsonPointer();
+ try
+ {
+ Uri fileUri = new Uri(fileUriReference);
+ }
+ catch
+ {
+ LogResult(
+ filePointer,
+ nameof(RuleResources.SV0003_Default),
+ fileUriReference);
+ }
+
+ // Then check the "uri" property, if any, of the property value.
+ AnalyzeUri(fileData.Uri, filePointer);
+ }
+
+ protected override void Analyze(PhysicalLocation physicalLocation, string physicalLocationPointer)
+ {
+ AnalyzeUri(physicalLocation.Uri, physicalLocationPointer);
+ }
+
+ protected override void Analyze(StackFrame frame, string framePointer)
+ {
+ AnalyzeUri(frame.Uri, framePointer);
+ }
+
+ protected override void Analyze(Rule rule, string rulePointer)
+ {
+ AnalyzeUri(rule.HelpUri, rulePointer, "helpUri");
+ }
+
+ private void AnalyzeUri(
+ Uri uri,
+ string parentPointer,
+ string childPropertyName = SarifPropertyName.Uri)
+ {
+ if (uri != null)
+ {
+ try
+ {
+ Uri fileUri = new Uri(uri.OriginalString);
+ }
+ catch
+ {
+ string uriPointer = parentPointer.AtProperty(childPropertyName);
+
+ LogResult(
+ uriPointer,
+ nameof(RuleResources.SV0003_Default),
+ uri.OriginalString);
+ }
+ }
+ }
+ }
+}
diff --git a/src/SarifCli/Rules/UseAbsolutePathsForNestedFileUriFragments.cs b/src/SarifCli/Rules/UseAbsolutePathsForNestedFileUriFragments.cs
new file mode 100644
index 000000000..a0c4408b4
--- /dev/null
+++ b/src/SarifCli/Rules/UseAbsolutePathsForNestedFileUriFragments.cs
@@ -0,0 +1,105 @@
+// 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;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli.Rules
+{
+ public class UseAbsolutePathsForNestedFileUriFragments : SarifValidationSkimmerBase
+ {
+ public override string FullDescription => RuleResources.SV0002_UseAbsolutePathsForNestedFileUriFragmentsDescription;
+
+ public override ResultLevel DefaultLevel => ResultLevel.Error;
+
+ ///
+ /// SV0002
+ ///
+ public override string Id => RuleId.UseAbsolutePathsForNestedFileUriFragments;
+
+ protected override IEnumerable FormatIds
+ {
+ get
+ {
+ return new string[]
+ {
+ nameof(RuleResources.SV0002_Default)
+ };
+ }
+ }
+
+ protected override void Analyze(FileChange fileChange, string fileChangePointer)
+ {
+ AnalyzeUri(fileChange.Uri, fileChangePointer);
+ }
+
+ protected override void Analyze(FileData fileData, string fileKey, string filePointer)
+ {
+ try
+ {
+ Uri fileUri = new Uri(fileKey);
+ if (UriHasNonAbsoluteFragment(fileUri))
+ {
+ LogResult(
+ filePointer,
+ nameof(RuleResources.SV0002_Default),
+ fileUri.OriginalString);
+ }
+ }
+ catch
+ {
+ // It wasn't a value URI. Rule SV0003, UrisMustBeValid, will catch this problem.
+ }
+
+ AnalyzeUri(fileData.Uri, filePointer);
+ }
+
+ protected override void Analyze(PhysicalLocation physicalLocation, string physicalLocationPointer)
+ {
+ AnalyzeUri(physicalLocation.Uri, physicalLocationPointer);
+ }
+
+ protected override void Analyze(StackFrame frame, string framePointer)
+ {
+ AnalyzeUri(frame.Uri, framePointer);
+ }
+
+ private void AnalyzeUri(Uri uri, string parentPointer)
+ {
+ if (UriHasNonAbsoluteFragment(uri))
+ {
+ string uriPointer = parentPointer.AtProperty(SarifPropertyName.Uri);
+
+ LogResult(
+ uriPointer,
+ nameof(RuleResources.SV0002_Default),
+ uri.OriginalString);
+ }
+ }
+
+ private bool UriHasNonAbsoluteFragment(Uri uri)
+ {
+ if (uri == null)
+ {
+ return false;
+ }
+
+ // You can't access the Fragment property of a relative URI, so if this URI is
+ // relative, turn it into a fake absolute URI, and get the fragment from that.
+ Uri absoluteUri = uri.IsAbsoluteUri
+ ? uri
+ : MakeFakeAbsoluteUri(uri);
+
+ string fragment = absoluteUri.Fragment;
+
+ return !string.IsNullOrEmpty(fragment) && !fragment.StartsWith("#/", StringComparison.Ordinal);
+ }
+
+ private static readonly Uri _fakeBaseUri = new Uri("file:///root", UriKind.Absolute);
+
+ private Uri MakeFakeAbsoluteUri(Uri relativeUri)
+ {
+ return new Uri(_fakeBaseUri, relativeUri);
+ }
+ }
+}
diff --git a/src/SarifCli/SarifCli.csproj b/src/SarifCli/SarifCli.csproj
new file mode 100644
index 000000000..0fe603ce8
--- /dev/null
+++ b/src/SarifCli/SarifCli.csproj
@@ -0,0 +1,157 @@
+
+
+
+ {0EBA700D-29E7-4FFF-8EBF-20B8C0EF9A98}
+ Exe
+ Microsoft.CodeAnalysis.Sarif.Cli
+ SarifCli
+ true
+ false
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ true
+
+
+ true
+ ..\..\GeneratedKey.snk
+
+
+ true
+
+
+
+ v4.5.1
+
+
+
+ ..\packages\CommandLineParser.2.0.275-beta\lib\net45\CommandLine.dll
+ True
+
+
+ ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll
+ True
+
+
+ ..\packages\Sarif.Sdk.1.5.29\lib\net45\Sarif.dll
+ True
+
+
+ ..\packages\Sarif.Driver.1.5.29\lib\net45\Sarif.Driver.dll
+ True
+
+
+ ..\packages\Microsoft.Json.Schema.0.46.0\lib\net451\Microsoft.Json.Schema.dll
+ True
+
+
+ ..\packages\Microsoft.Json.Pointer.0.46.0\lib\net451\Microsoft.Json.Pointer.dll
+ True
+
+
+
+ ..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll
+ True
+
+
+ ..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.Convention.dll
+ True
+
+
+ ..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.Hosting.dll
+ True
+
+
+ ..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.Runtime.dll
+ True
+
+
+ ..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll
+ True
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+ True
+ RuleResources.resx
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+ True
+ Resources.resx
+
+
+
+
+
+ Designer
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+ ResXFileCodeGenerator
+ RuleResources.Designer.cs
+ Designer
+
+
+
+
+ False
+ Microsoft .NET Framework 4.5.1 %28x86 and x64%29
+ true
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
+
+
\ No newline at end of file
diff --git a/src/SarifCli/SarifPropertyName.cs b/src/SarifCli/SarifPropertyName.cs
new file mode 100644
index 000000000..8c87c861a
--- /dev/null
+++ b/src/SarifCli/SarifPropertyName.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli
+{
+ public static class SarifPropertyName
+ {
+ public const string AnalysisTarget = "analysisTarget";
+ public const string CodeFlows = "codeFlows";
+ public const string ConfigurationNotifications = "configurationNotifications";
+ public const string EndColumn = "endColumn";
+ public const string EndLine = "endLine";
+ public const string EndTime = "endTime";
+ public const string Essential = "essential";
+ public const string FileChanges = "fileChanges";
+ public const string Files = "files";
+ public const string Fixes = "fixes";
+ public const string Frames = "frames";
+ public const string Hashes = "hashes";
+ public const string Id = "id";
+ public const string Importance = "importance";
+ public const string Invocation = "invocation";
+ public const string Locations = "locations";
+ public const string Message = "message";
+ public const string MessageFormats = "messageFormats";
+ public const string PhysicalLocation = "physicalLocation";
+ public const string Region = "region";
+ public const string RelatedLocations = "relatedLocations";
+ public const string ResultFile = "resultFile";
+ public const string Results = "results";
+ public const string Rules = "rules";
+ public const string Runs = "runs";
+ public const string Stacks = "stacks";
+ public const string Step = "step";
+ public const string ToolNotifications = "toolNotifications";
+ public const string Uri = "uri";
+ }
+}
diff --git a/src/SarifCli/SarifValidationContext.cs b/src/SarifCli/SarifValidationContext.cs
new file mode 100644
index 000000000..dd9c59482
--- /dev/null
+++ b/src/SarifCli/SarifValidationContext.cs
@@ -0,0 +1,69 @@
+// 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.IO;
+using Newtonsoft.Json.Linq;
+
+namespace Microsoft.CodeAnalysis.Sarif.Cli
+{
+ public class SarifValidationContext : IAnalysisContext
+ {
+ public bool IsValidAnalysisTarget
+ {
+ get
+ {
+ return Path.GetExtension(TargetUri.LocalPath).Equals(".sarif", StringComparison.OrdinalIgnoreCase);
+ }
+ }
+
+ public IAnalysisLogger Logger { get; set; }
+
+ public string MimeType
+ {
+ get { return "text/x-sarif"; }
+ set { throw new InvalidOperationException(); }
+ }
+
+ public PropertiesDictionary Policy { get; set; }
+
+ public IRule Rule { get; set; }
+
+ public RuntimeConditions RuntimeErrors { get; set; }
+
+ public Exception TargetLoadException { get; set; }
+
+ private Uri _uri;
+
+ public Uri TargetUri
+ {
+ get
+ {
+ return _uri;
+ }
+
+ set
+ {
+ if (_uri != null)
+ {
+ throw new InvalidOperationException(Resources.ErrorIllegalContextReuse);
+ }
+
+ _uri = value;
+ }
+ }
+
+ public string SchemaFilePath { get; internal set; }
+
+ public string InputLogContents { get; internal set; }
+
+ public SarifLog InputLog { get; internal set; }
+
+ public JToken InputLogToken { get; internal set; }
+
+ public void Dispose()
+ {
+ // Nothing to dispose.
+ }
+ }
+}
diff --git a/src/SarifCli/packages.config b/src/SarifCli/packages.config
new file mode 100644
index 000000000..29f6f2702
--- /dev/null
+++ b/src/SarifCli/packages.config
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/SarifValidator/CommandLineOptions.cs b/src/SarifValidator/CommandLineOptions.cs
deleted file mode 100644
index 94b67df59..000000000
--- a/src/SarifValidator/CommandLineOptions.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using CommandLine;
-
-namespace Microsoft.CodeAnalysis.Sarif.SarifValidator
-{
- internal class CommandLineOptions
- {
- [Value(0,
- MetaName = "",
- HelpText = "Path to the SARIF log file to be validated.",
- Required = true)]
- public string InputFilePath { get; set; }
- }
-}
diff --git a/src/SarifValidator/Properties/AssemblyInfo.cs b/src/SarifValidator/Properties/AssemblyInfo.cs
deleted file mode 100644
index b1da6e5ae..000000000
--- a/src/SarifValidator/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Reflection;
-
-[assembly: AssemblyTitle("SARIF Validation Tool")]
-[assembly: AssemblyDescription("Command line tool for validating SARIF log files.")]
-
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
\ No newline at end of file
diff --git a/src/SarifValidator/SarifValidator.csproj b/src/SarifValidator/SarifValidator.csproj
deleted file mode 100644
index 4ce2d3582..000000000
--- a/src/SarifValidator/SarifValidator.csproj
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
- {0EBA700D-29E7-4FFF-8EBF-20B8C0EF9A98}
- Exe
- Microsoft.CodeAnalysis.Sarif.SarifValidator
- SarifValidator
- true
-
-
-
-
- ..\packages\CommandLineParser.2.0.275-beta\lib\net45\CommandLine.dll
- True
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- True
- True
- Resources.resx
-
-
-
-
-
-
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
-
-
-
\ No newline at end of file
diff --git a/src/SarifValidator/packages.config b/src/SarifValidator/packages.config
deleted file mode 100644
index 7054a28c4..000000000
--- a/src/SarifValidator/packages.config
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file