Skip to content

Commit

Permalink
Updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaoticz committed Dec 30, 2024
1 parent 14969ec commit e739d17
Show file tree
Hide file tree
Showing 36 changed files with 119 additions and 139 deletions.
47 changes: 26 additions & 21 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
root = true

[*]
charset = utf-8
end_of_line = lf
Expand All @@ -7,24 +9,16 @@ indent_style = space
indent_size = 4 # A property with the same name was updated with a value 2 in a section [{*.yaml,*.yml}]

[{*.yaml,*.yml}]
indent_style = space
indent_size = 2 # A property with the same name was updated with a value 4 in a section [*]; with a value 4 in a section [*.{appxmanifest,asax,ascx,aspx,axaml,build,cg,cginc,compute,cs,cshtml,dtd,hlsl,hlsli,hlslinc,master,nuspec,paml,razor,resw,resx,skin,usf,ush,vb,xaml,xamlx,xoml,xsd}]
dotnet_diagnostic.CA1047.severity = error

[*.{appxmanifest,asax,ascx,aspx,axaml,build,cg,cginc,compute,cs,cshtml,dtd,hlsl,hlsli,hlslinc,master,nuspec,paml,razor,resw,resx,skin,usf,ush,vb,xaml,xamlx,xoml,xsd}]
indent_style = space
indent_size = 4 # A property with the same name was updated with a value 2 in a section [{*.yaml,*.yml}]
tab_width = 4
dotnet_style_operator_placement_when_wrapping = beginning_of_line

dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error
dotnet_style_prefer_auto_properties = true:warning
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
Expand All @@ -35,13 +29,8 @@ dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_readonly_field = true:warning
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning
dotnet_style_require_accessibility_modifiers = always:error
dotnet_style_allow_multiple_blank_lines_experimental = false:silent
dotnet_style_allow_statement_immediately_after_block_experimental = false:silent
dotnet_code_quality_unused_parameters = all:warning
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
Expand Down Expand Up @@ -712,14 +701,16 @@ resharper_blank_lines_inside_region = 1
resharper_blank_lines_inside_type = 0
resharper_blank_line_after_pi = true
resharper_braces_for_dowhile = required
resharper_braces_for_fixed = required
resharper_braces_for_fixed = required_for_multiline
resharper_braces_for_for = required_for_multiline
resharper_braces_for_foreach = required_for_multiline
resharper_braces_for_ifelse = required_for_multiline
resharper_braces_for_lock = required
resharper_braces_for_using = required
resharper_braces_for_lock = required_for_multiline
resharper_braces_for_using = required_for_multiline
resharper_braces_for_while = required_for_multiline
resharper_braces_redundant = true
resharper_builtin_type_apply_to_native_integer = true
resharper_csharp_empty_block_style = together_same_line
resharper_break_template_declaration = line_break
resharper_can_use_global_alias = false
resharper_configure_await_analysis_mode = disabled
Expand Down Expand Up @@ -817,7 +808,7 @@ resharper_indent_typearg_angles = inside
resharper_indent_typeparam_angles = inside
resharper_indent_type_constraints = true
resharper_indent_wrapped_function_names = false
resharper_instance_members_qualify_declared_in = base_class
resharper_instance_members_qualify_declared_in =
resharper_int_align_assignments = false
resharper_int_align_binary_expressions = false
resharper_int_align_declaration_names = false
Expand Down Expand Up @@ -918,7 +909,7 @@ resharper_place_simple_switch_expression_on_single_line = false
resharper_place_type_attribute_on_same_line = false
resharper_place_type_constraints_on_same_line = true
resharper_prefer_explicit_discard_declaration = false
resharper_prefer_separate_deconstructed_variables_declaration = true
resharper_prefer_separate_deconstructed_variables_declaration = false
resharper_preserve_spaces_inside_tags = pre,textarea
resharper_qualified_using_at_nested_scope = false
resharper_quote_style = doublequoted
Expand Down Expand Up @@ -1069,6 +1060,7 @@ resharper_space_within_typeof_parentheses = false
resharper_space_within_type_argument_angles = false
resharper_space_within_type_parameter_angles = false
resharper_space_within_type_parameter_parentheses = false
resharper_csharp_allow_alias = false
resharper_special_else_if_treatment = true
resharper_static_members_qualify_members = none
resharper_static_members_qualify_with = declared_type
Expand Down Expand Up @@ -1289,7 +1281,7 @@ resharper_convert_to_using_declaration_highlighting = suggestion
resharper_convert_to_vb_auto_property_highlighting = suggestion
resharper_convert_to_vb_auto_property_when_possible_highlighting = hint
resharper_convert_to_vb_auto_property_with_private_setter_highlighting = hint
resharper_convert_type_check_pattern_to_null_check_highlighting = warning
resharper_convert_type_check_pattern_to_null_check_highlighting = none
resharper_convert_type_check_to_null_check_highlighting = warning
resharper_co_variant_array_conversion_highlighting = warning
resharper_c_declaration_with_implicit_int_type_highlighting = warning
Expand Down Expand Up @@ -1872,4 +1864,17 @@ resharper_virtual_member_never_overridden_local_highlighting = suggestion
resharper_void_method_with_must_use_return_value_attribute_highlighting = warning
resharper_with_expression_instead_of_initializer_highlighting = suggestion
resharper_wrong_indent_size_highlighting = none
resharper_xunit_xunit_test_with_console_output_highlighting = warning
resharper_xunit_xunit_test_with_console_output_highlighting = warning
resharper_arrange_constructor_or_destructor_body_highlighting = hint
resharper_arrange_local_function_body_highlighting = hint
resharper_arrange_method_or_operator_body_highlighting = hint
resharper_arrange_null_checking_pattern_highlighting = suggestion
resharper_enforce_do_while_statement_braces_highlighting = warning
resharper_enforce_fixed_statement_braces_highlighting = warning
resharper_enforce_foreach_statement_braces_highlighting = suggestion
resharper_enforce_for_statement_braces_highlighting = suggestion
resharper_enforce_if_statement_braces_highlighting = suggestion
resharper_enforce_lock_statement_braces_highlighting = warning
resharper_enforce_while_statement_braces_highlighting = suggestion
resharper_remove_redundant_braces_highlighting = hint
resharper_suggest_discard_declaration_var_style_highlighting = warning
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
dotnet-version: '9.x'

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7.0.x
8.0.x
9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand All @@ -46,8 +46,8 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7.0.x
8.0.x
9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand All @@ -70,8 +70,8 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7.0.x
8.0.x
9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
uses: "actions/setup-dotnet@v4"
with:
dotnet-version: |
7.0.x
8.0.x
9.0.x
- name: Build
run: dotnet build -c Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
uses: "actions/setup-dotnet@v4"
with:
dotnet-version: |
7.0.x
8.0.x
9.0.x
- name: Build
run: dotnet build -c Release
Expand Down
9 changes: 4 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<AnalysisLevel>latest</AnalysisLevel>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<AnalysisLevel>latest-Recommended</AnalysisLevel>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<VersionPrefix>2.3.3</VersionPrefix>
<Authors>Kotz</Authors>
<Copyright>Copyright © Kotz 2022</Copyright>
<PackageProjectUrl>https://github.com/Kaoticz/Kotz.Utilities</PackageProjectUrl>
Expand All @@ -23,11 +22,11 @@
<PackageIcon>Avatar.png</PackageIcon>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions Kotz.Collections/Kotz.Collections.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<Description>Provides collection types for common tasks.</Description>
<VersionPrefix>3.0.0</VersionPrefix>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Kotz.DependencyInjection.Abstractions;
/// don't forget to also apply this attribute to the derived class.
/// </remarks>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = false)]
public abstract class ServiceAttributeBase : Attribute
public abstract class ServiceBaseAttribute : Attribute
{
private readonly Action<IServiceCollection, Type> _serviceRegister;

Expand All @@ -36,7 +36,7 @@ public abstract class ServiceAttributeBase : Attribute
/// services under the same interface, <see langword="false"/> otherwise.
/// </param>
/// <exception cref="UnreachableException"> Occurs when a value for <paramref name="lifespan"/> is not implemented.</exception>
protected ServiceAttributeBase(ServiceLifetime lifespan, bool allowMultiple)
protected ServiceBaseAttribute(ServiceLifetime lifespan, bool allowMultiple)
{
Lifetime = lifespan;
AllowMultiple = allowMultiple;
Expand Down Expand Up @@ -121,7 +121,7 @@ private static (string, string) GetRegisteredServiceError(IServiceCollection ioc

return (registeredConcreteType ?? registeredService.ServiceType.Name,
registeredService.ServiceType.Name +
((string.IsNullOrWhiteSpace(registeredConcreteType) || registeredService.ServiceType.Name.Equals(registeredConcreteType))
((string.IsNullOrWhiteSpace(registeredConcreteType) || registeredService.ServiceType.Name.Equals(registeredConcreteType, StringComparison.Ordinal))
? string.Empty
: ": " + registeredConcreteType));
}
Expand Down
8 changes: 4 additions & 4 deletions Kotz.DependencyInjection/Extensions/IServiceCollectionExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static class IServiceCollectionExt
{
/// <summary>
/// Registers all types in the current assembly that are marked with a
/// <see cref="ServiceAttributeBase"/> attribute to this service collection.
/// <see cref="ServiceBaseAttribute"/> attribute to this service collection.
/// </summary>
/// <param name="serviceCollection">This service collection.</param>
/// <returns>This service collection with the services registered in it.</returns>
Expand All @@ -23,7 +23,7 @@ public static IServiceCollection RegisterServices(this IServiceCollection servic

/// <summary>
/// Registers all types in the specifyed <paramref name="assembly"/> that are marked
/// with a <see cref="ServiceAttributeBase"/> attribute to this service collection.
/// with a <see cref="ServiceBaseAttribute"/> attribute to this service collection.
/// </summary>
/// <param name="serviceCollection">This service collection.</param>
/// <param name="assembly">The assembly to get the types from.</param>
Expand All @@ -33,8 +33,8 @@ public static IServiceCollection RegisterServices(this IServiceCollection servic
/// </exception>
public static IServiceCollection RegisterServices(this IServiceCollection serviceCollection, Assembly assembly)
{
var typesAndAttributes = assembly.GetConcreteTypesWithAttribute<ServiceAttributeBase>()
.Select(x => (Type: x, Attribute: x.GetCustomAttribute<ServiceAttributeBase>()!));
var typesAndAttributes = assembly.GetConcreteTypesWithAttribute<ServiceBaseAttribute>()
.Select(x => (Type: x, Attribute: x.GetCustomAttribute<ServiceBaseAttribute>()!));

foreach (var (type, attribute) in typesAndAttributes)
attribute.RegisterService(serviceCollection, type);
Expand Down
9 changes: 5 additions & 4 deletions Kotz.DependencyInjection/Kotz.DependencyInjection.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<Description>Provides utility methods and attributes for "Microsoft.Extensions.DependencyInjection".</Description>
<VersionPrefix>3.0.0</VersionPrefix>
</PropertyGroup>

<ItemGroup>
Expand All @@ -11,12 +12,12 @@
</None>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net7.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<ItemGroup Condition="'$(TargetFramework)'=='net9.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Kotz.DependencyInjection/ServiceAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Kotz.DependencyInjection;
/// This attribute marks the class or struct it is applied to for
/// registration in the IoC container for dependency injection.
/// </summary>
public sealed class ServiceAttribute : ServiceAttributeBase
public sealed class ServiceAttribute : ServiceBaseAttribute
{
/// <summary>
/// Marks this class for registration in the IoC container for dependency injection.
Expand Down
2 changes: 1 addition & 1 deletion Kotz.DependencyInjection/ServiceAttributeGeneric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Kotz.DependencyInjection;
/// registration in the IoC container for dependency injection.
/// </summary>
/// <typeparam name="T">The abstract type the service should be registered under.</typeparam>
public sealed class ServiceAttribute<T> : ServiceAttributeBase
public sealed class ServiceAttribute<T> : ServiceBaseAttribute
{
/// <summary>
/// Defines the type this service should be registered as.
Expand Down
2 changes: 2 additions & 0 deletions Kotz.Events/Kotz.Events.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

<PropertyGroup>
<Description>Provides generic and async event handlers.</Description>
<VersionPrefix>3.0.0</VersionPrefix>
<NoWarn>CA1711</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 0 additions & 2 deletions Kotz.Extensions/ArrayExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace Kotz.Extensions;
/// </summary>
public static class ArrayExt
{
#if NET8_0_OR_GREATER
/// <summary>
/// Performs an in-place shuffle of this array.
/// </summary>
Expand All @@ -23,7 +22,6 @@ public static T[] Shuffle<T>(this T[] array, Random? random)

return array;
}
#endif

/// <summary>
/// Creates a new <see cref="ReadOnlySpan{T}"/> over the entirety of the specified <paramref name="array"/>.
Expand Down
4 changes: 2 additions & 2 deletions Kotz.Extensions/CharExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public static bool IsWhiteSpace(this char character)
/// if the character is already lowercase or not alphabetic.
/// </returns>
public static char ToLower(this char character)
=> char.ToLower(character);
=> char.ToLower(character, CultureInfo.CurrentCulture);

/// <summary>
/// Converts the value of this character to its lowercase equivalent using the specified
Expand Down Expand Up @@ -331,7 +331,7 @@ public static char ToLowerInvariant(this char character)
/// if it's already uppercase, has no uppercase equivalent, or is not alphabetic.
/// </returns>
public static char ToUpper(this char character)
=> char.ToUpper(character);
=> char.ToUpper(character, CultureInfo.CurrentCulture);

/// <summary>
/// Converts the value of this character to its uppercase equivalent using the specified
Expand Down
4 changes: 2 additions & 2 deletions Kotz.Extensions/INumberExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static T FromDigits<T>(this string number, int @base) where T : struct, I
{
if (!number.All(char.IsAsciiLetterOrDigit))
throw new ArgumentException("The string must contain ASCII letters or digits only.", nameof(number));

if (number.Any(x => (char.IsAsciiDigit(x)) ? x >= '0' + @base : (char.IsAsciiLetterUpper(x)) ? x >= 'A' + @base - 10 : x >= 'a' + @base - 10))
throw new ArgumentException($"The number '{number}' cannot be represented in base {@base}", nameof(@base));

Expand Down Expand Up @@ -174,7 +174,7 @@ private static Span<char> ToTwosComplement<T>(T number, int @base, Span<char> bu
{
if (++buffer[index] != @base + '0')
break;

buffer[index] = '0';
}

Expand Down
1 change: 1 addition & 0 deletions Kotz.Extensions/Kotz.Extensions.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Provides extension methods for common tasks.</Description>
<VersionPrefix>3.0.0</VersionPrefix>
</PropertyGroup>
<ItemGroup>
<None Include="README.md">
Expand Down
Loading

0 comments on commit e739d17

Please sign in to comment.