@@ -10,9 +10,17 @@ insert_final_newline = true
10
10
[* .{cs} ]
11
11
indent_size = 4
12
12
trim_trailing_whitespace = true
13
+ file_header_template = Copyright (c) Microsoft Corporation.\nLicensed under the MIT License.
13
14
csharp_space_before_open_square_brackets = true
14
15
csharp_space_after_keywords_in_control_flow_statements = true
15
16
csharp_space_before_open_square_brackets = false
17
+ csharp_style_expression_bodied_constructors = when_on_single_line
18
+ csharp_style_expression_bodied_methods = when_on_single_line
19
+ csharp_style_expression_bodied_operators = when_on_single_line
20
+ csharp_style_expression_bodied_properties = true
21
+ csharp_style_expression_bodied_indexers = true
22
+ csharp_style_expression_bodied_accessors = true
23
+ csharp_style_expression_bodied_lambdas = when_on_single_line
16
24
17
25
# CS0168: The variable 'var' is declared but never used
18
26
dotnet_diagnostic.CS0168.severity = error
@@ -22,6 +30,8 @@ dotnet_diagnostic.CS0169.severity = error
22
30
dotnet_diagnostic.CS0219.severity = error
23
31
# CS0414: The private field 'field' is assigned but its value is never used
24
32
dotnet_diagnostic.CS0414.severity = error
33
+ # CA1067: Should override Equals because it implements IEquatable<T>
34
+ dotnet_diagnostic.CA1067.severity = silent
25
35
# CA1068: CancellationToken parameters must come last
26
36
dotnet_diagnostic.CA1068.severity = error
27
37
# CA1822: Mark members as static
@@ -32,6 +42,8 @@ dotnet_diagnostic.CA1823.severity = error
32
42
dotnet_diagnostic.CA2007.severity = error
33
43
# CA2016: Forward the CancellationToken parameter to methods that take one
34
44
dotnet_diagnostic.CA2016.severity = error
45
+ # CA2254: The logging message template should not vary between calls to 'LoggerExtensions.*'
46
+ dotnet_diagnostic.CA2254.severity = silent
35
47
36
48
# TODO: Enable all maintainability issues (dead code etc.) and enforce
37
49
# See: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/maintainability-warnings
@@ -40,26 +52,30 @@ dotnet_analyzer_diagnostic.category-Maintainability.severity = error
40
52
# TODO: Fix all of these issues and explicitly ignore the intentional ones!
41
53
42
54
# CA2016: Forward the CancellationToken parameter to methods that take one
43
- dotnet_diagnostic.CA2016.severity = suggestion
55
+ dotnet_diagnostic.CA2016.severity = error
44
56
# CS0618: A class member was marked with the Obsolete attribute
45
57
dotnet_diagnostic.CS0618.severity = suggestion
46
58
# CS0649: Uninitialized private or internal field declaration that is never assigned a value
47
- dotnet_diagnostic.CS0649.severity = suggestion
59
+ dotnet_diagnostic.CS0649.severity = warning
48
60
# CS1998: This async method lacks 'await' operators and will run synchronously
49
61
dotnet_diagnostic.CS1998.severity = suggestion
50
62
# CS4014: Consider applying the await operator to the result of the call
51
63
dotnet_diagnostic.CS4014.severity = suggestion
52
64
53
65
# RCS1102: Make class static
54
- dotnet_diagnostic.RCS1102.severity = suggestion
66
+ dotnet_diagnostic.RCS1102.severity = warning
55
67
# RCS1139: Add summary element to documentation comment
56
68
dotnet_diagnostic.RCS1139.severity = suggestion
57
69
# RCS1194: Implement exception constructors
58
70
dotnet_diagnostic.RCS1194.severity = suggestion
59
71
# RCS1210: Return completed task instead of returning null
60
72
dotnet_diagnostic.RCS1210.severity = suggestion
73
+ # RCS1036: Remove unnecessary blank line
74
+ dotnet_diagnostic.RCS1036.severity = warning
61
75
# RCS1075: Avoid empty catch clause that catches System.Exception
62
76
dotnet_diagnostic.RCS1075.severity = suggestion
77
+ # RCS1170: Use read-only auto-implemented property
78
+ dotnet_diagnostic.RCS1170.severity = warning
63
79
64
80
# VSTHRD002: Avoid problematic synchronous waits
65
81
dotnet_diagnostic.VSTHRD002.severity = suggestion
@@ -79,9 +95,118 @@ dotnet_diagnostic.VSTHRD114.severity = suggestion
79
95
dotnet_diagnostic.VSTHRD200.severity = suggestion
80
96
81
97
# xUnit2013: Do not use equality check to check for collection size
82
- dotnet_diagnostic.xUnit2013.severity = suggestion
83
- # IDE0003: this and Me preferences
84
- dotnet_diagnostic.IDE0003.severity = suggestion
98
+ dotnet_diagnostic.xUnit2013.severity = warning
99
+ # xUnit1004: Test methods should not be skipped
100
+ dotnet_diagnostic.xUnit1004.severity = suggestion
101
+
102
+ # IDE0001: Simplify name
103
+ dotnet_diagnostic.IDE0001.severity = warning
104
+ # IDE0002: Simplify member access
105
+ dotnet_diagnostic.IDE0001.severity = warning
106
+ # IDE0003: Remove this or Me qualification
107
+ dotnet_diagnostic.IDE0003.severity = warning
108
+ # IDE0004: Remove unnecessary cast
109
+ dotnet_diagnostic.IDE0004.severity = warning
110
+ # IDE0005: Remove unnecessary import
111
+ dotnet_diagnostic.IDE0005.severity = suggestion
112
+ # IDE0008: Use explicit type instead of var
113
+ dotnet_diagnostic.IDE0008.severity = warning
114
+ # IDE0011: Add braces
115
+ dotnet_diagnostic.IDE0011.severity = warning
116
+ # IDE0016: Use throw expression
117
+ dotnet_diagnostic.IDE0016.severity = warning
118
+ # IDE0017: Use object initializers
119
+ dotnet_diagnostic.IDE0017.severity = warning
120
+ # IDE0018: Inline variable declaration
121
+ dotnet_diagnostic.IDE0018.severity = warning
122
+ # IDE0019: Use pattern matching to avoid 'as' followed by a 'null' check
123
+ dotnet_diagnostic.IDE0019.severity = warning
124
+ # IDE0020: Use pattern matching to avoid 'is' check followed by a cast (with variable)
125
+ dotnet_diagnostic.IDE0020.severity = warning
126
+ # IDE0021: Use expression body for constructors
127
+ dotnet_diagnostic.IDE0021.severity = warning
128
+ # IDE0022: Use expression body for methods
129
+ dotnet_diagnostic.IDE0022.severity = warning
130
+ # IDE0023: Use expression body for conversion operators
131
+ dotnet_diagnostic.IDE0023.severity = warning
132
+ # IDE0024: Use expression body for operators
133
+ dotnet_diagnostic.IDE0024.severity = warning
134
+ # IDE0025: Use expression body for properties
135
+ dotnet_diagnostic.IDE0025.severity = warning
136
+ # IDE0026: Use expression body for indexers
137
+ dotnet_diagnostic.IDE0026.severity = warning
138
+ # IDE0027: Use expression body for accessors
139
+ dotnet_diagnostic.IDE0027.severity = warning
140
+ # IDE0028: Use collection initializers
141
+ dotnet_diagnostic.IDE0028.severity = warning
142
+ # IDE0029: Use coalesce expression (non-nullable types)
143
+ dotnet_diagnostic.IDE0029.severity = warning
144
+ # IDE0030: Use coalesce expression (nullable types)
145
+ dotnet_diagnostic.IDE0030.severity = warning
146
+ # IDE0031: Use null propagation
147
+ dotnet_diagnostic.IDE0031.severity = warning
148
+ # IDE0032: Use auto property
149
+ dotnet_diagnostic.IDE0032.severity = warning
150
+ # IDE0033: Use explicitly provided tuple name
151
+ dotnet_diagnostic.IDE0033.severity = warning
152
+ # IDE0034: Simplify 'default' expression
153
+ dotnet_diagnostic.IDE0034.severity = warning
154
+ # IDE0035: Remove unreachable code
155
+ dotnet_diagnostic.IDE0035.severity = warning
156
+ # IDE0036: Order modifiers
157
+ dotnet_diagnostic.IDE0036.severity = warning
158
+ # IDE0037: Use inferred member name
159
+ dotnet_diagnostic.IDE0037.severity = warning
160
+ # IDE0038: Use pattern matching to avoid is check followed by a cast (without variable)
161
+ dotnet_diagnostic.IDE0038.severity = suggestion
162
+ # IDE0040: Add accessibility modifiers
163
+ dotnet_diagnostic.IDE0040.severity = warning
164
+ # IDE0041: Use is null check
165
+ dotnet_diagnostic.IDE0041.severity = warning
166
+ # IDE0042: Deconstruct variable declaration
167
+ dotnet_diagnostic.IDE0042.severity = warning
168
+ # IDE0044: Add readonly modifier
169
+ dotnet_diagnostic.IDE0044.severity = warning
170
+ # IDE0045: Use conditional expression for assignment
171
+ dotnet_diagnostic.IDE0045.severity = warning
172
+ # IDE0046: Use conditional expression for return
173
+ dotnet_diagnostic.IDE0046.severity = silent
174
+ # IDE0047: Remove unnecessary parentheses
175
+ dotnet_diagnostic.IDE0047.severity = warning
176
+ # IDE0049: Use language keywords instead of framework type names for type references
177
+ dotnet_diagnostic.IDE0049.severity = warning
178
+ # IDE0051: Remove unused private member
179
+ dotnet_diagnostic.IDE0051.severity = warning
180
+ # IDE0052: Remove unread private member
181
+ dotnet_diagnostic.IDE0052.severity = suggestion
182
+ # IDE0053: Use expression body for lambdas
183
+ dotnet_diagnostic.IDE0053.severity = warning
184
+ # IDE0054: Use compound assignment
185
+ dotnet_diagnostic.IDE0054.severity = warning
186
+ # IDE0063: Use simple 'using' statement
187
+ dotnet_diagnostic.IDE0063.severity = warning
188
+ # IDE0066: Use switch expression
189
+ dotnet_diagnostic.IDE0066.severity = warning
190
+ # IDE0071: Simplify interpolation
191
+ dotnet_diagnostic.IDE0071.severity = warning
192
+ # IDE0073: Require file header
193
+ dotnet_diagnostic.IDE0073.severity = warning
194
+ # IDE0075: Simplify conditional expression
195
+ dotnet_diagnostic.IDE0075.severity = warning
196
+ # IDE0078: Use pattern matching
197
+ dotnet_diagnostic.IDE0078.severity = warning
198
+ # IDE0082: Convert typeof to nameof
199
+ dotnet_diagnostic.IDE0082.severity = warning
200
+ # IDE0083: Use pattern matching (not operator)
201
+ dotnet_diagnostic.IDE0083.severity = warning
202
+ # IDE0090: Simplify new expression
203
+ dotnet_diagnostic.IDE0090.severity = warning
204
+ # IDE0100: Remove unnecessary equality operator
205
+ dotnet_diagnostic.IDE0100.severity = warning
206
+ # IDE0110: Remove unnecessary discard
207
+ dotnet_diagnostic.IDE0110.severity = warning
208
+ # IDE1005: Use conditional delegate call
209
+ dotnet_diagnostic.IDE1005.severity = warning
85
210
86
211
[* .{json} ]
87
212
indent_size = 2
0 commit comments