diff --git a/.editorconfig b/.editorconfig index 39da3a80..fc533af8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -481,10 +481,6 @@ dotnet_diagnostic.CA1859.severity = none # https://github.com/DotNetAnalyzers/StyleCopAnalyzers ########################################## -# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md -# SA1028: Code should not contain trailing whitespace -dotnet_diagnostic.SA1028.severity = suggestion - # https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1101.md # SA1101: Prefix local calls with this dotnet_diagnostic.SA1101.severity = suggestion diff --git a/src/Microsoft.Sbom.Common/IFileSystemUtils.cs b/src/Microsoft.Sbom.Common/IFileSystemUtils.cs index db313e9b..9b3105c9 100644 --- a/src/Microsoft.Sbom.Common/IFileSystemUtils.cs +++ b/src/Microsoft.Sbom.Common/IFileSystemUtils.cs @@ -14,19 +14,19 @@ public interface IFileSystemUtils bool DirectoryExists(string path); DirectoryInfo CreateDirectory(string path); - + IEnumerable GetFilesInDirectory(string path, bool followSymlinks = true); - + IEnumerable GetDirectories(string path, bool followSymlinks = true); - + Stream OpenRead(string filePath); - + Stream OpenWrite(string filePath); - + string ReadAllText(string filePath); - + void WriteAllText(string filePath, string contents); - + string JoinPaths(string root, string relativePath); string JoinPaths(string root, string relativePath, string secondRelativePath); @@ -46,9 +46,9 @@ public interface IFileSystemUtils string GetDirectoryName(string filePath); bool DirectoryHasReadPermissions(string directoryPath); - + bool DirectoryHasWritePermissions(string directoryPath); - + void DeleteFile(string filePath); /// @@ -71,6 +71,6 @@ public interface IFileSystemUtils string GetSbomToolTempPath(); string GetFullPath(string path); - + DirectoryInfo GetParentDirectory(string path); } diff --git a/src/Microsoft.Sbom.Contracts/Contracts/Enums/ParserState.cs b/src/Microsoft.Sbom.Contracts/Contracts/Enums/ParserState.cs index 176676fa..31b3ca42 100644 --- a/src/Microsoft.Sbom.Contracts/Contracts/Enums/ParserState.cs +++ b/src/Microsoft.Sbom.Contracts/Contracts/Enums/ParserState.cs @@ -4,7 +4,7 @@ namespace Microsoft.Sbom.Contracts.Enums; /// -/// Defines the current state of the SBOM parser. +/// Defines the current state of the SBOM parser. /// public enum ParserState { @@ -40,7 +40,7 @@ public enum ParserState /// /// The parser is in a state where its returned a property that needs to be skipped. - /// This parser will never be in this state externally, internally we will try to move + /// This parser will never be in this state externally, internally we will try to move /// to the next available state when we reach this state. /// INTERNAL_SKIP, diff --git a/src/Microsoft.Sbom.Contracts/Contracts/Spdx22Metadata.cs b/src/Microsoft.Sbom.Contracts/Contracts/Spdx22Metadata.cs index 48160959..2b437921 100644 --- a/src/Microsoft.Sbom.Contracts/Contracts/Spdx22Metadata.cs +++ b/src/Microsoft.Sbom.Contracts/Contracts/Spdx22Metadata.cs @@ -40,7 +40,7 @@ public class Spdx22Metadata /// Information about the package this SPDX document represents. /// public IEnumerable DocumentDescribes { get; set; } - + /// /// The id of the spdx document. /// diff --git a/src/Microsoft.Sbom.Extensions/ISbomParser.cs b/src/Microsoft.Sbom.Extensions/ISbomParser.cs index c4785a33..0f0f1b6c 100644 --- a/src/Microsoft.Sbom.Extensions/ISbomParser.cs +++ b/src/Microsoft.Sbom.Extensions/ISbomParser.cs @@ -53,7 +53,7 @@ public interface ISbomParser IEnumerable GetReferences(); /// - /// Returns a object using the metadata defined in the + /// Returns a object using the metadata defined in the /// current SBOM. /// /// @@ -61,10 +61,10 @@ public interface ISbomParser Spdx22Metadata GetMetadata(); /// - /// This function is called by the sbom tool upon initialization to get all the + /// This function is called by the sbom tool upon initialization to get all the /// manifest versions this library can parse. /// - /// An version sorted array in ascending order of + /// An version sorted array in ascending order of /// manifests this library can parse. ManifestInfo[] RegisterManifest(); diff --git a/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Entities/Enums/SPDXRelationshipType.cs b/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Entities/Enums/SPDXRelationshipType.cs index a9523f66..34f5d4dd 100644 --- a/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Entities/Enums/SPDXRelationshipType.cs +++ b/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Entities/Enums/SPDXRelationshipType.cs @@ -6,9 +6,9 @@ namespace Microsoft.Sbom.Parsers.Spdx22SbomParser.Entities.Enums; /// -/// Defines the type of between the source and the +/// Defines the type of between the source and the /// target element. -/// +/// /// Full definition here: https://spdx.github.io/spdx-spec/7-relationships-between-SPDX-elements/#71-relationship. /// [JsonConverter(typeof(JsonStringEnumConverter))] diff --git a/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Exceptions/ParserException.cs b/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Exceptions/ParserException.cs index 32747a4a..e6c0cb66 100644 --- a/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Exceptions/ParserException.cs +++ b/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Exceptions/ParserException.cs @@ -21,12 +21,12 @@ public ParserException(string message) { } - public ParserException(string message, Exception innerException) + public ParserException(string message, Exception innerException) : base(message, innerException) { } - protected ParserException(SerializationInfo info, StreamingContext context) + protected ParserException(SerializationInfo info, StreamingContext context) : base(info, context) { } diff --git a/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Parser/ParserUtils.cs b/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Parser/ParserUtils.cs index a50d20d1..f63b06f5 100644 --- a/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Parser/ParserUtils.cs +++ b/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Parser/ParserUtils.cs @@ -24,7 +24,7 @@ internal class ParserUtils /// /// Read the next JSON token in the reader from the input buffer. - /// If the buffer is small and doesn't contain all the text for the next token, + /// If the buffer is small and doesn't contain all the text for the next token, /// a call to GetMoreBytesFromStream is made to read more data into the buffer. /// /// @@ -82,7 +82,7 @@ internal static void AssertTokenType(Stream stream, ref Utf8JsonReader reader, J } /// - /// Assert that the current token is either one of the tokens specified + /// Assert that the current token is either one of the tokens specified /// in the . /// /// @@ -150,9 +150,9 @@ internal static string GetStringValue(ReadOnlySpan valueSpan) /// /// Returns the next string value for a given property, for example: - /// + /// /// { "TestProperty": "TestProperty Value" } - /// + /// /// Will return "TestProperty Value". /// /// @@ -273,9 +273,9 @@ public static void GetMoreBytesFromStream(Stream stream, ref byte[] buffer, ref /// /// Returns the next boolean value for a given property, for example: - /// + /// /// { "TestProperty": false } - /// + /// /// Will return false. /// /// diff --git a/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Utils/SPDXToSbomFormatConverterExtensions.cs b/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Utils/SPDXToSbomFormatConverterExtensions.cs index 9facc3f9..c114453c 100644 --- a/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Utils/SPDXToSbomFormatConverterExtensions.cs +++ b/src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Utils/SPDXToSbomFormatConverterExtensions.cs @@ -11,7 +11,7 @@ namespace Microsoft.Sbom.Utils; /// -/// Provides extension methods to convert a SPDX object to +/// Provides extension methods to convert a SPDX object to /// the equivalent internal object as defined in Sbom.Contracts. /// internal static class SPDXToSbomFormatConverterExtensions @@ -91,7 +91,7 @@ internal static SBOMReference ToSbomReference(this SpdxExternalDocumentReference } /// - /// Gets the PURL from a object using the Locator property. + /// Gets the PURL from a object using the Locator property. /// /// ///