Skip to content

docs(audience-sdk): apply XML doc style to public surface (SDK-216)#722

Merged
ImmutableJeffrey merged 3 commits into
mainfrom
feat/sdk-216-xml-docs
Apr 30, 2026
Merged

docs(audience-sdk): apply XML doc style to public surface (SDK-216)#722
ImmutableJeffrey merged 3 commits into
mainfrom
feat/sdk-216-xml-docs

Conversation

@ImmutableJeffrey
Copy link
Copy Markdown
Collaborator

Summary

Adds XML doc comments to every public type and member of Immutable.Audience.Runtime, enables Immutable.Audience.Runtime.xml generation 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

  • ImmutableAudience 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).
  • AudienceConfig class plus 11 public properties.
  • AudienceError class plus AudienceErrorCode enum (5 cases).
  • IEvent interface plus Progression, Resource, Purchase, MilestoneReached typed events with <inheritdoc/> on the interface implementations.
  • ConsentLevel (3 cases), IdentityType (8 cases), ProgressionStatus (3 cases), ResourceFlow (2 cases) enums.
  • DistributionPlatforms static class plus 5 string constants.

Style applied

  • Property summaries are noun phrases. Method summaries are imperative.
  • Sentence case, period at end. British spelling.
  • <see cref> for sibling references; <seealso cref> for See Also; <param> per parameter; <returns> on tasks; <exception cref> on documented throws.
  • <inheritdoc/> on IEvent implementations.
  • <remarks> only where it carries consumer-facing nuance the signature does not (negative-space contracts, persistence guarantees, swallow contracts, handling semantics).
  • Maintainer-only blocks (threading invariants, lock notes, IL2CPP rationale, internal phase commentary) stay as // line comments.
  • Style ruleset lives at 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.
  • CS1591 (missing XML comment on publicly visible type or member) is enabled with no NoWarn suppression.

Em-dash cleanup

  • 57 em-dashes removed from runtime source (in // comments, Log.Warn messages, and ArgumentException messages).
  • 55 em-dashes removed from test source (in // comments and assertion messages).
  • Replacements use period plus new sentence, colon for "purpose: mechanism", parentheses for asides, semicolon for tight clause linkage. Per code-review/audience-comment-style.md §1.5.

No code behaviour changes. dotnet test passes (274 / 274; 1 pre-existing skip).

Linear: SDK-216

ImmutableJeffrey and others added 2 commits April 30, 2026 20:08
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>
@ImmutableJeffrey ImmutableJeffrey merged commit 62c2273 into main Apr 30, 2026
31 checks passed
@ImmutableJeffrey ImmutableJeffrey deleted the feat/sdk-216-xml-docs branch April 30, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants