@@ -10,9 +10,19 @@ 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
24
+
25
+ # TODO: Fix silenced and suggested rules!
16
26
17
27
# CS0168: The variable 'var' is declared but never used
18
28
dotnet_diagnostic.CS0168.severity = error
@@ -22,8 +32,43 @@ dotnet_diagnostic.CS0169.severity = error
22
32
dotnet_diagnostic.CS0219.severity = error
23
33
# CS0414: The private field 'field' is assigned but its value is never used
24
34
dotnet_diagnostic.CS0414.severity = error
35
+ # CS0618: A class member was marked with the Obsolete attribute
36
+ dotnet_diagnostic.CS0618.severity = suggestion
37
+ # CS0649: Uninitialized private or internal field declaration that is never assigned a value
38
+ dotnet_diagnostic.CS0649.severity = error
39
+ # CS1570: Parameter has no matching param tag in the XML comment
40
+ dotnet_diagnostic.CS1570.severity = silent
41
+ # CS1574: XML comment has cref attribute that could not be resolved.
42
+ dotnet_diagnostic.CS1574.severity = silent
43
+ # CS1591: Missing XML comment for publicly visible type or member
44
+ dotnet_diagnostic.CS1591.severity = silent
45
+ # CS1998: This async method lacks 'await' operators and will run synchronously
46
+ dotnet_diagnostic.CS1998.severity = suggestion
47
+ # CS4014: Consider applying the await operator to the result of the call
48
+ dotnet_diagnostic.CS4014.severity = suggestion
49
+
50
+ # CA1067: Should override Equals because it implements IEquatable<T>
51
+ dotnet_diagnostic.CA1067.severity = silent
25
52
# CA1068: CancellationToken parameters must come last
26
53
dotnet_diagnostic.CA1068.severity = error
54
+ # CA1501: Avoid excessive inheritance
55
+ dotnet_diagnostic.CA1501.severity = error
56
+ # CA1502: Avoid excessive complexity
57
+ dotnet_diagnostic.CA1502.severity = warning
58
+ # CA1505: Avoid unmaintainable code
59
+ dotnet_diagnostic.CA1505.severity = error
60
+ # CA1506: Avoid excessive class coupling
61
+ dotnet_diagnostic.CA1506.severity = warning
62
+ # CA1507: Use nameof in place of string
63
+ dotnet_diagnostic.CA1507.severity = error
64
+ # CA1508: Avoid dead conditional code
65
+ dotnet_diagnostic.CA1508.severity = error
66
+ # CA1802: Use Literals Where Appropriate
67
+ dotnet_diagnostic.CA1802.severity = error
68
+ # CA1805: Do not initialize unnecessarily.
69
+ dotnet_diagnostic.CA1805.severity = error
70
+ # CA1820: Test for empty strings using string length
71
+ dotnet_diagnostic.CA1820.severity = error
27
72
# CA1822: Mark members as static
28
73
dotnet_diagnostic.CA1822.severity = error
29
74
# CA1823: Avoid unused private fields
@@ -32,34 +77,27 @@ dotnet_diagnostic.CA1823.severity = error
32
77
dotnet_diagnostic.CA2007.severity = error
33
78
# CA2016: Forward the CancellationToken parameter to methods that take one
34
79
dotnet_diagnostic.CA2016.severity = error
80
+ # CA2213: Disposable fields should be disposed
81
+ dotnet_diagnostic.CA2213.severity = error
82
+ # CA2254: The logging message template should not vary between calls to 'LoggerExtensions.*'
83
+ dotnet_diagnostic.CA2254.severity = silent
35
84
36
- # TODO: Enable all maintainability issues (dead code etc.) and enforce
37
- # See: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/maintainability-warnings
38
- dotnet_analyzer_diagnostic.category-Maintainability.severity = error
39
-
40
- # TODO: Fix all of these issues and explicitly ignore the intentional ones!
41
-
42
- # CA2016: Forward the CancellationToken parameter to methods that take one
43
- dotnet_diagnostic.CA2016.severity = suggestion
44
- # CS0618: A class member was marked with the Obsolete attribute
45
- dotnet_diagnostic.CS0618.severity = suggestion
46
- # CS0649: Uninitialized private or internal field declaration that is never assigned a value
47
- dotnet_diagnostic.CS0649.severity = suggestion
48
- # CS1998: This async method lacks 'await' operators and will run synchronously
49
- dotnet_diagnostic.CS1998.severity = suggestion
50
- # CS4014: Consider applying the await operator to the result of the call
51
- dotnet_diagnostic.CS4014.severity = suggestion
52
-
85
+ # RCS1049: Simplify boolean comparison
86
+ dotnet_diagnostic.RCS1049.severity = error
53
87
# RCS1102: Make class static
54
- dotnet_diagnostic.RCS1102.severity = suggestion
88
+ dotnet_diagnostic.RCS1102.severity = error
55
89
# RCS1139: Add summary element to documentation comment
56
- dotnet_diagnostic.RCS1139.severity = suggestion
90
+ dotnet_diagnostic.RCS1139.severity = silent
57
91
# RCS1194: Implement exception constructors
58
92
dotnet_diagnostic.RCS1194.severity = suggestion
59
93
# RCS1210: Return completed task instead of returning null
60
- dotnet_diagnostic.RCS1210.severity = suggestion
94
+ dotnet_diagnostic.RCS1210.severity = error
95
+ # RCS1036: Remove unnecessary blank line
96
+ dotnet_diagnostic.RCS1036.severity = error
61
97
# RCS1075: Avoid empty catch clause that catches System.Exception
62
98
dotnet_diagnostic.RCS1075.severity = suggestion
99
+ # RCS1170: Use read-only auto-implemented property
100
+ dotnet_diagnostic.RCS1170.severity = error
63
101
64
102
# VSTHRD002: Avoid problematic synchronous waits
65
103
dotnet_diagnostic.VSTHRD002.severity = suggestion
@@ -74,14 +112,120 @@ dotnet_diagnostic.VSTHRD103.severity = suggestion
74
112
# VSTHRD110: Observe result of async calls
75
113
dotnet_diagnostic.VSTHRD110.severity = suggestion
76
114
# VSTHRD114: Avoid returning a null Task
77
- dotnet_diagnostic.VSTHRD114.severity = suggestion
115
+ dotnet_diagnostic.VSTHRD114.severity = error
78
116
# VSTHRD200: Use "Async" suffix for awaitable methods
79
- dotnet_diagnostic.VSTHRD200.severity = suggestion
117
+ dotnet_diagnostic.VSTHRD200.severity = silent
80
118
81
- # 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
119
+ # IDE0001: Simplify name
120
+ dotnet_diagnostic.IDE0001.severity = error
121
+ # IDE0002: Simplify member access
122
+ dotnet_diagnostic.IDE0001.severity = error
123
+ # IDE0003: Remove this or Me qualification
124
+ dotnet_diagnostic.IDE0003.severity = error
125
+ # IDE0004: Remove unnecessary cast
126
+ dotnet_diagnostic.IDE0004.severity = error
127
+ # IDE0005: Remove unnecessary import
128
+ dotnet_diagnostic.IDE0005.severity = error
129
+ # IDE0008: Use explicit type instead of var
130
+ dotnet_diagnostic.IDE0008.severity = error
131
+ # IDE0011: Add braces
132
+ dotnet_diagnostic.IDE0011.severity = error
133
+ # IDE0016: Use throw expression
134
+ dotnet_diagnostic.IDE0016.severity = error
135
+ # IDE0017: Use object initializers
136
+ dotnet_diagnostic.IDE0017.severity = error
137
+ # IDE0018: Inline variable declaration
138
+ dotnet_diagnostic.IDE0018.severity = error
139
+ # IDE0019: Use pattern matching to avoid 'as' followed by a 'null' check
140
+ dotnet_diagnostic.IDE0019.severity = error
141
+ # IDE0020: Use pattern matching to avoid 'is' check followed by a cast (with variable)
142
+ dotnet_diagnostic.IDE0020.severity = error
143
+ # IDE0021: Use expression body for constructors
144
+ dotnet_diagnostic.IDE0021.severity = error
145
+ # IDE0022: Use expression body for methods
146
+ dotnet_diagnostic.IDE0022.severity = error
147
+ # IDE0023: Use expression body for conversion operators
148
+ dotnet_diagnostic.IDE0023.severity = error
149
+ # IDE0024: Use expression body for operators
150
+ dotnet_diagnostic.IDE0024.severity = error
151
+ # IDE0025: Use expression body for properties
152
+ dotnet_diagnostic.IDE0025.severity = error
153
+ # IDE0026: Use expression body for indexers
154
+ dotnet_diagnostic.IDE0026.severity = error
155
+ # IDE0027: Use expression body for accessors
156
+ dotnet_diagnostic.IDE0027.severity = error
157
+ # IDE0028: Use collection initializers
158
+ dotnet_diagnostic.IDE0028.severity = suggestion
159
+ # IDE0029: Use coalesce expression (non-nullable types)
160
+ dotnet_diagnostic.IDE0029.severity = error
161
+ # IDE0030: Use coalesce expression (nullable types)
162
+ dotnet_diagnostic.IDE0030.severity = error
163
+ # IDE0031: Use null propagation
164
+ dotnet_diagnostic.IDE0031.severity = error
165
+ # IDE0032: Use auto property
166
+ dotnet_diagnostic.IDE0032.severity = error
167
+ # IDE0033: Use explicitly provided tuple name
168
+ dotnet_diagnostic.IDE0033.severity = error
169
+ # IDE0034: Simplify 'default' expression
170
+ dotnet_diagnostic.IDE0034.severity = error
171
+ # IDE0035: Remove unreachable code
172
+ dotnet_diagnostic.IDE0035.severity = error
173
+ # IDE0036: Order modifiers
174
+ dotnet_diagnostic.IDE0036.severity = error
175
+ # IDE0037: Use inferred member name
176
+ dotnet_diagnostic.IDE0037.severity = error
177
+ # IDE0038: Use pattern matching to avoid is check followed by a cast (without variable)
178
+ dotnet_diagnostic.IDE0038.severity = error
179
+ # IDE0040: Add accessibility modifiers
180
+ dotnet_diagnostic.IDE0040.severity = error
181
+ # IDE0041: Use is null check
182
+ dotnet_diagnostic.IDE0041.severity = error
183
+ # IDE0042: Deconstruct variable declaration
184
+ dotnet_diagnostic.IDE0042.severity = error
185
+ # IDE0044: Add readonly modifier
186
+ dotnet_diagnostic.IDE0044.severity = error
187
+ # IDE0045: Use conditional expression for assignment
188
+ dotnet_diagnostic.IDE0045.severity = error
189
+ # IDE0046: Use conditional expression for return
190
+ dotnet_diagnostic.IDE0046.severity = silent
191
+ # IDE0047: Remove unnecessary parentheses
192
+ dotnet_diagnostic.IDE0047.severity = error
193
+ # IDE0049: Use language keywords instead of framework type names for type references
194
+ dotnet_diagnostic.IDE0049.severity = error
195
+ # IDE0051: Remove unused private member
196
+ dotnet_diagnostic.IDE0051.severity = error
197
+ # IDE0052: Remove unread private member
198
+ dotnet_diagnostic.IDE0052.severity = error
199
+ # IDE0053: Use expression body for lambdas
200
+ dotnet_diagnostic.IDE0053.severity = error
201
+ # IDE0054: Use compound assignment
202
+ dotnet_diagnostic.IDE0054.severity = error
203
+ # IDE0059: Unnecessary assignment of a value
204
+ dotnet_diagnostic.IDE0059.severity = error
205
+ # IDE0063: Use simple 'using' statement
206
+ dotnet_diagnostic.IDE0063.severity = error
207
+ # IDE0066: Use switch expression
208
+ dotnet_diagnostic.IDE0066.severity = error
209
+ # IDE0071: Simplify interpolation
210
+ dotnet_diagnostic.IDE0071.severity = error
211
+ # IDE0073: Require file header
212
+ dotnet_diagnostic.IDE0073.severity = error
213
+ # IDE0075: Simplify conditional expression
214
+ dotnet_diagnostic.IDE0075.severity = error
215
+ # IDE0078: Use pattern matching
216
+ dotnet_diagnostic.IDE0078.severity = error
217
+ # IDE0082: Convert typeof to nameof
218
+ dotnet_diagnostic.IDE0082.severity = error
219
+ # IDE0083: Use pattern matching (not operator)
220
+ dotnet_diagnostic.IDE0083.severity = error
221
+ # IDE0090: Simplify new expression
222
+ dotnet_diagnostic.IDE0090.severity = suggestion
223
+ # IDE0100: Remove unnecessary equality operator
224
+ dotnet_diagnostic.IDE0100.severity = error
225
+ # IDE0110: Remove unnecessary discard
226
+ dotnet_diagnostic.IDE0110.severity = error
227
+ # IDE1005: Use conditional delegate call
228
+ dotnet_diagnostic.IDE1005.severity = error
85
229
86
230
[* .{json} ]
87
231
indent_size = 2
0 commit comments