docs(audience-sdk): apply XML doc style to public surface (SDK-216)#722
Merged
Conversation
nattb8
approved these changes
Apr 30, 2026
Adds XML doc comments to every public type and member of Immutable.Audience.Runtime, enables doc-file generation, and turns on CS1591 enforcement so future public surface without a <summary> breaks the build. Files documented: - ConsentLevel.cs: enum + 3 cases. - IdentityType.cs: enum + 8 cases. - AudienceError.cs: AudienceErrorCode enum (5 cases) plus AudienceError class, Code property, and constructor. - AudienceConfig.cs: class plus 11 public properties. - Events/IEvent.cs: interface plus EventName and ToProperties. - Events/TypedEvents.cs: ProgressionStatus, ResourceFlow enums plus Progression, Resource, Purchase, MilestoneReached classes (with <inheritdoc/> on the IEvent impls). - ImmutableAudience.cs: static class plus 6 properties (Initialized, CurrentConsent, UserId, AnonymousId, SessionId, QueueSize) and 11 methods (Init, Track x2, Identify x2, Alias x2, Reset, DeleteData, SetConsent, FlushAsync, Shutdown). - Core/Constants.cs: DistributionPlatforms class plus 5 string constants. Style applied: - Property summaries are noun-phrase, not "Gets..." or imperative. - Method summaries are imperative. - Sentence case, period at end. British spelling. - Negative-space stated for nullable members where non-trivial. - <see cref> for sibling references; <seealso cref> for See Also. - <param> per parameter; <returns> on Tasks; <exception cref> on documented throws. - <inheritdoc/> on interface impls. - <remarks> only where it carries load-bearing consumer-facing info (handling semantics, persistence guarantees, swallow contracts, negative-space). Internal mechanics stay out of public docs. - No "Gets/Sets" prefix, no "(RO)" suffix, no marketing language. - No em-dash, no emoji or symbol glyphs. - See code-review/audience-comment-style.md for the full ruleset. Maintainer-only blocks (threading invariants, lock notes, Phase 1/Phase 2 commentary, IL2CPP rationale) stay as // line comments per §6 of the style doc. Audience.Runtime.csproj: - <GenerateDocumentationFile>true</> emits Immutable.Audience.Runtime.xml beside the DLL on every build. - CS1591 fires when any future public surface is added without a <summary>. No NoWarn suppression. dotnet build clean: 0 warnings, 0 errors. No code behaviour changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Removes em-dash (U+2014) from every // line comment, /// XML doc, Log.Warn message, and ArgumentException message in the audience SDK runtime and test projects. Replaced contextually with period plus new sentence, semicolon for tight clause linkage, colon for "purpose: mechanism", or parentheses for asides. Per code-review/audience-comment-style.md §1.5. Touches 11 runtime files (~57 sites) and 11 test files (~55 sites). Runtime user-visible string changes worth noting (the wire format and AudienceErrorCode contract are unchanged): - ArgumentException messages on Progression/Resource/Purchase validation now end with a full stop and split the prescriptive clause into a second sentence. - Log.Warn messages from Init / Track / Identify / Alias / SetConsent / Shutdown swap em-dash for period or colon. - FormatException messages from Json.Serialize use period. dotnet test: 274 passed, 0 failed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
b899f54 to
4051a6b
Compare
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
Adds XML doc comments to every public type and member of
Immutable.Audience.Runtime, enablesImmutable.Audience.Runtime.xmlgeneration so Rider and DocFX can surface the docs, and turns on CS1591 enforcement so future undocumented public surface fails the build. Also strips em-dash characters from comments, log messages, and exception messages across the audience SDK runtime and tests so the source is consistent with the comment style.What's documented
ImmutableAudiencestatic class plus 6 properties (Initialized,CurrentConsent,UserId,AnonymousId,SessionId,QueueSize) and 11 methods (Init,Trackx2,Identifyx2,Aliasx2,Reset,DeleteData,SetConsent,FlushAsync,Shutdown).AudienceConfigclass plus 11 public properties.AudienceErrorclass plusAudienceErrorCodeenum (5 cases).IEventinterface plusProgression,Resource,Purchase,MilestoneReachedtyped events with<inheritdoc/>on the interface implementations.ConsentLevel(3 cases),IdentityType(8 cases),ProgressionStatus(3 cases),ResourceFlow(2 cases) enums.DistributionPlatformsstatic class plus 5 string constants.Style applied
<see cref>for sibling references;<seealso cref>for See Also;<param>per parameter;<returns>on tasks;<exception cref>on documented throws.<inheritdoc/>onIEventimplementations.<remarks>only where it carries consumer-facing nuance the signature does not (negative-space contracts, persistence guarantees, swallow contracts, handling semantics).//line comments.code-review/audience-comment-style.md.Build infrastructure
Audience.Runtime.csproj: adds<GenerateDocumentationFile>true</GenerateDocumentationFile>so the XML file ships beside the DLL on every build.NoWarnsuppression.Em-dash cleanup
//comments,Log.Warnmessages, andArgumentExceptionmessages).//comments and assertion messages).code-review/audience-comment-style.md§1.5.No code behaviour changes.
dotnet testpasses (274 / 274; 1 pre-existing skip).Linear: SDK-216