feat(utilities): add runtime helper utilities - #113
Conversation
|
@coderabbitai autofix |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis pull request introduces utility APIs across nine new files in 🚥 Pre-merge checks | ✅ 8 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (8 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found. |
Add small runtime utility helpers for disposables, empty enumerators, read-only empty collections, weak references, formatting/copy helpers, reader-writer lock scopes, and enumerable compatibility aliases. Cover the added helper behavior with focused tests, including idempotent lock-scope disposal through aliased references.
776d920 to
d5c9995
Compare
|
@coderabbitai autofix |
ANcpLua
left a comment
There was a problem hiding this comment.
Self-review findings: no blocking issues in this PR diff.
Checked scope:
- Branch had an already-merged PR (#111), but the branch was reused and had a newer unmerged helper commit.
- Rebasing onto current
origin/maindropped the old version-sync commit and left one runtime-helper commit. - PR now contains only helper additions/aliases plus focused tests.
Self-review changes made before this review:
- Converted reader/writer lock scope guards from mutable structs to sealed disposable classes using
Interlocked.Exchange, avoiding double-exit behavior if the disposable reference is aliased. - Replaced a source-file collection expression in
ReadOnlyCollection.Empty<T>withglobal::System.Array.Empty<T>()so the source package does not force collection-expression syntax on consumers. - Removed the Chasm-derived wording from the commit message; this PR now describes the local helper surface directly.
Validation:
git diff --check origin/main...HEADand working-treegit diff --checkdotnet test --project tests/ANcpLua.Roslyn.Utilities.Testing.Tests/ANcpLua.Roslyn.Utilities.Testing.Tests.csprojpassed: 38 total, 0 faileddotnet restore ANcpLua.Roslyn.Utilities.slnxdotnet build ANcpLua.Roslyn.Utilities.slnx -c Release --no-restore -p:Version=0.0.0-localpassed with 0 warnings, 0 errors- runtime and source-only package pack commands passed
- source package inspection confirmed the new helper files are included and
ReadOnlyCollection.cstransforms to internal source usingglobal::System.Array.Empty<T>()
Known existing issue, not introduced here: full-solution dotnet test --solution still has the ExtensibleEnumMirror namespace TestNs.TestNs / CS8955 issue previously reproduced on origin/main.
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found. |
Summary
dev/sync-published-ancplua-versionsfor the unmerged helper work after PR Sync published ANcpLua package versions #111 already merged the version-sync commit.origin/mainso this PR is a single runtime-helper commit on top of feat(utilities): add TryResult helpers #112 /v2.2.6.Interlocked.Exchange, avoiding mutable-struct copy double-dispose behavior.Validation
git diff --check origin/main...HEADdotnet test --project tests/ANcpLua.Roslyn.Utilities.Testing.Tests/ANcpLua.Roslyn.Utilities.Testing.Tests.csprojpassed: 38 total, 0 failed.dotnet restore ANcpLua.Roslyn.Utilities.slnxdotnet build ANcpLua.Roslyn.Utilities.slnx -c Release --no-restore -p:Version=0.0.0-localdotnet pack src/ANcpLua.Roslyn.Utilities/ANcpLua.Roslyn.Utilities.csproj -c Release -o artifacts/pr-pack-sync -p:Version=0.0.0-local --no-builddotnet pack src/ANcpLua.Roslyn.Utilities.Sources/ANcpLua.Roslyn.Utilities.Sources.csproj -c Release -o artifacts/pr-pack-sync -p:Version=0.0.0-local --no-buildDelegateDisposable.cs,Enumerator*.cs,FormattingExtensions.cs,ReadOnly*.cs,ReaderWriterLockSlimExtensions.cs,WeakReferenceExtensions.cs, and the currentTryResult.csfrom main.Notes
dotnet test --solution ANcpLua.Roslyn.Utilities.slnxfails inANcpLua.Roslyn.Utilities.ExtensibleEnumMirror.Testswith generatednamespace TestNs.TestNs;/ CS8955 onorigin/main, so I used the focused helper tests plus the CI-shaped Release build for this PR.Summary by CodeRabbit
New Features
Only,OnlyOrDefault,NotNull,JoinmethodsTests