Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ indent_style = space
trim_trailing_whitespace = true
charset = utf-8
end_of_line = lf
max_line_length = 120

# Verify settings
# https://github.com/VerifyTests/Verify?tab=readme-ov-file#text-file-settings
Expand All @@ -24,7 +25,7 @@ tab_width = unset
trim_trailing_whitespace = false

# Code files
[*.{cs,csx,vb,vbx}]
[*.{cs,csx,vb,vbx,razor,razor.cs}]
indent_size = 4
insert_final_newline = true
charset = utf-8-bom
Expand All @@ -34,6 +35,7 @@ charset = utf-8-bom
# See https://github.com/dotnet/aspnetcore/pull/23502 and https://github.com/dotnet/aspnetcore/issues/22753
[*.{razor,cshtml}]
charset = utf-8-bom
indent_size = 4

# Generated code
[*{_AssemblyInfo.cs,.notsupported.cs,.generated.cs}]
Expand Down Expand Up @@ -121,7 +123,7 @@ dotnet_style_null_propagation = true :

# Modifier preferences
# See https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#normalize-modifiers
dotnet_style_require_accessibility_modifiers = always : error
dotnet_style_require_accessibility_modifiers = for_non_interface_members : error
dotnet_style_readonly_field = true : warning

# Required Styles
Expand Down Expand Up @@ -277,3 +279,6 @@ dotnet_diagnostic.SA1504.severity = none
dotnet_diagnostic.SA1515.severity = none
dotnet_diagnostic.SA1516.severity = none

