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
6 changes: 4 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
12 changes: 2 additions & 10 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="Roslynator.Analyzers" Version="4.13.1" />
<GlobalPackageReference
Include="SonarAnalyzer.CSharp"
Expand All @@ -28,11 +25,6 @@
<PackageVersion Include="NetEvolve.Extensions.XUnit" Version="2.5.105" />
<PackageVersion Include="Polyfill" Version="7.27.0" />
<PackageVersion Include="xunit" Version="2.9.3" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' Or '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'net5.0' And '$(TargetFramework)' != 'netcoreapp3.1' ">
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ public static partial class Argument
[DoesNotReturn]
[MethodImpl(MethodImplOptions.NoInlining)]
[StackTraceHidden]
private static void ThrowArgumentOutOfRangeException<T>(
string? paramName,
T value,
string? message = null
)
private static void ThrowArgumentOutOfRangeException<T>(string? paramName, T value, string? message = null)
{
throw new ArgumentOutOfRangeException(paramName, value, message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ public static void ThrowIfGreaterThanOrEqual<T>(
#else
if (value.CompareTo(other) >= 0)
{
ThrowArgumentOutOfRangeException(
paramName,
value,
$"{paramName} ('{value}') must be less than '{other}'."
);
ThrowArgumentOutOfRangeException(paramName, value, $"{paramName} ('{value}') must be less than '{other}'.");
}
#endif
}
Expand Down
6 changes: 1 addition & 5 deletions src/NetEvolve.Arguments/Argument_ThrowIfNotEqual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ public static void ThrowIfNotEqual<T>(
#else
if (!EqualityComparer<T>.Default.Equals(value, other))
{
ThrowArgumentOutOfRangeException(
paramName,
value,
$"{paramName} ('{value}') must be equal to '{other}'."
);
ThrowArgumentOutOfRangeException(paramName, value, $"{paramName} ('{value}') must be equal to '{other}'.");
}
#endif
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ public void ThrowIfNullOrEmpty_WhenIEnumerableNull_ThrowsArgumentNullException()

[Theory]
[MemberData(nameof(ThrowIfNullOrEmptyEnumerableData))]
public void ThrowIfNullOrEmpty_WhenIEnumerableIsEmpty_ThrowsArgumentException(
IEnumerable<string> argument
)
public void ThrowIfNullOrEmpty_WhenIEnumerableIsEmpty_ThrowsArgumentException(IEnumerable<string> argument)
{
// Act
void Act() => Argument.ThrowIfNullOrEmpty(argument);
Expand All @@ -73,9 +71,7 @@ IEnumerable<string> argument

[Theory]
[MemberData(nameof(ThrowIfNullOrEmptyEnumerableWithData))]
public void ThrowIfNullOrEmpty_WhenIEnumerableIsNotEmpty_ReturnsArgument(
IEnumerable<string> argument
)
public void ThrowIfNullOrEmpty_WhenIEnumerableIsNotEmpty_ReturnsArgument(IEnumerable<string> argument)
{
// Act
Argument.ThrowIfNullOrEmpty(argument);
Expand Down