Skip to content

Rename namespace and package to ptr727.Utilities#384

Merged
ptr727 merged 6 commits into
developfrom
feature/rename-namespace-ptr727
Jul 10, 2026
Merged

Rename namespace and package to ptr727.Utilities#384
ptr727 merged 6 commits into
developfrom
feature/rename-namespace-ptr727

Conversation

@ptr727

@ptr727 ptr727 commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Renames the library from InsaneGenius.Utilities to ptr727.Utilities, folded into the breaking 3.7 release, and aligns the identifier style with the sibling LanguageTags project. Also includes a set of analyzer-suppression and formatting cleanups surfaced while doing the rename.

Changes

Namespace / package rename (breaking)

  • InsaneGenius.Utilities -> ptr727.Utilities across all namespaces, using directives, PackageId, and RootNamespace.
  • Bare, prefix-less AssemblyName (Utilities, UtilitiesTests) and InternalsVisibleTo, matching the ptr727.LanguageTags / LanguageTags split upstream.
  • README + HISTORY updated; both 3.7 breaking changes (namespace and the logging model) now carry consistent (breaking) notation.

Analyzer suppressions (CODESTYLE alignment)

  • Localized library exceptions CA1024, CA1034, CA1054, CA5394 moved from Utilities/.editorconfig to symbol-scoped [SuppressMessage] attributes with justifications (narrowest scope; CA1034 matches the CODESTYLE example).
  • Removed two dead test suppressions (CA1307, CA2007) that a probe build proved never fire.
  • Removed the unused IClassFixture _fixture fields and the empty IDisposable test fixture, which eliminates the CA1823 / IDE0052 / CA1063 suppressions entirely.

Bug fix — culture-dependent byte formatting

  • Format.BytesToKibi / BytesToKilo used {value:F} with no precision, so the fractional digit count followed the ambient culture. Now uses FormattableString.Invariant, making output deterministic. Fixes 6 tests that fail under non-en-US / POSIX (C.UTF-8) number formatting.

GlobalUsings

  • Added GlobalUsings.cs to the library (Microsoft.Extensions.Logging) and Sandbox (Serilog); added global using Xunit; to the tests. Removed the now-redundant per-file using directives.

Verification

  • dotnet build -c Release — 0 warnings, 0 errors (under TreatWarningsAsErrors).
  • dotnet test133 / 133 pass (was 127/6 locally; the 6 were the culture bug fixed here).
  • dotnet format style --verify-no-changes --severity=info — clean.
  • CSharpier-formatted; all C# files CRLF per .editorconfig.

Related

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 10, 2026 02:32
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.62%. Comparing base (9480c4b) to head (7f424e1).

Files with missing lines Patch % Lines
Utilities/Download.cs 58.82% 3 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #384      +/-   ##
===========================================
+ Coverage    40.23%   40.62%   +0.38%     
===========================================
  Files           10       10              
  Lines         1009     1024      +15     
  Branches        97       99       +2     
===========================================
+ Hits           406      416      +10     
- Misses         577      580       +3     
- Partials        26       28       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Renames the Utilities library’s NuGet package id and root namespace from InsaneGenius.Utilities to ptr727.Utilities, updates Sandbox and tests to match, and includes related analyzer-suppression cleanups plus a culture-invariant fix for byte-size formatting.

Changes:

  • Renamed namespaces/usings across library, tests, and Sandbox; updated PackageId, RootNamespace, AssemblyName, and InternalsVisibleTo.
  • Added GlobalUsings for logging/Serilog/xUnit and removed redundant per-file using directives.
  • Made Format.BytesToKibi / BytesToKilo output culture-invariant and localized several analyzer suppressions to [SuppressMessage].

Reviewed changes

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

