Skip to content

Code cleanup - #1704

Merged
clairernovotny merged 15 commits into
mainfrom
code-fixes
Mar 6, 2025
Merged

clairernovotny merged 15 commits into
mainfrom
code-fixes

Conversation

@clairernovotny

Copy link
Copy Markdown
Member

PR Classification

Code cleanup and standardization of null checks across the project.

PR Summary

This pull request updates the project to improve code quality by standardizing null checks and modifying class declarations for better performance. Key changes include:

  • .editorconfig: Modified severity levels for several code analysis rules.
  • AssemblyMetaDataInfo.cs, AssemblyMetadataParser.cs, AssemblyMetadataReader.cs: Updated null checks to use ArgumentNullException.ThrowIfNull.
  • CommonAssemblyInfo.cs: Added whitespace before the using directive.
  • PackageExtensions.cs, PluginExtensions.cs, StreamExtensions.cs: Changed class declarations to sealed class and standardized null checks.
  • Core.csproj and Types.csproj: Removed netstandard2.1 from target frameworks and added project references for analyzers.

- Updated `Core.csproj`, `PackageViewModel.csproj`, and `Types.csproj` to remove `netstandard2.1`, retaining only `net9.0` and `net8.0`.
- Modified `FileHelper.cs` to conditionally include `System.Drawing` for Windows compatibility.
This change simplifies the code, improves readability, and reduces boilerplate code related to null argument handling. Minor formatting adjustments were also made in some files.
Updated project structure to replace embedded resources with project references to `NuGetPeGenerators`. Modified `CommonAssemblyInfo.cs` to include necessary namespaces. Removed auto-generated content from several `.Designer.cs` files, indicating a regeneration process. Introduced `NuGetPeGenerators.csproj` for a new analyzer targeting `netstandard2.0` and added `ResXCompositeFormatGenerator.cs` for improved resource handling and string interpolation.
This commit removes the inclusion of the `Resources.Designer.cs` file from the project items, indicating that it is no longer part of the compilation process.
- Added a new `<ItemGroup>` in `NuGetPackageExplorer.WinUI.csproj`.
- Included a `<ProjectReference>` to `NuGetPeGenerators.csproj` as an analyzer.
- Added an `<AdditionalFiles>` entry for `.resx` files in the `PackageExplorer` directory.
- This change addresses a workaround for asset generation issues in the Uno platform.
@github-actions

github-actions Bot commented Mar 5, 2025

Copy link
Copy Markdown

Introduce a private static readonly field for resource strings,
replacing direct public static property access. This change
enhances encapsulation and improves performance by caching
the resource string value.
@github-actions

github-actions Bot commented Mar 5, 2025

Copy link
Copy Markdown

- Removed specific version numbers from multiple `PackageReference` entries across various project files for greater flexibility in package management.
- Updated copyright year in `Directory.Build.props` from 2024 to 2025.
- Introduced a new `Directory.Packages.props` file to centralize package version management.
Updated method signatures in `PackageHealthContentHelper.cs` to support nullable return types for several validation methods. Removed unused `using` directives to clean up the code and improve overall robustness.
- Enable central package transitive pinning in `Directory.Packages.props`.
- Update NuGet dependency version from `6.13.1` to `6.13.2`.
- Add new package versions: `System.Formats.Asn1`, `System.Net.Http`, `System.Private.Uri`, `System.Security.Cryptography.Xml`, and `System.Text.RegularExpressions`.
- Comment out "NuGet CI packages" source in `NuGet.config`.
- Introduce `packageSourceMapping` and set aggregate source as active.
This commit adds a new package source pattern for
"Microsoft.DiaSymReader.Converter" under the
"dotnet-tools" package source in the NuGet.config file.
- Updated `Microsoft.DiaSymReader.Converter` to version `1.1.0-beta2-25127-02`.
- Updated `Microsoft.SymbolStore` to version `8.0.0-preview.24273.2`.
- Modified `NuGet.config` to include specific package patterns for `Microsoft.FileFormats`, `Microsoft.SymbolStore`, and `Microsoft.DiaSymReader.Converter` in the `dotnet-tools` source mapping.
@clairernovotny
clairernovotny enabled auto-merge March 5, 2025 23:47
@github-actions

github-actions Bot commented Mar 5, 2025

Copy link
Copy Markdown

@clairernovotny
clairernovotny disabled auto-merge March 6, 2025 00:34
@clairernovotny
clairernovotny merged commit d3796af into main Mar 6, 2025
@clairernovotny
clairernovotny deleted the code-fixes branch March 6, 2025 00:34
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.

1 participant