diff --git a/src/Sarif.Converters.UnitTests/ConverterTestsBase.cs b/src/Sarif.Converters.UnitTests/ConverterTestsBase.cs index 8bed4ad8d..91d676eeb 100644 --- a/src/Sarif.Converters.UnitTests/ConverterTestsBase.cs +++ b/src/Sarif.Converters.UnitTests/ConverterTestsBase.cs @@ -4,7 +4,6 @@ using FluentAssertions; using Microsoft.CodeAnalysis.Sarif.Converters; -using Microsoft.CodeAnalysis.Sarif.Readers; using Microsoft.CodeAnalysis.Sarif.TestUtilities; using Newtonsoft.Json; diff --git a/src/Sarif.Converters.UnitTests/FortifyFprConverterTests.cs b/src/Sarif.Converters.UnitTests/FortifyFprConverterTests.cs index c1de5c04d..1afb35ddb 100644 --- a/src/Sarif.Converters.UnitTests/FortifyFprConverterTests.cs +++ b/src/Sarif.Converters.UnitTests/FortifyFprConverterTests.cs @@ -1,7 +1,6 @@ // 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 Xunit; using Xunit.Abstractions; diff --git a/src/Sarif.Converters/SemmleQlConverter.cs b/src/Sarif.Converters/SemmleQlConverter.cs index 3af6e4569..665d6a993 100644 --- a/src/Sarif.Converters/SemmleQlConverter.cs +++ b/src/Sarif.Converters/SemmleQlConverter.cs @@ -5,10 +5,8 @@ using System.Collections.Generic; using System.Globalization; using System.IO; -using System.Linq; using System.Text; using CsvHelper; -using Microsoft.CodeAnalysis.Sarif.Visitors; namespace Microsoft.CodeAnalysis.Sarif.Converters { diff --git a/src/Sarif.Converters/ToolFileConverterBase.cs b/src/Sarif.Converters/ToolFileConverterBase.cs index 8ad4b08f9..034fa9de3 100644 --- a/src/Sarif.Converters/ToolFileConverterBase.cs +++ b/src/Sarif.Converters/ToolFileConverterBase.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; -using System.Linq; using Microsoft.CodeAnalysis.Sarif.Visitors; using Microsoft.CodeAnalysis.Sarif.Writers; diff --git a/src/Sarif.Driver.UnitTests/Sdk/AnalyzeCommandBaseTests.cs b/src/Sarif.Driver.UnitTests/Sdk/AnalyzeCommandBaseTests.cs index 8cc420660..05968811e 100644 --- a/src/Sarif.Driver.UnitTests/Sdk/AnalyzeCommandBaseTests.cs +++ b/src/Sarif.Driver.UnitTests/Sdk/AnalyzeCommandBaseTests.cs @@ -8,7 +8,6 @@ using System.Reflection; using FluentAssertions; using Microsoft.CodeAnalysis.Sarif.Readers; -using Microsoft.CodeAnalysis.Sarif.VersionOne; using Newtonsoft.Json; using Xunit; diff --git a/src/Sarif.Driver.UnitTests/TestRuleBase.cs b/src/Sarif.Driver.UnitTests/TestRuleBase.cs index 17640ebde..6ae287642 100644 --- a/src/Sarif.Driver.UnitTests/TestRuleBase.cs +++ b/src/Sarif.Driver.UnitTests/TestRuleBase.cs @@ -1,9 +1,7 @@ // 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.CodeAnalysis.Sarif.Readers; namespace Microsoft.CodeAnalysis.Sarif.Driver { diff --git a/src/Sarif.Driver/Sdk/AnalyzeCommandBase.cs b/src/Sarif.Driver/Sdk/AnalyzeCommandBase.cs index 882d0d235..13b867ec6 100644 --- a/src/Sarif.Driver/Sdk/AnalyzeCommandBase.cs +++ b/src/Sarif.Driver/Sdk/AnalyzeCommandBase.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; diff --git a/src/Sarif.Driver/Sdk/AnalyzeOptionsBase.cs b/src/Sarif.Driver/Sdk/AnalyzeOptionsBase.cs index b58686e3a..ed08dcf6a 100644 --- a/src/Sarif.Driver/Sdk/AnalyzeOptionsBase.cs +++ b/src/Sarif.Driver/Sdk/AnalyzeOptionsBase.cs @@ -1,7 +1,6 @@ // 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 CommandLine; diff --git a/src/Sarif.Driver/Sdk/ExportRulesMetadataCommandBase.cs b/src/Sarif.Driver/Sdk/ExportRulesMetadataCommandBase.cs index bc0a307b6..809062a27 100644 --- a/src/Sarif.Driver/Sdk/ExportRulesMetadataCommandBase.cs +++ b/src/Sarif.Driver/Sdk/ExportRulesMetadataCommandBase.cs @@ -6,7 +6,6 @@ using System.Collections.Immutable; using System.IO; using System.Text; -using Microsoft.CodeAnalysis.Sarif.Readers; using Newtonsoft.Json; diff --git a/src/Sarif.Driver/Sdk/MultifileOptionsBase.cs b/src/Sarif.Driver/Sdk/MultifileOptionsBase.cs index dc4e07f4e..ebb64b79e 100644 --- a/src/Sarif.Driver/Sdk/MultifileOptionsBase.cs +++ b/src/Sarif.Driver/Sdk/MultifileOptionsBase.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using CommandLine; -using Microsoft.CodeAnalysis.Sarif.Driver; namespace Microsoft.CodeAnalysis.Sarif.Driver { diff --git a/src/Sarif.Driver/Sdk/SingleFileOptionsBase.cs b/src/Sarif.Driver/Sdk/SingleFileOptionsBase.cs index da5a723d8..8a7bfac30 100644 --- a/src/Sarif.Driver/Sdk/SingleFileOptionsBase.cs +++ b/src/Sarif.Driver/Sdk/SingleFileOptionsBase.cs @@ -2,7 +2,6 @@ // 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.Driver { diff --git a/src/Sarif.FunctionalTests/PropertyBagConverterTests.cs b/src/Sarif.FunctionalTests/PropertyBagConverterTests.cs index 79350034f..ceda53a44 100644 --- a/src/Sarif.FunctionalTests/PropertyBagConverterTests.cs +++ b/src/Sarif.FunctionalTests/PropertyBagConverterTests.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using FluentAssertions; -using Microsoft.CodeAnalysis.Sarif.Readers; using Microsoft.CodeAnalysis.Sarif.TestUtilities; using Newtonsoft.Json; using Xunit; diff --git a/src/Sarif.FunctionalTests/SarifConverterTests.cs b/src/Sarif.FunctionalTests/SarifConverterTests.cs index 8bf4db493..a2768262b 100644 --- a/src/Sarif.FunctionalTests/SarifConverterTests.cs +++ b/src/Sarif.FunctionalTests/SarifConverterTests.cs @@ -7,7 +7,6 @@ using System.Text; using FluentAssertions; -using Microsoft.CodeAnalysis.Sarif.Readers; using Microsoft.CodeAnalysis.Sarif.Visitors; using Microsoft.CodeAnalysis.Sarif.Writers; using Newtonsoft.Json; diff --git a/src/Sarif.FunctionalTests/SarifLogEqualityComparerTests.cs b/src/Sarif.FunctionalTests/SarifLogEqualityComparerTests.cs index 907e7c81e..6e358c26c 100644 --- a/src/Sarif.FunctionalTests/SarifLogEqualityComparerTests.cs +++ b/src/Sarif.FunctionalTests/SarifLogEqualityComparerTests.cs @@ -3,7 +3,6 @@ using System.IO; using FluentAssertions; -using Microsoft.CodeAnalysis.Sarif.Readers; using Microsoft.CodeAnalysis.Sarif.TestUtilities; using Microsoft.CodeAnalysis.Sarif.Writers; using Newtonsoft.Json; diff --git a/src/Sarif.Multitool.FunctionalTests/ValidateCommandTests.cs b/src/Sarif.Multitool.FunctionalTests/ValidateCommandTests.cs index 8d05f1e8c..032268fd3 100644 --- a/src/Sarif.Multitool.FunctionalTests/ValidateCommandTests.cs +++ b/src/Sarif.Multitool.FunctionalTests/ValidateCommandTests.cs @@ -4,7 +4,6 @@ using Microsoft.CodeAnalysis.Sarif.Writers; using System; using System.IO; -using System.Xml; using Xunit; namespace Microsoft.CodeAnalysis.Sarif.Multitool diff --git a/src/Sarif.Multitool.UnitTests/TransformCommandTests.cs b/src/Sarif.Multitool.UnitTests/TransformCommandTests.cs index 216a3f0da..ac7088846 100644 --- a/src/Sarif.Multitool.UnitTests/TransformCommandTests.cs +++ b/src/Sarif.Multitool.UnitTests/TransformCommandTests.cs @@ -1,16 +1,7 @@ // 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 FluentAssertions; using Microsoft.CodeAnalysis.Sarif; -using Microsoft.CodeAnalysis.Sarif.Multitool; -using Microsoft.CodeAnalysis.Sarif.Readers; -using Microsoft.CodeAnalysis.Sarif.VersionOne; -using Moq; -using Newtonsoft.Json; -using Xunit; namespace Sarif.Multitool.UnitTests { diff --git a/src/Sarif.Multitool/RewriteCommand.cs b/src/Sarif.Multitool/RewriteCommand.cs index 1da6b1250..d057ff8fa 100644 --- a/src/Sarif.Multitool/RewriteCommand.cs +++ b/src/Sarif.Multitool/RewriteCommand.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Linq; using Microsoft.CodeAnalysis.Sarif.Visitors; using Microsoft.CodeAnalysis.Sarif.Driver.Sdk; using Newtonsoft.Json; diff --git a/src/Sarif.Multitool/Rules/UrisMustBeValid.cs b/src/Sarif.Multitool/Rules/UrisMustBeValid.cs index 1b88cffaa..4dac9fb95 100644 --- a/src/Sarif.Multitool/Rules/UrisMustBeValid.cs +++ b/src/Sarif.Multitool/Rules/UrisMustBeValid.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text.RegularExpressions; using Microsoft.Json.Pointer; namespace Microsoft.CodeAnalysis.Sarif.Multitool.Rules diff --git a/src/Sarif.UnitTests/Core/FileLocationTests.cs b/src/Sarif.UnitTests/Core/FileLocationTests.cs index c2a015ac6..60bef8513 100644 --- a/src/Sarif.UnitTests/Core/FileLocationTests.cs +++ b/src/Sarif.UnitTests/Core/FileLocationTests.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; -using System.Collections.Generic; using System.Text; using FluentAssertions; using Xunit; diff --git a/src/Sarif.UnitTests/Core/PropertyBagHolderTests.cs b/src/Sarif.UnitTests/Core/PropertyBagHolderTests.cs index 7565ddc08..2aba3cc4b 100644 --- a/src/Sarif.UnitTests/Core/PropertyBagHolderTests.cs +++ b/src/Sarif.UnitTests/Core/PropertyBagHolderTests.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using FluentAssertions; -using Microsoft.CodeAnalysis.Sarif.Readers; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using Xunit; diff --git a/src/Sarif.UnitTests/Core/SarifLogTests.cs b/src/Sarif.UnitTests/Core/SarifLogTests.cs index 0d853d90a..e5ff556ba 100644 --- a/src/Sarif.UnitTests/Core/SarifLogTests.cs +++ b/src/Sarif.UnitTests/Core/SarifLogTests.cs @@ -1,7 +1,6 @@ // 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 FluentAssertions; using Newtonsoft.Json; diff --git a/src/Sarif.UnitTests/Core/TagsTests.cs b/src/Sarif.UnitTests/Core/TagsTests.cs index f44c148e0..a598234b8 100644 --- a/src/Sarif.UnitTests/Core/TagsTests.cs +++ b/src/Sarif.UnitTests/Core/TagsTests.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using FluentAssertions; -using Microsoft.CodeAnalysis.Sarif.Readers; using Xunit; namespace Microsoft.CodeAnalysis.Sarif diff --git a/src/Sarif.UnitTests/JsonTests.cs b/src/Sarif.UnitTests/JsonTests.cs index e0f499d8b..b72e7ffa9 100644 --- a/src/Sarif.UnitTests/JsonTests.cs +++ b/src/Sarif.UnitTests/JsonTests.cs @@ -4,7 +4,6 @@ using System; using System.IO; using System.Text; -using Microsoft.CodeAnalysis.Sarif.Readers; using Microsoft.CodeAnalysis.Sarif.Writers; using Newtonsoft.Json; diff --git a/src/Sarif.UnitTests/MockFactory.cs b/src/Sarif.UnitTests/MockFactory.cs index 08eef921a..90df515c7 100644 --- a/src/Sarif.UnitTests/MockFactory.cs +++ b/src/Sarif.UnitTests/MockFactory.cs @@ -2,12 +2,8 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; -using System.Collections.Generic; -using FluentAssertions; using Moq; -using Match = System.Text.RegularExpressions.Match; // Avoid ambiguity with Moq.Match; - namespace Microsoft.CodeAnalysis.Sarif { internal static class MockFactory diff --git a/src/Sarif.UnitTests/Processors/Log/RebaseUriStageTests.cs b/src/Sarif.UnitTests/Processors/Log/RebaseUriStageTests.cs index 02a8fe507..f89dd0450 100644 --- a/src/Sarif.UnitTests/Processors/Log/RebaseUriStageTests.cs +++ b/src/Sarif.UnitTests/Processors/Log/RebaseUriStageTests.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Linq; using FluentAssertions; -using Microsoft.CodeAnalysis.Sarif.Visitors; using Xunit; using Xunit.Abstractions; diff --git a/src/Sarif.UnitTests/Readers/SampleModel/LogModel.cs b/src/Sarif.UnitTests/Readers/SampleModel/LogModel.cs index 0c12ed3d6..82c5a2c1a 100644 --- a/src/Sarif.UnitTests/Readers/SampleModel/LogModel.cs +++ b/src/Sarif.UnitTests/Readers/SampleModel/LogModel.cs @@ -6,7 +6,6 @@ using System.IO; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; -using Xunit; namespace Microsoft.CodeAnalysis.Sarif.Readers.SampleModel { diff --git a/src/Sarif.UnitTests/Visitors/MakeUriAbsoluteVisitorTest.cs b/src/Sarif.UnitTests/Visitors/MakeUriAbsoluteVisitorTest.cs index 53db98957..21d90e9ec 100644 --- a/src/Sarif.UnitTests/Visitors/MakeUriAbsoluteVisitorTest.cs +++ b/src/Sarif.UnitTests/Visitors/MakeUriAbsoluteVisitorTest.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Linq; using FluentAssertions; -using Microsoft.CodeAnalysis.Sarif.Readers; using Xunit; namespace Microsoft.CodeAnalysis.Sarif.Visitors diff --git a/src/Sarif.UnitTests/Visitors/PrereleaseCompatibilityTransformerTests.cs b/src/Sarif.UnitTests/Visitors/PrereleaseCompatibilityTransformerTests.cs index ccd5281e8..7f42ffd0c 100644 --- a/src/Sarif.UnitTests/Visitors/PrereleaseCompatibilityTransformerTests.cs +++ b/src/Sarif.UnitTests/Visitors/PrereleaseCompatibilityTransformerTests.cs @@ -1,7 +1,6 @@ // 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 Microsoft.CodeAnalysis.Sarif.Writers; using Newtonsoft.Json; using Xunit; diff --git a/src/Sarif.UnitTests/Visitors/RebaseUriVisitorTests.cs b/src/Sarif.UnitTests/Visitors/RebaseUriVisitorTests.cs index 8d5ad885f..f2dc2847c 100644 --- a/src/Sarif.UnitTests/Visitors/RebaseUriVisitorTests.cs +++ b/src/Sarif.UnitTests/Visitors/RebaseUriVisitorTests.cs @@ -6,7 +6,6 @@ using System.IO; using System.Linq; using FluentAssertions; -using Microsoft.CodeAnalysis.Sarif.Readers; using Microsoft.CodeAnalysis.Sarif.Writers; using Newtonsoft.Json; using Xunit; diff --git a/src/Sarif.ValidationTests/DefaultObjectPopulatingVisitor.cs b/src/Sarif.ValidationTests/DefaultObjectPopulatingVisitor.cs index 9fa2180f5..dcea7afbd 100644 --- a/src/Sarif.ValidationTests/DefaultObjectPopulatingVisitor.cs +++ b/src/Sarif.ValidationTests/DefaultObjectPopulatingVisitor.cs @@ -28,7 +28,7 @@ public static IDictionary GetBuildersForRequiredPri { typeof(bool), (isRequired) => { return isRequired; } }, { typeof(int), (isRequired) => { return isRequired ? int.MaxValue : 0; } }, { typeof(double), (isRequired) => { return isRequired ? double.MaxValue : 0; } }, - { typeof(string), (isRequired) => { return isRequired ? "Required string value." : null; } }, + { typeof(string), (isRequired) => { return isRequired ? "string/required" : null; } }, { typeof(DateTime),(isRequired) => { return isRequired ? DateTime.UtcNow : new DateTime(); } }, { typeof(Uri), (isRequired) => { return isRequired ? new Uri("https://required.uri.contoso.com") : null; } } }; @@ -45,7 +45,7 @@ public static IDictionary GetBuildersForAllPrimitiv { typeof(bool), (isRequired) => { return true; } }, { typeof(int), (isRequired) => { return isRequired ? int.MaxValue : 1; } }, { typeof(double), (isRequired) => { return isRequired ? double.MaxValue : 1; } }, - { typeof(string), (isRequired) => { return isRequired ? "[Required string value]" : "[Optional string value]"; } }, + { typeof(string), (isRequired) => { return isRequired ? "string/required" : "string/optional"; } }, { typeof(DateTime),(isRequired) => { return isRequired ? new DateTime(2018, 10, 31).ToUniversalTime() : new DateTime(1776, 7, 4).ToUniversalTime(); } }, { typeof(Uri), (isRequired) => { return isRequired ? new Uri("https://required.uri.value.contoso.com") : new Uri("https://optional.uri.value.contoso.com"); } } }; diff --git a/src/Sarif.ValidationTests/SarifValidatorTests.cs b/src/Sarif.ValidationTests/SarifValidatorTests.cs index d8d3e9b2b..f8f01f53e 100644 --- a/src/Sarif.ValidationTests/SarifValidatorTests.cs +++ b/src/Sarif.ValidationTests/SarifValidatorTests.cs @@ -11,7 +11,6 @@ using Microsoft.Json.Schema; using Microsoft.Json.Schema.Validation; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; using Xunit; namespace Microsoft.CodeAnalysis.Sarif diff --git a/src/Sarif/Autogenerated/FileData.cs b/src/Sarif/Autogenerated/FileData.cs index 35fef35b5..4364d4cc5 100644 --- a/src/Sarif/Autogenerated/FileData.cs +++ b/src/Sarif/Autogenerated/FileData.cs @@ -4,6 +4,7 @@ using System; using System.CodeDom.Compiler; using System.Collections.Generic; +using System.ComponentModel; using System.Runtime.Serialization; using Microsoft.CodeAnalysis.Sarif.Readers; using Newtonsoft.Json; @@ -14,7 +15,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.58.0.0")] + [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.61.0.0")] public partial class FileData : PropertyBagHolder, ISarifNode { public static IEqualityComparer ValueComparer => FileDataEqualityComparer.Instance; @@ -43,8 +44,8 @@ public SarifNodeKind SarifNodeKind /// Identifies the index of the immediate parent of the file, if this file is nested. /// [DataMember(Name = "parentIndex", IsRequired = false, EmitDefaultValue = false)] + [DefaultValue(-1)] [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] - [System.ComponentModel.DefaultValue(-1)] public int ParentIndex { get; set; } /// @@ -63,6 +64,7 @@ public SarifNodeKind SarifNodeKind /// The role or roles played by the file in the analysis. /// [DataMember(Name = "roles", IsRequired = false, EmitDefaultValue = false)] + [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] [JsonConverter(typeof(FlagsEnumConverter))] public FileRoles Roles { get; set; } @@ -94,7 +96,7 @@ public SarifNodeKind SarifNodeKind /// The Coordinated Universal Time (UTC) date and time at which the file was most recently modified. See "Date/time properties" in the SARIF spec for the required format. /// [DataMember(Name = "lastModifiedTimeUtc", IsRequired = false, EmitDefaultValue = false)] - [JsonConverter(typeof(DateTimeConverter))] + [JsonConverter(typeof(Microsoft.CodeAnalysis.Sarif.Readers.DateTimeConverter))] public DateTime LastModifiedTimeUtc { get; set; } /// @@ -115,37 +117,37 @@ public FileData() /// Initializes a new instance of the class from the supplied values. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// public FileData(FileLocation fileLocation, int parentIndex, int offset, int length, FileRoles roles, string mimeType, FileContent contents, string encoding, IDictionary hashes, DateTime lastModifiedTimeUtc, IDictionary properties) { diff --git a/src/Sarif/Autogenerated/FileLocation.cs b/src/Sarif/Autogenerated/FileLocation.cs index db0b26c71..b2aaa6be3 100644 --- a/src/Sarif/Autogenerated/FileLocation.cs +++ b/src/Sarif/Autogenerated/FileLocation.cs @@ -4,6 +4,7 @@ using System; using System.CodeDom.Compiler; using System.Collections.Generic; +using System.ComponentModel; using System.Runtime.Serialization; using Microsoft.CodeAnalysis.Sarif.Readers; using Newtonsoft.Json; @@ -47,11 +48,11 @@ public SarifNodeKind SarifNodeKind public string UriBaseId { get; set; } /// - /// The index within the run files array that specifies the file object associated with the file location. + /// The index within the run files array of the file object associated with the file location. /// [DataMember(Name = "fileIndex", IsRequired = false, EmitDefaultValue = false)] + [DefaultValue(-1)] [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] - [System.ComponentModel.DefaultValue(-1)] public int FileIndex { get; set; } /// @@ -78,7 +79,7 @@ public FileLocation() /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// /// An initialization value for the property. diff --git a/src/Sarif/Autogenerated/Invocation.cs b/src/Sarif/Autogenerated/Invocation.cs index 60dd21712..3b3145490 100644 --- a/src/Sarif/Autogenerated/Invocation.cs +++ b/src/Sarif/Autogenerated/Invocation.cs @@ -62,14 +62,14 @@ public SarifNodeKind SarifNodeKind /// The Coordinated Universal Time (UTC) date and time at which the run started. See "Date/time properties" in the SARIF spec for the required format. /// [DataMember(Name = "startTimeUtc", IsRequired = false, EmitDefaultValue = false)] - [JsonConverter(typeof(DateTimeConverter))] + [JsonConverter(typeof(Microsoft.CodeAnalysis.Sarif.Readers.DateTimeConverter))] public DateTime StartTimeUtc { get; set; } /// /// The Coordinated Universal Time (UTC) date and time at which the run ended. See "Date/time properties" in the SARIF spec for the required format. /// [DataMember(Name = "endTimeUtc", IsRequired = false, EmitDefaultValue = false)] - [JsonConverter(typeof(DateTimeConverter))] + [JsonConverter(typeof(Microsoft.CodeAnalysis.Sarif.Readers.DateTimeConverter))] public DateTime EndTimeUtc { get; set; } /// diff --git a/src/Sarif/Autogenerated/Location.cs b/src/Sarif/Autogenerated/Location.cs index 9c5800e9b..51c873785 100644 --- a/src/Sarif/Autogenerated/Location.cs +++ b/src/Sarif/Autogenerated/Location.cs @@ -47,7 +47,7 @@ public SarifNodeKind SarifNodeKind public string FullyQualifiedLogicalName { get; set; } /// - /// The index within the logicalLocations array that specifies the logical location associated with the result. + /// The index within the logical locations array of the logical location associated with the result. /// [DataMember(Name = "logicalLocationIndex", IsRequired = false, EmitDefaultValue = false)] [DefaultValue(-1)] diff --git a/src/Sarif/Autogenerated/LogicalLocation.cs b/src/Sarif/Autogenerated/LogicalLocation.cs index 95efd59b5..fa70ee4e2 100644 --- a/src/Sarif/Autogenerated/LogicalLocation.cs +++ b/src/Sarif/Autogenerated/LogicalLocation.cs @@ -61,7 +61,7 @@ public SarifNodeKind SarifNodeKind public int ParentIndex { get; set; } /// - /// The type of construct this logicalLocationComponent refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', or 'variable', if any of those accurately describe the construct. + /// The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', or 'variable', if any of those accurately describe the construct. /// [DataMember(Name = "kind", IsRequired = false, EmitDefaultValue = false)] public string Kind { get; set; } diff --git a/src/Sarif/Autogenerated/Rule.cs b/src/Sarif/Autogenerated/Rule.cs index 7ad89d6af..243a036ab 100644 --- a/src/Sarif/Autogenerated/Rule.cs +++ b/src/Sarif/Autogenerated/Rule.cs @@ -14,7 +14,7 @@ namespace Microsoft.CodeAnalysis.Sarif /// Describes an analysis rule. /// [DataContract] - [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.61.0.0")] + [GeneratedCode("Microsoft.Json.Schema.ToDotNet", "0.58.0.0")] public partial class Rule : PropertyBagHolder, IRule, ISarifNode { public static IEqualityComparer ValueComparer => RuleEqualityComparer.Instance; @@ -111,37 +111,37 @@ public Rule() /// Initializes a new instance of the class from the supplied values. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// /// - /// An initialization value for the property. + /// An initialization value for the property. /// public Rule(string id, IEnumerable deprecatedIds, Message name, Message shortDescription, Message fullDescription, IDictionary messageStrings, IDictionary richMessageStrings, RuleConfiguration configuration, Uri helpUri, Message help, IDictionary properties) { diff --git a/src/Sarif/Autogenerated/Run.cs b/src/Sarif/Autogenerated/Run.cs index 2e668b6bd..705d6ca3f 100644 --- a/src/Sarif/Autogenerated/Run.cs +++ b/src/Sarif/Autogenerated/Run.cs @@ -146,7 +146,7 @@ public SarifNodeKind SarifNodeKind /// /// Specifies the unit in which the tool measures columns. /// - [DataMember(Name = "columnKind", IsRequired = false)] + [DataMember(Name = "columnKind", IsRequired = false, EmitDefaultValue = false)] [JsonConverter(typeof(Microsoft.CodeAnalysis.Sarif.Readers.EnumConverter))] public ColumnKind ColumnKind { get; set; } diff --git a/src/Sarif/Autogenerated/VersionControlDetails.cs b/src/Sarif/Autogenerated/VersionControlDetails.cs index e308ed647..67c652d59 100644 --- a/src/Sarif/Autogenerated/VersionControlDetails.cs +++ b/src/Sarif/Autogenerated/VersionControlDetails.cs @@ -62,7 +62,7 @@ public SarifNodeKind SarifNodeKind /// A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of the repository at that time. /// [DataMember(Name = "asOfTimeUtc", IsRequired = false, EmitDefaultValue = false)] - [JsonConverter(typeof(DateTimeConverter))] + [JsonConverter(typeof(Microsoft.CodeAnalysis.Sarif.Readers.DateTimeConverter))] public DateTime AsOfTimeUtc { get; set; } /// diff --git a/src/Sarif/CodeGenHints.json b/src/Sarif/CodeGenHints.json index d23705943..6f2507607 100644 --- a/src/Sarif/CodeGenHints.json +++ b/src/Sarif/CodeGenHints.json @@ -132,7 +132,7 @@ "arguments": { "namespaceName": "Newtonsoft.Json", "typeName": "JsonConverter", - "arguments": [ "typeof(DateTimeConverter)" ] + "arguments": [ "typeof(Microsoft.CodeAnalysis.Sarif.Readers.DateTimeConverter)" ] } } ], @@ -209,23 +209,6 @@ } } ], - "FileLocation.FileIndex": [ - { - "kind": "AttributeHint", - "arguments": { - "namespaceName": "Newtonsoft.Json", - "typeName": "JsonProperty", - "arguments": [ "DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate" ] - } - }, - { - "kind": "AttributeHint", - "arguments": { - "typeName": "System.ComponentModel.DefaultValue", - "arguments": [ "-1" ] - } - } - ], "fix": [ { "kind": "BaseTypeHint", @@ -277,7 +260,7 @@ "arguments": { "namespaceName": "Newtonsoft.Json", "typeName": "JsonConverter", - "arguments": [ "typeof(DateTimeConverter)" ] + "arguments": [ "typeof(Microsoft.CodeAnalysis.Sarif.Readers.DateTimeConverter)" ] } } ], @@ -292,7 +275,7 @@ "arguments": { "namespaceName": "Newtonsoft.Json", "typeName": "JsonConverter", - "arguments": [ "typeof(DateTimeConverter)" ] + "arguments": [ "typeof(Microsoft.CodeAnalysis.Sarif.Readers.DateTimeConverter)" ] } } ], @@ -306,23 +289,6 @@ } } ], - "Location.LogicalLocationIndex": [ - { - "kind": "AttributeHint", - "arguments": { - "namespaceName": "Newtonsoft.Json", - "typeName": "JsonProperty", - "arguments": [ "DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate" ] - } - }, - { - "kind": "AttributeHint", - "arguments": { - "typeName": "System.ComponentModel.DefaultValue", - "arguments": [ "-1" ] - } - } - ], "logicalLocation": [ { "kind": "BaseTypeHint", @@ -854,7 +820,7 @@ "arguments": { "namespaceName": "Newtonsoft.Json", "typeName": "JsonConverter", - "arguments": [ "typeof(DateTimeConverter)" ] + "arguments": [ "typeof(Microsoft.CodeAnalysis.Sarif.Readers.DateTimeConverter)" ] } } ], @@ -904,7 +870,7 @@ "arguments": { "namespaceName": "Newtonsoft.Json", "typeName": "JsonConverter", - "arguments": [ "typeof(DateTimeConverter)" ] + "arguments": [ "typeof(Microsoft.CodeAnalysis.Sarif.Readers.DateTimeConverter)" ] } } ] diff --git a/src/Sarif/NotYetAutoGenerated/Run.cs b/src/Sarif/NotYetAutoGenerated/Run.cs index 2a06a0117..705d6ca3f 100644 --- a/src/Sarif/NotYetAutoGenerated/Run.cs +++ b/src/Sarif/NotYetAutoGenerated/Run.cs @@ -67,10 +67,10 @@ public SarifNodeKind SarifNodeKind public IDictionary OriginalUriBaseIds { get; set; } /// - /// A dictionary, each of whose keys is a URI and each of whose values is a file object. + /// An array of file objects relevant to the run. /// [DataMember(Name = "files", IsRequired = false, EmitDefaultValue = false)] - public IDictionary Files { get; set; } + public IList Files { get; set; } /// /// An array of logical locations such as namespaces, types or functions. @@ -146,7 +146,7 @@ public SarifNodeKind SarifNodeKind /// /// Specifies the unit in which the tool measures columns. /// - [DataMember(Name = "columnKind", IsRequired = false)] + [DataMember(Name = "columnKind", IsRequired = false, EmitDefaultValue = false)] [JsonConverter(typeof(Microsoft.CodeAnalysis.Sarif.Readers.EnumConverter))] public ColumnKind ColumnKind { get; set; } @@ -234,7 +234,7 @@ public Run() /// /// An initialization value for the property. /// - public Run(Tool tool, IEnumerable invocations, Conversion conversion, IEnumerable versionControlProvenance, IDictionary originalUriBaseIds, IDictionary files, IEnumerable logicalLocations, IDictionary graphs, IEnumerable results, Resources resources, RunAutomationDetails id, IEnumerable aggregateIds, string baselineInstanceGuid, string richMessageMimeType, string redactionToken, string defaultFileEncoding, IEnumerable newlineSequences, ColumnKind columnKind, ExternalPropertyFiles externalPropertyFiles, IDictionary properties) + public Run(Tool tool, IEnumerable invocations, Conversion conversion, IEnumerable versionControlProvenance, IDictionary originalUriBaseIds, IEnumerable files, IEnumerable logicalLocations, IDictionary graphs, IEnumerable results, Resources resources, RunAutomationDetails id, IEnumerable aggregateIds, string baselineInstanceGuid, string richMessageMimeType, string redactionToken, string defaultFileEncoding, IEnumerable newlineSequences, ColumnKind columnKind, ExternalPropertyFiles externalPropertyFiles, IDictionary properties) { Init(tool, invocations, conversion, versionControlProvenance, originalUriBaseIds, files, logicalLocations, graphs, results, resources, id, aggregateIds, baselineInstanceGuid, richMessageMimeType, redactionToken, defaultFileEncoding, newlineSequences, columnKind, externalPropertyFiles, properties); } @@ -276,7 +276,7 @@ private ISarifNode DeepCloneCore() return new Run(this); } - private void Init(Tool tool, IEnumerable invocations, Conversion conversion, IEnumerable versionControlProvenance, IDictionary originalUriBaseIds, IDictionary files, IEnumerable logicalLocations, IDictionary graphs, IEnumerable results, Resources resources, RunAutomationDetails id, IEnumerable aggregateIds, string baselineInstanceGuid, string richMessageMimeType, string redactionToken, string defaultFileEncoding, IEnumerable newlineSequences, ColumnKind columnKind, ExternalPropertyFiles externalPropertyFiles, IDictionary properties) + private void Init(Tool tool, IEnumerable invocations, Conversion conversion, IEnumerable versionControlProvenance, IDictionary originalUriBaseIds, IEnumerable files, IEnumerable logicalLocations, IDictionary graphs, IEnumerable results, Resources resources, RunAutomationDetails id, IEnumerable aggregateIds, string baselineInstanceGuid, string richMessageMimeType, string redactionToken, string defaultFileEncoding, IEnumerable newlineSequences, ColumnKind columnKind, ExternalPropertyFiles externalPropertyFiles, IDictionary properties) { if (tool != null) { @@ -335,29 +335,38 @@ private void Init(Tool tool, IEnumerable invocations, Conversion con if (files != null) { - Files = new Dictionary(); + var destination_2 = new List(); foreach (var value_3 in files) { - Files.Add(value_3.Key, new FileData(value_3.Value)); + if (value_3 == null) + { + destination_2.Add(null); + } + else + { + destination_2.Add(new FileData(value_3)); + } } + + Files = destination_2; } if (logicalLocations != null) { - var destination_2 = new List(); + var destination_3 = new List(); foreach (var value_4 in logicalLocations) { if (value_4 == null) { - destination_2.Add(null); + destination_3.Add(null); } else { - destination_2.Add(new LogicalLocation(value_4)); + destination_3.Add(new LogicalLocation(value_4)); } } - LogicalLocations = destination_2; + LogicalLocations = destination_3; } if (graphs != null) @@ -371,20 +380,20 @@ private void Init(Tool tool, IEnumerable invocations, Conversion con if (results != null) { - var destination_3 = new List(); + var destination_4 = new List(); foreach (var value_6 in results) { if (value_6 == null) { - destination_3.Add(null); + destination_4.Add(null); } else { - destination_3.Add(new Result(value_6)); + destination_4.Add(new Result(value_6)); } } - Results = destination_3; + Results = destination_4; } if (resources != null) @@ -399,20 +408,20 @@ private void Init(Tool tool, IEnumerable invocations, Conversion con if (aggregateIds != null) { - var destination_4 = new List(); + var destination_5 = new List(); foreach (var value_7 in aggregateIds) { if (value_7 == null) { - destination_4.Add(null); + destination_5.Add(null); } else { - destination_4.Add(new RunAutomationDetails(value_7)); + destination_5.Add(new RunAutomationDetails(value_7)); } } - AggregateIds = destination_4; + AggregateIds = destination_5; } BaselineInstanceGuid = baselineInstanceGuid; @@ -421,13 +430,13 @@ private void Init(Tool tool, IEnumerable invocations, Conversion con DefaultFileEncoding = defaultFileEncoding; if (newlineSequences != null) { - var destination_5 = new List(); + var destination_6 = new List(); foreach (var value_8 in newlineSequences) { - destination_5.Add(value_8); + destination_6.Add(value_8); } - NewlineSequences = destination_5; + NewlineSequences = destination_6; } ColumnKind = columnKind; diff --git a/src/Sarif/NotYetAutoGenerated/FileData.cs b/src/Sarif/NotYetAutoGenerated/save/FileData.cs similarity index 100% rename from src/Sarif/NotYetAutoGenerated/FileData.cs rename to src/Sarif/NotYetAutoGenerated/save/FileData.cs diff --git a/src/Sarif/NotYetAutoGenerated/FileLocation.cs b/src/Sarif/NotYetAutoGenerated/save/FileLocation.cs similarity index 100% rename from src/Sarif/NotYetAutoGenerated/FileLocation.cs rename to src/Sarif/NotYetAutoGenerated/save/FileLocation.cs diff --git a/src/Sarif/Visitors/MakeUrisAbsoluteVisitor.cs b/src/Sarif/Visitors/MakeUrisAbsoluteVisitor.cs index 555a473a7..845c08762 100644 --- a/src/Sarif/Visitors/MakeUrisAbsoluteVisitor.cs +++ b/src/Sarif/Visitors/MakeUrisAbsoluteVisitor.cs @@ -2,7 +2,6 @@ // 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.Visitors { diff --git a/src/Sarif/Visitors/VersionOneLogicalLocationKeyToLogicalLocationDataVisitor.cs b/src/Sarif/Visitors/VersionOneLogicalLocationKeyToLogicalLocationDataVisitor.cs index 296cd1810..ef465ef9e 100644 --- a/src/Sarif/Visitors/VersionOneLogicalLocationKeyToLogicalLocationDataVisitor.cs +++ b/src/Sarif/Visitors/VersionOneLogicalLocationKeyToLogicalLocationDataVisitor.cs @@ -1,7 +1,6 @@ // 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.CodeAnalysis.Sarif.VersionOne;