-
Notifications
You must be signed in to change notification settings - Fork 3
/
.editorconfig
313 lines (221 loc) · 11.1 KB
/
.editorconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# See https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
# for C# defaults.
# Set this to the top-most EditorConfig file.
root = true
# Use spaces for indentation.
[*]
indent_style = space
# XML project and config files.
[*.csproj]
indent_size = 2
# C# code.
[*.cs]
# Configure indentation, new lines and encoding.
charset = utf-8-bom
end_of_line = crlf
indent_size = 4
max_line_length = 100
insert_final_newline = true
trim_trailing_whitespace = true
# Prefer file-scope namespace declarations.
csharp_style_namespace_declarations = file_scoped:warning
# Ensure using statements are placed before namespace definitions to avoid name conflicts.
csharp_using_directive_placement = outside_namespace:warning
# Warn when initialising variables to their default value.
dotnet_diagnostic.CA1805.severity = warning
# Ensure that specific exception types are raised.
dotnet_diagnostic.CA2201.severity = warning
# Ensure that unused imports are reported.
dotnet_diagnostic.CS8019.severity = warning
# Name can be simplified (to ensure unnecessary generics are omitted).
dotnet_diagnostic.IDE0001.severity = warning
# Ensure that unnecessary casts are reported.
dotnet_diagnostic.IDE0004.severity = warning
# Ensure that namespaces match their folder structure.
dotnet_diagnostic.IDE0130.severity = warning
# --------------------------------------------------------------------------------------------------
# StyleCop
# --------------------------------------------------------------------------------------------------
# Disable a requirement of having a file header at the top of all files.
dotnet_diagnostic.SA1633.severity = none
# Disable forced usage of this to prefix local calls.
dotnet_diagnostic.SA1101.severity = none
# Allow fields to be prefixed with an underscore for private and protected members.
dotnet_diagnostic.SA1309.severity = none
# Disable rules which conflict with the CSharpier formatter.
dotnet_diagnostic.SA1003.severity = none
dotnet_diagnostic.SA1009.severity = none
dotnet_diagnostic.SA1111.severity = none
dotnet_diagnostic.SA1118.severity = none
dotnet_diagnostic.SA1502.severity = none
dotnet_diagnostic.SA1504.severity = none
dotnet_diagnostic.SA1515.severity = none
dotnet_diagnostic.SA1516.severity = none
# Disable checking of square bracket spacing due to incompatibility with .NET 8.
# See https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3687
dotnet_diagnostic.SA1010.severity = none
# --------------------------------------------------------------------------------------------------
# Sonar
# --------------------------------------------------------------------------------------------------
# Allow URIs to be hardcoded.
dotnet_diagnostic.S1075.severity = none
# Disable reporting of TODOs in favour of Meziantou.Analyzer which does the same.
dotnet_diagnostic.S1135.severity = none
# --------------------------------------------------------------------------------------------------
# Roslynator
# --------------------------------------------------------------------------------------------------
# Increase the severity of all diagnostics during code review.
# dotnet_analyzer_diagnostic.category-roslynator.severity = warning
# Force braces around if statement blocks.
dotnet_diagnostic.RCS1007.severity = warning
# Enable explicit types.
dotnet_diagnostic.RCS1008.severity = warning
dotnet_diagnostic.RCS1009.severity = warning
dotnet_diagnostic.RCS1012.severity = warning
dotnet_diagnostic.RCS1014.severity = warning
# Use built in types for variables.
dotnet_diagnostic.RCS1013.severity = warning
# Ensure modifiers are ordered.
dotnet_diagnostic.RCS1019.severity = warning
# Ensure private fields use camel case and start with an underscore.
dotnet_diagnostic.RCS1045.severity = warning
# Ensure async methods end with the word Async as per Microsoft recommendations.
dotnet_diagnostic.RCS1046.severity = warning
# Force empty argument lists when initializing objects for consistency.
dotnet_diagnostic.RCS1050.severity = warning
# Declare each attribute on a separate line.
dotnet_diagnostic.RCS1052.severity = warning
# Declare each type in a separate file.
dotnet_diagnostic.RCS1060.severity = warning
# Prefer while loops when creating infinite loops.
dotnet_diagnostic.RCS1064.severity = warning
# Ensure redundant constructors are reported.
dotnet_diagnostic.RCS1074.severity = warning
# Prefer string.Empty when creating empty strings.
dotnet_diagnostic.RCS1078.severity = warning
roslynator.RCS1078.invert = true
# Ensure each variable is declared on a separate line.
dotnet_diagnostic.RCS1081.severity = warning
# Ensure using directives are at the top level.
dotnet_diagnostic.RCS1094.severity = warning
# Force braces around if / else statement blocks.
dotnet_diagnostic.RCS1126.severity = warning
# Avoid assigning multiple variables at the same time.
dotnet_diagnostic.RCS1162.severity = warning
# Remove redundant async / await.
dotnet_diagnostic.RCS1174.severity = warning
# Ensure method comments are converted to documentation comments.
dotnet_diagnostic.RCS1181.severity = warning
# Use pattern matching when checking for null.
dotnet_diagnostic.RCS1248.severity = warning
# Format documentation summaries on multiple lines.
roslynator_doc_comment_summary_style = multi_line
# --------------------------------------------------------------------------------------------------
# Roslynator Formatting
# --------------------------------------------------------------------------------------------------
# Ensure an empty line after embedded statements (single line blocks).
dotnet_diagnostic.RCS0001.severity = warning
# Ensure an empty line after #region.
dotnet_diagnostic.RCS0002.severity = warning
# Ensure an empty line is present after using statements.
dotnet_diagnostic.RCS0003.severity = warning
# Ensure an empty line before #endregion.
dotnet_diagnostic.RCS0005.severity = warning
# Ensure an empty line is present before using statements when a header is present.
dotnet_diagnostic.RCS0006.severity = warning
# Ensure an empty line between declaration and documentation comments.
dotnet_diagnostic.RCS0009.severity = warning
# Ensure an empty line between declarations (e.g. methods).
dotnet_diagnostic.RCS0010.severity = warning
# Ensure an empty line between single-line property accessors.
dotnet_diagnostic.RCS0011.severity = warning
# Ensure an empty line between single-line declarations.
dotnet_diagnostic.RCS0012.severity = warning
# Ensure an empty line between single-line declarations of a different kind.
dotnet_diagnostic.RCS0013.severity = warning
# Ensure a new line after attribute listings.
dotnet_diagnostic.RCS0016.severity = warning
# Ensure a new line after the opening brace of a block if it has multiple lines.
dotnet_diagnostic.RCS0021.severity = warning
roslynator_block_braces_style = single_line_when_empty
# Ensure a new line after the opening brace of a type declaration.
dotnet_diagnostic.RCS0023.severity = warning
# Ensure a new line after a switch label.
dotnet_diagnostic.RCS0024.severity = warning
# Ensure a new line before property accessors.
dotnet_diagnostic.RCS0025.severity = warning
# Ensure a new line before binary operators (e.g. &&, || etc.)
dotnet_diagnostic.RCS0027.severity = warning
# Ensure a new line before ternary conditional operators.
dotnet_diagnostic.RCS0028.severity = warning
# Ensure a new line before parent constructor initializers.
dotnet_diagnostic.RCS0029.severity = warning
# Ensure a new line before embeddable statements (single line blocks).
dotnet_diagnostic.RCS0030.severity = warning
# Ensure a new line before enum members.
dotnet_diagnostic.RCS0031.severity = warning
# Ensure a new line after an expression-body arrow (=>).
dotnet_diagnostic.RCS0032.severity = warning
roslynator.RCS0032.invert = true
# Ensure a new line between statements.
dotnet_diagnostic.RCS0033.severity = warning
# Ensure a new line before type parameter constraints.
dotnet_diagnostic.RCS0034.severity = warning
# Ensure no empty lines between using directives with the same root namespace.
dotnet_diagnostic.RCS0038.severity = warning
# Ensure no new line before a parent class association.
dotnet_diagnostic.RCS0039.severity = warning
# Ensure no new line between else if.
dotnet_diagnostic.RCS0041.severity = warning
# Ensure no now line between automatic property accessors.
dotnet_diagnostic.RCS0042.severity = warning
# Ensure Windows line endings are used new line characters.
dotnet_diagnostic.RCS0044.severity = warning
# Ensure spaces are used instead of tabs.
dotnet_diagnostic.RCS0046.severity = warning
# Disable forced a single line initializer to be compacted.
dotnet_diagnostic.RCS0048.severity = none
# Ensure an empty line after the comment at the top of a file.
dotnet_diagnostic.RCS0049.severity = warning
# Ensure an empty line before the first declaration.
dotnet_diagnostic.RCS0050.severity = warning
# Ensure a new line after the closing brace of a do while loop.
dotnet_diagnostic.RCS0051.severity = warning
# Ensure a new line after an equals sign when the declaration follows on the next line.
dotnet_diagnostic.RCS0052.severity = warning
roslynator.RCS0052.invert = true
# Ensure that long lines are flagged.
dotnet_diagnostic.RCS0056.severity = warning
roslynator_max_line_length = 100
# --------------------------------------------------------------------------------------------------
# Meziantou
# --------------------------------------------------------------------------------------------------
# Ignore culture-sensitive recommendations.
dotnet_diagnostic.MA0074.severity = none
dotnet_diagnostic.MA0075.severity = none
dotnet_diagnostic.MA0076.severity = none
dotnet_diagnostic.MA0011.severity = none
# Disable forced use of comparer when strings are being compared.
dotnet_diagnostic.MA0002.severity = none
# Disable forced use of string.Equals for all string comparisons.
dotnet_diagnostic.MA0006.severity = none
# Disable enforcing of a timeout on regular expression evaluation.
dotnet_diagnostic.MA0009.severity = none
# Report remaining TODOs as suggestions instead of warnings.
dotnet_diagnostic.MA0026.severity = suggestion
# Allow longer methods.
dotnet_diagnostic.MA0051.severity = none
[**/obj/**.cs]
# Ignore unused using statements in generated code.
dotnet_diagnostic.CS8019.severity = none
[**/*Tests.cs]
# Prefer anonymous functions in tests to allow for mocked functions to be defined within tests.
csharp_style_prefer_local_over_anonymous_function = false
# Do not force short-hand object initialisers in tests so properties may be set in the Act stage.
dotnet_diagnostic.IDE0017.severity = none
# Disable checking for ConfigureAwait calls in tests as this may cause parallelization issues.
# See https://xunit.net/xunit.analyzers/rules/xUnit1030
dotnet_diagnostic.MA0004.severity = none
# Disable documentation requirements for unit tests.
dotnet_diagnostic.SA0001.severity = none
dotnet_diagnostic.SA1600.severity = none