forked from opensearch-project/opensearch-net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.editorconfig
210 lines (161 loc) · 8.37 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
root=true
[*]
charset = utf-8
end_of_line = lf
indent_style = tab
indent_size = 4
insert_final_newline=true
[*.cs]
trim_trailing_whitespace=true
[*.cshtml]
indent_style = tab
indent_size = 4
[*.{fs,fsx}]
indent_style = space
indent_size = 4
[*.yml]
indent_style = space
indent_size = 2
[*.{md,markdown,json,js,csproj,fsproj,targets,targets,props}]
indent_style = space
indent_size = 2
# Dotnet code style settings:
[*.{cs,vb}]
# ---
# naming conventions https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions
# currently not supported in Rider/Resharper so not using these for now
# ---
# ---
# language conventions https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#language-conventions
# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true
# Style rules
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/naming-rules?view=vs-2017
# Constants always pascal case
dotnet_naming_rule.constants_should_be_pascal_case.symbols = consts
dotnet_naming_rule.constants_should_be_pascal_case.style = consts
dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion
dotnet_naming_symbols.consts.applicable_kinds = field
dotnet_naming_symbols.consts.applicable_accessibilities = *
dotnet_naming_symbols.consts.required_modifiers = const
dotnet_naming_style.consts.capitalization = pascal_case
# Non-public static fields always pascal case
dotnet_naming_rule.non_public_static_fields_should_be_pascal_case.symbols = non_public_static_fields
dotnet_naming_rule.non_public_static_fields_should_be_pascal_case.style = non_public_static_fields
dotnet_naming_rule.non_public_static_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_symbols.non_public_static_fields.applicable_kinds = field
dotnet_naming_symbols.non_public_static_fields.applicable_accessibilities = private,protected,internal,protected_internal,private_protected
dotnet_naming_symbols.non_public_static_fields.required_modifiers = static
dotnet_naming_style.non_public_static_fields.capitalization = pascal_case
# Non-private readonly fields are pascal case
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.symbols = non_private_readonly_fields
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.style = non_private_readonly_fields
dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public,protected,internal,protected_internal,private_protected
dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly
dotnet_naming_style.non_private_readonly_fields.capitalization = pascal_case
# Private instance fields are camel case prefixed underscore
dotnet_naming_rule.private_fields_should_be_camelcase_prefix_underscore.symbols = private_fields
dotnet_naming_rule.private_fields_should_be_camelcase_prefix_underscore.style = private_fields
dotnet_naming_rule.private_fields_should_be_camelcase_prefix_underscore.severity = suggestion
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
dotnet_naming_style.private_fields.capitalization = camel_case
dotnet_naming_style.private_fields.required_prefix = _
# Locals and parameters are camel case
dotnet_naming_rule.locals.severity = suggestion
dotnet_naming_rule.locals.symbols = locals
dotnet_naming_rule.locals.style = locals
dotnet_naming_symbols.locals.applicable_kinds = parameter, local
dotnet_naming_style.locals.capitalization = camel_case
# Local functions are pascal case
dotnet_naming_rule.local_functions.severity = suggestion
dotnet_naming_rule.local_functions.symbols = local_functions
dotnet_naming_rule.local_functions.style = local_functions
dotnet_naming_symbols.local_functions.applicable_kinds = local_function
dotnet_naming_style.local_functions.capitalization = pascal_case
# Public members always pascal case
dotnet_naming_rule.public_members_should_be_pascal_case.symbols = public_members
dotnet_naming_rule.public_members_should_be_pascal_case.style = public_members
dotnet_naming_rule.public_members_should_be_pascal_case.severity = suggestion
dotnet_naming_symbols.public_members.applicable_kinds = property,method,field,event,delegate
dotnet_naming_symbols.public_members.applicable_accessibilities = public
dotnet_naming_style.public_members.capitalization = pascal_case
dotnet_style_qualification_for_field = false:error
dotnet_style_qualification_for_property = false:error
dotnet_style_qualification_for_method = false:error
dotnet_style_qualification_for_event = false:error
# Use language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:error
dotnet_style_predefined_type_for_member_access = true:error
# Suggest more modern language features when available
dotnet_style_object_initializer = true:error
dotnet_style_collection_initializer = true:error
dotnet_style_explicit_tuple_names = true:error
dotnet_style_prefer_inferred_anonymous_type_member_names = true:error
dotnet_style_prefer_inferred_tuple_names = true:error
dotnet_style_coalesce_expression = true:error
dotnet_style_null_propagation = true:error
dotnet_style_require_accessibility_modifiers = for_non_interface_members:error
dotnet_style_readonly_field = true:error
# CSharp code style settings:
[*.cs]
# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true:error
csharp_style_var_when_type_is_apparent = true:error
csharp_style_var_elsewhere = true:error
csharp_style_expression_bodied_methods = true:error
csharp_style_expression_bodied_constructors = true:error
csharp_style_expression_bodied_operators = true:error
csharp_style_expression_bodied_properties = true:error
csharp_style_expression_bodied_indexers = true:error
csharp_style_expression_bodied_accessors = true:error
# Suggest more modern language features when available
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
csharp_style_deconstructed_variable_declaration = true:error
csharp_style_pattern_local_over_anonymous_function = true:error
csharp_style_throw_expression = true:error
csharp_style_conditional_delegate_call = true:error
csharp_prefer_braces = false:warning
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:error
# ---
# formatting conventions https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#formatting-conventions
# Newline settings (Allman yo!)
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
# just a suggestion do to our JSON tests that use anonymous types to
# represent json quite a bit (makes copy paste easier).
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Indent
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
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
#Wrap
csharp_preserve_single_line_statements = false
csharp_preserve_single_line_blocks = true
# Resharper
resharper_csharp_braces_for_lock=required_for_multiline
resharper_csharp_braces_for_using=required_for_multiline
resharper_csharp_braces_for_while=required_for_multiline
resharper_csharp_braces_for_foreach=required_for_multiline
resharper_csharp_braces_for_for=required_for_multiline
resharper_csharp_braces_for_fixed=required_for_multiline
resharper_csharp_braces_for_ifelse=required_for_multiline
resharper_csharp_accessor_owner_body=expression_body
resharper_redundant_case_label_highlighting=do_not_show
resharper_redundant_argument_default_value_highlighting=do_not_show
[*.{sh,bat,ps1}]
trim_trailing_whitespace=true
insert_final_newline=true
[*.sh]
end_of_line = lf