diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07274db..ed4f15c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,9 @@ jobs: strategy: matrix: include: - - os: windows-2022 + - os: windows-latest name: Windows - - os: ubuntu-22.04 + - os: ubuntu-latest name: Linux fail-fast: false steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 94c2d14..6590a01 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ defaults: shell: pwsh jobs: release: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4.2.2 diff --git a/.gitignore b/.gitignore index 190ac12..5bf25cc 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,7 @@ build/ bld/ [Bb]in/ [Oo]bj/ +*.binlog # Roslyn cache directories *.ide/ diff --git a/src/.editorconfig b/src/.editorconfig index 6a05949..a751d64 100644 --- a/src/.editorconfig +++ b/src/.editorconfig @@ -41,14 +41,17 @@ dotnet_style_qualification_for_field = false:error dotnet_style_qualification_for_method = false:error dotnet_style_qualification_for_property = false:error +# Namespace/folder matching +dotnet_style_namespace_match_folder = false + # Language keywords vs BCL types preferences dotnet_diagnostic.IDE0049.severity = error dotnet_style_predefined_type_for_locals_parameters_members = true:error dotnet_style_predefined_type_for_member_access = true:error # Modifier preferences -dotnet_diagnostic.IDE0040.severity = error -dotnet_style_require_accessibility_modifiers = omit_if_default:error +dotnet_diagnostic.IDE0040.severity = warning +dotnet_style_require_accessibility_modifiers = omit_if_default:warning # TODO: Change to error dotnet_diagnostic.IDE0044.severity = suggestion @@ -63,8 +66,8 @@ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:error dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:error # Expression-level preferences -dotnet_diagnostic.IDE0017.severity = error -dotnet_style_object_initializer = true:error +dotnet_diagnostic.IDE0017.severity = warning +dotnet_style_object_initializer = true:warning dotnet_diagnostic.IDE0028.severity = error dotnet_style_collection_initializer = true:error @@ -223,22 +226,22 @@ file_header_template = unset dotnet_diagnostic.IDE0001.severity = error dotnet_diagnostic.IDE0002.severity = error dotnet_diagnostic.IDE0004.severity = error -dotnet_diagnostic.IDE0005.severity = error +dotnet_diagnostic.IDE0005.severity = warning dotnet_diagnostic.IDE0035.severity = error -dotnet_diagnostic.IDE0051.severity = error -dotnet_diagnostic.IDE0052.severity = error +dotnet_diagnostic.IDE0051.severity = warning +dotnet_diagnostic.IDE0052.severity = warning # TODO: Change to error dotnet_diagnostic.IDE0058.severity = suggestion csharp_style_unused_value_expression_statement_preference = discard_variable -dotnet_diagnostic.IDE0059.severity = error +dotnet_diagnostic.IDE0059.severity = warning csharp_style_unused_value_assignment_preference = discard_variable -dotnet_diagnostic.IDE0060.severity = error +dotnet_diagnostic.IDE0060.severity = warning dotnet_code_quality_unused_parameters = non_public -dotnet_diagnostic.IDE0079.severity = error +dotnet_diagnostic.IDE0079.severity = error # Diagnostic does not fail build dotnet_remove_unnecessary_suppression_exclusions = none dotnet_diagnostic.IDE0080.severity = error @@ -249,7 +252,7 @@ dotnet_diagnostic.IDE0110.severity = error #### Formatting Rules #### -dotnet_diagnostic.IDE0055.severity = error +dotnet_diagnostic.IDE0055.severity = warning # New line preferences csharp_new_line_before_catch = true @@ -322,6 +325,14 @@ dotnet_naming_rule.fields.style = camel_case dotnet_naming_rule.fields.symbols = fields dotnet_naming_rule.fields.severity = none +dotnet_naming_rule.local_constants.severity = none +dotnet_naming_rule.local_constants.symbols = local_constants +dotnet_naming_rule.local_constants.style = camel_case + +dotnet_naming_rule.local_variables.severity = suggestion +dotnet_naming_rule.local_variables.symbols = local_variables +dotnet_naming_rule.local_variables.style = camel_case + # Symbol specifications dotnet_naming_symbols.interface.applicable_kinds = interface dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected @@ -339,6 +350,12 @@ dotnet_naming_symbols.fields.applicable_kinds = field dotnet_naming_symbols.fields.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected dotnet_naming_symbols.fields.required_modifiers = +dotnet_naming_symbols.local_constants.applicable_kinds = local +dotnet_naming_symbols.local_constants.required_modifiers = const + +dotnet_naming_symbols.local_variables.applicable_kinds = local +dotnet_naming_symbols.local_variables.required_modifiers = + # Naming styles dotnet_naming_style.pascal_case.required_prefix = dotnet_naming_style.pascal_case.required_suffix = diff --git a/src/AcceptanceTests/HostApplicationBuilder/When_logging_with_host_application_builder.cs b/src/AcceptanceTests/HostApplicationBuilder/When_logging_with_host_application_builder.cs index 53a6899..e062337 100644 --- a/src/AcceptanceTests/HostApplicationBuilder/When_logging_with_host_application_builder.cs +++ b/src/AcceptanceTests/HostApplicationBuilder/When_logging_with_host_application_builder.cs @@ -18,8 +18,8 @@ public async Task Should_integrate_with_default_host_logging() { var builder = new StringBuilder(); - var ExpectedLogMessage = "We want to see this"; - var NotExpectedLogMessage = "We don't want to see this"; + var expectedLogMessage = "We want to see this"; + var notExpectedLogMessage = "We don't want to see this"; var hostBuilder = Host.CreateApplicationBuilder(); hostBuilder.Logging.ClearProviders(); @@ -33,8 +33,8 @@ public async Task Should_integrate_with_default_host_logging() hostBuilder.UseNServiceBus(endpointConfiguration); var logger = LogManager.GetLogger("TestLogger"); - logger.Warn(ExpectedLogMessage); - logger.Debug(NotExpectedLogMessage); + logger.Warn(expectedLogMessage); + logger.Debug(notExpectedLogMessage); var host = hostBuilder.Build(); @@ -43,8 +43,8 @@ public async Task Should_integrate_with_default_host_logging() await host.StartAsync(); var actual = builder.ToString(); - Assert.That(actual, Does.Contain(ExpectedLogMessage)); - Assert.That(actual, Does.Not.Contain(NotExpectedLogMessage)); + Assert.That(actual, Does.Contain(expectedLogMessage)); + Assert.That(actual, Does.Not.Contain(notExpectedLogMessage)); } finally { @@ -87,4 +87,4 @@ public ILogger CreateLogger(string categoryName) readonly StringBuilder builder; } } -} \ No newline at end of file +} diff --git a/src/AcceptanceTests/HostBuilder/When_logging_with_host_builder.cs b/src/AcceptanceTests/HostBuilder/When_logging_with_host_builder.cs index 268f5b9..9e632e7 100644 --- a/src/AcceptanceTests/HostBuilder/When_logging_with_host_builder.cs +++ b/src/AcceptanceTests/HostBuilder/When_logging_with_host_builder.cs @@ -18,8 +18,8 @@ public async Task Should_integrate_with_default_host_logging() { var builder = new StringBuilder(); - var ExpectedLogMessage = "We want to see this"; - var NotExpectedLogMessage = "We don't want to see this"; + var expectedLogMessage = "We want to see this"; + var notExpectedLogMessage = "We don't want to see this"; var host = Host.CreateDefaultBuilder() .ConfigureLogging(logging => @@ -31,8 +31,8 @@ public async Task Should_integrate_with_default_host_logging() .UseNServiceBus(hostBuilderContext => { var logger = LogManager.GetLogger("TestLogger"); - logger.Warn(ExpectedLogMessage); - logger.Debug(NotExpectedLogMessage); + logger.Warn(expectedLogMessage); + logger.Debug(notExpectedLogMessage); var endpointConfiguration = new EndpointConfiguration("NSBRepro"); endpointConfiguration.UseTransport(new LearningTransport { StorageDirectory = TestContext.CurrentContext.TestDirectory }); @@ -47,8 +47,8 @@ public async Task Should_integrate_with_default_host_logging() await host.StartAsync(); var actual = builder.ToString(); - Assert.That(actual, Does.Contain(ExpectedLogMessage)); - Assert.That(actual, Does.Not.Contain(NotExpectedLogMessage)); + Assert.That(actual, Does.Contain(expectedLogMessage)); + Assert.That(actual, Does.Not.Contain(notExpectedLogMessage)); } finally { @@ -91,4 +91,4 @@ public ILogger CreateLogger(string categoryName) readonly StringBuilder builder; } } -} \ No newline at end of file +}