Skip to content

Commit 9db9f01

Browse files
authored
Updated code to remove trailing commas (#8334)
1 parent cd85af5 commit 9db9f01

File tree

832 files changed

+4280
-4277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

832 files changed

+4280
-4277
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ dotnet_diagnostic.CA1512.severity = warning
168168
dotnet_diagnostic.CA1513.severity = warning
169169
# Use range operator.
170170
dotnet_diagnostic.IDE0057.severity = warning
171+
# Add/remove trailing comma.
172+
dotnet_diagnostic.RCS1260.severity = warning
173+
roslynator_trailing_comma_style = omit
171174

172175
# netstandard2.0
173176
[src/HotChocolate/{Core/src/Types.Analyzers,Language}/**/*.cs]

src/CookieCrumble/src/CookieCrumble.HotChocolate/Formatters/ExecutionResultSnapshotValueFormatter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public void WriteResponse(IBufferWriter<byte> snapshot)
122122
"You must first set the initial response before you can apply patches.");
123123
}
124124

125-
using var writer = new Utf8JsonWriter(snapshot, new JsonWriterOptions { Indented = true, });
125+
using var writer = new Utf8JsonWriter(snapshot, new JsonWriterOptions { Indented = true });
126126

127127
_json.Remove("hasNext");
128128

@@ -246,7 +246,7 @@ private static (JsonNode Node, JsonElement PathSegment) SelectNodeToPatch(
246246
{
247247
JsonValueKind.String => current[last.Value.GetString()!]!,
248248
JsonValueKind.Number => current[last.Value.GetInt32()]!,
249-
_ => throw new NotSupportedException("Path segment must be int or string."),
249+
_ => throw new NotSupportedException("Path segment must be int or string.")
250250
};
251251
}
252252

src/CookieCrumble/src/CookieCrumble/Formatters/JsonElementSnapshotValueFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal sealed class JsonElementSnapshotValueFormatter() : SnapshotValueFormatt
1010
new(JsonSerializerDefaults.Web)
1111
{
1212
WriteIndented = true,
13-
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
13+
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
1414
};
1515

1616
protected override void Format(IBufferWriter<byte> snapshot, JsonElement value)

src/CookieCrumble/src/CookieCrumble/Formatters/JsonSnapshotValueFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ internal sealed class JsonSnapshotValueFormatter : ISnapshotValueFormatter, IMar
1717
DateFormatHandling = DateFormatHandling.IsoDateFormat,
1818
Culture = CultureInfo.InvariantCulture,
1919
ContractResolver = ChildFirstContractResolver.Instance,
20-
Converters = new List<JsonConverter> { new StringEnumConverter(), },
20+
Converters = new List<JsonConverter> { new StringEnumConverter() }
2121
};
2222

2323
public bool CanHandle(object? value)

src/CookieCrumble/test/CookieCrumble.Tests/SnapshotTests.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public void SnapshotBuilder()
6060
{
6161
var snapshot = new Snapshot();
6262
snapshot.Add(new MyClass());
63-
snapshot.Add(new MyClass { Foo = "Bar", });
64-
snapshot.Add(new MyClass { Foo = "Baz", });
63+
snapshot.Add(new MyClass { Foo = "Bar" });
64+
snapshot.Add(new MyClass { Foo = "Baz" });
6565
snapshot.Match();
6666
}
6767

@@ -70,8 +70,8 @@ public async Task SnapshotBuilderAsync()
7070
{
7171
var snapshot = new Snapshot();
7272
snapshot.Add(new MyClass());
73-
snapshot.Add(new MyClass { Foo = "Bar", });
74-
snapshot.Add(new MyClass { Foo = "Baz", });
73+
snapshot.Add(new MyClass { Foo = "Bar" });
74+
snapshot.Add(new MyClass { Foo = "Baz" });
7575
await snapshot.MatchAsync();
7676
}
7777

@@ -80,8 +80,8 @@ public void SnapshotBuilder_Segment_Name()
8080
{
8181
var snapshot = new Snapshot();
8282
snapshot.Add(new MyClass());
83-
snapshot.Add(new MyClass { Foo = "Bar", }, "Bar:");
84-
snapshot.Add(new MyClass { Foo = "Baz", });
83+
snapshot.Add(new MyClass { Foo = "Bar" }, "Bar:");
84+
snapshot.Add(new MyClass { Foo = "Baz" });
8585
snapshot.Match();
8686
}
8787

@@ -90,8 +90,8 @@ public void SnapshotBuilder_Segment_Name_All()
9090
{
9191
var snapshot = new Snapshot();
9292
snapshot.Add(new MyClass(), "Segment 1:");
93-
snapshot.Add(new MyClass { Foo = "Bar", }, "Segment 2:");
94-
snapshot.Add(new MyClass { Foo = "Baz", }, "Segment 3:");
93+
snapshot.Add(new MyClass { Foo = "Bar" }, "Segment 2:");
94+
snapshot.Add(new MyClass { Foo = "Baz" }, "Segment 3:");
9595
snapshot.Match();
9696
}
9797

