diff --git a/src/.editorconfig b/src/.editorconfig index bb59b63e..c9db1cb9 100644 --- a/src/.editorconfig +++ b/src/.editorconfig @@ -140,15 +140,17 @@ resharper_wrap_before_binary_pattern_op = false resharper_wrap_object_and_collection_initializer_style = chop_always resharper_place_simple_initializer_on_single_line = false -# space -resharper_space_around_lambda_arrow = true - dotnet_style_require_accessibility_modifiers = never:error resharper_place_type_constraints_on_same_line = false resharper_blank_lines_inside_namespace = 0 resharper_blank_lines_after_file_scoped_namespace_directive = 1 resharper_blank_lines_inside_type = 0 +insert_final_newline = false +resharper_place_attribute_on_same_line = false +resharper_space_around_lambda_arrow = true +resharper_place_constructor_initializer_on_same_line = false + #braces https://www.jetbrains.com/help/resharper/EditorConfig_CSHARP_CSharpCodeStylePageImplSchema.html#Braces resharper_braces_for_ifelse = required resharper_braces_for_foreach = required diff --git a/src/Shared.sln.DotSettings b/src/Shared.sln.DotSettings index f9d0a1a2..38d0d527 100644 --- a/src/Shared.sln.DotSettings +++ b/src/Shared.sln.DotSettings @@ -25,14 +25,16 @@ ERROR ERROR ERROR - DO_NOT_SHOW ERROR ERROR ERROR + ERROR + ERROR ERROR ERROR ERROR ERROR + ERROR DO_NOT_SHOW ERROR ERROR @@ -42,6 +44,7 @@ ERROR ERROR ERROR + ERROR ERROR C90+,E79+,S14+ ERROR diff --git a/src/Verify.Blazor/ComponentInfo.cs b/src/Verify.Blazor/ComponentInfo.cs index e5fe5471..c669a94a 100644 --- a/src/Verify.Blazor/ComponentInfo.cs +++ b/src/Verify.Blazor/ComponentInfo.cs @@ -1,9 +1,4 @@ -using Microsoft.AspNetCore.Components; - -class ComponentInfo +class ComponentInfo(ComponentBase instance) { - public ComponentBase Instance { get; } - - public ComponentInfo(ComponentBase instance) => - Instance = instance; + public ComponentBase Instance { get; } = instance; } \ No newline at end of file diff --git a/src/Verify.Blazor/ContainerComponent.cs b/src/Verify.Blazor/ContainerComponent.cs index aab25925..7b2cbcbf 100644 --- a/src/Verify.Blazor/ContainerComponent.cs +++ b/src/Verify.Blazor/ContainerComponent.cs @@ -1,5 +1,4 @@ -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; +using Microsoft.AspNetCore.Components.Rendering; // This provides the ability for test code to trigger rendering at arbitrary times, // and to supply arbitrary parameters to the component being tested (including ones diff --git a/src/Verify.Blazor/GlobalUsings.cs b/src/Verify.Blazor/GlobalUsings.cs new file mode 100644 index 00000000..cc4d251f --- /dev/null +++ b/src/Verify.Blazor/GlobalUsings.cs @@ -0,0 +1,3 @@ +// Global using directives + +global using Microsoft.AspNetCore.Components; \ No newline at end of file diff --git a/src/Verify.Blazor/Render.cs b/src/Verify.Blazor/Render.cs index a2bf88b9..7faa3ed4 100644 --- a/src/Verify.Blazor/Render.cs +++ b/src/Verify.Blazor/Render.cs @@ -1,5 +1,4 @@ -using Microsoft.AspNetCore.Components; -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; namespace VerifyTests.Blazor; diff --git a/src/Verify.Blazor/TestRenderer.cs b/src/Verify.Blazor/TestRenderer.cs index 56712696..ab0993ad 100644 --- a/src/Verify.Blazor/TestRenderer.cs +++ b/src/Verify.Blazor/TestRenderer.cs @@ -1,5 +1,4 @@ using System.Runtime.ExceptionServices; -using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.RenderTree; using Microsoft.Extensions.Logging; diff --git a/src/Verify.Blazor/VerifyBlazor.cs b/src/Verify.Blazor/VerifyBlazor.cs index d625b7e5..aa3d1851 100644 --- a/src/Verify.Blazor/VerifyBlazor.cs +++ b/src/Verify.Blazor/VerifyBlazor.cs @@ -1,5 +1,4 @@ -using Microsoft.AspNetCore.Components; -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using VerifyTests.Blazor; diff --git a/src/Verify.Bunit.Tests/Samples.cs b/src/Verify.Bunit.Tests/Samples.cs index 3f8e3d70..33406ef2 100644 --- a/src/Verify.Bunit.Tests/Samples.cs +++ b/src/Verify.Bunit.Tests/Samples.cs @@ -34,10 +34,12 @@ public Task Nested() builder => { builder.Add(_ => _.Title, "New Title"); - builder.Add(_ => _.Person, new() - { - Name = "Sam" - }); + builder.Add( + _ => _.Person, + new() + { + Name = "Sam" + }); }); return Verify( @@ -56,10 +58,12 @@ public async Task WaitForState() builder => { builder.Add(_ => _.Title, "New Title"); - builder.Add(_ => _.Person, new() - { - Name = "Sam" - }); + builder.Add( + _ => _.Person, + new() + { + Name = "Sam" + }); }, _ => _.Intitialized); await Verify(component); diff --git a/src/Verify.Bunit/ComponentReader.cs b/src/Verify.Bunit/ComponentReader.cs index a300744b..a78f43d0 100644 --- a/src/Verify.Bunit/ComponentReader.cs +++ b/src/Verify.Bunit/ComponentReader.cs @@ -1,5 +1,4 @@ -using Bunit; -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; static class ComponentReader { diff --git a/src/Verify.Bunit/FragmentToStream.cs b/src/Verify.Bunit/FragmentToStream.cs index b8d0b89c..5e38050b 100644 --- a/src/Verify.Bunit/FragmentToStream.cs +++ b/src/Verify.Bunit/FragmentToStream.cs @@ -1,6 +1,4 @@ -using Bunit; - -static class FragmentToStream +static class FragmentToStream { public static ConversionResult Convert(IRenderedFragment fragment, IReadOnlyDictionary context) { diff --git a/src/Verify.Bunit/GlobalUsings.cs b/src/Verify.Bunit/GlobalUsings.cs new file mode 100644 index 00000000..d8bf5bc0 --- /dev/null +++ b/src/Verify.Bunit/GlobalUsings.cs @@ -0,0 +1,3 @@ +// Global using directives + +global using Bunit; \ No newline at end of file diff --git a/src/Verify.Bunit/RenderedFragmentConverter.cs b/src/Verify.Bunit/RenderedFragmentConverter.cs index 4cffbecd..5bb94865 100644 --- a/src/Verify.Bunit/RenderedFragmentConverter.cs +++ b/src/Verify.Bunit/RenderedFragmentConverter.cs @@ -1,6 +1,4 @@ -using Bunit; - -class RenderedFragmentConverter : +class RenderedFragmentConverter : WriteOnlyJsonConverter { public override void Write(VerifyJsonWriter writer, IRenderedFragment fragment) diff --git a/src/Verify.Bunit/VerifyBunit.cs b/src/Verify.Bunit/VerifyBunit.cs index 539c75e2..0a019d70 100644 --- a/src/Verify.Bunit/VerifyBunit.cs +++ b/src/Verify.Bunit/VerifyBunit.cs @@ -1,5 +1,4 @@ using AngleSharp.Dom; -using Bunit; using Bunit.Extensions.WaitForHelpers; using Microsoft.AspNetCore.Components;