Skip to content

Commit a77b171

Browse files
committed
more
1 parent 05c4a08 commit a77b171

File tree

8 files changed

+37
-13
lines changed

8 files changed

+37
-13
lines changed

.editorconfig

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
# IDE0090: Use 'new(...)'
44
csharp_style_implicit_object_creation_when_type_is_apparent = false:silent
5-
csharp_using_directive_placement = outside_namespace:suggestion
5+
csharp_using_directive_placement = outside_namespace:warning
66
csharp_prefer_simple_using_statement = true:suggestion
77
csharp_prefer_braces = true:suggestion
8-
csharp_style_namespace_declarations = block_scoped:suggestion
8+
csharp_style_namespace_declarations = block_scoped:error
99
csharp_style_prefer_method_group_conversion = true:silent
10-
csharp_style_prefer_top_level_statements = true:silent
10+
csharp_style_prefer_top_level_statements = true:suggestion
1111
csharp_style_expression_bodied_methods = false:silent
1212
csharp_style_expression_bodied_constructors = false:silent
1313
csharp_style_expression_bodied_operators = false:silent
@@ -51,6 +51,14 @@ csharp_style_var_elsewhere = false:suggestion
5151
dotnet_diagnostic.CA1001.severity = warning
5252
dotnet_diagnostic.CA1309.severity = warning
5353
dotnet_diagnostic.CA1510.severity = none
54+
csharp_style_prefer_primary_constructors = false:error
55+
dotnet_diagnostic.CA1311.severity = warning
56+
dotnet_diagnostic.SYSLIB1054.severity = warning
57+
dotnet_diagnostic.CA1805.severity = suggestion
58+
dotnet_diagnostic.CA1825.severity = suggestion
59+
dotnet_diagnostic.CA1824.severity = warning
60+
dotnet_diagnostic.CA1870.severity = warning
61+
csharp_style_prefer_readonly_struct_member = true:suggestion
5462

5563
[*.{cs,vb}]
5664
#### Naming styles ####
@@ -106,14 +114,14 @@ dotnet_style_prefer_auto_properties = true:silent
106114
dotnet_style_object_initializer = true:suggestion
107115
dotnet_style_collection_initializer = true:suggestion
108116
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
109-
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
110-
dotnet_style_prefer_conditional_expression_over_return = true:silent
117+
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
118+
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
111119
dotnet_style_operator_placement_when_wrapping = beginning_of_line
112120
tab_width = 4
113121
indent_size = 4
114122
end_of_line = crlf
115123
dotnet_style_allow_multiple_blank_lines_experimental = false:suggestion
116-
dotnet_style_prefer_collection_expression = false
124+
dotnet_style_prefer_collection_expression = never:silent
117125
csharp_style_prefer_primary_constructors = false
118126
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
119127
dotnet_style_explicit_tuple_names = true:suggestion
@@ -140,6 +148,14 @@ dotnet_diagnostic.CA1000.severity = silent
140148
dotnet_diagnostic.CA1304.severity = warning
141149
dotnet_diagnostic.CA1305.severity = warning
142150
dotnet_diagnostic.CA1310.severity = warning
151+
dotnet_diagnostic.CA2101.severity = warning
152+
dotnet_diagnostic.CA1401.severity = warning
153+
dotnet_diagnostic.CA1511.severity = none
154+
dotnet_diagnostic.CA1512.severity = none
155+
dotnet_diagnostic.CA1806.severity = suggestion
156+
dotnet_diagnostic.CA1821.severity = warning
157+
dotnet_diagnostic.CA1826.severity = warning
158+
dotnet_diagnostic.CA1829.severity = warning
143159

144160
[*.vb]
145161
dotnet_diagnostic.CA1047.severity = suggestion

src/Extensions/ReadOnlySpan/Linq/FirstOrDefault.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public static T FirstOrDefault<T>(this ReadOnlySpan<T> source, Predicate<T> pred
9393
return item;
9494
}
9595
}
96-
return default(T);
96+
return default(T);
9797
}
9898
#elif NETSTANDARD2_1
9999
#pragma warning disable CS8603 // Possible null reference return.

src/Extensions/ReadOnlySpan/Linq/LastOrDefault.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,19 @@ public static T LastOrDefault<T>(this ReadOnlySpan<T> source, T defaultValue)
1818
return defaultValue;
1919
}
2020
return source[^1];
21+
22+
/* Unmerged change from project 'SpanExtensions (netstandard2.1)'
23+
Before:
24+
}
25+
26+
/// <summary>
27+
After:
28+
}
29+
30+
/// <summary>
31+
*/
2132
}
22-
33+
2334
/// <summary>
2435
/// Returns the last element in a <see cref="ReadOnlySpan{T}"/> that satisfies a specified condition or a specified default value if no such element is found.
2536
/// </summary>
@@ -93,7 +104,7 @@ public static T LastOrDefault<T>(this ReadOnlySpan<T> source, Predicate<T> predi
93104
return item;
94105
}
95106
}
96-
return default(T);
107+
return default(T);
97108
}
98109
#elif NETSTANDARD2_1
99110
#pragma warning disable CS8603 // Possible null reference return.

src/Extensions/ReadOnlySpan/Linq/MaxBy.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Numerics;
43

54
namespace SpanExtensions
65
{

src/Extensions/ReadOnlySpan/Linq/MinBy.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Numerics;
43

54
namespace SpanExtensions
65
{

src/Extensions/ReadOnlySpan/Linq/SingleOrDefault.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public static partial class ReadOnlySpanExtensions
99
/// </summary>
1010
/// <typeparam name="T">The type of elements in <paramref name="source"/>.</typeparam>
1111
/// <param name="source">The <see cref="ReadOnlySpan{T}"/> to return the single element of.</param>
12+
/// /// <param name="defaultValue">The default value to return if <paramref name="source"/> is empty.</param>
1213
/// <returns>The single element in <paramref name="source"/>.</returns>
1314
/// <exception cref="InvalidOperationException"><paramref name="source"/> contains more than one element -or- <paramref name="source"/> is empty.</exception>
1415
public static T SingleOrDefault<T>(this ReadOnlySpan<T> source, T defaultValue)

src/Extensions/Span/Linq/MaxBy.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Numerics;
43

54
namespace SpanExtensions
65
{

src/Extensions/Span/Linq/MinBy.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Numerics;
43

54
namespace SpanExtensions
65
{

0 commit comments

Comments
 (0)