# Support for NetEvolve.Arguments Methods
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1062#null-check-validation-methods
dotnet_code_quality.CA1062.null_check_validation_methods = M:NetEvolve.Arguments.Argument.ThrowIfNull(System.Object,System.String)|M:NetEvolve.Arguments.Argument.ThrowIfNull(System.Void*,System.String)|M:NetEvolve.Arguments.Argument.ThrowIfNullOrEmpty(System.String,System.String)|M:NetEvolve.Arguments.Argument.ThrowIfNullOrEmpty``1(System.Collections.Generic.IEnumerable{``0},System.String)|M:NetEvolve.Arguments.Argument.ThrowIfNullOrWhiteSpace(System.String,System.String)
7 changes: 2 additions & 5 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
<GlobalPackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0" />
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<GlobalPackageReference
Include="Microsoft.VisualStudio.Threading.Analyzers"
Version="17.13.61"
/>
<GlobalPackageReference Include="NetEvolve.Defaults" Version="1.3.74" />
<GlobalPackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.13.61" />
<GlobalPackageReference Include="NetEvolve.Defaults" Version="1.3.80" />
<GlobalPackageReference
Include="SonarAnalyzer.CSharp"
Version="10.6.0.109712"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentException">When <paramref name="value"/> is not a power of two.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<BigInteger> IsPow2(
in this EnsureContext<BigInteger> value
)
public static ref readonly EnsureContext<BigInteger> IsPow2(in this EnsureContext<BigInteger> value)
{
if (!value.Value.IsPowerOfTwo)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentOutOfRangeException">When <paramref name="value"/> is greater than <paramref name="compareValue"/>.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<char> IsGreaterThan(
in this EnsureContext<char> value,
char compareValue
)
public static ref readonly EnsureContext<char> IsGreaterThan(in this EnsureContext<char> value, char compareValue)
{
Argument.ThrowIfLessThanOrEqual(value.Value, compareValue, value.ParameterName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ public partial class EnsureContextExtensions
/// <returns>Returns <paramref name="value"/>.</returns>
/// <exception cref="ArgumentOutOfRangeException">When <paramref name="value"/> is greater than <paramref name="compareValue"/>.</exception>
[StackTraceHidden]
public static ref readonly EnsureContext<char> IsLessThan(
in this EnsureContext<char> value,
char compareValue
)
public static ref readonly EnsureContext<char> IsLessThan(in this EnsureContext<char> value, char compareValue)
{
Argument.ThrowIfGreaterThanOrEqual(value.Value, compareValue, value.ParameterName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ public partial class EnsureContextExtensions
/// <exception cref="DirectoryNotFoundException">When <paramref name="value"/> not exists.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<DirectoryInfo> Exists(
in this EnsureContext<DirectoryInfo> value
)
public static ref readonly EnsureContext<DirectoryInfo> Exists(in this EnsureContext<DirectoryInfo> value)
{
if (!value.Value.Exists)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentException">When <paramref name="value"/> is negative infinity, then a <see cref="ArgumentException"/> is raised.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<double> IsNotNegativeInfinity(
in this EnsureContext<double> value
)
public static ref readonly EnsureContext<double> IsNotNegativeInfinity(in this EnsureContext<double> value)
{
if (double.IsNegativeInfinity(value.Value))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentException">When <paramref name="value"/> is infinity, then a <see cref="ArgumentException"/> is raised.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<double> IsNotInfinity(
in this EnsureContext<double> value
)
public static ref readonly EnsureContext<double> IsNotInfinity(in this EnsureContext<double> value)
{
if (double.IsInfinity(value.Value))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentException">When <paramref name="value"/> is negative infinity, then a <see cref="ArgumentException"/> is raised.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<double> IsNotPositiveInfinity(
in this EnsureContext<double> value
)
public static ref readonly EnsureContext<double> IsNotPositiveInfinity(in this EnsureContext<double> value)
{
if (double.IsPositiveInfinity(value.Value))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentOutOfRangeException">When <paramref name="value"/> is greater than <paramref name="compareValue"/>.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<float> IsLessThan(
in this EnsureContext<float> value,
float compareValue
)
public static ref readonly EnsureContext<float> IsLessThan(in this EnsureContext<float> value, float compareValue)
{
Argument.ThrowIfGreaterThanOrEqual(value.Value, compareValue, value.ParameterName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentException">When <paramref name="value"/> is negative infinity, then a <see cref="ArgumentException"/> is raised.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<float> IsNotNegativeInfinity(
in this EnsureContext<float> value
)
public static ref readonly EnsureContext<float> IsNotNegativeInfinity(in this EnsureContext<float> value)
{
if (float.IsNegativeInfinity(value.Value))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentException">When <paramref name="value"/> is infinity, then a <see cref="ArgumentException"/> is raised.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<float> IsNotInfinity(
in this EnsureContext<float> value
)
public static ref readonly EnsureContext<float> IsNotInfinity(in this EnsureContext<float> value)
{
if (float.IsInfinity(value.Value))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentException">When <paramref name="value"/> is negative infinity, then a <see cref="ArgumentException"/> is raised.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<float> IsNotPositiveInfinity(
in this EnsureContext<float> value
)
public static ref readonly EnsureContext<float> IsNotPositiveInfinity(in this EnsureContext<float> value)
{
if (float.IsPositiveInfinity(value.Value))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentOutOfRangeException">When <paramref name="value"/> is greater than <paramref name="compareValue"/>.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<Half> IsGreaterThan(
in this EnsureContext<Half> value,
Half compareValue
)
public static ref readonly EnsureContext<Half> IsGreaterThan(in this EnsureContext<Half> value, Half compareValue)
{
Argument.ThrowIfLessThanOrEqual(value.Value, compareValue, value.ParameterName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentOutOfRangeException">When <paramref name="value"/> is greater than <paramref name="compareValue"/>.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<Half> IsLessThan(
in this EnsureContext<Half> value,
Half compareValue
)
public static ref readonly EnsureContext<Half> IsLessThan(in this EnsureContext<Half> value, Half compareValue)
{
Argument.ThrowIfGreaterThanOrEqual(value.Value, compareValue, value.ParameterName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentException">When <paramref name="value"/> is negative infinity, then a <see cref="ArgumentException"/> is raised.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<Half> IsNotNegativeInfinity(
in this EnsureContext<Half> value
)
public static ref readonly EnsureContext<Half> IsNotNegativeInfinity(in this EnsureContext<Half> value)
{
if (Half.IsNegativeInfinity(value.Value))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentException">When <paramref name="value"/> is negative infinity, then a <see cref="ArgumentException"/> is raised.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<Half> IsNotPositiveInfinity(
in this EnsureContext<Half> value
)
public static ref readonly EnsureContext<Half> IsNotPositiveInfinity(in this EnsureContext<Half> value)
{
if (Half.IsPositiveInfinity(value.Value))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentOutOfRangeException">When <paramref name="value"/> is not between <paramref name="minValue"/> and <paramref name="maxValue"/>.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<T> IsBetween<T>(
in this EnsureContext<T> value,
T minValue,
T maxValue
)
public static ref readonly EnsureContext<T> IsBetween<T>(in this EnsureContext<T> value, T minValue, T maxValue)
where T : IComparisonOperators<T, T, bool>
{
if ((minValue <= value.Value) != (value.Value <= maxValue))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentOutOfRangeException">When <paramref name="value"/> is greater than <paramref name="compareValue"/>.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<T> IsGreaterThan<T>(
in this EnsureContext<T> value,
T compareValue
)
public static ref readonly EnsureContext<T> IsGreaterThan<T>(in this EnsureContext<T> value, T compareValue)
where T : IComparisonOperators<T, T, bool>, IComparable<T>
{
Argument.ThrowIfLessThanOrEqual(value.Value, compareValue, value.ParameterName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentOutOfRangeException">When <paramref name="value"/> is greater than <paramref name="compareValue"/>.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<T> IsGreaterThanOrEqual<T>(
in this EnsureContext<T> value,
T compareValue
)
public static ref readonly EnsureContext<T> IsGreaterThanOrEqual<T>(in this EnsureContext<T> value, T compareValue)
where T : IComparisonOperators<T, T, bool>, IComparable<T>
{
Argument.ThrowIfLessThan(value.Value, compareValue, value.ParameterName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentOutOfRangeException">When <paramref name="value"/> is greater than <paramref name="compareValue"/>.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<T> IsLessThan<T>(
in this EnsureContext<T> value,
T compareValue
)
public static ref readonly EnsureContext<T> IsLessThan<T>(in this EnsureContext<T> value, T compareValue)
where T : IComparisonOperators<T, T, bool>, IComparable<T>
{
Argument.ThrowIfGreaterThanOrEqual(value.Value, compareValue, value.ParameterName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentOutOfRangeException">When <paramref name="value"/> is greater than <paramref name="compareValue"/>.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<T> IsLessThanOrEqual<T>(
in this EnsureContext<T> value,
T compareValue
)
public static ref readonly EnsureContext<T> IsLessThanOrEqual<T>(in this EnsureContext<T> value, T compareValue)
where T : IComparisonOperators<T, T, bool>, IComparable<T>
{
Argument.ThrowIfGreaterThan(value.Value, compareValue, value.ParameterName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentOutOfRangeException">When <paramref name="value"/> is not between <paramref name="minValue"/> and <paramref name="maxValue"/>.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<T> IsNotBetween<T>(
in this EnsureContext<T> value,
T minValue,
T maxValue
)
public static ref readonly EnsureContext<T> IsNotBetween<T>(in this EnsureContext<T> value, T minValue, T maxValue)
where T : IComparisonOperators<T, T, bool>
{
if ((minValue <= value.Value) == (value.Value <= maxValue))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentException">When <paramref name="value"/> has no elements.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static EnsureContext<IEnumerable<T>> IsNotNullOrEmpty<T>(
in this EnsureContext<IEnumerable<T>?> value
)
public static EnsureContext<IEnumerable<T>> IsNotNullOrEmpty<T>(in this EnsureContext<IEnumerable<T>?> value)
{
Argument.ThrowIfNull(value.Value, value.ParameterName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentException">When <paramref name="value"/> is negative infinity, then a <see cref="ArgumentException"/> is raised.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<T> IsNotNegativeInfinity<T>(
in this EnsureContext<T> value
)
public static ref readonly EnsureContext<T> IsNotNegativeInfinity<T>(in this EnsureContext<T> value)
where T : IFloatingPoint<T>
{
if (T.IsNegativeInfinity(value.Value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentException">When <paramref name="value"/> is negative infinity, then a <see cref="ArgumentException"/> is raised.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<T> IsNotPositiveInfinity<T>(
in this EnsureContext<T> value
)
public static ref readonly EnsureContext<T> IsNotPositiveInfinity<T>(in this EnsureContext<T> value)
where T : IFloatingPoint<T>
{
if (T.IsPositiveInfinity(value.Value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentOutOfRangeException">When <paramref name="value"/> is greater than <paramref name="compareValue"/>.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<short> IsLessThan(
in this EnsureContext<short> value,
short compareValue
)
public static ref readonly EnsureContext<short> IsLessThan(in this EnsureContext<short> value, short compareValue)
{
Argument.ThrowIfGreaterThanOrEqual(value.Value, compareValue, value.ParameterName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentOutOfRangeException">When <paramref name="value"/> is greater than <paramref name="compareValue"/>.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<int> IsGreaterThan(
in this EnsureContext<int> value,
int compareValue
)
public static ref readonly EnsureContext<int> IsGreaterThan(in this EnsureContext<int> value, int compareValue)
{
Argument.ThrowIfLessThanOrEqual(value.Value, compareValue, value.ParameterName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentOutOfRangeException">When <paramref name="value"/> is greater than <paramref name="compareValue"/>.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<int> IsLessThan(
in this EnsureContext<int> value,
int compareValue
)
public static ref readonly EnsureContext<int> IsLessThan(in this EnsureContext<int> value, int compareValue)
{
Argument.ThrowIfGreaterThanOrEqual(value.Value, compareValue, value.ParameterName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ public partial class EnsureContextExtensions
/// <exception cref="ArgumentOutOfRangeException">When <paramref name="value"/> is greater than <paramref name="compareValue"/>.</exception>
[DebuggerStepThrough]
[StackTraceHidden]
public static ref readonly EnsureContext<int> IsLessThanOrEqual(
in this EnsureContext<int> value,
int compareValue
)
public static ref readonly EnsureContext<int> IsLessThanOrEqual(in this EnsureContext<int> value, int compareValue)
{
Argument.ThrowIfGreaterThan(value.Value, compareValue, value.ParameterName);

Expand Down
Loading