Skip to content

Commit 02c30c8

Browse files
mus65Rob-Hague
andauthored
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 <rob.hague00@gmail.com> --------- Co-authored-by: Rob Hague <rob.hague00@gmail.com>
1 parent c318e39 commit 02c30c8

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

.editorconfig

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -456,22 +456,22 @@ dotnet_diagnostic.SA1601.severity = none
456456
# SA1648: <inheritdoc> must be used with inheriting class
457457
#
458458
# This rule is disabled by default, hence we need to explicitly enable it.
459-
dotnet_diagnostic.SA1648.severity = error
459+
dotnet_diagnostic.SA1648.severity = warning
460460

461461
# SX1101: Do not prefix local members with 'this.'
462462
#
463463
# This rule is disabled by default, hence we need to explicitly enable it.
464-
dotnet_diagnostic.SX1101.severity = error
464+
dotnet_diagnostic.SX1101.severity = warning
465465

466466
# SX1309: Field names must begin with underscore
467467
#
468468
# This rule is disabled by default, hence we need to explicitly enable it.
469-
dotnet_diagnostic.SX1309.severity = error
469+
dotnet_diagnostic.SX1309.severity = warning
470470

471471
# SX1309S: Static field names must begin with underscore
472472
#
473473
# This rule is disabled by default, hence we need to explicitly enable it.
474-
dotnet_diagnostic.SX1309S.severity = error
474+
dotnet_diagnostic.SX1309S.severity = warning
475475

476476
#### Meziantou.Analyzer rules ####
477477

@@ -608,7 +608,7 @@ MA0053.class_with_virtual_member_shoud_be_sealed = true
608608
# MA0112: Use 'Count > 0' instead of 'Any()'
609609
#
610610
# This rule is disabled by default, hence we need to explicitly enable it.
611-
dotnet_diagnostic.MA0112.severity = error
611+
dotnet_diagnostic.MA0112.severity = warning
612612

613613
# MA0165: Make interpolated string
614614
dotnet_diagnostic.MA0165.severity = none
@@ -646,7 +646,7 @@ dotnet_diagnostic.CA1008.severity = none
646646
#
647647
# Even when enabled, this diagnostic does not appear to be reported for assemblies without CLSCompliantAttribute.
648648
# We reported this issue as https://github.com/dotnet/roslyn-analyzers/issues/6563.
649-
dotnet_diagnostic.CA1014.severity = error
649+
dotnet_diagnostic.CA1014.severity = warning
650650

651651
# CA1051: Do not declare visible instance fields
652652
# 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
10031003

10041004
dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.symbols = private_fields
10051005
dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.style = camel_case_begins_with_underscore
1006-
dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.severity = error
1006+
dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.severity = warning
10071007

10081008
dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.symbols = private_static_fields
10091009
dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.style = camel_case_begins_with_underscore
1010-
dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.severity = error
1010+
dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.severity = warning
10111011

10121012
dotnet_naming_rule.private_static_readonly_fields_pascal_case.symbols = private_static_readonly_fields
10131013
dotnet_naming_rule.private_static_readonly_fields_pascal_case.style = pascal_case
1014-
dotnet_naming_rule.private_static_readonly_fields_pascal_case.severity = error
1014+
dotnet_naming_rule.private_static_readonly_fields_pascal_case.severity = warning
10151015

10161016
dotnet_naming_rule.private_const_fields_pascal_case.symbols = private_const_fields
10171017
dotnet_naming_rule.private_const_fields_pascal_case.style = pascal_case
1018-
dotnet_naming_rule.private_const_fields_pascal_case.severity = error
1018+
dotnet_naming_rule.private_const_fields_pascal_case.severity = warning
10191019

10201020
# Symbol specifications
10211021

@@ -1067,7 +1067,7 @@ dotnet_naming_style.camel_case_begins_with_underscore.capitalization = camel_cas
10671067
#### .NET Compiler Platform general options ####
10681068

10691069
# Change the default rule severity for all analyzer rules that are enabled by default
1070-
dotnet_analyzer_diagnostic.severity = error
1070+
dotnet_analyzer_diagnostic.severity = warning
10711071

10721072
#### .NET Compiler Platform code refactoring rules ####
10731073

Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1212
<LangVersion>latest</LangVersion>
1313
<WarningLevel>9999</WarningLevel>
14+
</PropertyGroup>
15+
16+
<PropertyGroup Condition="'$(Configuration)' == 'Release' Or '$(CI)' != ''">
1417
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1518
</PropertyGroup>
1619

global.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)