-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.editorconfig
More file actions
209 lines (176 loc) · 11.4 KB
/
.editorconfig
File metadata and controls
209 lines (176 loc) · 11.4 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
root = true # Do NOT inherit any higher level settings.
[*.cs]
# IDE0005: Remove unnecessary using directives (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0005)
dotnet_diagnostic.IDE0005.severity = suggestion
# IDE0017: Object initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0017)
dotnet_diagnostic.IDE0017.severity = suggestion
# IDE0022: Use expression body for methods (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0022)
dotnet_diagnostic.IDE0022.severity = silent
# IDE0028: Simplify collection initialization
dotnet_diagnostic.IDE0028.severity = silent
# IDE0037: Use inferred member name
dotnet_diagnostic.IDE0037.severity = none
# IDE0045: 'if' statement can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0045)
dotnet_diagnostic.IDE0045.severity = silent
# IDE0046: Use conditional expression for return (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0046)
dotnet_diagnostic.IDE0046.severity = none
# IDE0055: Formatting rule (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0055)
dotnet_diagnostic.IDE0055.severity = none
# IDE0057: Substring can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0057)
dotnet_diagnostic.IDE0057.severity = suggestion
# IDE0058: Expression value is never used (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0058)
dotnet_diagnostic.IDE0058.severity = none
# IDE0063: Use simple 'using' statement (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0063)
csharp_prefer_simple_using_statement = false
dotnet_diagnostic.IDE0063.severity = none
# IDE0078: Use pattern matching (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0078)
dotnet_diagnostic.IDE0078.severity = warning
# IDE0090: Use 'new(...)'
dotnet_diagnostic.IDE0090.severity = silent
# IDE0220: Add explicit cast (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0220)
dotnet_diagnostic.IDE0220.severity = warning
# IDE0220: Add explicit cast (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0220#dotnet_style_prefer_foreach_explicit_cast_in_source)
dotnet_style_prefer_foreach_explicit_cast_in_source = always
# IDE0270: Null check can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0270)
dotnet_diagnostic.IDE0270.severity = suggestion
# IDE0280: Use 'nameof'
dotnet_diagnostic.IDE0280.severity = warning
# IDE0290: Use primary constructor - It's a case by case choice.
dotnet_diagnostic.IDE0290.severity = silent
# IDE0305: Collection initialization can be simplified (https://github.com/dotnet/roslyn/issues/70656)
dotnet_diagnostic.IDE0305.severity = silent # Some suggestions are bad.
# IDE1006: Naming rule violation - Sadly, the 'Naming styles' are not sufficient enough, use ReSharper!
dotnet_diagnostic.IDE1006.severity = none
# CA1024: Use properties where appropriate
dotnet_diagnostic.CA1024.severity = none
# CA1062: Validate arguments of public methods
dotnet_diagnostic.CA1062.severity = silent
# CA1304: Specify CultureInfo
dotnet_diagnostic.CA1304.severity = none
# CA1305: Specify IFormatProvider
dotnet_diagnostic.CA1305.severity = none
# CA1309: Use ordinal string comparison
dotnet_diagnostic.CA1309.severity = none
# CA1507: Use nameof to express symbol names
dotnet_diagnostic.CA1507.severity = suggestion
# CA1716: Identifiers should not match keywords
dotnet_diagnostic.CA1716.severity = none
# CA1720: Identifier contains type name
dotnet_diagnostic.CA1720.severity = none
# CA1725: Parameter names should match base declaration
dotnet_diagnostic.CA1725.severity = silent
# CA1806: Do not ignore method results
dotnet_diagnostic.CA1806.severity = silent
# CA1815: Override equals and operator equals on value types
dotnet_diagnostic.CA1815.severity = silent
# CA1819: Properties should not return arrays
dotnet_diagnostic.CA1819.severity = none
# CA1822: Mark members as static
dotnet_diagnostic.CA1822.severity = silent
# CA1847: Use char literal for a single character lookup
dotnet_diagnostic.CA1847.severity = warning
# CA1848: Use the LoggerMessage delegates
dotnet_diagnostic.CA1848.severity = silent
# CA1863: Use 'CompositeFormat' - The default is warning and in some cases it's not true
dotnet_diagnostic.CA1863.severity = suggestion
# CA2007: Consider calling ConfigureAwait on the awaited task
dotnet_diagnostic.CA2007.severity = none
# CA2016: Forward the 'CancellationToken' parameter to methods
dotnet_diagnostic.CA2016.severity = suggestion # R# is better at this, pointing to the corect method, instead of the whole call.
# CA2201: Do not raise reserved exception types
dotnet_diagnostic.CA2201.severity = error
# CA2234: Pass system uri objects instead of strings
dotnet_diagnostic.CA2234.severity = none
# CS1591: Missing XML comment for publicly visible type or member (https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs1591)
dotnet_diagnostic.CS1591.severity = none
# CS8602: Dereference of a possibly null reference (https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/nullable-warnings#possible-dereference-of-null)
dotnet_diagnostic.CS8602.severity = error
# MSTEST0016: Test class should have test method (https://learn.microsoft.com/en-us/dotnet/core/testing/mstest-analyzers/mstest0016)
dotnet_diagnostic.MSTEST0016.severity = warning
# MSTEST0039: Use newer methods to assert exceptions (https://learn.microsoft.com/en-us/dotnet/core/testing/mstest-analyzers/mstest0039)
dotnet_diagnostic.MSTEST0039.severity = warning
# MSTEST0042: Avoid duplicated 'DataRow' entries (https://learn.microsoft.com/en-us/dotnet/core/testing/mstest-analyzers/mstest0042)
dotnet_diagnostic.MSTEST0042.severity = warning
# MSTEST0049: Flow TestContext.CancellationToken to async operations (https://learn.microsoft.com/en-us/dotnet/core/testing/mstest-analyzers/mstest0049)
dotnet_diagnostic.MSTEST0049.severity = warning
[*.{cs,vb}]
csharp_style_expression_bodied_methods = when_on_single_line
csharp_style_expression_bodied_accessors = when_on_single_line # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0027
csharp_style_expression_bodied_operators = when_on_single_line # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0023
csharp_style_namespace_declarations = file_scoped
dotnet_sort_system_directives_first = false
dotnet_style_qualification_for_field = true:silent
dotnet_style_qualification_for_property = true:silent
dotnet_style_qualification_for_method = true:silent
dotnet_style_qualification_for_event = true:silent
# ■■■ Naming styles ■■■
# ■■ Non-functional Rules (matching only happens on the 'symbols' (Specification), not the 'style' (Suffix)).
# ■ Dependency Property backend field - public static readonly DependencyProperty MyProperty = DependencyProperty.Register(...)
dotnet_naming_rule.PublicStaticReadonlyField.severity = warning
dotnet_naming_rule.PublicStaticReadonlyField.symbols = public_static_readonly_fields
dotnet_naming_rule.PublicStaticReadonlyField.style = PascalCaseProperty
# ■ Public static readonly field (Default) - public static readonly TypeOfField MyFieldName = ...
dotnet_naming_rule.PublicStaticReadonlyField.severity = warning
dotnet_naming_rule.PublicStaticReadonlyField.symbols = public_static_readonly_fields
dotnet_naming_rule.PublicStaticReadonlyField.style = PascalCase
# ■ Dependency Property backend field - private static readonly DependencyPropertyKey MyPropertyKey = DependencyProperty.RegisterReadOnly(...)
dotnet_naming_rule.PrivateStaticReadonlyField.severity = warning # Should be warning
dotnet_naming_rule.PrivateStaticReadonlyField.symbols = private_static_readonly_fields
dotnet_naming_rule.PrivateStaticReadonlyField.style = PascalCasePropertyKey
# ■ Private static readonly field (Default) - private static readonly TypeOfField myFieldName = ...
dotnet_naming_rule.PrivateStaticReadonlyField.severity = information # Should be warning
dotnet_naming_rule.PrivateStaticReadonlyField.symbols = private_static_readonly_fields
dotnet_naming_rule.PrivateStaticReadonlyField.style = CamelCase
# ■■ End of Non-functional Rules
dotnet_naming_rule.InstanceField.severity = suggestion
dotnet_naming_rule.InstanceField.symbols = all_fields
dotnet_naming_rule.InstanceField.style = CamelCase
dotnet_naming_rule.ConstantField.severity = suggestion
dotnet_naming_rule.ConstantField.symbols = const_fields
dotnet_naming_rule.ConstantField.style = PascalCase
dotnet_naming_rule.NonPrivateField.severity = suggestion
dotnet_naming_rule.NonPrivateField.symbols = non_private_fields
dotnet_naming_rule.NonPrivateField.style = PascalCase
# ■■■ Symbol specifications ■■■
dotnet_naming_symbols.all_fields.applicable_kinds = field
dotnet_naming_symbols.const_fields.applicable_kinds = field
dotnet_naming_symbols.const_fields.required_modifiers = const
dotnet_naming_symbols.public_fields.applicable_kinds = field
dotnet_naming_symbols.public_fields.applicable_accessibilities = public
dotnet_naming_symbols.non_private_fields.applicable_kinds = field
dotnet_naming_symbols.non_private_fields.applicable_accessibilities = public, internal, protected, protected_internal
dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = readonly, static
dotnet_naming_symbols.public_static_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.public_static_readonly_fields.applicable_accessibilities = public
dotnet_naming_symbols.public_static_readonly_fields.required_modifiers = readonly, static
# ■■■ Naming styles ■■■
dotnet_naming_style.PascalCase.required_prefix =
dotnet_naming_style.PascalCase.required_suffix =
dotnet_naming_style.PascalCase.word_separator =
dotnet_naming_style.PascalCase.capitalization = pascal_case
dotnet_naming_style.CamelCase.required_prefix =
dotnet_naming_style.CamelCase.required_suffix =
dotnet_naming_style.CamelCase.word_separator =
dotnet_naming_style.CamelCase.capitalization = camel_case
dotnet_naming_style.IPascalCase.required_prefix = I
dotnet_naming_style.IPascalCase.required_suffix =
dotnet_naming_style.IPascalCase.word_separator =
dotnet_naming_style.IPascalCase.capitalization = pascal_case
dotnet_naming_style.PascalCaseProperty.required_suffix = Property
dotnet_naming_style.PascalCaseProperty.capitalization = pascal_case
dotnet_naming_style.PascalCasePropertyKey.required_suffix = PropertyKey
dotnet_naming_style.PascalCasePropertyKey.capitalization = pascal_case
# ■■■ RESX Formatter ■■■
[*.resx]
resx_formatter_sort_entries = true
resx_formatter_remove_xsd_schema = false
resx_formatter_remove_documentation_comment = true
resx_formatter_sort_comparer = OrdinalIgnoreCase
# ■■■ MAUI Rules ■■■
[*.cs]
# CsWinRT1028: Class should be marked partial
dotnet_diagnostic.CsWinRT1028.severity = warning
# MVVMTK0034: Direct field reference to [ObservableProperty] backing field
dotnet_diagnostic.MVVMTK0034.severity = error