Skip to content

Commit 5d2f338

Browse files
nficanoclaude
andcommitted
style: align with MS C# coding conventions
- Set max_line_length = 120 in .editorconfig for *.cs - Filter OperationCanceledException out of sweep-loop best-effort catch in ArtifactStore so shutdown cancellation propagates - Use collection expressions ([] / [x]) in ARCPRuntime and SubscriptionManager Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 050dda9 commit 5d2f338

4 files changed

Lines changed: 4 additions & 3 deletions

File tree

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ trim_trailing_whitespace = false
1919

2020
[*.cs]
2121
indent_size = 4
22+
max_line_length = 120
2223

2324
# Naming
2425
dotnet_naming_rule.types_should_be_pascal_case.severity = warning

src/ARCP/Runtime/ARCPRuntime.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public ARCPRuntime(ARCPRuntimeOptions options, ILogger<ARCPRuntime>? logger = nu
4444
_messageRegistry = options.MessageRegistry ?? MessageTypeRegistry.CoreCatalog();
4545
_jsonOptions = EnvelopeJson.CreateOptions(_messageRegistry, options.ExtensionRegistry);
4646
_verifiers = new ConcurrentDictionary<AuthScheme, IAuthVerifier>();
47-
foreach (IAuthVerifier verifier in options.AuthVerifiers ?? Array.Empty<IAuthVerifier>())
47+
foreach (IAuthVerifier verifier in options.AuthVerifiers ?? [])
4848
{
4949
_verifiers[verifier.Scheme] = verifier;
5050
}

src/ARCP/Runtime/ArtifactStore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ private async Task SweepLoopAsync()
269269
{
270270
await SweepExpiredAsync(_shutdown.Token).ConfigureAwait(false);
271271
}
272-
catch (Exception)
272+
catch (Exception ex) when (ex is not OperationCanceledException)
273273
{
274274
// best effort
275275
}

src/ARCP/Runtime/SubscriptionManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public SubscriptionManager(EventLog log, TimeProvider? time = null)
8080
}
8181
else
8282
{
83-
filter = filter with { SessionId = new[] { subscriberSessionId.Value } };
83+
filter = filter with { SessionId = [subscriberSessionId.Value] };
8484
}
8585

8686
SubscriptionId id = SubscriptionId.New();

0 commit comments

Comments
 (0)