Skip to content

Commit 19b3e06

Browse files
author
Petr Sramek
committed
updated .editorconfig
1 parent 29949fe commit 19b3e06

File tree

1 file changed

+219
-65
lines changed

1 file changed

+219
-65
lines changed

.editorconfig

Lines changed: 219 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,212 @@
1+
# Remove the line below if you want to inherit .editorconfig settings from higher directories
2+
root = true
3+
4+
# C# files
15
[*.cs]
6+
27
# File header
38

4-
file_header_template = \nCopyright © Pete Sramek. All rights reserved.\nLicensed under the MIT License. See LICENSE file in the project root for full license information.\n
9+
file_header_template = \nCopyright © Pete Sramek. All rights reserved.\nLicensed under the MIT License. See LICENSE file in the project root for full license information.\n
510
dotnet_diagnostic.IDE0073.severity = warning
611

7-
[*.cs]
8-
#### Naming styles ####
12+
#### Core EditorConfig Options ####
913

10-
# Naming rules
14+
# Indentation and spacing
15+
indent_size = 4
16+
indent_style = space
17+
tab_width = 4
1118

12-
dotnet_naming_rule.private_or_internal_field_should_be_underscore_camel_case.severity = suggestion
13-
dotnet_naming_rule.private_or_internal_field_should_be_underscore_camel_case.symbols = private_or_internal_field
14-
dotnet_naming_rule.private_or_internal_field_should_be_underscore_camel_case.style = underscore_camel_case
19+
# New line preferences
20+
end_of_line = crlf
21+
insert_final_newline = false
1522

16-
# Symbol specifications
23+
#### .NET Code Actions ####
1724

18-
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
19-
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
20-
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
25+
# Type members
26+
dotnet_hide_advanced_members = false
27+
dotnet_member_insertion_location = with_other_members_of_the_same_kind
28+
dotnet_property_generation_behavior = prefer_auto_properties
2129

22-
# Naming styles
30+
# Symbol search
31+
dotnet_search_reference_assemblies = true
2332

