Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/nuget/System.Reactive-6.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveTryon committed Jul 5, 2024
2 parents cdff367 + cdc046a commit 7ebbd71
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 60 deletions.
4 changes: 0 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,6 @@ dotnet_diagnostic.SA1024.severity = suggestion
# SA1101: Prefix local calls with this
dotnet_diagnostic.SA1101.severity = suggestion

# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1124.md
# SA1124: Do not use regions
dotnet_diagnostic.SA1124.severity = suggestion

# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1200.md
# SA1200: Using directive should appear within a namespace declaration
dotnet_diagnostic.SA1200.severity = suggestion
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
MINVERBUILDMETADATA: build.${{github.run_number}}

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0

Expand All @@ -43,6 +43,6 @@ jobs:
run: dotnet test --collect:"XPlat Code Coverage"

- name: Upload code coverage
uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # v4.0.1
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Initialize CodeQL
uses: github/codeql-action/init@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3
uses: github/codeql-action/init@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with:
languages: csharp

- name: Autobuild
uses: github/codeql-action/autobuild@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3
uses: github/codeql-action/autobuild@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3
uses: github/codeql-action/analyze@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
2 changes: 1 addition & 1 deletion .github/workflows/gen-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
gen-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Setup .NET
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
Expand Down
4 changes: 0 additions & 4 deletions src/Microsoft.Sbom.Api/Manifest/Configuration/SBOMConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ public void StartJsonSerialization()
JsonSerializer = new ManifestToolJsonSerializer(fileStream);
}

#region Disposable implementation

public void Dispose()
{
Dispose(disposing: true);
Expand Down Expand Up @@ -138,6 +136,4 @@ protected virtual async ValueTask DisposeAsyncCore()
fileStream = null;
JsonSerializer = null;
}

#endregion
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ public void ApplyToEachConfig(Action<ISbomConfig> action)
}
}

#region IInternalMetadataProvider implementation

public object GetMetadata(MetadataKey key)
{
if (MetadataDictionary.TryGetValue(key, out var value))
Expand Down Expand Up @@ -207,10 +205,6 @@ public string GetSBOMNamespaceUri()
throw new Exception($"Unable to find any provider to generate the namespace.");
}

#endregion

#region Disposable implementation

public void Dispose()
{
Dispose(disposing: true);
Expand Down Expand Up @@ -240,6 +234,4 @@ protected virtual async ValueTask DisposeAsyncCore()
await config.Value.DisposeAsync().ConfigureAwait(false);
}
}

#endregion
}
4 changes: 0 additions & 4 deletions src/Microsoft.Sbom.Api/Utils/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,5 @@ public static class Constants
public const string CatalogFileName = "manifest.cat";
public const string BsiFileName = "bsi.json";

#region Configuration switches

public const string DeleteManifestDirBoolVariableName = "DeleteManifestDirIfPresent";

#endregion
}
2 changes: 0 additions & 2 deletions src/Microsoft.Sbom.Api/Utils/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace Microsoft.Sbom.Api.Utils;

internal static class Events
{
#region Generation
internal const string SBOMGenerationWorkflow = "Total generation time";
internal const string SBOMParseMetadata = "Total metadata parsing time";
internal const string FilesGeneration = "Files generation time";
Expand All @@ -14,6 +13,5 @@ internal static class Events
internal const string MetadataBuilder = "Metadata build time for {0} format";
internal const string ExternalDocumentReferenceGeneration = "External document reference generation time";

#endregion
internal const string SBOMValidationWorkflow = "Total validation time";
}
4 changes: 0 additions & 4 deletions src/Microsoft.Sbom.Extensions/MetadataKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ public enum MetadataKey
/// these variables, go to
/// https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#build-variables-devops-services
/// </summary>
#region Azure DevOps Pipelines metadata

Build_BuildId,
Build_DefinitionName,
Build_Repository_Uri,
Expand All @@ -62,6 +60,4 @@ public enum MetadataKey
ImageVersion,
OrganizationId,
ProjectId

#endregion
}
7 changes: 0 additions & 7 deletions src/Microsoft.Sbom.Parsers.Spdx22SbomParser/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ internal static class Constants
internal const string SPDXDocumentIdValue = "SPDXRef-DOCUMENT";
internal const string RootPackageIdValue = "SPDXRef-RootPackage";
internal const string SPDXRefFile = "SPDXRef-File";
#region Headers

internal const string SPDXVersionHeaderName = "spdxVersion";
internal const string DataLicenseHeaderName = "dataLicense";
Expand All @@ -29,17 +28,11 @@ internal static class Constants
internal const string RelationshipsArrayHeaderName = "relationships";
internal const string ExternalDocumentRefArrayHeaderName = "externalDocumentRefs";

#endregion

internal const int ReadBufferSize = 4096;

#region Value format strings

internal const string SPDXDocumentNameFormatString = "{0} {1}";
internal const string PackageSupplierFormatString = "Organization: {0}";

#endregion

/// <summary>
/// Use if there is no available information for a field.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,13 @@ namespace Microsoft.Sbom.Parsers.Spdx22SbomParser.Entities.Enums;
Justification = "These are enum types that are case sensitive and defined by external code.")]
public enum ExternalRepositoryType
{
#region Security
cpe22,
cpe23,

#endregion

#region Persistent-Id

swh,

#endregion

#region Package-Manager

maven_central,
npm,
nuget,
bower,
purl,

#endregion

#region Other

idstring

#endregion
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ object Ctor(Type type)
mapper = mapperConfiguration.CreateMapper();
}

protected const string JSONConfigWithManifestPath = "{ \"ManifestDirPath\": \"manifestDirPath\"}";
protected const string JSONConfigGoodWithManifestInfo = "{ \"ManifestInfo\": [{ \"Name\":\"manifest\", \"Version\":\"1\"}]}";
protected const string JSONConfigWithManifestPath = $"{{ \"ManifestDirPath\": \"manifestDirPath\"}}";
protected const string JSONConfigGoodWithManifestInfo = $"{{ \"ManifestInfo\": [{{ \"Name\":\"manifest\", \"Version\":\"1\"}}]}}";
}

0 comments on commit 7ebbd71

Please sign in to comment.