Fix Release-build analyzer errors blocking develop -> main release#30
Merged
Merged
Conversation
Release builds now run 'dotnet build -c Release' with TreatWarningsAsErrors,
which surfaced existing analyzer findings that Debug builds didn't enforce.
src:
- InMemoryLoggerBuilderExtensions.AddInMemoryLogger: add <exception> XML doc
for ArgumentNullException (RCS1140)
- InMemoryLoggerProvider.CreateLogger: add <exception> XML doc for
ArgumentNullException (RCS1140)
- InMemoryLoggerProvider: mark sealed (CA1063, S3881). The class has no
overridable members and the existing no-op Dispose doesn't justify the
full Dispose(bool) pattern.
tests:
- InMemoryLogger{,OfT}Tests.Log_when_called_adds_entry_to_LogEntries:
- Name the 'exception' parameter explicitly (MA0003)
- Discard unused 'exception' parameter in the formatter delegate
(RCS1163, S3257)
- Use indexer on IReadOnlyList instead of First() (CA1826)
Verified locally: Release build 0/0, 52 tests pass on all TFMs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
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.
Summary
Release builds now run with
TreatWarningsAsErrors=true(set inDirectory.Build.propsfor Release config). Local verification of develop after PR #28 surfaced analyzer findings that Debug builds didn't enforce. Fixing them now so the eventualdevelop -> mainrelease PR clears thevalidate-releaseandpack-and-validatejobs inrelease.yaml.src
InMemoryLoggerBuilderExtensions.AddInMemoryLogger— add<exception>XML doc forArgumentNullException(RCS1140)InMemoryLoggerProvider.CreateLogger— add<exception>XML doc forArgumentNullException(RCS1140)InMemoryLoggerProvider— marksealed(CA1063, S3881). No overridable members and the existing no-opDisposedoesn't justify the fullDispose(bool)pattern.tests
InMemoryLoggerTests.Log_when_called_adds_entry_to_LogEntriesand the<T>equivalent:exceptionargument explicitly (MA0003)exceptionparameter in the formatter delegate (RCS1163, S3257)IReadOnlyList<T>indexer instead ofFirst()(CA1826)Test plan
dotnet build "In-Memory Logger.slnx" -c Release— 0 errors / 0 warningsdotnet test "In-Memory Logger.slnx" -c Release— 52/52 passing on net462, net47, net471, net472, net48, net481, net6.0, net7.0, net8.0, net9.0, net10.0🤖 Generated with Claude Code