From 02c30c88a9b34eb9940f3fb87834bb51531fde89 Mon Sep 17 00:00:00 2001 From: mus65 Date: Sat, 29 Mar 2025 19:53:36 +0100 Subject: [PATCH] Only enable TreatWarningsAsErrors in Release (#1624) * Only enable TreatWarningsAsErrors in Release * Remove global.json this doesn't actually do anything useful like this. * Also check CI Co-authored-by: Rob Hague --------- Co-authored-by: Rob Hague --- .editorconfig | 22 +++++++++++----------- Directory.Build.props | 3 +++ global.json | 6 ------ 3 files changed, 14 insertions(+), 17 deletions(-) delete mode 100644 global.json diff --git a/.editorconfig b/.editorconfig index 61d024e1..ec2a1638 100644 --- a/.editorconfig +++ b/.editorconfig @@ -456,22 +456,22 @@ dotnet_diagnostic.SA1601.severity = none # SA1648: must be used with inheriting class # # This rule is disabled by default, hence we need to explicitly enable it. -dotnet_diagnostic.SA1648.severity = error +dotnet_diagnostic.SA1648.severity = warning # SX1101: Do not prefix local members with 'this.' # # This rule is disabled by default, hence we need to explicitly enable it. -dotnet_diagnostic.SX1101.severity = error +dotnet_diagnostic.SX1101.severity = warning # SX1309: Field names must begin with underscore # # This rule is disabled by default, hence we need to explicitly enable it. -dotnet_diagnostic.SX1309.severity = error +dotnet_diagnostic.SX1309.severity = warning # SX1309S: Static field names must begin with underscore # # This rule is disabled by default, hence we need to explicitly enable it. -dotnet_diagnostic.SX1309S.severity = error +dotnet_diagnostic.SX1309S.severity = warning #### Meziantou.Analyzer rules #### @@ -608,7 +608,7 @@ MA0053.class_with_virtual_member_shoud_be_sealed = true # MA0112: Use 'Count > 0' instead of 'Any()' # # This rule is disabled by default, hence we need to explicitly enable it. -dotnet_diagnostic.MA0112.severity = error +dotnet_diagnostic.MA0112.severity = warning # MA0165: Make interpolated string dotnet_diagnostic.MA0165.severity = none @@ -646,7 +646,7 @@ dotnet_diagnostic.CA1008.severity = none # # Even when enabled, this diagnostic does not appear to be reported for assemblies without CLSCompliantAttribute. # We reported this issue as https://github.com/dotnet/roslyn-analyzers/issues/6563. -dotnet_diagnostic.CA1014.severity = error +dotnet_diagnostic.CA1014.severity = warning # CA1051: Do not declare visible instance fields # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1051 @@ -1003,19 +1003,19 @@ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.symbols = private_fields dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.style = camel_case_begins_with_underscore -dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.severity = error +dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.severity = warning dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.symbols = private_static_fields dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.style = camel_case_begins_with_underscore -dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.severity = error +dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.severity = warning dotnet_naming_rule.private_static_readonly_fields_pascal_case.symbols = private_static_readonly_fields dotnet_naming_rule.private_static_readonly_fields_pascal_case.style = pascal_case -dotnet_naming_rule.private_static_readonly_fields_pascal_case.severity = error +dotnet_naming_rule.private_static_readonly_fields_pascal_case.severity = warning dotnet_naming_rule.private_const_fields_pascal_case.symbols = private_const_fields dotnet_naming_rule.private_const_fields_pascal_case.style = pascal_case -dotnet_naming_rule.private_const_fields_pascal_case.severity = error +dotnet_naming_rule.private_const_fields_pascal_case.severity = warning # Symbol specifications @@ -1067,7 +1067,7 @@ dotnet_naming_style.camel_case_begins_with_underscore.capitalization = camel_cas #### .NET Compiler Platform general options #### # Change the default rule severity for all analyzer rules that are enabled by default -dotnet_analyzer_diagnostic.severity = error +dotnet_analyzer_diagnostic.severity = warning #### .NET Compiler Platform code refactoring rules #### diff --git a/Directory.Build.props b/Directory.Build.props index 7c214d4b..bdc86d3a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -11,6 +11,9 @@ true latest 9999 + + + true diff --git a/global.json b/global.json deleted file mode 100644 index f6578894..00000000 --- a/global.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "sdk": { - "version": "9.0.100", - "rollForward": "latestMajor" - } -}