Skip to content

Apply visual studio cleanup suggestions. - #53

Merged
Malcolmnixon merged 3 commits into
mainfrom
visual-studio-cleanup
May 4, 2025
Merged

Malcolmnixon merged 3 commits into
mainfrom
visual-studio-cleanup

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

This PR cleans up suggestions by Visual Studio

@Malcolmnixon
Malcolmnixon requested a review from Copilot May 4, 2025 14:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR applies cleanup suggestions provided by Visual Studio to improve code readability and consistency.

  • Updated object initializers and array constructions to use new C# 12 collection expression features.
  • Replaced manual deep copy array assignments with either the spread operator or array cloning for consistency.
  • Cleaned up test assertions for deep copy functionality in multiple test cases.

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/DemaConsulting.SpdxModel.Tests/SpdxPackageTests.cs Updated object initializer formatting and deep copy assertions.
test/DemaConsulting.SpdxModel.Tests/SpdxFileTests.cs Simplified deep copy test logic and added clarity comments.
test/DemaConsulting.SpdxModel.Tests/SpdxExtractedLicensingInfoTests.cs Refined deep copy equality tests for licensing info.
test/DemaConsulting.SpdxModel.Tests/SpdxExternalReferenceTests.cs Updated deep copy tests to remove redundant property mutations.
test/DemaConsulting.SpdxModel.Tests/SpdxExternalDocumentReferenceTests.cs Updated deep copy tests for external document references.
test/DemaConsulting.SpdxModel.Tests/SpdxDocumentTests.cs Enhanced deep copy tests with new collection expressions.
test/DemaConsulting.SpdxModel.Tests/SpdxCreationInformationTests.cs Standardized creator cloning in tests.
test/DemaConsulting.SpdxModel.Tests/SpdxChecksumTests.cs Minor cleanup in deep copy assertions.
test/DemaConsulting.SpdxModel.Tests/SpdxAnnotationTests.cs Updated assertion structure in deep copy tests.
src/DemaConsulting.SpdxModel/Transform/SpdxRelationships.cs Refactored relationships removal using a new collection expression.
src/DemaConsulting.SpdxModel/SpdxSnippet.cs Updated cloning logic for AttributionText and license info.
src/DemaConsulting.SpdxModel/SpdxPackageVerificationCode.cs Replaced manual array copy with Clone() for excluded files.
src/DemaConsulting.SpdxModel/SpdxPackage.cs Updated deep copy methods to use new array expression and Clone() patterns.
src/DemaConsulting.SpdxModel/SpdxLicenseElement.cs Refactored AttributionText merge using a collection expression.
src/DemaConsulting.SpdxModel/SpdxFile.cs Standardized deep copy and enhancement logic, leveraging both Clone() and spread operators.
src/DemaConsulting.SpdxModel/SpdxExtractedLicensingInfo.cs Updated deep copy and enhancement methods with new array syntax.
src/DemaConsulting.SpdxModel/SpdxDocument.cs Updated deep copy and GetRootPackages with new array creation approaches.
src/DemaConsulting.SpdxModel/SpdxCreationInformation.cs Refactored deep copy and enhancement using Clone() and collection expressions.
src/DemaConsulting.SpdxModel/IO/Spdx2JsonSerializer.cs Modified array expressions in JSON serialization calls.
src/DemaConsulting.SpdxModel/IO/Spdx2JsonDeserializer.cs Updated array creation for JSON deserialization using new syntax.

Comment thread src/DemaConsulting.SpdxModel/SpdxFile.cs Outdated
Comment thread src/DemaConsulting.SpdxModel/SpdxPackage.cs
@Malcolmnixon
Malcolmnixon merged commit d6362d3 into main May 4, 2025
@Malcolmnixon
Malcolmnixon deleted the visual-studio-cleanup branch May 4, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants