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