Show a summary per file
File Description
UtilitiesTests/UtilitiesTests.csproj Updates test project metadata to new package/namespace naming and assembly name.
UtilitiesTests/UtilitiesTests.cs Updates test project namespace and adjusts the (now-empty) fixture type.
UtilitiesTests/StringHistoryTests.cs Moves to new test namespace and removes redundant fixture field/ctor usage.
UtilitiesTests/StringCompressionTests.cs Moves to new test namespace and removes redundant fixture field/ctor usage.
UtilitiesTests/StringCompressionAsyncTests.cs Moves to new test namespace and removes redundant fixture field/ctor usage.
UtilitiesTests/LogOptionsTests.cs Moves to new test namespace and relies on global xUnit usings.
UtilitiesTests/GlobalUsings.cs Adds global using Xunit; to centralize test imports.
UtilitiesTests/FormatTests.cs Moves to new test namespace and removes redundant fixture field/ctor usage.
UtilitiesTests/FileTests.cs Moves to new test namespace and removes redundant fixture field/ctor usage.
UtilitiesTests/FileExAsyncTests.cs Moves to new test namespace and removes redundant fixture field/ctor usage.
UtilitiesTests/ExtensionsTests.cs Moves to new test namespace and removes redundant fixture field/ctor usage.
UtilitiesTests/DownloadTests.cs Moves to new test namespace and removes redundant fixture field/ctor usage.
UtilitiesTests/DownloadAsyncTests.cs Moves to new test namespace and removes redundant fixture field/ctor usage.
UtilitiesTests/ConsoleTests.cs Moves to new test namespace and removes redundant fixture field/ctor usage.
UtilitiesTests/CommandLineTests.cs Moves to new test namespace and removes redundant fixture field/ctor usage.
UtilitiesTests/.editorconfig Removes now-unneeded test suppressions after fixture cleanup.
Utilities/Utilities.csproj Renames package/root namespace and aligns assembly name and InternalsVisibleTo target.
Utilities/StringHistory.cs Renames library namespace to ptr727.Utilities.
Utilities/StringCompression.cs Renames library namespace to ptr727.Utilities.
Utilities/LogOptions.cs Renames library namespace and relies on global logging using.
Utilities/GlobalUsings.cs Adds global using Microsoft.Extensions.Logging; for the library.
Utilities/Format.cs Renames namespace and makes byte formatting culture-invariant.
Utilities/FileExOptions.cs Renames library namespace to ptr727.Utilities.
Utilities/FileEx.cs Renames namespace, relies on global logging using, and adds targeted CA5394 suppressions.
Utilities/Extensions.cs Renames namespace, relies on global logging using, and adds targeted CA1034 suppression.
Utilities/Download.cs Renames namespace, relies on global logging using, updates product naming, and adds targeted CA1024/CA1054 suppressions.
Utilities/ConsoleEx.cs Renames library namespace to ptr727.Utilities.
Utilities/CommandLineEx.cs Renames library namespace to ptr727.Utilities.
Utilities/.editorconfig Updates analyzer suppression approach to prefer symbol-scoped [SuppressMessage] where appropriate.
Sandbox/Sandbox.csproj Renames Sandbox root namespace to ptr727.Utilities.Sandbox.
Sandbox/Program.cs Updates usings to the renamed namespaces and relies on global Serilog using.
Sandbox/LoggerFactory.cs Renames Sandbox namespace and relies on global Serilog using.
Sandbox/GlobalUsings.cs Adds global using Serilog; for the Sandbox project.
README.md Updates docs for new package id/namespace and marks breaking changes consistently.
HISTORY.md Documents the breaking rename and related release notes for v3.7.
codecov.yml Updates commentary to reference the renamed library.
AGENTS.md Updates repository agent documentation to the new published package name.

Comment thread Utilities/Download.cs Outdated
Comment thread UtilitiesTests/UtilitiesTests.cs Outdated
Fold the namespace/package rename into the breaking 3.7 release and align with
the ptr727.* style of the sibling LanguageTags project.

- Rename InsaneGenius.Utilities -> ptr727.Utilities across namespaces, PackageId
  and RootNamespace; use bare AssemblyName (Utilities / UtilitiesTests) and
  InternalsVisibleTo, matching LanguageTags (breaking).
- Move localized library suppressions CA1024/CA1034/CA1054/CA5394 from
  Utilities/.editorconfig to symbol-scoped [SuppressMessage] attributes, per
  CODESTYLE's narrowest-scope preference.
- Remove dead test suppressions CA1307 and CA2007, and drop the unused
  IClassFixture _fixture fields and the empty IDisposable fixture, removing the
  CA1823/IDE0052/CA1063 suppressions.
- Make Format.BytesToKibi/BytesToKilo culture-invariant via
  FormattableString.Invariant, fixing locale-dependent decimal digits.
- Add GlobalUsings.cs to the library (Microsoft.Extensions.Logging) and Sandbox
  (Serilog); add global using Xunit to the tests.
- Document both breaking 3.7 changes (namespace and logging) consistently in
  README and HISTORY.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 10, 2026 02:39
