Skip to content

Commit

Permalink
chore: SA1028 code must not contain trailing whitespace
Browse files Browse the repository at this point in the history
[SA1028: Code must not contain trailing whitespace](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Related to #340
  • Loading branch information
JamieMagee committed Sep 6, 2023
1 parent 626e5a8 commit c289490
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 32 deletions.
4 changes: 0 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions src/Microsoft.Sbom.Common/IFileSystemUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ public interface IFileSystemUtils
bool DirectoryExists(string path);

DirectoryInfo CreateDirectory(string path);

IEnumerable<string> GetFilesInDirectory(string path, bool followSymlinks = true);

IEnumerable<string> 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);
Expand All @@ -46,9 +46,9 @@ public interface IFileSystemUtils
string GetDirectoryName(string filePath);

bool DirectoryHasReadPermissions(string directoryPath);

bool DirectoryHasWritePermissions(string directoryPath);

void DeleteFile(string filePath);

/// <summary>
Expand All @@ -71,6 +71,6 @@ public interface IFileSystemUtils
string GetSbomToolTempPath();

string GetFullPath(string path);

DirectoryInfo GetParentDirectory(string path);
}
4 changes: 2 additions & 2 deletions src/Microsoft.Sbom.Contracts/Contracts/Enums/ParserState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Microsoft.Sbom.Contracts.Enums;

/// <summary>
/// Defines the current state of the SBOM parser.
/// Defines the current state of the SBOM parser.
/// </summary>
public enum ParserState
{
Expand Down Expand Up @@ -40,7 +40,7 @@ public enum ParserState

/// <summary>
/// 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.
/// </summary>
INTERNAL_SKIP,
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Sbom.Contracts/Contracts/Spdx22Metadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class Spdx22Metadata
/// Information about the package this SPDX document represents.
/// </summary>
public IEnumerable<string> DocumentDescribes { get; set; }

/// <summary>
/// The id of the spdx document.
/// </summary>
Expand Down
6 changes: 3 additions & 3 deletions src/Microsoft.Sbom.Extensions/ISbomParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ public interface ISbomParser
IEnumerable<SBOMReference> GetReferences();

/// <summary>
/// Returns a <see cref="SBOMMetadata"/> object using the metadata defined in the
/// Returns a <see cref="SBOMMetadata"/> object using the metadata defined in the
/// current SBOM.
/// </summary>
/// <param name="stream"></param>
/// <returns></returns>
Spdx22Metadata GetMetadata();

/// <summary>
/// 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.
/// </summary>
/// <returns>An version sorted array in ascending order of
/// <returns>An version sorted array in ascending order of
/// <see cref="ManifestInfo">manifests</see> this library can parse.</returns>
ManifestInfo[] RegisterManifest();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
namespace Microsoft.Sbom.Parsers.Spdx22SbomParser.Entities.Enums;

/// <summary>
/// Defines the type of <see cref="SPDXRelationship"/> between the source and the
/// Defines the type of <see cref="SPDXRelationship"/> between the source and the
/// target element.
///
///
/// Full definition here: https://spdx.github.io/spdx-spec/7-relationships-between-SPDX-elements/#71-relationship.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal class ParserUtils

/// <summary>
/// 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.
/// </summary>
/// <exception cref="EndOfStreamException"></exception>
Expand Down Expand Up @@ -82,7 +82,7 @@ internal static void AssertTokenType(Stream stream, ref Utf8JsonReader reader, J
}

/// <summary>
/// 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 <paramref name="expectedTokenTypes"/>.
/// </summary>
/// <param name="stream"></param>
Expand Down Expand Up @@ -150,9 +150,9 @@ internal static string GetStringValue(ReadOnlySpan<byte> valueSpan)

/// <summary>
/// Returns the next string value for a given property, for example:
///
///
/// { "TestProperty": "TestProperty Value" }
///
///
/// Will return "TestProperty Value".
/// </summary>
/// <param name="reader"></param>
Expand Down Expand Up @@ -273,9 +273,9 @@ public static void GetMoreBytesFromStream(Stream stream, ref byte[] buffer, ref

/// <summary>
/// Returns the next boolean value for a given property, for example:
///
///
/// { "TestProperty": false }
///
///
/// Will return false.
/// </summary>
/// <param name="reader"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace Microsoft.Sbom.Utils;

/// <summary>
/// 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.
/// </summary>
internal static class SPDXToSbomFormatConverterExtensions
Expand Down Expand Up @@ -91,7 +91,7 @@ internal static SBOMReference ToSbomReference(this SpdxExternalDocumentReference
}

/// <summary>
/// Gets the PURL from a <see cref="ExternalReference"/> object using the Locator property.
/// Gets the PURL from a <see cref="ExternalReference"/> object using the Locator property.
/// </summary>
/// <param name="externalReference"></param>
/// <returns></returns>
Expand Down

0 comments on commit c289490

Please sign in to comment.