-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.editorconfig
562 lines (403 loc) · 20.5 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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
root = true
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
# Global settings
[*]
end_of_line = crlf
# In line with the Airbnb JavaScript Guidelines and https://katafrakt.me/2017/09/16/80-characters-line-length-limit/#:~:text=When%20you%20look%20at%20code,should%20not%20exceed%2080%20characters
max_line_length = 132
insert_final_newline = true
trim_trailing_whitespace = true
# Microsoft .NET properties
csharp_indent_braces = false
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_style_expression_bodied_methods = false:none
# ReSharper properties
resharper_braces_for_foreach = required
resharper_braces_for_ifelse = required
resharper_csharp_empty_block_style = multiline
resharper_csharp_remove_blank_lines_near_braces_in_code = false
resharper_csharp_wrap_before_binary_opsign = true
resharper_place_method_attribute_on_same_line = false
resharper_place_accessorholder_attribute_on_same_line = false
resharper_place_field_attribute_on_same_line = false
resharper_wrap_chained_binary_expressions = chop_if_long
resharper_blank_lines_after_multiline_statements = 1
resharper_blank_lines_around_single_line_local_method = 1
resharper_blank_lines_before_multiline_statements = 0
resharper_blank_lines_around_single_line_auto_property = 1
resharper_keep_blank_lines_in_code = 1
resharper_remove_blank_lines_near_braces_in_code = true
resharper_csharp_blank_lines_around_single_line_invocable = 1
resharper_space_within_single_line_array_initializer_braces = true
resharper_wrap_object_and_collection_initializer_style = chop_always
resharper_wrap_array_initializer_style = chop_if_long
resharper_arguments_skip_single = true
resharper_arguments_literal = positional
resharper_parentheses_non_obvious_operations = none, null_coalescing, conditional, conditional_or, conditional_and, bitwise, bitwise_inclusive_or, range, bitwise_exclusive_or, relational, shift, arithmetic, additive, multiplicative, bitwise_and
resharper_new_line_before_while = true
resharper_xmldoc_indent_text = zero_indent
[*.{md,json}]
indent_style = space
indent_size = 4
[*.cs]
indent_style = space
indent_size = 4
# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = one_less_than_current
# avoid this. unless absolutely necessary
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion
# use language keywords instead of BCL types
dotnet_style_predefined_type_for_locals_parameters_members = true:error
dotnet_style_predefined_type_for_member_access = true:error
# name all constant fields using PascalCase
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
dotnet_naming_symbols.constant_fields.required_modifiers = const
# prefix instance fields with _ and static instance fields with s_
dotnet_naming_symbols.private_instance_fields.applicable_kinds = field
dotnet_naming_symbols.private_instance_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_static_fields.applicable_kinds = field
dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_static_fields.required_modifiers = static
dotnet_naming_style.prefix_with_s.capitalization = camel_case
dotnet_naming_style.prefix_with_s.required_prefix = s_
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
dotnet_naming_style.prefix_with_underscore.capitalization = camel_case
dotnet_naming_style.prefix_with_underscore.required_prefix = _
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = error
dotnet_naming_rule.private_instance_fields_should_be_underscored.symbols = private_instance_fields
dotnet_naming_rule.private_instance_fields_should_be_underscored.style = prefix_with_underscore
dotnet_naming_rule.private_instance_fields_should_be_underscored.severity = error
dotnet_naming_rule.private_static_fields_should_be_prefixed.symbols = private_static_fields
dotnet_naming_rule.private_static_fields_should_be_prefixed.style = prefix_with_s
dotnet_naming_rule.private_static_fields_should_be_prefixed.severity = error
# Code style defaults
csharp_using_directive_placement = inside_namespace:suggestion
dotnet_sort_system_directives_first = true
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = false
# var preferences
csharp_style_var_for_built_in_types = false:silent
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = false:silent
# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
# Expression-bodied members
csharp_style_expression_bodied_methods = true:none
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_operators = false:none
csharp_style_expression_bodied_properties = true:none
csharp_style_expression_bodied_indexers = true:none
csharp_style_expression_bodied_accessors = true:none
# Pattern matching
csharp_style_pattern_matching_over_is_with_cast_check = true:error
csharp_style_pattern_matching_over_as_with_null_check = true:error
csharp_style_inlined_variable_declaration = true:error
# Null checking preferences
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
dotnet_style_require_accessibility_modifiers = for_non_interface_members:error
dotnet_style_readonly_field = true:error
# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
# Banned API Analyzers
dotnet_diagnostic.rs0030.severity = error
# Remove unnecessary cast.
dotnet_diagnostic.ide0004.severity = error
# Remove unnecessary usings/imports
dotnet_diagnostic.ide0005.severity = error
# Naming rule violation
dotnet_diagnostic.ide1006.severity = error
# Remove unused private members (no reads or writes)
dotnet_diagnostic.ide0051.severity = error
# Remove unread private members (writes but no reads)
dotnet_diagnostic.ide0052.severity = error
# Use pattern matching
dotnet_diagnostic.ide0020.severity = suggestion
dotnet_diagnostic.sa1822.severity = error
########################
# StyleCop: General Rules
########################
# The keyword 'if' should be followed by a space
dotnet_diagnostic.sa1000.severity = suggestion
# Documentation line should begin with a space.
dotnet_diagnostic.sa1004.severity = error
# Opening parenthesis should not be preceded by a space.
dotnet_diagnostic.sa1008.severity = error
# Closing parenthesis should not be preceded by a space
dotnet_diagnostic.sa1009.severity = none
# Opening square brackets should not be preceded by a space
dotnet_diagnostic.sa1010.severity = suggestion
# Block statements should not contain embedded comments
dotnet_diagnostic.sa1108.severity = none
# Code should not contain multiple whitespace characters in a row
dotnet_diagnostic.sa1025.severity = none
# Tabs and spaces should be used correctly
dotnet_diagnostic.sa1027.severity = suggestion
# Code should not contain trailing whitespace
dotnet_diagnostic.sa1028.severity = none
# Prefix local calls with this.
dotnet_diagnostic.sa1101.severity = none
# The parameters should begin on the line after the declaration, whenever the parameter span across multiple lines
dotnet_diagnostic.sa1116.severity = none
# The parameters should all be placed on the same line or each parameter should be placed on its own line
dotnet_diagnostic.sa1117.severity = none
# The parameter spans multiple lines
dotnet_diagnostic.sa1118.severity = none
# Use built-in type alias.
dotnet_diagnostic.sa1121.severity = error
# Use string.Empty for empty strings. There's no real advantage in one over the other.
dotnet_diagnostic.sa1122.severity = none
# Generic type constraints should be on their own line
dotnet_diagnostic.sa1127.severity = none
# Put constructor initializers on their own line
dotnet_diagnostic.sa1128.severity = none
# Do not use default value type constructor.
dotnet_diagnostic.sa1129.severity = error
# Using directive should appear within a namespace declaration
dotnet_diagnostic.sa1200.severity = suggestion
# Partial elements should declare an access modifier.
dotnet_diagnostic.sa1205.severity = error
# Don't care about the ordering of the namespaces
dotnet_diagnostic.sa1208.severity = none
# Using directives should be ordered alphabetically by the namespaces
dotnet_diagnostic.sa1210.severity = none
# The using-alias directives within a C# code file are not sorted alphabetically by alias name.
dotnet_diagnostic.sa1211.severity = none
# A get accessor appears after a set accessor within a property or indexer.
dotnet_diagnostic.sa1212.severity = error
# Field 'ReadOnly' should begin with lower-case letter
dotnet_diagnostic.sa1306.severity = none
# Variable names must not be prefixed. Disabled to prevent conflicts with _ and _s
dotnet_diagnostic.sa1308.severity = none
# FieldNamesMustNotBeginWithUnderscore
dotnet_diagnostic.sa1309.severity = none
# Static readonly fields should begin with upper-case letter. Disabled to prevent conflicts with _ and _s
dotnet_diagnostic.sa1311.severity = none
# Parameter '_' should begin with lower-case letter. Doesn't understand discards.
dotnet_diagnostic.sa1313.severity = none
# Tuple element names should use correct casing.
dotnet_diagnostic.sa1316.severity = error
# Documentation text should end with a period
dotnet_diagnostic.sa1413.severity = none
# Tuple types in signatures should have element names.
dotnet_diagnostic.sa1414.severity = error
# Code should not contain blank lines at start of file
dotnet_diagnostic.sa1517.severity = none
# Code should not contain blank lines at the end of the file
dotnet_diagnostic.sa1518.severity = none
# Code should not contain multiple blank lines in a row
dotnet_diagnostic.sa1507.severity = none
# Element documentation header should be preceded by blank line.
dotnet_diagnostic.sa1514.severity = error
# The file header is missing or not located at the top of the file.
dotnet_diagnostic.sa1633.severity = none
########################
# Member ordering is mostly disabled because we prefer to order members so you read it as a book (Clean Code)
########################
# ElementsMustAppearInTheCorrectOrder
dotnet_diagnostic.sa1201.severity = none
# 'public' members should come before 'private' members
dotnet_diagnostic.sa1202.severity = none
# Constant fields should appear before non-constant fields
dotnet_diagnostic.sa1203.severity = none
# Static members should appear before non-static members
dotnet_diagnostic.sa1204.severity = none
# Readonly fields should appear before non-readonly fields
dotnet_diagnostic.sa1214.severity = none
########################
Documentation rules
########################
# Missing XML comment for publicly visible type or member
dotnet_diagnostic.cs1591.severity = none
# A C# code element is missing a documentation header
dotnet_diagnostic.sa1600.severity = suggestion
# Partial elements should be documented
dotnet_diagnostic.sa1601.severity = suggestion
# Enumeration items should be documented
dotnet_diagnostic.sa1602.severity = suggestion
# Element documentation should have summary
dotnet_diagnostic.sa1604.severity = suggestion
# Element documentation should have summary text.
dotnet_diagnostic.sa1606.severity = suggestion
# The documentation for parameter 'dependentApplication' is missing
dotnet_diagnostic.sa1611.severity = suggestion
# Element parameter documentation should have text
dotnet_diagnostic.sa1614.severity = suggestion
# Element return value should be documented
dotnet_diagnostic.sa1615.severity = suggestion
# Element return value documentation should have text
dotnet_diagnostic.sa1616.severity = suggestion
# The documentation for type parameter 'T' is missing
dotnet_diagnostic.sa1618.severity = suggestion
# Generic type parameter documentation should have text.
dotnet_diagnostic.sa1622.severity = suggestion
# The property's documentation summary text should begin with: 'Gets or sets'
dotnet_diagnostic.sa1623.severity = suggestion
# The documentation text within the 'exception' tag should not be empty
dotnet_diagnostic.sa1627.severity = suggestion
# Documentation text should end with a period
dotnet_diagnostic.sa1629.severity = none
# Constructor summary documentation should begin with standard text
dotnet_diagnostic.sa1642.severity = none
# File name should match first type name.
dotnet_diagnostic.sa1649.severity = error
########################
# The following layout rules should have a severity level of "warning" and should fail the build i.c.w. Treat Warnings As Errors.
# However, for existing projects you might decide to temporarily lower the level to "suggestion" until all of them have been fixed.
########################
# Commas should not be preceded by whitespace.
dotnet_diagnostic.sa1001.severity = error
# Semicolons should be followed by a space.
dotnet_diagnostic.sa1002.severity = error
# Operator '=' should be preceded by whitespace.
dotnet_diagnostic.sa1003.severity = error
# Single line comment should begin with a space.
dotnet_diagnostic.sa1005.severity = error
# Closing square bracket should be followed by space.
dotnet_diagnostic.sa1011.severity = error
# Opening brace should be followed by a space.
dotnet_diagnostic.sa1012.severity = error
# Closing brace should be followed by a space.
dotnet_diagnostic.sa1013.severity = error
# Closing generic bracket should be followed by a space
dotnet_diagnostic.sa1015.severity = error
# Colon should be preceded by a space.
dotnet_diagnostic.sa1024.severity = error
# The keyword 'new' should not be followed by a space or a blank line.
dotnet_diagnostic.sa1026.severity = error
# Code should not contain empty statements.
dotnet_diagnostic.sa1106.severity = error
# Code should not contain multiple statements on one line.
dotnet_diagnostic.sa1107.severity = error
# Closing parenthesis DON'T have to be on line of last parameter.
dotnet_diagnostic.sa1111.severity = none
# Comma should be on the same line as previous parameter.
dotnet_diagnostic.sa1113.severity = error
# Parameter list should follow declaration. Some valid violations.
dotnet_diagnostic.sa1114.severity = suggestion
# The parameter should begin on the line after the previous parameter
dotnet_diagnostic.sa1115.severity = error
# Statement should not use unnecessary parenthesis.
dotnet_diagnostic.sa1119.severity = error
# Each attribute should be placed in its own set of square brackets. Is totally fine.
dotnet_diagnostic.sa1133.severity = none
# Each attribute should be placed on its own line of code.
dotnet_diagnostic.sa1134.severity = error
# Elements should have the same indentation
dotnet_diagnostic.sa1135.severity = suggestion
# Elements should have the same indentation.
dotnet_diagnostic.sa1137.severity = error
# Element should begin with an uppercase letter
dotnet_diagnostic.sa1300.severity = warning
# Field should be private.
dotnet_diagnostic.sa1401.severity = suggestion
# A C# code file contains more than one unique type.
dotnet_diagnostic.sa1402.severity = suggestion
# Arithmetic expressions should declare precedence.
dotnet_diagnostic.sa1407.severity = error
# Braces for multi-line statements should not share line.
dotnet_diagnostic.sa1500.severity = error
# Statement should not be on a single line
dotnet_diagnostic.sa1501.severity = suggestion
# Element should not be on a single line
dotnet_diagnostic.sa1502.severity = none
# Braces should not be omitted.
dotnet_diagnostic.sa1503.severity = error
# All accessors should be single-line or multi-line. Too dogmatic.
dotnet_diagnostic.sa1504.severity = none
# An opening brace should not be followed by a blank line.
dotnet_diagnostic.sa1505.severity = error
# Element documentation headers should not be followed by blank line.
dotnet_diagnostic.sa1506.severity = error
# A closing brace should not be preceded by a blank line.
dotnet_diagnostic.sa1508.severity = error
# Opening braces should not be preceded by blank line
dotnet_diagnostic.sa1509.severity = warning
# Single-line comments should not be followed by blank line.
dotnet_diagnostic.sa1512.severity = suggestion
# Closing brace should be followed by blank line.
dotnet_diagnostic.sa1513.severity = error
# Single-line comment should be preceded by blank line
dotnet_diagnostic.sa1515.severity = suggestion
# Elements should be separated by blank line
dotnet_diagnostic.sa1516.severity = suggestion
# Braces should not be omitted from multi-line child statement
dotnet_diagnostic.sa1519.severity = warning
# Use braces consistently
dotnet_diagnostic.sa1520.severity = warning
# File name should match first type name
dotnet_diagnostic.l.severity = error
[AppBuilderExtensions.cs]
generated_code = true
[*Tests/**.cs]
# Don't detect naming rule violations. We have too many variations in our codebase.
dotnet_diagnostic.ide1006.severity = none
# Closing generic bracket should be followed by a space
dotnet_diagnostic.sa1015.severity = suggestion
# Opening parenthesis must be on declaration line
dotnet_diagnostic.sa1110.severity = suggestion
# Comments should contain text
dotnet_diagnostic.sa1120.severity = suggestion
# Do not use regions
dotnet_diagnostic.sa1124.severity = suggestion
# Using alias directives should be placed after all using namespace directives
dotnet_diagnostic.sa1209.severity = suggestion
# Element should begin with an uppercase letter
dotnet_diagnostic.sa1300.severity = suggestion
# Const field names should begin with upper-case letter
dotnet_diagnostic.sa1303.severity = suggestion
# Field should begin with upper-case letter
dotnet_diagnostic.sa1307.severity = suggestion
# Field 'HelpText_Permit_ColdWork_1' should not contain an underscore
dotnet_diagnostic.sa1310.severity = suggestion
# Element 'FakeCommit' should declare an access modifier
dotnet_diagnostic.sa1400.severity = suggestion
# We do want to allow more than one type for tests
dotnet_diagnostic.sa1402.severity = suggestion
# Opening braces should not be preceded by blank line
dotnet_diagnostic.sa1509.severity = suggestion
resharper_inconsistent_naming_highlighting = none