NEO-146: fix record struct docs and collection spread in tests
Replace param XML on record struct mutation outcomes with summary cref docs to avoid Roslynator RCS1263 false positives; apply IDE0305 in RewardRouterOperationsTests and update style guide guidance.pull/187/head
parent
a4f37db594
commit
01e82f38f6
|
|
@ -133,7 +133,7 @@ var store = secondScope.ServiceProvider.GetRequiredService<IExampleStore>(); //
|
|||
## Documentation
|
||||
|
||||
- Use **`///` XML doc comments** on public APIs (types and members) when behavior or contracts are not obvious.
|
||||
- **Primary-constructor records:** include a **`<summary>`** plus **`<param>`** for every constructor parameter (Roslynator RCS1139 / RCS1263). Do not leave orphaned `<param>` lines without a summary on the type.
|
||||
- **Primary-constructor records:** include a **`<summary>`** on the type. Prefer **`<see cref="PropertyName"/>`** in the summary for positional parameters. Do **not** use **`<param>`** on **`record struct`** primary constructors — Roslynator reports false-positive **RCS1263** ([roslynator#1730](https://github.com/dotnet/roslynator/issues/1730)). **`record class`** / **`class`** primary constructors may use `<param>` when the analyzer accepts them.
|
||||
|
||||
## Null checks (IDE0270)
|
||||
|
||||
|
|
|
|||
|
|
@ -803,7 +803,7 @@ public sealed class RewardRouterOperationsTests
|
|||
var filtered = rows.Where(r => r.PlayerId == normalized).ToList();
|
||||
if (limit is > 0)
|
||||
{
|
||||
return filtered.Take(limit.Value).ToList();
|
||||
return [.. filtered.Take(limit.Value)];
|
||||
}
|
||||
|
||||
return filtered;
|
||||
|
|
|
|||
|
|
@ -10,10 +10,11 @@ public enum ResourceNodeInstanceMutationKind
|
|||
Applied,
|
||||
}
|
||||
|
||||
/// <summary>Result of <see cref="ResourceNodeInstanceOperations.TryCommitSuccessfulGatherDecrement"/> (NEO-61).</summary>
|
||||
/// <param name="Kind">Applied or denied.</param>
|
||||
/// <param name="ReasonCode">Populated when <see cref="Kind"/> is <see cref="ResourceNodeInstanceMutationKind.Denied"/>.</param>
|
||||
/// <param name="Snapshot">Authoritative snapshot after apply, or current snapshot on depletion deny; null for unknown node.</param>
|
||||
/// <summary>
|
||||
/// Result of <see cref="ResourceNodeInstanceOperations.TryCommitSuccessfulGatherDecrement"/> (NEO-61).
|
||||
/// <see cref="ReasonCode"/> is populated when <see cref="Kind"/> is <see cref="ResourceNodeInstanceMutationKind.Denied"/>.
|
||||
/// <see cref="Snapshot"/> is the authoritative snapshot after apply, or the current snapshot on depletion deny; null for unknown node.
|
||||
/// </summary>
|
||||
public readonly record struct ResourceNodeInstanceMutationOutcome(
|
||||
ResourceNodeInstanceMutationKind Kind,
|
||||
string? ReasonCode,
|
||||
|
|
|
|||
|
|
@ -13,10 +13,11 @@ public enum PlayerInventoryMutationKind
|
|||
Applied,
|
||||
}
|
||||
|
||||
/// <summary>Result of <see cref="PlayerInventoryOperations.TryAddStack"/> or <see cref="PlayerInventoryOperations.TryRemoveStack"/> (NEO-54).</summary>
|
||||
/// <param name="Kind">Applied, denied, or store missing.</param>
|
||||
/// <param name="ReasonCode">Populated when <see cref="Kind"/> is <see cref="PlayerInventoryMutationKind.Denied"/>.</param>
|
||||
/// <param name="Snapshot">Authoritative snapshot after apply, or unchanged snapshot on deny; null when store missing.</param>
|
||||
/// <summary>
|
||||
/// Result of <see cref="PlayerInventoryOperations.TryAddStack"/> or <see cref="PlayerInventoryOperations.TryRemoveStack"/> (NEO-54).
|
||||
/// <see cref="ReasonCode"/> is populated when <see cref="Kind"/> is <see cref="PlayerInventoryMutationKind.Denied"/>.
|
||||
/// <see cref="Snapshot"/> is the authoritative snapshot after apply, or unchanged snapshot on deny; null when store missing.
|
||||
/// </summary>
|
||||
public readonly record struct PlayerInventoryMutationOutcome(
|
||||
PlayerInventoryMutationKind Kind,
|
||||
string? ReasonCode,
|
||||
|
|
|
|||
Loading…
Reference in New Issue