@ptr727
ptr727 force-pushed the feature/rename-namespace-ptr727 branch from 3404faf to d9e9b0d Compare July 10, 2026 02:39

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

Copilot reviewed 37 out of 37 changed files in this pull request and generated 12 comments.

Comment thread UtilitiesTests/StringHistoryTests.cs Outdated
Comment thread UtilitiesTests/StringCompressionTests.cs Outdated
Comment thread UtilitiesTests/StringCompressionAsyncTests.cs Outdated
Comment thread UtilitiesTests/FormatTests.cs Outdated
Comment thread UtilitiesTests/FileTests.cs Outdated
Comment thread UtilitiesTests/DownloadTests.cs Outdated
Comment thread UtilitiesTests/DownloadAsyncTests.cs Outdated
Comment thread UtilitiesTests/ConsoleTests.cs Outdated
Comment thread UtilitiesTests/CommandLineTests.cs Outdated
Comment thread Utilities/Download.cs Outdated
…xture

- Use a deliberate "ptr727.Utilities" constant for the HttpClient User-Agent
  product name instead of deriving it from the bare "Utilities" assembly name,
  resolving the assembly-name/fallback inconsistency.
- Remove the now-empty UtilitiesTests fixture and drop
  IClassFixture<UtilitiesTests> from all test classes; the LogOptions collection
  (separate LogOptionsCollectionDefinition) is unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 10, 2026 02:47

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

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

Identify the caller (consuming executable) for the HttpClient User-Agent
instead of hardcoding or falling back to this library's own assembly: try the
managed entry assembly name, then the OS-level process executable name
(Environment.ProcessPath), then a generic value. Assembly-to-file metadata is
unreliable under NativeAOT (dotnet/runtime#122457), so this avoids
Assembly.GetExecutingAssembly()/Location. The User-Agent is added via
ProductInfoHeaderValue.TryParse so a non-token app name cannot throw.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 10, 2026 03:05

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

Copilot reviewed 37 out of 37 changed files in this pull request and generated 1 comment.

Comment thread Utilities/Download.cs Outdated
Per AGENTS.md comment rules (no naming other repos), state the NativeAOT
limitation without the external issue reference.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 10, 2026 03:13

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

Copilot reviewed 37 out of 37 changed files in this pull request and generated 1 comment.

Comment thread Utilities/Download.cs Outdated
If the derived product name is not a valid HTTP token (e.g. a process
executable name with spaces), fall back to Unknown/<version> so a User-Agent
header is always set, matching the prior always-set behavior.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 10, 2026 03:19

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

Copilot reviewed 37 out of 37 changed files in this pull request and generated 1 comment.

Comment thread codecov.yml Outdated
Break the ignore-note comment after the clause comma so the two lines read
naturally instead of splitting "the shipped ptr727.Utilities library".

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 10, 2026 03:24

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

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

@ptr727
ptr727 merged commit 55ce08a into develop Jul 10, 2026
12 checks passed
@ptr727
ptr727 deleted the feature/rename-namespace-ptr727 branch July 10, 2026 03:31
ptr727 added a commit that referenced this pull request Jul 10, 2026
Promotes the `ptr727.Utilities` rename from `develop` to `main`, folded
into the breaking **3.7** release. Full detail and review history in
#384.

## Highlights

- **Rename (breaking):** `InsaneGenius.Utilities` -> `ptr727.Utilities`
across namespaces, `using` directives, `PackageId`, and `RootNamespace`;
bare `AssemblyName` (`Utilities` / `UtilitiesTests`) and
`InternalsVisibleTo`, matching the sibling `LanguageTags` project. Both
3.7 breaking changes (namespace **and** the logging model) are marked
consistently in README and HISTORY.
- **Analyzer suppressions:** localized library exceptions
(CA1024/CA1034/CA1054/CA5394) moved to symbol-scoped
`[SuppressMessage]`; dead test suppressions (CA1307/CA2007) and the
vestigial `IClassFixture` fixture removed (CA1823/IDE0052/CA1063).
- **Bug fix:** `Format.BytesToKibi`/`BytesToKilo` are now
culture-invariant.
- **HttpClient User-Agent:** derived from the consuming application
(AOT-safe), always sets a header.
- **GlobalUsings.cs** added per project.

## Verification

- 133/133 tests, 0 warnings, clean `dotnet format` + editorconfig,
NativeAOT publish verified.
- All #384 review threads resolved; Copilot's final pass generated no
new comments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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