Sitelet https://github.com/microsoft/vstest/commit/474bfe5b70cff3ac11da1940c35e616a22d713af
Skip to content

Commit 474bfe5

Browse files
nohwndCopilot
andauthored
Reduce code style rule severity from warning to suggestion (#15522)
Downgrade purely cosmetic IDE rules from warning to suggestion so they no longer break the build via TreatWarningsAsErrors. Rules that catch real bugs (IDE0043, IDE0059, IDE0060, IDE0076, IDE0077, IDE0064, etc.) remain as warnings. Rules changed to suggestion: - IDE0005 (unnecessary using) - IDE0019/IDE0020/IDE0078/IDE0083 (pattern matching style) - IDE0053 (expression body for lambdas) - IDE0055 (formatting) - IDE0063 (simple using statement) - IDE0065 (using directive placement) - IDE0073 (file header) - IDE0074 (compound assignment) - IDE0090 (simplify new expression) Fixes #15460 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent beaf5c6 commit 474bfe5

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

‎.editorconfig‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
101101
dotnet_style_prefer_simplified_interpolation = true:suggestion
102102

103103
# IDE0074: Use compound assignment
104-
dotnet_style_prefer_compound_assignment = true:warning # not default, default is true:suggestion, increased severity to ensure it is used
105-
dotnet_diagnostic.IDE0074.severity = warning # not default, set in accordance to previous setting
104+
dotnet_style_prefer_compound_assignment = true:suggestion # not default, reduced from warning to suggestion to avoid breaking builds on style issues
105+
dotnet_diagnostic.IDE0074.severity = suggestion # not default, set in accordance to previous setting
106106

107107
# IDE0032: Use auto property
108108
dotnet_style_prefer_auto_properties = true:suggestion # not default, default is true:suggestion, increased severity to ensure it is used
@@ -120,18 +120,18 @@ dotnet_diagnostic.IDE0060.severity = warning
120120
dotnet_remove_unnecessary_suppression_exclusions = none
121121

122122
# IDE0090: Use 'new(...)'
123-
dotnet_diagnostic.IDE0090.severity = warning # not default, increased severity to go with simpler declarations
123+
dotnet_diagnostic.IDE0090.severity = suggestion # not default, reduced from warning to suggestion to avoid breaking builds on style issues
124124

125125
# IDE0005: Remove unnecessary import
126-
dotnet_diagnostic.IDE0005.severity = warning # not default, increased severity to ensure it is used
126+
dotnet_diagnostic.IDE0005.severity = suggestion # not default, reduced from warning to suggestion to avoid breaking builds on style issues
127127

128128
# 'using' directive preferences
129129
# Keep this in sync with the related C# rule: csharp_using_directive_placement
130-
dotnet_diagnostic.IDE0065.severity = warning
130+
dotnet_diagnostic.IDE0065.severity = suggestion
131131

132132
# Use simple using statements
133133
# Keep this in sync with th related C# rule: csharp_prefer_simple_using_statement
134-
dotnet_diagnostic.IDE0063.severity = warning
134+
dotnet_diagnostic.IDE0063.severity = suggestion
135135

136136
# CA2208: Instantiate argument exceptions correctly
137137
dotnet_diagnostic.CA2208.severity = warning # not default, increased severity to ensure it is always applied
@@ -141,7 +141,7 @@ dotnet_diagnostic.CA2241.severity = warning # not default, increased severity to
141141

142142
# IDE0053: Use expression body for lambda expressions
143143
# Keep this in sync with csharp_style_expression_bodied_lambdas
144-
dotnet_diagnostic.IDE0053.severity = warning # not default, increased severity to ensure it is applied
144+
dotnet_diagnostic.IDE0053.severity = suggestion # not default, reduced from warning to suggestion to avoid breaking builds on style issues
145145

146146
# CA2016: Forward the 'CancellationToken' parameter to methods
147147
dotnet_diagnostic.CA2016.severity = warning # not default, increased severity to ensure it is applied
@@ -172,19 +172,19 @@ dotnet_diagnostic.CA2215.severity=warning # not default, increased severity to e
172172

173173
# IDE0019: Use pattern matching
174174
# Keep this in sync with csharp_style_pattern_matching_over_as_with_null_check
175-
dotnet_diagnostic.IDE0019.severity = warning # not default, increased severity to ensure it is applied
175+
dotnet_diagnostic.IDE0019.severity = suggestion # not default, reduced from warning to suggestion to avoid breaking builds on style issues
176176

177177
# IDE0020:
178178
# Keep this in sync with csharp_style_pattern_matching_over_is_with_cast_check
179-
dotnet_diagnostic.IDE0020.severity = warning # not default, increased severity to ensure it is applied
179+
dotnet_diagnostic.IDE0020.severity = suggestion # not default, reduced from warning to suggestion to avoid breaking builds on style issues
180180

181181
# IDE0078: Use pattern matching
182182
# Keep this in sync with csharp_style_prefer_pattern_matching
183-
dotnet_diagnostic.IDE0078.severity = warning # not default, increased severity to ensure it is applied
183+
dotnet_diagnostic.IDE0078.severity = suggestion # not default, reduced from warning to suggestion to avoid breaking builds on style issues
184184

185185
# IDE0083: Use pattern matching (not operator)
186186
# Keep this in sync with csharp_style_prefer_not_pattern
187-
dotnet_diagnostic.IDE0083.severity = warning # not default, increased severity to ensure it is applied
187+
dotnet_diagnostic.IDE0083.severity = suggestion # not default, reduced from warning to suggestion to avoid breaking builds on style issues
188188

189189
# CA1836: Prefer IsEmpty over Count
190190
dotnet_diagnostic.CA1836.severity = warning # not default, increased severity to ensure it is applied
@@ -278,22 +278,22 @@ csharp_style_expression_bodied_accessors = true:silent
278278
csharp_style_expression_bodied_constructors = false:silent
279279
csharp_style_expression_bodied_indexers = true:silent
280280
# Keep this in sync with IDE0053
281-
csharp_style_expression_bodied_lambdas = true:warning # not default, increased severity to ensure it is applied
281+
csharp_style_expression_bodied_lambdas = true:suggestion # not default, reduced from warning to suggestion
282282
csharp_style_expression_bodied_local_functions = false:silent
283283
csharp_style_expression_bodied_methods = false:silent
284284
csharp_style_expression_bodied_operators = false:silent
285285
csharp_style_expression_bodied_properties = true:silent
286286

287287
# Pattern matching preferences
288288
# Keep this in sync with IDE0019
289-
csharp_style_pattern_matching_over_as_with_null_check = true:warning
289+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
290290
# Keep this in sync with IDE0020 and IDE0038
291-
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
291+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
292292
# Keep this in sync with IDE0083
293-
csharp_style_prefer_not_pattern = true:warning
293+
csharp_style_prefer_not_pattern = true:suggestion
294294
# Keep this in sync with IDE0078
295-
csharp_style_prefer_pattern_matching = true:warning
296-
csharp_style_prefer_switch_expression = true:warning
295+
csharp_style_prefer_pattern_matching = true:suggestion
296+
csharp_style_prefer_switch_expression = true:suggestion
297297

298298
# Null-checking preferences
299299
csharp_style_conditional_delegate_call = true:suggestion
@@ -305,7 +305,7 @@ csharp_preferred_modifier_order = public,private,protected,internal,static,exter
305305
# Code-block preferences
306306
csharp_prefer_braces = true:silent
307307
# Keep this in sync with the related .NET rule: IDE0063
308-
csharp_prefer_simple_using_statement = true:warning # not default, default is true:suggestion, increased severity to ensure it is used
308+
csharp_prefer_simple_using_statement = true:suggestion # not default, reduced from warning to suggestion
309309

310310
# Expression-level preferences
311311
csharp_prefer_simple_default_expression = true:suggestion
@@ -320,7 +320,7 @@ csharp_style_unused_value_expression_statement_preference = discard_variable:sil
320320

321321
# 'using' directive preferences
322322
# Keep this in sync with the related .NET rule: IDE0065
323-
csharp_using_directive_placement = outside_namespace:warning
323+
csharp_using_directive_placement = outside_namespace:suggestion
324324

325325
# IDE0190: Null check can be simplified
326326
# Keep this in sync with the related .NET rule: IDE0190
@@ -329,7 +329,7 @@ csharp_style_prefer_parameter_null_checking = false # not default, disabled as n
329329
#### .NET Formatting Rules ####
330330

331331
# IDE0055: Fix formatting - Set the severity of all .NET and C# formatting rules (https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules)
332-
dotnet_diagnostic.IDE0055.severity = warning # ensure all formatting rules are enforced on build
332+
dotnet_diagnostic.IDE0055.severity = suggestion # reduced from warning to suggestion to avoid breaking builds on formatting issues
333333

334334
# IDE0057: Use range operator
335335
dotnet_diagnostic.IDE0057.severity = none # Range operator is not supported in some TFMs.
@@ -393,7 +393,7 @@ dotnet_diagnostic.IDE0052.severity = silent
393393

394394
# IDE1006: Naming Styles
395395
dotnet_diagnostic.IDE1006.severity = warning
396-
dotnet_diagnostic.IDE0073.severity = warning
396+
dotnet_diagnostic.IDE0073.severity = suggestion
397397

398398
# Naming rules
399399

0 commit comments

Comments
 (0)