-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.editorconfig
More file actions
377 lines (295 loc) · 15.3 KB
/
.editorconfig
File metadata and controls
377 lines (295 loc) · 15.3 KB
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
# Top-level EditorConfig — FlowForge
root = true
# All files
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
# XML / project files
[*.{xml,csproj,props,targets}]
indent_size = 2
# JSON
[*.json]
indent_size = 2
# YAML
[*.{yml,yaml}]
indent_size = 2
# Markdown
[*.md]
trim_trailing_whitespace = false
# =========================================================================
# C# Code Style
# =========================================================================
[*.cs]
# ---- Language conventions ------------------------------------------------
# Prefer file-scoped namespace declarations
csharp_style_namespace_declarations = file_scoped:warning
# Prefer braces (Allman style)
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
# var preferences — use var when type is apparent
csharp_style_var_for_built_in_types = false:warning
csharp_style_var_when_type_is_apparent = true:warning
csharp_style_var_elsewhere = false:warning
# Expression-bodied members
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
csharp_style_expression_bodied_constructors = false:suggestion
csharp_style_expression_bodied_operators = when_on_single_line:suggestion
csharp_style_expression_bodied_properties = when_on_single_line:suggestion
csharp_style_expression_bodied_indexers = when_on_single_line:suggestion
csharp_style_expression_bodied_accessors = when_on_single_line:suggestion
csharp_style_expression_bodied_lambdas = true:suggestion
csharp_style_expression_bodied_local_functions = when_on_single_line:suggestion
# Pattern matching
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
csharp_style_pattern_matching_over_as_with_null_check = true:warning
csharp_style_prefer_switch_expression = true:suggestion
csharp_style_prefer_pattern_matching = true:suggestion
csharp_style_prefer_not_pattern = true:suggestion
# Null checking
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:warning
csharp_style_prefer_null_check_over_type_check = true:warning
# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:warning
# Using directives
csharp_using_directive_placement = outside_namespace:warning
# Prefer simple using statement
csharp_prefer_simple_using_statement = true:suggestion
# Prefer simple default expression
csharp_prefer_simple_default_expression = true:warning
# Prefer index/range operators
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
# Prefer tuple names
dotnet_style_prefer_inferred_tuple_names = true:suggestion
# ---- Formatting ----------------------------------------------------------
# Indentation
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_block_contents = true
csharp_indent_braces = false
# Spacing
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
# Wrapping
csharp_preserve_single_line_statements = false
csharp_preserve_single_line_blocks = true
# ---- .NET conventions ----------------------------------------------------
# this. qualification — do NOT require this. prefix
dotnet_style_qualification_for_field = false:warning
dotnet_style_qualification_for_property = false:warning
dotnet_style_qualification_for_method = false:warning
dotnet_style_qualification_for_event = false:warning
# Use language keywords instead of framework type names
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning
# Require accessibility modifiers
dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion
# Object/collection initializer
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
# Null propagation
dotnet_style_null_propagation = true:warning
dotnet_style_coalesce_expression = true:warning
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
# ---- Naming conventions --------------------------------------------------
# Interfaces must start with I
dotnet_naming_rule.interface_should_begin_with_i.severity = warning
dotnet_naming_rule.interface_should_begin_with_i.symbols = interface_symbols
dotnet_naming_rule.interface_should_begin_with_i.style = begins_with_i
dotnet_naming_symbols.interface_symbols.applicable_kinds = interface
dotnet_naming_symbols.interface_symbols.applicable_accessibilities = *
dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.capitalization = pascal_case
# Public/internal members: PascalCase
dotnet_naming_rule.public_members_pascal_case.severity = warning
dotnet_naming_rule.public_members_pascal_case.symbols = public_symbols
dotnet_naming_rule.public_members_pascal_case.style = pascal_case_style
dotnet_naming_symbols.public_symbols.applicable_kinds = property, method, event, delegate, class, struct, enum
dotnet_naming_symbols.public_symbols.applicable_accessibilities = public, internal, protected, protected_internal
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Private static readonly fields: PascalCase (no underscore prefix)
dotnet_naming_rule.private_static_readonly_pascal.severity = warning
dotnet_naming_rule.private_static_readonly_pascal.symbols = private_static_readonly_symbols
dotnet_naming_rule.private_static_readonly_pascal.style = pascal_case_style
dotnet_naming_symbols.private_static_readonly_symbols.applicable_kinds = field
dotnet_naming_symbols.private_static_readonly_symbols.applicable_accessibilities = private, private_protected
dotnet_naming_symbols.private_static_readonly_symbols.required_modifiers = static, readonly
# Private fields: _camelCase
dotnet_naming_rule.private_fields_underscore_camel.severity = warning
dotnet_naming_rule.private_fields_underscore_camel.symbols = private_field_symbols
dotnet_naming_rule.private_fields_underscore_camel.style = underscore_camel_style
dotnet_naming_symbols.private_field_symbols.applicable_kinds = field
dotnet_naming_symbols.private_field_symbols.applicable_accessibilities = private, private_protected
dotnet_naming_style.underscore_camel_style.required_prefix = _
dotnet_naming_style.underscore_camel_style.capitalization = camel_case
# Constants: PascalCase
dotnet_naming_rule.constants_pascal_case.severity = warning
dotnet_naming_rule.constants_pascal_case.symbols = constant_symbols
dotnet_naming_rule.constants_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_symbols.applicable_kinds = field
dotnet_naming_symbols.constant_symbols.required_modifiers = const
# Async methods: suffix with Async (suggestion only)
dotnet_naming_rule.async_methods_end_with_async.severity = suggestion
dotnet_naming_rule.async_methods_end_with_async.symbols = async_method_symbols
dotnet_naming_rule.async_methods_end_with_async.style = async_suffix_style
dotnet_naming_symbols.async_method_symbols.applicable_kinds = method
dotnet_naming_symbols.async_method_symbols.required_modifiers = async
dotnet_naming_style.async_suffix_style.required_suffix = Async
dotnet_naming_style.async_suffix_style.capitalization = pascal_case
# Local variables/parameters: camelCase
dotnet_naming_rule.locals_camel_case.severity = warning
dotnet_naming_rule.locals_camel_case.symbols = local_symbols
dotnet_naming_rule.locals_camel_case.style = camel_case_local_style
dotnet_naming_symbols.local_symbols.applicable_kinds = parameter, local
dotnet_naming_style.camel_case_local_style.capitalization = camel_case
# Type parameters: T prefix
dotnet_naming_rule.type_parameters_t_prefix.severity = warning
dotnet_naming_rule.type_parameters_t_prefix.symbols = type_parameter_symbols
dotnet_naming_rule.type_parameters_t_prefix.style = t_prefix_style
dotnet_naming_symbols.type_parameter_symbols.applicable_kinds = type_parameter
dotnet_naming_style.t_prefix_style.required_prefix = T
dotnet_naming_style.t_prefix_style.capitalization = pascal_case
# ---- Meziantou overrides -------------------------------------------------
# MA0051: Method too long — raise threshold from 60 to 80 lines
MA0051.maximum_lines_per_method = 80
# ---- Roslyn analyzer severity overrides ----------------------------------
# CA1720: Identifier contains type name (e.g., enum member named "String")
dotnet_diagnostic.CA1720.severity = suggestion
# CA1852: Type can be sealed — not applicable to top-level statement Program classes
dotnet_diagnostic.CA1852.severity = none
# CA1859: Use concrete type — suppressed, interface usage is intentional for DI/MVVM
dotnet_diagnostic.CA1859.severity = suggestion
# CA1001: Type owns disposable fields — enforce globally, suppress per-type where needed
dotnet_diagnostic.CA1001.severity = warning
# IDE0005: Remove unnecessary using directives
dotnet_diagnostic.IDE0005.severity = warning
# ---- StyleCop suppressions (rules that conflict with our conventions) ----
# SA0001: XML comment analysis disabled (we don't require XML docs everywhere)
dotnet_diagnostic.SA0001.severity = none
# SA1101: Prefix local calls with this — we prefer no this. prefix
dotnet_diagnostic.SA1101.severity = none
# SA1128: Put constructor initializers on their own line
dotnet_diagnostic.SA1128.severity = none
# SA1200: Using directives should be placed correctly — we use outside namespace
dotnet_diagnostic.SA1200.severity = none
# SA1203: Constant fields should appear before non-constant fields
dotnet_diagnostic.SA1203.severity = none
# SA1208: Using directive for System should appear before other directives
dotnet_diagnostic.SA1208.severity = none
# SA1309: Field names should not begin with underscore — we use _camelCase
dotnet_diagnostic.SA1309.severity = none
# SA1413: Use trailing comma in multi-line initializers
dotnet_diagnostic.SA1413.severity = none
# SA1009: Closing parenthesis should not be preceded by a space
dotnet_diagnostic.SA1009.severity = none
# SA1111: Closing parenthesis should be on line of last parameter
dotnet_diagnostic.SA1111.severity = none
# SA1116: Split parameters should start on line after declaration
dotnet_diagnostic.SA1116.severity = none
# SA1117: Parameters should be on same line or each on own line
dotnet_diagnostic.SA1117.severity = none
# SA1122: Use string.Empty for empty strings — we prefer ""
dotnet_diagnostic.SA1122.severity = none
# SA1127: Generic type constraints should be on their own line
dotnet_diagnostic.SA1127.severity = none
# SA1136: Enum values should be on separate lines
dotnet_diagnostic.SA1136.severity = none
# SA1201: Elements should appear in the correct order
dotnet_diagnostic.SA1201.severity = none
# SA1202: Elements should be ordered by access
dotnet_diagnostic.SA1202.severity = none
# SA1204: Static members should appear before non-static members
dotnet_diagnostic.SA1204.severity = none
# SA1210: Using directives should be ordered alphabetically
dotnet_diagnostic.SA1210.severity = none
# SA1214: Readonly fields should appear before non-readonly fields
dotnet_diagnostic.SA1214.severity = none
# SA1400: Element should declare an access modifier (top-level statements)
dotnet_diagnostic.SA1400.severity = none
# SA1402: File may only contain a single type
dotnet_diagnostic.SA1402.severity = warning
# SA1500: Braces for multi-line statements should not share line
dotnet_diagnostic.SA1500.severity = none
# SA1501: Statement should not be on a single line
dotnet_diagnostic.SA1501.severity = none
# SA1502: Element should not be on a single line
dotnet_diagnostic.SA1502.severity = none
# SA1503: Braces should not be omitted
dotnet_diagnostic.SA1503.severity = warning
# SA1512: Single-line comments should not be followed by blank line
dotnet_diagnostic.SA1512.severity = none
# SA1513: Closing brace should be followed by blank line
dotnet_diagnostic.SA1513.severity = none
# SA1515: Single-line comment should be preceded by blank line
dotnet_diagnostic.SA1515.severity = none
# SA1516: Elements should be separated by blank line
dotnet_diagnostic.SA1516.severity = none
# SA1518: File is required to end with a single newline character
dotnet_diagnostic.SA1518.severity = warning
# SA1600-SA1651: Documentation rules — we don't enforce XML docs on everything
dotnet_diagnostic.SA1600.severity = none
dotnet_diagnostic.SA1601.severity = none
dotnet_diagnostic.SA1602.severity = none
dotnet_diagnostic.SA1603.severity = none
dotnet_diagnostic.SA1604.severity = none
dotnet_diagnostic.SA1605.severity = none
dotnet_diagnostic.SA1606.severity = none
dotnet_diagnostic.SA1607.severity = none
dotnet_diagnostic.SA1608.severity = none
dotnet_diagnostic.SA1609.severity = none
dotnet_diagnostic.SA1610.severity = none
dotnet_diagnostic.SA1611.severity = none
dotnet_diagnostic.SA1612.severity = none
dotnet_diagnostic.SA1613.severity = none
dotnet_diagnostic.SA1614.severity = none
dotnet_diagnostic.SA1615.severity = none
dotnet_diagnostic.SA1616.severity = none
dotnet_diagnostic.SA1617.severity = none
dotnet_diagnostic.SA1618.severity = none
dotnet_diagnostic.SA1619.severity = none
dotnet_diagnostic.SA1620.severity = none
dotnet_diagnostic.SA1621.severity = none
dotnet_diagnostic.SA1622.severity = none
dotnet_diagnostic.SA1623.severity = none
dotnet_diagnostic.SA1624.severity = none
dotnet_diagnostic.SA1625.severity = none
dotnet_diagnostic.SA1626.severity = none
dotnet_diagnostic.SA1627.severity = none
dotnet_diagnostic.SA1629.severity = none
dotnet_diagnostic.SA1633.severity = none
dotnet_diagnostic.SA1634.severity = none
dotnet_diagnostic.SA1635.severity = none
dotnet_diagnostic.SA1636.severity = none
dotnet_diagnostic.SA1637.severity = none
dotnet_diagnostic.SA1638.severity = none
dotnet_diagnostic.SA1639.severity = none
dotnet_diagnostic.SA1640.severity = none
dotnet_diagnostic.SA1641.severity = none
dotnet_diagnostic.SA1642.severity = none
dotnet_diagnostic.SA1643.severity = none
dotnet_diagnostic.SA1644.severity = none
dotnet_diagnostic.SA1645.severity = none
dotnet_diagnostic.SA1646.severity = none
dotnet_diagnostic.SA1647.severity = none
dotnet_diagnostic.SA1648.severity = none
# SA1649: File name should match first type name — re-enabled
dotnet_diagnostic.SA1649.severity = warning
dotnet_diagnostic.SA1651.severity = none