-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy path.editorconfig
More file actions
194 lines (170 loc) · 8.17 KB
/
.editorconfig
File metadata and controls
194 lines (170 loc) · 8.17 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
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = tab
insert_final_newline = true
# YAML requires indentation with spaces instead of tabs.
[*.{yml,yaml,json,jsonc}]
indent_style = space
indent_size = 2
[*.{sh,ps1,psd1}]
indent_style = space
indent_size = 2
[*.py]
indent_style = space
indent_size = 4
[*.css]
indent_style = space
indent_size = 2
[*.{sln,csproj}]
end_of_line = crlf
charset = utf-8-bom
[*.sln]
indent_style = tab
[*.{slnx,csproj,proj,projitems,props,targets,nuspec,resx}]
indent_style = space
indent_size = 2
[*.cs]
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 120
# 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_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
# Indentation preferences.
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = false
csharp_indent_switch_labels = true
csharp_indent_labels = one_less_than_current
# Code style defaults.
csharp_using_directive_placement = outside_namespace:suggestion
dotnet_sort_system_directives_first = true:warning
csharp_prefer_braces = true:warning
csharp_prefer_static_local_function = true:warning
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_prefer_switch_expression = true:suggestion
dotnet_style_readonly_field = true:suggestion
dotnet_style_require_accessibility_modifiers = always:warning
dotnet_style_namespace_match_folder = true:silent
csharp_style_namespace_declarations = file_scoped:warning
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_prefer_primary_constructors = false
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
# Expression-level preferences.
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:warning
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
csharp_prefer_simple_default_expression = true:warning
# Expression-bodied members
csharp_style_expression_bodied_methods = true:silent
csharp_style_expression_bodied_constructors = true:silent
csharp_style_expression_bodied_operators = true:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = true:silent
# Types: use keywords instead of BCL types, and permit var only when the type is clear.
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = false:none
csharp_style_var_elsewhere = false:suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
# Modifier preferences.
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:warning
# IDE0055: Formatting rule violation.
dotnet_diagnostic.IDE0055.severity = warning
# IDE1006: Naming rule violation.
dotnet_diagnostic.IDE1006.severity = suggestion
# RS2008: Enable analyzer release tracking for the analyzer project containing rule '{0}'.
dotnet_diagnostic.RS2008.severity = none
# Severity levels for dotnet_naming_rule only affect IDE environments.
# To have them extra visible to people, we can set them as 'warning' here without affecting compilation.
# Everything should be PascalCase by default.
dotnet_naming_rule.all_should_be_camel_case.severity = warning
dotnet_naming_rule.all_should_be_camel_case.symbols = all
dotnet_naming_rule.all_should_be_camel_case.style = pascal_case_style
# Non-public fields should be _camelCase.
dotnet_naming_rule.non_public_fields_should_be_underscore_camel_case.severity = warning
dotnet_naming_rule.non_public_fields_should_be_underscore_camel_case.symbols = non_public_fields
dotnet_naming_rule.non_public_fields_should_be_underscore_camel_case.style = underscore_camel_case_style
# Constant fields (and local vars) should be PascalCase.
dotnet_naming_rule.constants_should_be_pascal_case.severity = warning
dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants
dotnet_naming_rule.constants_should_be_pascal_case.style = pascal_case_style
# Locals variables should be camelCase.
dotnet_naming_rule.local_vars_should_be_camel_case.severity = warning
dotnet_naming_rule.local_vars_should_be_camel_case.symbols = local_vars
dotnet_naming_rule.local_vars_should_be_camel_case.style = camel_case_style
# Parameters should be camelCase.
dotnet_naming_rule.parameters_should_be_camel_case.severity = warning
dotnet_naming_rule.parameters_should_be_camel_case.symbols = parameters
dotnet_naming_rule.parameters_should_be_camel_case.style = camel_case_style
dotnet_naming_symbols.all.applicable_kinds = *
dotnet_naming_symbols.local_vars.applicable_kinds = local
dotnet_naming_symbols.parameters.applicable_kinds = parameter
dotnet_naming_symbols.constants.applicable_kinds = field, local
dotnet_naming_symbols.constants.required_modifiers = const
dotnet_naming_symbols.non_public_fields.applicable_kinds = field
dotnet_naming_symbols.non_public_fields.applicable_accessibilities = private, protected, private_protected
dotnet_naming_style.camel_case_style.capitalization = camel_case
dotnet_naming_style.camel_case_style.required_prefix =
dotnet_naming_style.underscore_camel_case_style.capitalization = camel_case
dotnet_naming_style.underscore_camel_case_style.required_prefix = _
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
dotnet_naming_style.pascal_case_style.required_prefix =
# Severity override to diagnostics, in order to make generated code compilation readable.
# We want to limit the scope of suppression as much as possible.
[**/Generated/**.cs]
# IDE1006: Naming rule violation.
dotnet_diagnostic.IDE1006.severity = none
# IDE0018: Variable declaration can be inlined.
dotnet_diagnostic.IDE0018.severity = none
# IDE0047: Parentheses can be removed.
dotnet_diagnostic.IDE0047.severity = none
# IDE0059: Remove unnecessary value assignment.
dotnet_diagnostic.IDE0059.severity = none
# IDE0241: Nullable directive is unnecessary.
dotnet_diagnostic.IDE0241.severity = none
# CA1062: Validate parameter is non-null before using it.
# Useful for generated code, since it disables nullable.
dotnet_diagnostic.CA1062.severity = error
# CA1069: Enums should not have duplicate values.
dotnet_diagnostic.CA1069.severity = none
# CA1707: Identifiers should not contain underscores.
dotnet_diagnostic.CA1707.severity = none
# CA1708: Identifiers should differ by more than case.
dotnet_diagnostic.CA1708.severity = none
# CA1711: Identifiers should not have incorrect suffix.
# Disable warning for suffixes like EventHandler, Flags, Enum, etc.
dotnet_diagnostic.CA1711.severity = none
# CA1712: Do not prefix enum values with the name of the enum type.
dotnet_diagnostic.CA1712.severity = none
# CA1716: Identifiers should not match keywords.
# This is suppressed, because it will report `@event` as well as `event`.
dotnet_diagnostic.CA1716.severity = none
# CA1720: Identifiers should not contain type names.
dotnet_diagnostic.CA1720.severity = none
# CS1573: Parameter has no matching param tag in the XML comment.
dotnet_diagnostic.CS1573.severity = none
# CS1591: Missing XML comment for publicly visible type or member.
dotnet_diagnostic.CS1591.severity = none