Skip to content

Commit a491ccf

Browse files
committed
Fix lint
1 parent 1cf8147 commit a491ccf

4 files changed

Lines changed: 29 additions & 14 deletions

File tree

crates/bindings-csharp/BSATN.Runtime/BSATN/Runtime.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ public AlgebraicType GetAlgebraicType(ITypeRegistrar registrar) =>
180180
(_) =>
181181
new AlgebraicType.Sum(
182182
#pragma warning disable CA2263 // netstandard2.1 lacks the generic Enum overloads.
183-
[.. Enum.GetNames(typeof(T)).Select(name => new AggregateElement(name, AlgebraicType.Unit))]
183+
[
184+
.. Enum.GetNames(typeof(T))
185+
.Select(name => new AggregateElement(name, AlgebraicType.Unit)),
186+
]
184187
#pragma warning restore CA2263
185188
)
186189
);

crates/bindings-csharp/Codegen/Module.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,8 @@ public IEnumerable<FieldDefaultValue> GenerateDefaultValues()
10591059
.Select(m => m.Attrs.FirstOrDefault(a => a.Mask == ColumnAttrs.Default))
10601060
);
10611061

1062-
var withDefaultValues = fieldsWithDefaultValues as ColumnDeclaration[] ?? [.. fieldsWithDefaultValues];
1062+
var withDefaultValues =
1063+
fieldsWithDefaultValues as ColumnDeclaration[] ?? [.. fieldsWithDefaultValues];
10631064
foreach (var fieldsWithDefaultValue in withDefaultValues)
10641065
{
10651066
if (

crates/bindings-csharp/Runtime/Http.cs

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
namespace SpacetimeDB;
22

33
using System;
4-
using System.Diagnostics.CodeAnalysis;
54
using System.Collections.Generic;
5+
using System.Diagnostics.CodeAnalysis;
66
using System.IO;
77
using System.Linq;
88
using System.Text;
@@ -272,7 +272,11 @@ public Result<HttpResponse, HttpError> Get(string uri, TimeSpan? timeout = null)
272272
/// }
273273
/// </code>
274274
/// </example>
275-
[SuppressMessage("Performance", "CA1822", Justification = "Public instance API exposed through ProcedureContext.Http.")]
275+
[SuppressMessage(
276+
"Performance",
277+
"CA1822",
278+
Justification = "Public instance API exposed through ProcedureContext.Http."
279+
)]
276280
public Result<HttpResponse, HttpError> Send(HttpRequest request)
277281
{
278282
// The host syscall expects BSATN-encoded spacetimedb_lib::http::Request bytes.
@@ -308,7 +312,10 @@ public Result<HttpResponse, HttpError> Send(HttpRequest request)
308312
var requestWire = new HttpRequestWire
309313
{
310314
Method = ToWireMethod(request.Method),
311-
Headers = new HttpHeadersWire { Entries = [.. request.Headers.Select(ToWireHeader)] },
315+
Headers = new HttpHeadersWire
316+
{
317+
Entries = [.. request.Headers.Select(ToWireHeader)],
318+
},
312319
Timeout = timeout is null
313320
? null
314321
: new HttpTimeoutWire { Timeout = (TimeDuration)timeout.Value },
@@ -422,7 +429,10 @@ internal static HttpRequest FromWire(HttpRequestWire requestWire, byte[] body) =
422429
{
423430
Uri = requestWire.Uri,
424431
Method = FromWireMethod(requestWire.Method),
425-
Headers = [.. requestWire.Headers.Entries.Select(h => new HttpHeader(h.Name, h.Value, false))],
432+
Headers =
433+
[
434+
.. requestWire.Headers.Entries.Select(h => new HttpHeader(h.Name, h.Value, false)),
435+
],
426436
Body = new HttpBody(body),
427437
Version = FromWireVersion(requestWire.Version),
428438
};
@@ -431,7 +441,10 @@ internal static (HttpResponseWire Response, byte[] Body) ToWire(HttpResponse res
431441
(
432442
new HttpResponseWire
433443
{
434-
Headers = new HttpHeadersWire { Entries = [.. response.Headers.Select(ToWireHeader)] },
444+
Headers = new HttpHeadersWire
445+
{
446+
Entries = [.. response.Headers.Select(ToWireHeader)],
447+
},
435448
Version = ToWireVersion(response.Version),
436449
Code = response.StatusCode,
437450
},
@@ -473,7 +486,9 @@ List<HttpHeader> headers
473486
{
474487
var version = FromWireVersion(responseWire.Version);
475488

476-
var headers = responseWire.Headers.Entries.Select(h => new HttpHeader(h.Name, h.Value, false)).ToList();
489+
var headers = responseWire
490+
.Headers.Entries.Select(h => new HttpHeader(h.Name, h.Value, false))
491+
.ToList();
477492

478493
return (responseWire.Code, version, headers);
479494
}

crates/bindings-csharp/Runtime/Internal/Module.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,7 @@ internal RawModuleDefV10 BuildModuleDefinition()
129129
Sequences: table.Sequences,
130130
TableType: table.TableType,
131131
TableAccess: table.TableAccess,
132-
DefaultValues: defaults is null
133-
? []
134-
: [.. defaults],
132+
DefaultValues: defaults is null ? [] : [.. defaults],
135133
IsEvent: table.IsEvent
136134
)
137135
);
@@ -211,9 +209,7 @@ internal RawModuleDefV10 BuildModuleDefinition()
211209
if (explicitNames.Count > 0)
212210
{
213211
sections.Add(
214-
new RawModuleDefV10Section.ExplicitNames(
215-
new ExplicitNames([.. explicitNames])
216-
)
212+
new RawModuleDefV10Section.ExplicitNames(new ExplicitNames([.. explicitNames]))
217213
);
218214
}
219215
if (rowLevelSecurityDefs.Count > 0)

0 commit comments

Comments
 (0)