Apply visual studio cleanup suggestions. - #53
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR cleans up suggestions by Visual Studio