@@ -100,9 +100,9 @@ public void SnapshotBuilder_Segment_Custom_Serializer_For_Segment()
100100
{
101101
var snapshot = new Snapshot();
102102
snapshot.Add(new MyClass());
103-
snapshot.Add(new MyClass { Foo = "Baz", }, "Bar:", new CustomSerializer());
104-
snapshot.Add(new MyClass { Foo = "Baz", });
105-
snapshot.Add(new MyClass { Foo = "Baz", });
103+
snapshot.Add(new MyClass { Foo = "Baz" }, "Bar:", new CustomSerializer());
104+
snapshot.Add(new MyClass { Foo = "Baz" });
105+
snapshot.Add(new MyClass { Foo = "Baz" });
106106
snapshot.Match();
107107
}
108108

@@ -112,7 +112,7 @@ public void SnapshotBuilder_Segment_Custom_Global_Serializer()
112112
Snapshot.RegisterFormatter(new CustomSerializer());
113113

114114
var snapshot = new Snapshot();
115-
snapshot.Add(new MyClass { Foo = "123", });
115+
snapshot.Add(new MyClass { Foo = "123" });
116116
snapshot.Match();
117117
}
118118

@@ -124,7 +124,7 @@ public async Task Match_StrictMode_On(string strictMode)
124124
Environment.SetEnvironmentVariable("COOKIE_CRUMBLE_STRICT_MODE", strictMode);
125125

126126
var snapshot = new Snapshot();
127-
snapshot.Add(new MyClass { Foo = "123", });
127+
snapshot.Add(new MyClass { Foo = "123" });
128128

129129
async Task Act1() => await snapshot.MatchAsync();
130130
void Act2() => snapshot.Match();
@@ -160,7 +160,7 @@ public async Task Match_StrictMode_Off(int number, string? strictMode)
160160
Environment.SetEnvironmentVariable("COOKIE_CRUMBLE_STRICT_MODE", strictMode);
161161

162162
var snapshot = new Snapshot();
163-
snapshot.Add(new MyClass { Foo = "123", });
163+
snapshot.Add(new MyClass { Foo = "123" });
164164

165165
async Task Act1() => await snapshot.SetPostFix($"MA_{number}").MatchAsync();
166166
void Act2() => snapshot.SetPostFix($"M_{number}").Match();
@@ -201,7 +201,7 @@ public class MyClass
201201
public class CustomSerializer : ISnapshotValueFormatter
202202
{
203203
public bool CanHandle(object? value)
204-
=> value is MyClass { Foo: "123", };
204+
=> value is MyClass { Foo: "123" };
205205

206206
public void Format(IBufferWriter<byte> snapshot, object? value)
207207
{

src/GreenDonut/src/GreenDonut.Abstractions/Attributes/DataLoaderAccessModifier.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ public enum DataLoaderAccessModifier
2323
/// <summary>
2424
/// Generates an internal DataLoader class and an internal DataLoader interface.
2525
/// </summary>
26-
Internal = 3,
26+
Internal = 3
2727
}

src/GreenDonut/src/GreenDonut.Abstractions/Attributes/DataLoaderServiceScope.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ public enum DataLoaderServiceScope
1919
/// Defines that the DataLoader should resolve services
2020
/// from the passed in <see cref="IServiceProvider"/>.
2121
/// </summary>
22-
OriginalScope = 2,
22+
OriginalScope = 2
2323
}

src/GreenDonut/src/GreenDonut.Data/Cursors/CursorKeySerializerRegistration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static class CursorKeySerializerRegistration
2626
new BoolCursorKeySerializer(),
2727
new UShortCursorKeySerializer(),
2828
new UIntCursorKeySerializer(),
29-
new ULongCursorKeySerializer(),
29+
new ULongCursorKeySerializer()
3030
];
3131

3232
/// <summary>

src/GreenDonut/src/GreenDonut/DataLoaderOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ public DataLoaderOptions Copy()
3737
{
3838
MaxBatchSize = MaxBatchSize,
3939
Cache = Cache,
40-
DiagnosticEvents = DiagnosticEvents,
40+
DiagnosticEvents = DiagnosticEvents
4141
};
4242
}

src/GreenDonut/src/GreenDonut/DependencyInjection/DataLoaderServiceCollectionExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static IServiceCollection TryAddDataLoaderCore(
8282
{
8383
0 => new DataLoaderDiagnosticEventListener(),
8484
1 => listeners[0],
85-
_ => new AggregateDataLoaderDiagnosticEventListener(listeners),
85+
_ => new AggregateDataLoaderDiagnosticEventListener(listeners)
8686
};
8787
});
8888

@@ -95,7 +95,7 @@ public static IServiceCollection TryAddDataLoaderCore(
9595
{
9696
Cache = cacheOwner.Cache,
9797
DiagnosticEvents = sp.GetService<IDataLoaderDiagnosticEvents>(),
98-
MaxBatchSize = 1024,
98+
MaxBatchSize = 1024
9999
};
100100
});
101101

0 commit comments

Comments
 (0)