Skip to content

Align naming and member order with sibling repo conventions - #58

Merged
Tyrrrz merged 2 commits into
masterfrom
copilot/fix-codebase-inconsistencies
Feb 27, 2026
Merged

Tyrrrz merged 2 commits into
masterfrom
copilot/fix-codebase-inconsistencies

Conversation

Copilot AI commented Feb 27, 2026 •

Copy link
Copy Markdown
Contributor

Two minor inconsistencies with sibling repos (YoutubeDownloader, DiscordChatExporter, LightBulb.PlatformInterop).

  • StringExtensions: Rename NullIfEmptyOrWhiteSpace() → NullIfWhiteSpace() and update all call sites (TargetAssembly.cs, Url.cs)
  • Disposable: Move Create() above Dispose() to match conventional static-factory-before-instance-method ordering
// Before
public void Dispose() => dispose();
public static IDisposable Create(Action dispose) => new Disposable(dispose);

// After
public static IDisposable Create(Action dispose) => new Disposable(dispose);
public void Dispose() => dispose();
Original prompt

Fix the following inconsistencies found in the codebase by comparing patterns with sibling repos.

Important instructions:

  • Update file names/paths to match type names/namespaces where appropriate
  • Run dotnet build to verify the build succeeds and to fix any formatting issues

1. NullIfEmptyOrWhiteSpace — rename to NullIfWhiteSpace

In DotnetRuntimeBootstrapper.AppHost.Core/Utils/Extensions/StringExtensions.cs:

  • Rename NullIfEmptyOrWhiteSpace() to NullIfWhiteSpace() to match the convention used in sibling repos

Update all call sites across the repo that call .NullIfEmptyOrWhiteSpace() to use .NullIfWhiteSpace() instead.

2. Disposable — fix member order

In DotnetRuntimeBootstrapper.AppHost.Core/Utils/Disposable.cs, the member order is Dispose() then Create(). Swap to put Create() before Dispose() to match the convention in sibling repos (YoutubeDownloader, DiscordChatExporter, LightBulb.PlatformInterop):

// Before
public void Dispose() => dispose();
public static IDisposable Create(Action dispose) => new Disposable(dispose);

// After
public static IDisposable Create(Action dispose) => new Disposable(dispose);
public void Dispose() => dispose();

This pull request was created from Copilot chat.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix codebase inconsistencies by renaming methods and adjusting order Align naming and member order with sibling repo conventions Feb 27, 2026
@Tyrrrz Tyrrrz added the enhancement New feature or request label Feb 27, 2026
@Tyrrrz
Tyrrrz marked this pull request as ready for review February 27, 2026 12:33
Copilot AI review requested due to automatic review settings February 27, 2026 12:33

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

Aligns this repo’s utilities with naming and member-order conventions used in sibling repositories, keeping extension APIs and helper patterns consistent across related projects.

Changes:

  • Renamed StringExtensions.NullIfEmptyOrWhiteSpace() to NullIfWhiteSpace() and updated all in-repo call sites.
  • Reordered Disposable members so the static factory Create() appears before Dispose().

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
DotnetRuntimeBootstrapper.AppHost.Core/Utils/Url.cs Updates TryExtractFileName() to use the renamed NullIfWhiteSpace() extension.
DotnetRuntimeBootstrapper.AppHost.Core/Utils/Extensions/StringExtensions.cs Renames the extension member to NullIfWhiteSpace() (behavior remains IsNullOrWhiteSpace-based).
DotnetRuntimeBootstrapper.AppHost.Core/Utils/Disposable.cs Reorders members to place Create() above Dispose().
DotnetRuntimeBootstrapper.AppHost.Core/TargetAssembly.cs Updates Resolve() to use NullIfWhiteSpace() for ProductName normalization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Tyrrrz
Tyrrrz merged commit 01223a3 into master Feb 27, 2026
9 checks passed
@Tyrrrz
Tyrrrz deleted the copilot/fix-codebase-inconsistencies branch February 27, 2026 12:40
@codecov

codecov Bot commented Feb 27, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants