Skip to content

Commit 2497509

Browse files
committed
add editorconfig using dotnet new editorconfig
1 parent 6673191 commit 2497509

File tree

2 files changed

+383
-1
lines changed

2 files changed

+383
-1
lines changed

.editorconfig

Lines changed: 381 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,381 @@
1+
root = true
2+
3+
# All files
4+
[*]
5+
indent_style = space
6+
7+
# Xml files
8+
[*.xml]
9+
indent_size = 2
10+
11+
# C# files
12+
[*.cs]
13+
14+
#### Core EditorConfig Options ####
15+
16+
# Indentation and spacing
17+
indent_size = 4
18+
tab_width = 4
19+
20+
# New line preferences
21+
end_of_line = lf
22+
insert_final_newline = false
23+
24+
#### .NET Coding Conventions ####
25+
[*.{cs,vb}]
26+
27+
# Organize usings
28+
dotnet_separate_import_directive_groups = true
29+
dotnet_sort_system_directives_first = true
30+
file_header_template = unset
31+
32+
# this. and Me. preferences
33+
dotnet_style_qualification_for_event = false:silent
34+
dotnet_style_qualification_for_field = false:silent
35+
dotnet_style_qualification_for_method = false:silent
36+
dotnet_style_qualification_for_property = false:silent
37+
38+
# Language keywords vs BCL types preferences
39+
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
40+
dotnet_style_predefined_type_for_member_access = true:silent
41+
42+
# Parentheses preferences
43+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
44+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
45+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
46+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
47+
48+
# Modifier preferences
49+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
50+
51+
# Expression-level preferences
52+
dotnet_style_coalesce_expression = true:suggestion
53+
dotnet_style_collection_initializer = true:suggestion
54+
dotnet_style_explicit_tuple_names = true:suggestion
55+
dotnet_style_null_propagation = true:suggestion
56+
dotnet_style_object_initializer = true:suggestion
57+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
58+
dotnet_style_prefer_auto_properties = true:suggestion
59+
dotnet_style_prefer_compound_assignment = true:suggestion
60+
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
61+
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
62+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
63+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
64+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
65+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
66+
dotnet_style_prefer_simplified_interpolation = true:suggestion
67+
68+
# Field preferences
69+
dotnet_style_readonly_field = true:warning
70+
71+
# Parameter preferences
72+
dotnet_code_quality_unused_parameters = all:suggestion
73+
74+
# Suppression preferences
75+
dotnet_remove_unnecessary_suppression_exclusions = none
76+
77+
dotnet_style_prefer_collection_expression = false:suggestion
78+
dotnet_style_namespace_match_folder = false:suggestion
79+
80+
#### C# Coding Conventions ####
81+
[*.cs]
82+
83+
# var preferences
84+
csharp_style_var_elsewhere = false:silent
85+
csharp_style_var_for_built_in_types = false:silent
86+
csharp_style_var_when_type_is_apparent = false:silent
87+
88+
# Expression-bodied members
89+
csharp_style_expression_bodied_accessors = true:silent
90+
csharp_style_expression_bodied_constructors = false:silent
91+
csharp_style_expression_bodied_indexers = true:silent
92+
csharp_style_expression_bodied_lambdas = true:suggestion
93+
csharp_style_expression_bodied_local_functions = false:silent
94+
csharp_style_expression_bodied_methods = false:silent
95+
csharp_style_expression_bodied_operators = false:silent
96+
csharp_style_expression_bodied_properties = true:silent
97+
98+
# Pattern matching preferences
99+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
100+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
101+
csharp_style_prefer_not_pattern = true:suggestion
102+
csharp_style_prefer_pattern_matching = true:silent
103+
csharp_style_prefer_switch_expression = true:suggestion
104+
105+
# Null-checking preferences
106+
csharp_style_conditional_delegate_call = true:suggestion
107+
108+
# Modifier preferences
109+
csharp_prefer_static_local_function = true:warning
110+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
111+
112+
# Code-block preferences
113+
csharp_prefer_braces = true:silent
114+
csharp_prefer_simple_using_statement = true:suggestion
115+
116+
# Expression-level preferences
117+
csharp_prefer_simple_default_expression = true:suggestion
118+
csharp_style_deconstructed_variable_declaration = true:suggestion
119+
csharp_style_inlined_variable_declaration = true:suggestion
120+
csharp_style_pattern_local_over_anonymous_function = true:suggestion
121+
csharp_style_prefer_index_operator = true:suggestion
122+
csharp_style_prefer_range_operator = true:suggestion
123+
csharp_style_throw_expression = true:suggestion
124+
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
125+
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
126+
127+
# 'using' directive preferences
128+
csharp_using_directive_placement = outside_namespace:silent
129+
130+
#### C# Formatting Rules ####
131+
132+
# New line preferences
133+
csharp_new_line_before_catch = true
134+
csharp_new_line_before_else = true
135+
csharp_new_line_before_finally = true
136+
csharp_new_line_before_members_in_anonymous_types = true
137+
csharp_new_line_before_members_in_object_initializers = true
138+
csharp_new_line_before_open_brace = all
139+
csharp_new_line_between_query_expression_clauses = true
140+
141+
# Indentation preferences
142+
csharp_indent_block_contents = true
143+
csharp_indent_braces = false
144+
csharp_indent_case_contents = true
145+
csharp_indent_case_contents_when_block = true
146+
csharp_indent_labels = one_less_than_current
147+
csharp_indent_switch_labels = true
148+
149+
# Space preferences
150+
csharp_space_after_cast = false
151+
csharp_space_after_colon_in_inheritance_clause = true
152+
csharp_space_after_comma = true
153+
csharp_space_after_dot = false
154+
csharp_space_after_keywords_in_control_flow_statements = true
155+
csharp_space_after_semicolon_in_for_statement = true
156+
csharp_space_around_binary_operators = before_and_after
157+
csharp_space_around_declaration_statements = false
158+
csharp_space_before_colon_in_inheritance_clause = true
159+
csharp_space_before_comma = false
160+
csharp_space_before_dot = false
161+
csharp_space_before_open_square_brackets = false
162+
csharp_space_before_semicolon_in_for_statement = false
163+
csharp_space_between_empty_square_brackets = false
164+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
165+
csharp_space_between_method_call_name_and_opening_parenthesis = false
166+
csharp_space_between_method_call_parameter_list_parentheses = false
167+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
168+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
169+
csharp_space_between_method_declaration_parameter_list_parentheses = false
170+
csharp_space_between_parentheses = false
171+
csharp_space_between_square_brackets = false
172+
173+
# Wrapping preferences
174+
csharp_preserve_single_line_blocks = true
175+
csharp_preserve_single_line_statements = true
176+
177+
# Other preferences
178+
csharp_style_namespace_declarations = block_scoped:silent
179+
csharp_style_prefer_method_group_conversion = true:silent
180+
csharp_style_prefer_top_level_statements = true:silent
181+
csharp_style_prefer_primary_constructors = true:suggestion
182+
csharp_style_prefer_null_check_over_type_check = true:suggestion
183+
csharp_style_prefer_local_over_anonymous_function = true:suggestion
184+
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
185+
csharp_style_prefer_tuple_swap = true:suggestion
186+
csharp_style_prefer_utf8_string_literals = true:suggestion
187+
188+
#### Naming styles ####
189+
[*.{cs,vb}]
190+
tab_width = 4
191+
indent_size = 4
192+
end_of_line = lf
193+
194+
# Naming rules
195+
196+
dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.severity = suggestion
197+
dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.symbols = types_and_namespaces
198+
dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.style = pascalcase
199+
200+
dotnet_naming_rule.interfaces_should_be_ipascalcase.severity = suggestion
201+
dotnet_naming_rule.interfaces_should_be_ipascalcase.symbols = interfaces
202+
dotnet_naming_rule.interfaces_should_be_ipascalcase.style = ipascalcase
203+
204+
dotnet_naming_rule.type_parameters_should_be_tpascalcase.severity = suggestion
205+
dotnet_naming_rule.type_parameters_should_be_tpascalcase.symbols = type_parameters
206+
dotnet_naming_rule.type_parameters_should_be_tpascalcase.style = tpascalcase
207+
208+
dotnet_naming_rule.methods_should_be_pascalcase.severity = suggestion
209+
dotnet_naming_rule.methods_should_be_pascalcase.symbols = methods
210+
dotnet_naming_rule.methods_should_be_pascalcase.style = pascalcase
211+
212+
dotnet_naming_rule.properties_should_be_pascalcase.severity = suggestion
213+
dotnet_naming_rule.properties_should_be_pascalcase.symbols = properties
214+
dotnet_naming_rule.properties_should_be_pascalcase.style = pascalcase
215+
216+
dotnet_naming_rule.events_should_be_pascalcase.severity = suggestion
217+
dotnet_naming_rule.events_should_be_pascalcase.symbols = events
218+
dotnet_naming_rule.events_should_be_pascalcase.style = pascalcase
219+
220+
dotnet_naming_rule.local_variables_should_be_camelcase.severity = suggestion
221+
dotnet_naming_rule.local_variables_should_be_camelcase.symbols = local_variables
222+
dotnet_naming_rule.local_variables_should_be_camelcase.style = camelcase
223+
224+
dotnet_naming_rule.local_constants_should_be_camelcase.severity = suggestion
225+
dotnet_naming_rule.local_constants_should_be_camelcase.symbols = local_constants
226+
dotnet_naming_rule.local_constants_should_be_camelcase.style = camelcase
227+
228+
dotnet_naming_rule.parameters_should_be_camelcase.severity = suggestion
229+
dotnet_naming_rule.parameters_should_be_camelcase.symbols = parameters
230+
dotnet_naming_rule.parameters_should_be_camelcase.style = camelcase
231+
232+
dotnet_naming_rule.public_fields_should_be_pascalcase.severity = suggestion
233+
dotnet_naming_rule.public_fields_should_be_pascalcase.symbols = public_fields
234+
dotnet_naming_rule.public_fields_should_be_pascalcase.style = pascalcase
235+
236+
dotnet_naming_rule.private_fields_should_be__camelcase.severity = suggestion
237+
dotnet_naming_rule.private_fields_should_be__camelcase.symbols = private_fields
238+
dotnet_naming_rule.private_fields_should_be__camelcase.style = _camelcase
239+
240+
dotnet_naming_rule.private_static_fields_should_be_s_camelcase.severity = suggestion
241+
dotnet_naming_rule.private_static_fields_should_be_s_camelcase.symbols = private_static_fields
242+
dotnet_naming_rule.private_static_fields_should_be_s_camelcase.style = s_camelcase
243+
244+
dotnet_naming_rule.public_constant_fields_should_be_pascalcase.severity = suggestion
245+
dotnet_naming_rule.public_constant_fields_should_be_pascalcase.symbols = public_constant_fields
246+
dotnet_naming_rule.public_constant_fields_should_be_pascalcase.style = pascalcase
247+
248+
dotnet_naming_rule.private_constant_fields_should_be_pascalcase.severity = suggestion
249+
dotnet_naming_rule.private_constant_fields_should_be_pascalcase.symbols = private_constant_fields
250+
dotnet_naming_rule.private_constant_fields_should_be_pascalcase.style = pascalcase
251+
252+
dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.severity = suggestion
253+
dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.symbols = public_static_readonly_fields
254+
dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.style = pascalcase
255+
256+
dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.severity = suggestion
257+
dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.symbols = private_static_readonly_fields
258+
dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.style = pascalcase
259+
260+
dotnet_naming_rule.enums_should_be_pascalcase.severity = suggestion
261+
dotnet_naming_rule.enums_should_be_pascalcase.symbols = enums
262+
dotnet_naming_rule.enums_should_be_pascalcase.style = pascalcase
263+
264+
dotnet_naming_rule.local_functions_should_be_pascalcase.severity = suggestion
265+
dotnet_naming_rule.local_functions_should_be_pascalcase.symbols = local_functions
266+
dotnet_naming_rule.local_functions_should_be_pascalcase.style = pascalcase
267+
268+
dotnet_naming_rule.non_field_members_should_be_pascalcase.severity = suggestion
269+
dotnet_naming_rule.non_field_members_should_be_pascalcase.symbols = non_field_members
270+
dotnet_naming_rule.non_field_members_should_be_pascalcase.style = pascalcase
271+
272+
# Symbol specifications
273+
274+
dotnet_naming_symbols.interfaces.applicable_kinds = interface
275+
dotnet_naming_symbols.interfaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
276+
dotnet_naming_symbols.interfaces.required_modifiers =
277+
278+
dotnet_naming_symbols.enums.applicable_kinds = enum
279+
dotnet_naming_symbols.enums.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
280+
dotnet_naming_symbols.enums.required_modifiers =
281+
282+
dotnet_naming_symbols.events.applicable_kinds = event
283+
dotnet_naming_symbols.events.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
284+
dotnet_naming_symbols.events.required_modifiers =
285+
286+
dotnet_naming_symbols.methods.applicable_kinds = method
287+
dotnet_naming_symbols.methods.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
288+
dotnet_naming_symbols.methods.required_modifiers =
289+
290+
dotnet_naming_symbols.properties.applicable_kinds = property
291+
dotnet_naming_symbols.properties.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
292+
dotnet_naming_symbols.properties.required_modifiers =
293+
294+
dotnet_naming_symbols.public_fields.applicable_kinds = field
295+
dotnet_naming_symbols.public_fields.applicable_accessibilities = public, internal
296+
dotnet_naming_symbols.public_fields.required_modifiers =
297+
298+
dotnet_naming_symbols.private_fields.applicable_kinds = field
299+
dotnet_naming_symbols.private_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
300+
dotnet_naming_symbols.private_fields.required_modifiers =
301+
302+
dotnet_naming_symbols.private_static_fields.applicable_kinds = field
303+
dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
304+
dotnet_naming_symbols.private_static_fields.required_modifiers = static
305+
306+
dotnet_naming_symbols.types_and_namespaces.applicable_kinds = namespace, class, struct, interface, enum
307+
dotnet_naming_symbols.types_and_namespaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
308+
dotnet_naming_symbols.types_and_namespaces.required_modifiers =
309+
310+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
311+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
312+
dotnet_naming_symbols.non_field_members.required_modifiers =
313+
314+
dotnet_naming_symbols.type_parameters.applicable_kinds = namespace
315+
dotnet_naming_symbols.type_parameters.applicable_accessibilities = *
316+
dotnet_naming_symbols.type_parameters.required_modifiers =
317+
318+
dotnet_naming_symbols.private_constant_fields.applicable_kinds = field
319+
dotnet_naming_symbols.private_constant_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
320+
dotnet_naming_symbols.private_constant_fields.required_modifiers = const
321+
322+
dotnet_naming_symbols.local_variables.applicable_kinds = local
323+
dotnet_naming_symbols.local_variables.applicable_accessibilities = local
324+
dotnet_naming_symbols.local_variables.required_modifiers =
325+
326+
dotnet_naming_symbols.local_constants.applicable_kinds = local
327+
dotnet_naming_symbols.local_constants.applicable_accessibilities = local
328+
dotnet_naming_symbols.local_constants.required_modifiers = const
329+
330+
dotnet_naming_symbols.parameters.applicable_kinds = parameter
331+
dotnet_naming_symbols.parameters.applicable_accessibilities = *
332+
dotnet_naming_symbols.parameters.required_modifiers =
333+
334+
dotnet_naming_symbols.public_constant_fields.applicable_kinds = field
335+
dotnet_naming_symbols.public_constant_fields.applicable_accessibilities = public, internal
336+
dotnet_naming_symbols.public_constant_fields.required_modifiers = const
337+
338+
dotnet_naming_symbols.public_static_readonly_fields.applicable_kinds = field
339+
dotnet_naming_symbols.public_static_readonly_fields.applicable_accessibilities = public, internal
340+
dotnet_naming_symbols.public_static_readonly_fields.required_modifiers = readonly, static
341+
342+
dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field
343+
dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
344+
dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = readonly, static
345+
346+
dotnet_naming_symbols.local_functions.applicable_kinds = local_function
347+
dotnet_naming_symbols.local_functions.applicable_accessibilities = *
348+
dotnet_naming_symbols.local_functions.required_modifiers =
349+
350+
# Naming styles
351+
352+
dotnet_naming_style.pascalcase.required_prefix =
353+
dotnet_naming_style.pascalcase.required_suffix =
354+
dotnet_naming_style.pascalcase.word_separator =
355+
dotnet_naming_style.pascalcase.capitalization = pascal_case
356+
357+
dotnet_naming_style.ipascalcase.required_prefix = I
358+
dotnet_naming_style.ipascalcase.required_suffix =
359+
dotnet_naming_style.ipascalcase.word_separator =
360+
dotnet_naming_style.ipascalcase.capitalization = pascal_case
361+
362+
dotnet_naming_style.tpascalcase.required_prefix = T
363+
dotnet_naming_style.tpascalcase.required_suffix =
364+
dotnet_naming_style.tpascalcase.word_separator =
365+
dotnet_naming_style.tpascalcase.capitalization = pascal_case
366+
367+
dotnet_naming_style._camelcase.required_prefix = _
368+
dotnet_naming_style._camelcase.required_suffix =
369+
dotnet_naming_style._camelcase.word_separator =
370+
dotnet_naming_style._camelcase.capitalization = camel_case
371+
372+
dotnet_naming_style.camelcase.required_prefix =
373+
dotnet_naming_style.camelcase.required_suffix =
374+
dotnet_naming_style.camelcase.word_separator =
375+
dotnet_naming_style.camelcase.capitalization = camel_case
376+
377+
dotnet_naming_style.s_camelcase.required_prefix = s_
378+
dotnet_naming_style.s_camelcase.required_suffix =
379+
dotnet_naming_style.s_camelcase.word_separator =
380+
dotnet_naming_style.s_camelcase.capitalization = camel_case
381+

SystemTextJson.JsonDiffPatch.sln

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
1+
22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.8.34309.116
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3707B7E8-C345-4F67-9C37-56FF2A62B720}"
77
ProjectSection(SolutionItems) = preProject
8+
.editorconfig = .editorconfig
89
.gitignore = .gitignore
910
Benchmark.md = Benchmark.md
1011
icon.png = icon.png

0 commit comments

Comments
 (0)