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
|
## Documentation
|
||||||
|
|
||||||
- Use **`///` XML doc comments** on public APIs (types and members) when behavior or contracts are not obvious.
|
- 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)
|
## Null checks (IDE0270)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -803,7 +803,7 @@ public sealed class RewardRouterOperationsTests
|
||||||
var filtered = rows.Where(r => r.PlayerId == normalized).ToList();
|
var filtered = rows.Where(r => r.PlayerId == normalized).ToList();
|
||||||
if (limit is > 0)
|
if (limit is > 0)
|
||||||
{
|
{
|
||||||
return filtered.Take(limit.Value).ToList();
|
return [.. filtered.Take(limit.Value)];
|
||||||
}
|
}
|
||||||
|
|
||||||
return filtered;
|
return filtered;
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,11 @@ public enum ResourceNodeInstanceMutationKind
|
||||||
Applied,
|
Applied,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Result of <see cref="ResourceNodeInstanceOperations.TryCommitSuccessfulGatherDecrement"/> (NEO-61).</summary>
|
/// <summary>
|
||||||
/// <param name="Kind">Applied or denied.</param>
|
/// Result of <see cref="ResourceNodeInstanceOperations.TryCommitSuccessfulGatherDecrement"/> (NEO-61).
|
||||||
/// <param name="ReasonCode">Populated when <see cref="Kind"/> is <see cref="ResourceNodeInstanceMutationKind.Denied"/>.</param>
|
/// <see cref="ReasonCode"/> is populated when <see cref="Kind"/> is <see cref="ResourceNodeInstanceMutationKind.Denied"/>.
|
||||||
/// <param name="Snapshot">Authoritative snapshot after apply, or current snapshot on depletion deny; null for unknown node.</param>
|
/// <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(
|
public readonly record struct ResourceNodeInstanceMutationOutcome(
|
||||||
ResourceNodeInstanceMutationKind Kind,
|
ResourceNodeInstanceMutationKind Kind,
|
||||||
string? ReasonCode,
|
string? ReasonCode,
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,11 @@ public enum PlayerInventoryMutationKind
|
||||||
Applied,
|
Applied,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Result of <see cref="PlayerInventoryOperations.TryAddStack"/> or <see cref="PlayerInventoryOperations.TryRemoveStack"/> (NEO-54).</summary>
|
/// <summary>
|
||||||
/// <param name="Kind">Applied, denied, or store missing.</param>
|
/// Result of <see cref="PlayerInventoryOperations.TryAddStack"/> or <see cref="PlayerInventoryOperations.TryRemoveStack"/> (NEO-54).
|
||||||
/// <param name="ReasonCode">Populated when <see cref="Kind"/> is <see cref="PlayerInventoryMutationKind.Denied"/>.</param>
|
/// <see cref="ReasonCode"/> is populated when <see cref="Kind"/> is <see cref="PlayerInventoryMutationKind.Denied"/>.
|
||||||
/// <param name="Snapshot">Authoritative snapshot after apply, or unchanged snapshot on deny; null when store missing.</param>
|
/// <see cref="Snapshot"/> is the authoritative snapshot after apply, or unchanged snapshot on deny; null when store missing.
|
||||||
|
/// </summary>
|
||||||
public readonly record struct PlayerInventoryMutationOutcome(
|
public readonly record struct PlayerInventoryMutationOutcome(
|
||||||
PlayerInventoryMutationKind Kind,
|
PlayerInventoryMutationKind Kind,
|
||||||
string? ReasonCode,
|
string? ReasonCode,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue