-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy path.editorconfig
More file actions
193 lines (157 loc) · 7.62 KB
/
Copy path.editorconfig
File metadata and controls
193 lines (157 loc) · 7.62 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
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# Default: prefer spaces for data/markup
indent_style = space
indent_size = 2
tab_width = 2
# This style rule concern the use of the range operator, which is available in C# 8.0 and later.
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0057
[*.{cs,vb}]
dotnet_diagnostic.IDE0057.severity = none
# This style rule concerns the use of switch expressions versus switch statements.
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0066
[*.{cs,vb}]
dotnet_diagnostic.IDE0066.severity = none
# Performance rules
# https://docs.microsoft.com/da-dk/dotnet/fundamentals/code-analysis/quality-rules/performance-warnings
[*.{cs,vb}]
dotnet_analyzer_diagnostic.category-Performance.severity = none # Because many of the suggestions by performance analyzers are not compatible with .NET Standard 2.0
# This style rule concerns the use of using statements without curly braces, also known as using declarations. This alternative syntax was introduced in C# 8.0.
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0063
[*.{cs,vb}]
dotnet_diagnostic.IDE0063.severity = none
# This style rule concerns with simplification of interpolated strings to improve code readability. It recommends removal of certain explicit method calls, such as ToString(), when the same method would be implicitly invoked by the compiler if the explicit method call is removed.
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0071
[*.{cs,vb}]
dotnet_diagnostic.IDE0071.severity = none
# S3267: Loops should be simplified with "LINQ" expressions
# https://rules.sonarsource.com/csharp/RSPEC-3267
dotnet_diagnostic.S3267.severity = none
# CA1859: Use concrete types when possible for improved performance
# This is a violation of Framework Design Guidelines.
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1859
[*.{cs,vb}]
dotnet_diagnostic.CA1859.severity = none
# IDE0008: Use explicit type
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0007-ide0008
[*.{cs,vb}]
dotnet_diagnostic.IDE0008.severity = none
[*.{cs,vb}]
indent_style = space
indent_size = 4
# IDE0161: Namespace declaration preferences
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0161
# Prefer file-scoped namespaces for new files; existing block-scoped files should not be converted unless explicitly asked
[*.cs]
csharp_style_namespace_declarations = file_scoped:suggestion
# Top-level statements: DO NOT USE
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0210-ide0211
# This is enforced via a style preference set to error severity, not a language-level prohibition.
# Always use explicit class declarations with a proper namespace and Main method where applicable.
[*.cs]
csharp_style_prefer_top_level_statements = false:error
[*.xml]
indent_style = space
indent_size = 2
# IDE0078: Use pattern matching
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0078
[*.{cs,vb}]
dotnet_diagnostic.IDE0078.severity = none
# IDE0290: Use primary constructor
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0290
[*.{cs,vb}]
dotnet_diagnostic.IDE0290.severity = none
# CA1200: Avoid using cref tags with a prefix
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1200
[*.{cs,vb}]
dotnet_diagnostic.CA1200.severity = none
# IDE0305: Use collection expression for fluent
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0305
[*.{cs,vb}]
dotnet_diagnostic.IDE0305.severity = none
# IDE0011: Add braces
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0011
[*.{cs,vb}]
dotnet_diagnostic.IDE0011.severity = none
# IDE0028: Use collection initializers or expressions
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0028
[*.{cs,vb}]
dotnet_diagnostic.IDE0028.severity = none
# IDE0039: Use collection expression for array
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0300
[*.{cs,vb}]
dotnet_diagnostic.IDE0300.severity = none
# IDE0031: Use collection expression for empty
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0301
[*.{cs,vb}]
dotnet_diagnostic.IDE0301.severity = none
# IDE0046: Use conditional expression for return
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0046
[*.{cs,vb}]
dotnet_diagnostic.IDE0046.severity = none
# IDE0047: Parentheses preferences
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0047-ide0048
[*.{cs,vb}]
dotnet_diagnostic.IDE0047.severity = none
# CA1716: Identifiers should not match keywords
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1716
[*.{cs,vb}]
dotnet_diagnostic.CA1716.severity = none
# CA1720: Identifiers should not contain type names
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1720
[*.{cs,vb}]
dotnet_diagnostic.CA1720.severity = none
# CA1846: Prefer AsSpan over Substring
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1846
# Excluded while TFMs include netstandard2.0
[*.{cs,vb}]
dotnet_diagnostic.CA1846.severity = none
# CA1847: Use String.Contains(char) instead of String.Contains(string) with single characters
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1847
# Excluded while TFMs include netstandard2.0
[*.{cs,vb}]
dotnet_diagnostic.CA1847.severity = none
# CA1865-CA1867: Use 'string.Method(char)' instead of 'string.Method(string)' for string with single char
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1865-ca1867
# Excluded while TFMs include netstandard2.0
[*.{cs,vb}]
dotnet_diagnostic.CA1865.severity = none
dotnet_diagnostic.CA1866.severity = none
dotnet_diagnostic.CA1867.severity = none
# CA2263: Prefer generic overload when type is known
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2263
# Excluded while TFMs include netstandard2.0
[*.{cs,vb}]
dotnet_diagnostic.CA2263.severity = none
# CA2249: Consider using String.Contains instead of String.IndexOf
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2249
# Excluded while TFMs include netstandard2.0
[*.{cs,vb}]
dotnet_diagnostic.CA2249.severity = none
# IDE0022: Use expression body for methods
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0022
[*.{cs,vb}]
dotnet_diagnostic.IDE0022.severity = none
# IDE0032: Use auto-property
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0032
[*.{cs,vb}]
dotnet_diagnostic.IDE0032.severity = none
# Order modifiers
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0036
# Excluded becuase of inconsistency with other analyzers
[*.{cs,vb}]
dotnet_diagnostic.IDE0036.severity = none
# Order modifiers
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0036
# Excluded becuase of inconsistency with other analyzers
[*.{cs,vb}]
dotnet_diagnostic.IDE0036.severity = none
# Use 'System.Threading.Lock'
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0330
# Excluded while TFMs are less than net9.0
[*.{cs,vb}]
dotnet_diagnostic.IDE0330.severity = none