24-
dotnet_naming_style.underscore_camel_case.required_prefix = _
25-
dotnet_naming_style.underscore_camel_case.required_suffix =
26-
dotnet_naming_style.underscore_camel_case.word_separator =
27-
dotnet_naming_style.underscore_camel_case.capitalization = camel_case
33+
#### .NET Coding Conventions ####
34+
35+
# Organize usings
36+
dotnet_separate_import_directive_groups = false
37+
dotnet_sort_system_directives_first = false
38+
file_header_template = unset
39+
40+
# this. and Me. preferences
41+
dotnet_style_qualification_for_event = false
42+
dotnet_style_qualification_for_field = false
43+
dotnet_style_qualification_for_method = false
44+
dotnet_style_qualification_for_property = false
45+
46+
# Language keywords vs BCL types preferences
47+
dotnet_style_predefined_type_for_locals_parameters_members = true
48+
dotnet_style_predefined_type_for_member_access = true
49+
50+
# Parentheses preferences
51+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
52+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
53+
dotnet_style_parentheses_in_other_operators = always_for_clarity
54+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
55+
56+
# Modifier preferences
57+
dotnet_style_require_accessibility_modifiers = for_non_interface_members
58+
59+
# Expression-level preferences
60+
dotnet_prefer_system_hash_code = true
61+
dotnet_style_coalesce_expression = true
62+
dotnet_style_collection_initializer = true
63+
dotnet_style_explicit_tuple_names = true
64+
dotnet_style_namespace_match_folder = true
65+
dotnet_style_null_propagation = true
66+
dotnet_style_object_initializer = true
67+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
68+
dotnet_style_prefer_auto_properties = true
69+
dotnet_style_prefer_collection_expression = when_types_loosely_match
70+
dotnet_style_prefer_compound_assignment = true
71+
dotnet_style_prefer_conditional_expression_over_assignment = true
72+
dotnet_style_prefer_conditional_expression_over_return = true
73+
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
74+
dotnet_style_prefer_inferred_anonymous_type_member_names = true
75+
dotnet_style_prefer_inferred_tuple_names = true
76+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
77+
dotnet_style_prefer_simplified_boolean_expressions = true
78+
dotnet_style_prefer_simplified_interpolation = true
79+
80+
# Field preferences
81+
dotnet_style_readonly_field = true
82+
83+
# Parameter preferences
84+
dotnet_code_quality_unused_parameters = non_public
85+
86+
# Suppression preferences
87+
dotnet_remove_unnecessary_suppression_exclusions = none
88+
89+
# New line preferences
90+
dotnet_style_allow_multiple_blank_lines_experimental = false
91+
dotnet_style_allow_statement_immediately_after_block_experimental = false
92+
93+
#### C# Coding Conventions ####
94+
95+
# var preferences
96+
csharp_style_var_elsewhere = false
97+
csharp_style_var_for_built_in_types = false
98+
csharp_style_var_when_type_is_apparent = false
99+
100+
# Expression-bodied members
101+
csharp_style_expression_bodied_accessors = true
102+
csharp_style_expression_bodied_constructors = false
103+
csharp_style_expression_bodied_indexers = true
104+
csharp_style_expression_bodied_lambdas = when_on_single_line
105+
csharp_style_expression_bodied_local_functions = when_on_single_line
106+
csharp_style_expression_bodied_methods = false
107+
csharp_style_expression_bodied_operators = false
108+
csharp_style_expression_bodied_properties = true
109+
110+
# Pattern matching preferences
111+
csharp_style_pattern_matching_over_as_with_null_check = true
112+
csharp_style_pattern_matching_over_is_with_cast_check = true
113+
csharp_style_prefer_extended_property_pattern = true
114+
csharp_style_prefer_not_pattern = true
115+
csharp_style_prefer_pattern_matching = true
116+
csharp_style_prefer_switch_expression = true
117+
118+
# Null-checking preferences
119+
csharp_style_conditional_delegate_call = true
120+
121+
# Modifier preferences
122+
csharp_prefer_static_anonymous_function = true
123+
csharp_prefer_static_local_function = true
124+
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async
125+
csharp_style_prefer_readonly_struct = true
126+
csharp_style_prefer_readonly_struct_member = true
127+
128+
# Code-block preferences
129+
csharp_prefer_braces = true
130+
csharp_prefer_simple_using_statement = false
131+
csharp_prefer_system_threading_lock = true
132+
csharp_style_namespace_declarations = file_scoped
133+
csharp_style_prefer_method_group_conversion = false
134+
csharp_style_prefer_primary_constructors = true
135+
csharp_style_prefer_top_level_statements = false
136+
137+
# Expression-level preferences
138+
csharp_prefer_simple_default_expression = true
139+
csharp_style_deconstructed_variable_declaration = true
140+
csharp_style_implicit_object_creation_when_type_is_apparent = true
141+
csharp_style_inlined_variable_declaration = true
142+
csharp_style_prefer_index_operator = true
143+
csharp_style_prefer_local_over_anonymous_function = false
144+
csharp_style_prefer_null_check_over_type_check = true
145+
csharp_style_prefer_range_operator = true
146+
csharp_style_prefer_tuple_swap = true
147+
csharp_style_prefer_unbound_generic_type_in_nameof = true
148+
csharp_style_prefer_utf8_string_literals = true
149+
csharp_style_throw_expression = true
150+
csharp_style_unused_value_assignment_preference = discard_variable
151+
csharp_style_unused_value_expression_statement_preference = discard_variable
152+
153+
# 'using' directive preferences
154+
csharp_using_directive_placement = inside_namespace
155+
156+
# New line preferences
157+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false
158+
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = false
159+
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = false
160+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false
161+
csharp_style_allow_embedded_statements_on_same_line_experimental = false
162+
163+
#### C# Formatting Rules ####
164+
165+
# New line preferences
166+
csharp_new_line_before_catch = false
167+
csharp_new_line_before_else = false
168+
csharp_new_line_before_finally = false
169+
csharp_new_line_before_members_in_anonymous_types = true
170+
csharp_new_line_before_members_in_object_initializers = true
171+
csharp_new_line_before_open_brace = none
172+
csharp_new_line_between_query_expression_clauses = true
173+
174+
# Indentation preferences
175+
csharp_indent_block_contents = true
176+
csharp_indent_braces = false
177+
csharp_indent_case_contents = true
178+
csharp_indent_case_contents_when_block = false
28179
csharp_indent_labels = one_less_than_current
29-
csharp_using_directive_placement = inside_namespace:silent
30-
csharp_prefer_simple_using_statement = false:suggestion
31-
csharp_prefer_braces = true:silent
32-
csharp_style_namespace_declarations = file_scoped:silent
33-
csharp_style_prefer_method_group_conversion = false:silent
34-
csharp_style_prefer_top_level_statements = false:silent
35-
csharp_style_prefer_primary_constructors = true:suggestion
36-
csharp_prefer_system_threading_lock = true:suggestion
37-
csharp_style_expression_bodied_methods = false:silent
38-
csharp_style_expression_bodied_constructors = false:silent
39-
csharp_style_expression_bodied_operators = false:silent
40-
csharp_style_expression_bodied_properties = true:silent
41-
csharp_style_expression_bodied_indexers = true:silent
42-
csharp_style_expression_bodied_accessors = true:silent
43-
csharp_style_expression_bodied_lambdas = when_on_single_line:silent
44-
csharp_style_expression_bodied_local_functions = when_on_single_line:silent
45-
46-
[*.{cs,vb}]
180+
csharp_indent_switch_labels = true
181+
182+
# Space preferences
183+
csharp_space_after_cast = false
184+
csharp_space_after_colon_in_inheritance_clause = true
185+
csharp_space_after_comma = true
186+
csharp_space_after_dot = false
187+
csharp_space_after_keywords_in_control_flow_statements = true
188+
csharp_space_after_semicolon_in_for_statement = true
189+
csharp_space_around_binary_operators = before_and_after
190+
csharp_space_around_declaration_statements = false
191+
csharp_space_before_colon_in_inheritance_clause = true
192+
csharp_space_before_comma = false
193+
csharp_space_before_dot = false
194+
csharp_space_before_open_square_brackets = false
195+
csharp_space_before_semicolon_in_for_statement = false
196+
csharp_space_between_empty_square_brackets = false
197+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
198+
csharp_space_between_method_call_name_and_opening_parenthesis = false
199+
csharp_space_between_method_call_parameter_list_parentheses = false
200+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
201+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
202+
csharp_space_between_method_declaration_parameter_list_parentheses = false
203+
csharp_space_between_parentheses = false
204+
csharp_space_between_square_brackets = false
205+
206+
# Wrapping preferences
207+
csharp_preserve_single_line_blocks = true
208+
csharp_preserve_single_line_statements = false
209+
47210
#### Naming styles ####
48211

49212
# Naming rules
@@ -56,6 +219,10 @@ dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
56219
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
57220
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
58221

222+
dotnet_naming_rule.private_or_internal_field_should_be_underscore_camel_case.severity = suggestion
223+
dotnet_naming_rule.private_or_internal_field_should_be_underscore_camel_case.symbols = private_or_internal_field
224+
dotnet_naming_rule.private_or_internal_field_should_be_underscore_camel_case.style = underscore_camel_case
225+
59226
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
60227
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
61228
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
@@ -64,46 +231,33 @@ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
64231

65232
dotnet_naming_symbols.interface.applicable_kinds = interface
66233
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
67-
dotnet_naming_symbols.interface.required_modifiers =
234+
dotnet_naming_symbols.interface.required_modifiers =
235+
236+
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
237+
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
238+
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
68239

69240
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
70241
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
71-
dotnet_naming_symbols.types.required_modifiers =
242+
dotnet_naming_symbols.types.required_modifiers =
72243

73244
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
74245
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
75-
dotnet_naming_symbols.non_field_members.required_modifiers =
246+
dotnet_naming_symbols.non_field_members.required_modifiers =
76247

77248
# Naming styles
78249

250+
dotnet_naming_style.pascal_case.required_prefix =
251+
dotnet_naming_style.pascal_case.required_suffix =
252+
dotnet_naming_style.pascal_case.word_separator =
253+
dotnet_naming_style.pascal_case.capitalization = pascal_case
254+
79255
dotnet_naming_style.begins_with_i.required_prefix = I
80-
dotnet_naming_style.begins_with_i.required_suffix =
81-
dotnet_naming_style.begins_with_i.word_separator =
256+
dotnet_naming_style.begins_with_i.required_suffix =
257+
dotnet_naming_style.begins_with_i.word_separator =
82258
dotnet_naming_style.begins_with_i.capitalization = pascal_case
83259

84-
dotnet_naming_style.pascal_case.required_prefix =
85-
dotnet_naming_style.pascal_case.required_suffix =
86-
dotnet_naming_style.pascal_case.word_separator =
87-
dotnet_naming_style.pascal_case.capitalization = pascal_case
88-
89-
dotnet_naming_style.pascal_case.required_prefix =
90-
dotnet_naming_style.pascal_case.required_suffix =
91-
dotnet_naming_style.pascal_case.word_separator =
92-
dotnet_naming_style.pascal_case.capitalization = pascal_case
93-
dotnet_style_operator_placement_when_wrapping = beginning_of_line
94-
tab_width = 4
95-
indent_size = 4
96-
end_of_line = crlf
97-
dotnet_style_coalesce_expression = true:suggestion
98-
dotnet_style_null_propagation = true:suggestion
99-
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
100-
dotnet_style_prefer_auto_properties = true:silent
101-
dotnet_style_object_initializer = true:suggestion
102-
dotnet_style_collection_initializer = true:suggestion
103-
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
104-
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
105-
dotnet_style_prefer_conditional_expression_over_return = true:silent
106-
dotnet_style_explicit_tuple_names = true:suggestion
107-
dotnet_style_prefer_inferred_tuple_names = true:suggestion
108-
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
109-
dotnet_style_prefer_compound_assignment = true:suggestion
260+
dotnet_naming_style.underscore_camel_case.required_prefix = _
261+
dotnet_naming_style.underscore_camel_case.required_suffix =
262+
dotnet_naming_style.underscore_camel_case.word_separator =
263+
dotnet_naming_style.underscore_camel_case.capitalization = camel_case

0 commit comments

Comments
 (0)