Skip to content

Commit b38fe55

Browse files
committed
Clean up suppressions
1 parent 381a42f commit b38fe55

File tree

8 files changed

+20
-388
lines changed

8 files changed

+20
-388
lines changed

Source/Common/HashCode.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,7 @@ public override bool Equals(object? obj)
114114
[EditorBrowsable(EditorBrowsableState.Never)]
115115
public override int GetHashCode() =>
116116
#pragma warning disable CA1065 // Do not raise exceptions in unexpected locations
117-
#pragma warning disable CA1303 // Do not pass literals as localized parameters
118117
throw new NotSupportedException("Implicitly convert this struct to an int to get the hash code.");
119-
#pragma warning restore CA1303 // Do not pass literals as localized parameters
120118
#pragma warning restore CA1065 // Do not raise exceptions in unexpected locations
121119

122120
private static int CombineHashCodes(int h1, int h2)

Source/Common/OneOrMany{T}.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ namespace Schema.NET
1010
/// </summary>
1111
/// <typeparam name="T">The type of the values.</typeparam>
1212
/// <seealso cref="ICollection{T}" />
13-
#pragma warning disable CA1710 // Identifiers should have correct suffix
1413
public readonly struct OneOrMany<T>
1514
: IReadOnlyCollection<T>, IEnumerable<T>, IValues, IEquatable<OneOrMany<T>>
16-
#pragma warning restore CA1710 // Identifiers should have correct suffix
1715
{
1816
private readonly T[]? collection;
1917

Source/Common/Thing.Partial.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ namespace Schema.NET
55
/// <summary>
66
/// The most generic type of item.
77
/// </summary>
8-
#pragma warning disable CA1040 // Avoid empty interfaces
98
public partial interface IThing
10-
#pragma warning restore CA1040 // Avoid empty interfaces
119
{
1210
}
1311

Source/Common/Values{T1,T2,T3,T4,T5,T6,T7}.cs

Lines changed: 5 additions & 117 deletions
Large diffs are not rendered by default.

Source/Common/Values{T1,T2,T3,T4,T5,T6}.cs

Lines changed: 6 additions & 101 deletions
Large diffs are not rendered by default.

Source/Common/Values{T1,T2,T3,T4}.cs

Lines changed: 3 additions & 70 deletions
Large diffs are not rendered by default.

Source/Common/Values{T1,T2,T3}.cs

Lines changed: 3 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ namespace Schema.NET
1111
/// <typeparam name="T1">The first type the values can take.</typeparam>
1212
/// <typeparam name="T2">The second type the values can take.</typeparam>
1313
/// <typeparam name="T3">The third type the values can take.</typeparam>
14-
#pragma warning disable CA1710 // Identifiers should have correct suffix
1514
public readonly struct Values<T1, T2, T3>
1615
: IReadOnlyCollection<object?>, IEnumerable<object?>, IValues, IEquatable<Values<T1, T2, T3>>
17-
#pragma warning restore CA1710 // Identifiers should have correct suffix
1816
{
1917
/// <summary>
2018
/// Initializes a new instance of the <see cref="Values{T1,T2,T3}"/> struct.
@@ -162,112 +160,84 @@ public Values(IEnumerable<object> items)
162160
/// </summary>
163161
public OneOrMany<T3> Value3 { get; }
164162

163+
#pragma warning disable CA1002 // Do not expose generic lists
164+
#pragma warning disable CA2225 // Operator overloads have named alternates
165165
/// <summary>
166166
/// Performs an implicit conversion from <typeparamref name="T1"/> to <see cref="Values{T1,T2}"/>.
167167
/// </summary>
168168
/// <param name="item">The single item value.</param>
169169
/// <returns>The result of the conversion.</returns>
170-
#pragma warning disable CA2225 // Operator overloads have named alternates
171170
public static implicit operator Values<T1, T2, T3>(T1 item) => new(item);
172-
#pragma warning restore CA2225 // Operator overloads have named alternates
173171

174172
/// <summary>
175173
/// Performs an implicit conversion from <typeparamref name="T2"/> to <see cref="Values{T1,T2}"/>.
176174
/// </summary>
177175
/// <param name="item">The single item value.</param>
178176
/// <returns>The result of the conversion.</returns>
179-
#pragma warning disable CA2225 // Operator overloads have named alternates
180177
public static implicit operator Values<T1, T2, T3>(T2 item) => new(item);
181-
#pragma warning restore CA2225 // Operator overloads have named alternates
182178

183179
/// <summary>
184180
/// Performs an implicit conversion from <typeparamref name="T3"/> to <see cref="Values{T1,T2}"/>.
185181
/// </summary>
186182
/// <param name="item">The single item value.</param>
187183
/// <returns>The result of the conversion.</returns>
188-
#pragma warning disable CA2225 // Operator overloads have named alternates
189184
public static implicit operator Values<T1, T2, T3>(T3 item) => new(item);
190-
#pragma warning restore CA2225 // Operator overloads have named alternates
191185

192186
/// <summary>
193187
/// Performs an implicit conversion from <typeparamref name="T1[]"/> to <see cref="Values{T1,T2,T3}"/>.
194188
/// </summary>
195189
/// <param name="array">The array of values.</param>
196190
/// <returns>The result of the conversion.</returns>
197-
#pragma warning disable CA2225 // Operator overloads have named alternates
198191
public static implicit operator Values<T1, T2, T3>(T1[] array) => new(array);
199-
#pragma warning restore CA2225 // Operator overloads have named alternates
200192

201193
/// <summary>
202194
/// Performs an implicit conversion from <typeparamref name="T2[]"/> to <see cref="Values{T1,T2,T3}"/>.
203195
/// </summary>
204196
/// <param name="array">The array of values.</param>
205197
/// <returns>The result of the conversion.</returns>
206-
#pragma warning disable CA2225 // Operator overloads have named alternates
207198
public static implicit operator Values<T1, T2, T3>(T2[] array) => new(array);
208-
#pragma warning restore CA2225 // Operator overloads have named alternates
209199

210200
/// <summary>
211201
/// Performs an implicit conversion from <typeparamref name="T3[]"/> to <see cref="Values{T1,T2,T3}"/>.
212202
/// </summary>
213203
/// <param name="array">The array of values.</param>
214204
/// <returns>The result of the conversion.</returns>
215-
#pragma warning disable CA2225 // Operator overloads have named alternates
216205
public static implicit operator Values<T1, T2, T3>(T3[] array) => new(array);
217-
#pragma warning restore CA2225 // Operator overloads have named alternates
218206

219207
/// <summary>
220208
/// Performs an implicit conversion from <see cref="List{T1}"/> to <see cref="Values{T1,T2}"/>.
221209
/// </summary>
222210
/// <param name="list">The list of values.</param>
223211
/// <returns>The result of the conversion.</returns>
224-
#pragma warning disable CA2225 // Operator overloads have named alternates
225-
#pragma warning disable CA1002 // Do not expose generic lists
226212
public static implicit operator Values<T1, T2, T3>(List<T1> list) => new(list);
227-
#pragma warning restore CA1002 // Do not expose generic lists
228-
#pragma warning restore CA2225 // Operator overloads have named alternates
229213

230214
/// <summary>
231215
/// Performs an implicit conversion from <see cref="List{T2}"/> to <see cref="Values{T1,T2}"/>.
232216
/// </summary>
233217
/// <param name="list">The list of values.</param>
234218
/// <returns>The result of the conversion.</returns>
235-
#pragma warning disable CA2225 // Operator overloads have named alternates
236-
#pragma warning disable CA1002 // Do not expose generic lists
237219
public static implicit operator Values<T1, T2, T3>(List<T2> list) => new(list);
238-
#pragma warning restore CA1002 // Do not expose generic lists
239-
#pragma warning restore CA2225 // Operator overloads have named alternates
240220

241221
/// <summary>
242222
/// Performs an implicit conversion from <see cref="List{T3}"/> to <see cref="Values{T1,T2}"/>.
243223
/// </summary>
244224
/// <param name="list">The list of values.</param>
245225
/// <returns>The result of the conversion.</returns>
246-
#pragma warning disable CA2225 // Operator overloads have named alternates
247-
#pragma warning disable CA1002 // Do not expose generic lists
248226
public static implicit operator Values<T1, T2, T3>(List<T3> list) => new(list);
249-
#pragma warning restore CA1002 // Do not expose generic lists
250-
#pragma warning restore CA2225 // Operator overloads have named alternates
251227

252228
/// <summary>
253229
/// Performs an implicit conversion from <see cref="object"/> array to <see cref="Values{T1,T2,T3}"/>.
254230
/// </summary>
255231
/// <param name="array">The array of values.</param>
256232
/// <returns>The result of the conversion.</returns>
257-
#pragma warning disable CA2225 // Operator overloads have named alternates
258233
public static implicit operator Values<T1, T2, T3>(object[] array) => new(array);
259-
#pragma warning restore CA2225 // Operator overloads have named alternates
260234

261235
/// <summary>
262236
/// Performs an implicit conversion from <see cref="List{Object}"/> to <see cref="Values{T1,T2,T3}"/>.
263237
/// </summary>
264238
/// <param name="list">The list of values.</param>
265239
/// <returns>The result of the conversion.</returns>
266-
#pragma warning disable CA2225 // Operator overloads have named alternates
267-
#pragma warning disable CA1002 // Do not expose generic lists
268240
public static implicit operator Values<T1, T2, T3>(List<object> list) => new(list);
269-
#pragma warning restore CA1002 // Do not expose generic lists
270-
#pragma warning restore CA2225 // Operator overloads have named alternates
271241

272242
/// <summary>
273243
/// Performs an implicit conversion from <see cref="Values{T1, T2, T3}"/> to the first item of type <typeparamref name="T1"/>.
@@ -276,9 +246,7 @@ public Values(IEnumerable<object> items)
276246
/// <returns>
277247
/// The result of the conversion.
278248
/// </returns>
279-
#pragma warning disable CA2225 // Operator overloads have named alternates
280249
public static implicit operator T1?(Values<T1, T2, T3> values) => values.Value1.FirstOrDefault();
281-
#pragma warning restore CA2225 // Operator overloads have named alternates
282250

283251
/// <summary>
284252
/// Performs an implicit conversion from <see cref="Values{T1, T2, T3}"/> to the first item of type <typeparamref name="T2"/>.
@@ -287,9 +255,7 @@ public Values(IEnumerable<object> items)
287255
/// <returns>
288256
/// The result of the conversion.
289257
/// </returns>
290-
#pragma warning disable CA2225 // Operator overloads have named alternates
291258
public static implicit operator T2?(Values<T1, T2, T3> values) => values.Value2.FirstOrDefault();
292-
#pragma warning restore CA2225 // Operator overloads have named alternates
293259

294260
/// <summary>
295261
/// Performs an implicit conversion from <see cref="Values{T1, T2, T3}"/> to the first item of type <typeparamref name="T3"/>.
@@ -298,9 +264,7 @@ public Values(IEnumerable<object> items)
298264
/// <returns>
299265
/// The result of the conversion.
300266
/// </returns>
301-
#pragma warning disable CA2225 // Operator overloads have named alternates
302267
public static implicit operator T3?(Values<T1, T2, T3> values) => values.Value3.FirstOrDefault();
303-
#pragma warning restore CA2225 // Operator overloads have named alternates
304268

305269
/// <summary>
306270
/// Performs an implicit conversion from <see cref="Values{T1, T2, T3}"/> to an array of <typeparamref name="T1"/>.
@@ -309,9 +273,7 @@ public Values(IEnumerable<object> items)
309273
/// <returns>
310274
/// The result of the conversion.
311275
/// </returns>
312-
#pragma warning disable CA2225 // Operator overloads have named alternates
313276
public static implicit operator T1[](Values<T1, T2, T3> values) => values.Value1.ToArray();
314-
#pragma warning restore CA2225 // Operator overloads have named alternates
315277

316278
/// <summary>
317279
/// Performs an implicit conversion from <see cref="Values{T1, T2, T3}"/> to <see cref="List{T1}"/>.
@@ -320,11 +282,7 @@ public Values(IEnumerable<object> items)
320282
/// <returns>
321283
/// The result of the conversion.
322284
/// </returns>
323-
#pragma warning disable CA2225 // Operator overloads have named alternates
324-
#pragma warning disable CA1002 // Do not expose generic lists
325285
public static implicit operator List<T1>(Values<T1, T2, T3> values) => values.Value1.ToList();
326-
#pragma warning restore CA1002 // Do not expose generic lists
327-
#pragma warning restore CA2225 // Operator overloads have named alternates
328286

329287
/// <summary>
330288
/// Performs an implicit conversion from <see cref="Values{T1, T2, T3}"/> to an array of <typeparamref name="T2"/>.
@@ -333,9 +291,7 @@ public Values(IEnumerable<object> items)
333291
/// <returns>
334292
/// The result of the conversion.
335293
/// </returns>
336-
#pragma warning disable CA2225 // Operator overloads have named alternates
337294
public static implicit operator T2[](Values<T1, T2, T3> values) => values.Value2.ToArray();
338-
#pragma warning restore CA2225 // Operator overloads have named alternates
339295

340296
/// <summary>
341297
/// Performs an implicit conversion from <see cref="Values{T1, T2, T3}"/> to <see cref="List{T2}"/>.
@@ -344,11 +300,7 @@ public Values(IEnumerable<object> items)
344300
/// <returns>
345301
/// The result of the conversion.
346302
/// </returns>
347-
#pragma warning disable CA2225 // Operator overloads have named alternates
348-
#pragma warning disable CA1002 // Do not expose generic lists
349303
public static implicit operator List<T2>(Values<T1, T2, T3> values) => values.Value2.ToList();
350-
#pragma warning restore CA1002 // Do not expose generic lists
351-
#pragma warning restore CA2225 // Operator overloads have named alternates
352304

353305
/// <summary>
354306
/// Performs an implicit conversion from <see cref="Values{T1, T2, T3}"/> to an array of <typeparamref name="T3"/>.
@@ -357,9 +309,7 @@ public Values(IEnumerable<object> items)
357309
/// <returns>
358310
/// The result of the conversion.
359311
/// </returns>
360-
#pragma warning disable CA2225 // Operator overloads have named alternates
361312
public static implicit operator T3[](Values<T1, T2, T3> values) => values.Value3.ToArray();
362-
#pragma warning restore CA2225 // Operator overloads have named alternates
363313

364314
/// <summary>
365315
/// Performs an implicit conversion from <see cref="Values{T1, T2, T3}"/> to <see cref="List{T3}"/>.
@@ -368,11 +318,9 @@ public Values(IEnumerable<object> items)
368318
/// <returns>
369319
/// The result of the conversion.
370320
/// </returns>
371-
#pragma warning disable CA2225 // Operator overloads have named alternates
372-
#pragma warning disable CA1002 // Do not expose generic lists
373321
public static implicit operator List<T3>(Values<T1, T2, T3> values) => values.Value3.ToList();
374-
#pragma warning restore CA1002 // Do not expose generic lists
375322
#pragma warning restore CA2225 // Operator overloads have named alternates
323+
#pragma warning restore CA1002 // Do not expose generic lists
376324

377325
/// <summary>
378326
/// Implements the operator ==.

0 commit comments

Comments
 (0)